From 26bcbb6e8c4a7bc502ceb26907b94eefa8d76e88 Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Thu, 21 Jul 2016 13:38:46 +0200 Subject: [PATCH] Cleanup (annotations) --- .../formatter/java/AbstractJavaFormatterTest.java | 13 ++++++------- .../psi/formatter/java/JavaIndenterTest.java | 11 ++++++----- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/java/java-tests/testSrc/com/intellij/psi/formatter/java/AbstractJavaFormatterTest.java b/java/java-tests/testSrc/com/intellij/psi/formatter/java/AbstractJavaFormatterTest.java index 94d4a659674b..d4c3e9980fbd 100644 --- a/java/java-tests/testSrc/com/intellij/psi/formatter/java/AbstractJavaFormatterTest.java +++ b/java/java-tests/testSrc/com/intellij/psi/formatter/java/AbstractJavaFormatterTest.java @@ -36,7 +36,6 @@ import com.intellij.testFramework.LightIdeaTestCase; import com.intellij.util.IncorrectOperationException; import com.intellij.util.containers.ContainerUtil; import com.intellij.util.text.LineReader; -import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -147,11 +146,11 @@ public abstract class AbstractJavaFormatterTest extends LightIdeaTestCase { doTest(getTestName(false) + ".java", getTestName(false) + "_after.java"); } - public void doTest(@NonNls String fileNameBefore, @NonNls String fileNameAfter) { + public void doTest(@NotNull String fileNameBefore, @NotNull String fileNameAfter) { doTextTest(Action.REFORMAT, loadFile(fileNameBefore), loadFile(fileNameAfter)); } - public void doTestWithDetectableIndentOptions(@NonNls String text, @NonNls String textAfter) { + public void doTestWithDetectableIndentOptions(@NotNull String text, @NotNull String textAfter) { DetectableIndentOptionsProvider provider = DetectableIndentOptionsProvider.getInstance(); assertNotNull("DetectableIndentOptionsProvider not found", provider); provider.setEnabledInTest(true); @@ -163,11 +162,11 @@ public abstract class AbstractJavaFormatterTest extends LightIdeaTestCase { } } - public void doTextTest(@NonNls final String text, @NonNls String textAfter) throws IncorrectOperationException { + public void doTextTest(@NotNull String text, @NotNull String textAfter) throws IncorrectOperationException { doTextTest(Action.REFORMAT, text, textAfter); } - public void doTextTest(@NotNull final Action action, @NotNull String text, @NotNull String textAfter) throws IncorrectOperationException { + public void doTextTest(@NotNull Action action, @NotNull String text, @NotNull String textAfter) throws IncorrectOperationException { final PsiFile file = createFile("A.java", text); final PsiDocumentManager manager = PsiDocumentManager.getInstance(getProject()); final Document document = manager.getDocument(file); @@ -226,7 +225,7 @@ public abstract class AbstractJavaFormatterTest extends LightIdeaTestCase { return document.getText(); } - public void doMethodTest(@NonNls final String before, @NonNls final String after) { + public void doMethodTest(@NotNull String before, @NotNull String after) { doTextTest( Action.REFORMAT, "class Foo{\n" + " void foo() {\n" + before + '\n' + " }\n" + "}", @@ -234,7 +233,7 @@ public abstract class AbstractJavaFormatterTest extends LightIdeaTestCase { ); } - public void doClassTest(@NonNls final String before, @NonNls final String after) { + public void doClassTest(@NotNull String before, @NotNull String after) { doTextTest( Action.REFORMAT, "class Foo{\n" + before + '\n' + "}", diff --git a/java/java-tests/testSrc/com/intellij/psi/formatter/java/JavaIndenterTest.java b/java/java-tests/testSrc/com/intellij/psi/formatter/java/JavaIndenterTest.java index 6961877d7bae..625dce1c0c43 100644 --- a/java/java-tests/testSrc/com/intellij/psi/formatter/java/JavaIndenterTest.java +++ b/java/java-tests/testSrc/com/intellij/psi/formatter/java/JavaIndenterTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2010 JetBrains s.r.o. + * Copyright 2000-2016 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,6 +17,7 @@ package com.intellij.psi.formatter.java; import com.intellij.openapi.util.TextRange; import com.intellij.util.IncorrectOperationException; +import org.jetbrains.annotations.NotNull; /** * @author Denis Zhdanov @@ -43,7 +44,7 @@ public class JavaIndenterTest extends AbstractJavaFormatterTest { int end = initial.indexOf("\n", start); myTextRange = new TextRange(start, end); - doTextTest(initial, + doTextTest(initial, "class BrokenAlignment {\n" + " public\n" + "\tstatic int foo(String a, String b, String c,\n" + @@ -64,7 +65,7 @@ public class JavaIndenterTest extends AbstractJavaFormatterTest { "\n" + " }" + "}", - + "class Test {\n" + " // some comment\n" + " public void doSmth(int[] p) {\n" + @@ -74,7 +75,7 @@ public class JavaIndenterTest extends AbstractJavaFormatterTest { } @Override - public void doTextTest(String text, String textAfter) throws IncorrectOperationException { + public void doTextTest(@NotNull String text, @NotNull String textAfter) throws IncorrectOperationException { doTextTest(Action.INDENT, adjustTextIfNecessary(text), textAfter); } @@ -91,4 +92,4 @@ public class JavaIndenterTest extends AbstractJavaFormatterTest { myTextRange = new TextRange(caretIndex, caretIndex); return text.substring(0, caretIndex) + text.substring(caretIndex + CARET_TOKEN.length()); } -} +} \ No newline at end of file