Skip to content

Commit

Permalink
Some warning cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
gnl42 authored and ruspl-afed committed Jun 30, 2024
1 parent cff4d7d commit 8afd29e
Show file tree
Hide file tree
Showing 20 changed files with 38 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* Contributors:
* Jeremie Bresson - copied from MarkdownDocumentBuilderTest and adapted to AsciiDoc
* ArSysOp - ongoing support
* See git history
*******************************************************************************/

package org.eclipse.mylyn.internal.wikitext.asciidoc.tests;
Expand All @@ -28,7 +29,7 @@
import org.junit.Before;
import org.junit.Test;

@SuppressWarnings({ "nls", "restriction" })
@SuppressWarnings("nls")
public class AsciiDocDocumentBuilderTest {

private DocumentBuilder builder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* Contributors:
* Jeremie Bresson - initial API and implementation
* ArSysOp - ongoing support
* See git history
*******************************************************************************/

package org.eclipse.mylyn.internal.wikitext.asciidoc.tests;
Expand All @@ -28,7 +29,7 @@
/**
* Unit Tests for {@link LanguageSupport}
*/
@SuppressWarnings({ "nls", "restriction" })
@SuppressWarnings("nls")
public class AsciiDocLanguageSupportTest extends AsciiDocLanguageTestBase {

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import org.eclipse.mylyn.wikitext.parser.Locator;
import org.junit.Test;

@SuppressWarnings({ "nls", "restriction" })
@SuppressWarnings("nls")
public class LineTest {

@Test(expected = NullPointerException.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* Contributors:
* David Green - initial API and implementation
* ArSysOp - ongoing support
* See git history
*******************************************************************************/

package org.eclipse.mylyn.wikitext.commonmark.internal;
Expand All @@ -19,7 +20,7 @@
import org.eclipse.mylyn.wikitext.parser.Locator;
import org.junit.Test;

@SuppressWarnings({ "nls", "restriction" })
@SuppressWarnings("nls")
public class SimpleLocatorTest {

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* Contributors:
* David Green - initial API and implementation
* ArSysOp - ongoing support
* See git history
*******************************************************************************/

package org.eclipse.mylyn.wikitext.commonmark.internal.inlines;
Expand All @@ -25,7 +26,7 @@
import org.eclipse.mylyn.wikitext.parser.Locator;
import org.junit.Test;

@SuppressWarnings({ "nls", "restriction" })
@SuppressWarnings("nls")
public class InlineTest {

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public void characters(String text) {
@Override
public void entityReference(String entity) {
stringBuilder
.append(Objects.requireNonNullElse(EntityReferences.instance().equivalentString(entity), ""));
.append(Objects.requireNonNullElse(EntityReferences.instance().equivalentString(entity), "")); //$NON-NLS-1$
}
};
for (Inline inline : contents) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* Contributors:
* David Green - initial API and implementation
* ArSysOp - ongoing support
* See git history
*******************************************************************************/

package org.eclipse.mylyn.wikitext.confluence.internal.tests;
Expand All @@ -31,7 +32,7 @@
* @author David Green
* @see ConfluenceDocumentBuilder
*/
@SuppressWarnings({ "nls", "restriction" })
@SuppressWarnings("nls")
public class ConfluenceDocumentBuilderTest {

private final StringWriter out = new StringWriter();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* Contributors:
* Kevin de Vlaming - initial API and implementation
* ArSysOp - ongoing support
* See git history
*******************************************************************************/

package org.eclipse.mylyn.internal.wikitext.creole.tests.documentbuilder;
Expand All @@ -25,7 +26,6 @@
/**
* @author Kevin de Vlaming
*/
@SuppressWarnings("restriction")
public abstract class AbstractCreoleDocumentBuilderTest {

protected DocumentBuilder builder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* Contributors:
* Kevin de Vlaming - initial API and implementation
* ArSysOp - ongoing support
* See git history
*******************************************************************************/

package org.eclipse.mylyn.internal.wikitext.creole.tests.documentbuilder;
Expand All @@ -25,7 +26,7 @@
* @see http://www.wikicreole.org/wiki/Elements
* @author Kevin de Vlaming
*/
@SuppressWarnings({ "nls", "restriction" })
@SuppressWarnings("nls")
public class CreoleDocumentBuilderBlockTest extends AbstractCreoleDocumentBuilderTest {
@Test
public void testParagraph() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* Contributors:
* Kevin de Vlaming - initial API and implementation
* ArSysOp - ongoing support
* See git history
*******************************************************************************/

package org.eclipse.mylyn.internal.wikitext.creole.tests.documentbuilder;
Expand All @@ -25,7 +26,7 @@
* @see http://www.wikicreole.org/wiki/Elements
* @author Kevin de Vlaming
*/
@SuppressWarnings({ "nls", "restriction" })
@SuppressWarnings("nls")
public class CreoleDocumentBuilderLinkImageTest extends AbstractCreoleDocumentBuilderTest {
@Test
public void testLink() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* Contributors:
* Kevin de Vlaming - initial API and implementation
* ArSysOp - ongoing support
* See git history
*******************************************************************************/

package org.eclipse.mylyn.internal.wikitext.creole.tests.documentbuilder;
Expand All @@ -25,7 +26,7 @@
* @see http://www.wikicreole.org/wiki/Elements
* @author Kevin de Vlaming
*/
@SuppressWarnings({ "nls", "restriction" })
@SuppressWarnings("nls")
public class CreoleDocumentBuilderListTest extends AbstractCreoleDocumentBuilderTest {
@Test
public void testListBulleted() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* Contributors:
* Kevin de Vlaming - initial API and implementation
* ArSysOp - ongoing support
* See git history
*******************************************************************************/

package org.eclipse.mylyn.internal.wikitext.creole.tests.documentbuilder;
Expand All @@ -22,7 +23,7 @@
* @see http://www.wikicreole.org/wiki/Elements
* @author Kevin de Vlaming
*/
@SuppressWarnings({ "nls", "restriction" })
@SuppressWarnings("nls")
public class CreoleDocumentBuilderSpanTest extends AbstractCreoleDocumentBuilderTest {
@Test
public void testItalic() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* Contributors:
* Kevin de Vlaming - initial API and implementation
* ArSysOp - ongoing support
* See git history
*******************************************************************************/

package org.eclipse.mylyn.internal.wikitext.creole.tests.documentbuilder;
Expand All @@ -26,7 +27,7 @@
* @see http://www.wikicreole.org/wiki/Elements
* @author Kevin de Vlaming
*/
@SuppressWarnings({ "nls", "restriction" })
@SuppressWarnings("nls")
public class CreoleDocumentBuilderTableTest extends AbstractCreoleDocumentBuilderTest {
@Test
public void testTableWithEmptyCells() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* Contributors:
* Kevin de Vlaming - initial API and implementation
* ArSysOp - ongoing support
* See git history
*******************************************************************************/

package org.eclipse.mylyn.internal.wikitext.creole.tests.documentbuilder;
Expand All @@ -22,7 +23,7 @@
* @see http://www.wikicreole.org/wiki/Elements
* @author Kevin de Vlaming
*/
@SuppressWarnings({ "nls", "restriction" })
@SuppressWarnings("nls")
public class CreoleDocumentBuilderTest extends AbstractCreoleDocumentBuilderTest {
@Test
public void testLineBreak() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* Contributors:
* David Green - initial API and implementation
* ArSysOp - ongoing support
* See git history
*******************************************************************************/

package org.eclipse.mylyn.wikitext.html.internal;
Expand All @@ -27,7 +28,6 @@
import org.eclipse.mylyn.wikitext.parser.DocumentBuilder.BlockType;
import org.junit.Test;

@SuppressWarnings("restriction")
public class BlockStrategiesTest {

@Test(expected = NullPointerException.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* Contributors:
* David Green - initial API and implementation
* ArSysOp - ongoing support
* See git history
*******************************************************************************/

package org.eclipse.mylyn.wikitext.html.internal;
Expand All @@ -26,7 +27,7 @@
import org.eclipse.mylyn.wikitext.parser.DocumentBuilder.SpanType;
import org.junit.Test;

@SuppressWarnings({ "nls", "restriction" })
@SuppressWarnings("nls")
public class SpanStrategiesTest {

@Test(expected = NullPointerException.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* Leo Dos Santos - initial API and implementation
* Pierre-Yves B. <[email protected]> - Bug 509033 - markdown misses support for ~~strike~~
* ArSysOp - ongoing support
* See git history
*******************************************************************************/

package org.eclipse.mylyn.internal.wikitext.markdown.tests;
Expand All @@ -33,7 +34,7 @@
* @see http://daringfireball.net/projects/markdown/syntax
* @author Leo Dos Santos
*/
@SuppressWarnings({ "nls", "restriction" })
@SuppressWarnings("nls")
public class MarkdownDocumentBuilderTest {

private DocumentBuilder builder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* Contributors:
* David Green - initial API and implementation
* ArSysOp - ongoing support
* See git history
*******************************************************************************/

package org.eclipse.mylyn.wikitext.parser.tests;
Expand All @@ -20,7 +21,7 @@
import org.eclipse.mylyn.wikitext.parser.Attributes;
import org.junit.Test;

@SuppressWarnings({ "nls", "restriction" })
@SuppressWarnings("nls")
public class AttributesTest {

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* Contributors:
* David Green - initial API and implementation
* ArSysOp - ongoing support
* See git history
*******************************************************************************/
package org.eclipse.mylyn.wikitext.textile.internal.tests;

Expand All @@ -27,7 +28,7 @@
/**
* @author David Green
*/
@SuppressWarnings({ "nls", "restriction" })
@SuppressWarnings("nls")
public class TextileTest {
@Test
public void testExplicitHeaderStartsNewBlock() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* David Green - initial API and implementation
* Frank Becker - improvements for bug 304910
* Tasktop Technologies - improvements
* See git history
*******************************************************************************/
package org.eclipse.mylyn.wikitext.tasks.ui.editor;

Expand Down Expand Up @@ -74,7 +75,7 @@
* @since 1.0
*/
public class MarkupTaskEditorExtension<MarkupLanguageType extends MarkupLanguage> extends AbstractTaskEditorExtension
implements IAdaptable {
implements IAdaptable {

private static final String MARKUP_SOURCE_CONTEXT_ID = "org.eclipse.mylyn.wikitext.tasks.ui.markupSourceContext"; //$NON-NLS-1$

Expand Down Expand Up @@ -147,8 +148,8 @@ public SourceViewer createViewer(TaskRepository taskRepository, Composite parent

if (JFaceResources.getFontRegistry().hasValueFor(WikiTextTasksUiPlugin.FONT_REGISTRY_KEY_DEFAULT_FONT)) {
markupViewer.getTextWidget()
.setFont(
JFaceResources.getFontRegistry().get(WikiTextTasksUiPlugin.FONT_REGISTRY_KEY_DEFAULT_FONT));
.setFont(
JFaceResources.getFontRegistry().get(WikiTextTasksUiPlugin.FONT_REGISTRY_KEY_DEFAULT_FONT));
}
if (JFaceResources.getFontRegistry().hasValueFor(WikiTextTasksUiPlugin.FONT_REGISTRY_KEY_MONOSPACE_FONT)) {
markupViewer.setDefaultMonospaceFont(
Expand Down Expand Up @@ -218,7 +219,6 @@ public SourceViewer createEditor(TaskRepository taskRepository, Composite parent
return createEditor(taskRepository, parent, style, null);
}

@SuppressWarnings("unchecked")
@Override
public SourceViewer createEditor(TaskRepository taskRepository, Composite parent, int style, IAdaptable context) {
final MarkupLanguageType markupLanguageCopy = createRepositoryMarkupLanguage(taskRepository);
Expand Down Expand Up @@ -348,7 +348,6 @@ protected boolean isIncluded(Annotation annotation) {
};
}

@SuppressWarnings("unchecked")
@Override
protected Map<String, IAdaptable> getHyperlinkDetectorTargets(ISourceViewer sourceViewer) {
Map<String, IAdaptable> hyperlinkDetectorTargets = super.getHyperlinkDetectorTargets(sourceViewer);
Expand Down Expand Up @@ -400,7 +399,6 @@ public TaskMarkupViewerConfiguration(MarkupViewer viewer, TaskRepository taskRep
markupHyperlinksFirst = false;
}

@SuppressWarnings("unchecked")
@Override
protected Map<String, IAdaptable> getHyperlinkDetectorTargets(ISourceViewer sourceViewer) {
Map<String, IAdaptable> hyperlinkDetectorTargets = super.getHyperlinkDetectorTargets(sourceViewer);
Expand Down

0 comments on commit 8afd29e

Please sign in to comment.