mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Cleanup (annotations)
This commit is contained in:
+6
-7
@@ -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' + "}",
|
||||
|
||||
@@ -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 {
|
||||
"<caret>\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());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user