mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-20 13:31:28 +07:00
[java-inspections] Add quotes to annotations in inspection messages
GitOrigin-RevId: a2d102bb75c6f0f213cfe79928909f8501be6ca7
This commit is contained in:
committed by
intellij-monorepo-bot
parent
9ee8313ff0
commit
2a86552363
@@ -147,9 +147,9 @@ message.class.inaccessible.from.module=Class ''{0}'' is not accessible from modu
|
||||
message.class.inaccessible=Class ''{0}'' is not accessible here
|
||||
|
||||
inspection.i18n.quickfix.annotate=Annotate...
|
||||
inspection.i18n.quickfix.annotate.as=Annotate as @{0}
|
||||
inspection.i18n.quickfix.annotate.as=Annotate as ''@{0}''
|
||||
inspection.i18n.quickfix.annotate.element=Annotate {0} ''{1}''...
|
||||
inspection.i18n.quickfix.annotate.element.as=Annotate {0} ''{1}'' as @{2}
|
||||
inspection.i18n.quickfix.annotate.element.as=Annotate {0} ''{1}'' as ''@{2}''
|
||||
inspection.reference.default.package=<default>
|
||||
error.message.invalid.java.type=Invalid Java type
|
||||
move.0.to.the.beginning=Move ''{0}'' to the beginning
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Annotate method 'dontAnnotateBase' as @NotNull" "true-preview"
|
||||
// "Annotate method 'dontAnnotateBase' as '@NotNull'" "true-preview"
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
class X {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Annotate method 'dontAnnotateBase' as @NotNull" "true-preview"
|
||||
// "Annotate method 'dontAnnotateBase' as '@NotNull'" "true-preview"
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
class X {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
|
||||
// "Annotate variable 'a' as @NonNls" "true-preview"
|
||||
// "Annotate variable 'a' as '@NonNls'" "true-preview"
|
||||
class Foo {
|
||||
public boolean doTest() {
|
||||
@NonNls String a;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
|
||||
// "Annotate method 'test' as @NonNls" "true-preview"
|
||||
// "Annotate method 'test' as '@NonNls'" "true-preview"
|
||||
class Foo {
|
||||
@NonNls
|
||||
Foo test(String s) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
|
||||
// "Annotate variable 'a' as @NonNls" "true-preview"
|
||||
// "Annotate variable 'a' as '@NonNls'" "true-preview"
|
||||
class Foo {
|
||||
public void doTest() {
|
||||
@NonNls String a = new String("test");
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
|
||||
// "Annotate variable 'a' as @NonNls" "true-preview"
|
||||
// "Annotate variable 'a' as '@NonNls'" "true-preview"
|
||||
class Foo {
|
||||
public void doTest() {
|
||||
@NonNls String a;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
|
||||
// "Annotate variable 'a' as @NonNls" "true-preview"
|
||||
// "Annotate variable 'a' as '@NonNls'" "true-preview"
|
||||
class Foo {
|
||||
public boolean doTest() {
|
||||
@NonNls String a;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
|
||||
// "Annotate field 'field' as @NonNls" "true-preview"
|
||||
// "Annotate field 'field' as '@NonNls'" "true-preview"
|
||||
class Foo {
|
||||
@NonNls
|
||||
String field = "text";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
|
||||
// "Annotate parameter 'sb' as @NonNls" "true-preview"
|
||||
// "Annotate parameter 'sb' as '@NonNls'" "true-preview"
|
||||
class Foo {
|
||||
java.util.function.Consumer<StringBuilder> consumerTest() {
|
||||
return (@NonNls var sb) -> sb.append("foo");
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
|
||||
// "Annotate parameter 'sb' as @NonNls" "true-preview"
|
||||
// "Annotate parameter 'sb' as '@NonNls'" "true-preview"
|
||||
class Foo {
|
||||
java.util.function.Consumer<StringBuilder> consumerTest() {
|
||||
return (@NonNls StringBuilder sb) -> sb.append("foo");
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import org.jetbrains.annotations.Nls;
|
||||
|
||||
// "Annotate parameter 's' as @Nls" "true-preview"
|
||||
// "Annotate parameter 's' as '@Nls'" "true-preview"
|
||||
class Foo {
|
||||
String foo(@org.jetbrains.annotations.Nls String s) { return s;}
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Annotate parameter 'obj' as @NonNls" "true-preview"
|
||||
// "Annotate parameter 'obj' as '@NonNls'" "true-preview"
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
|
||||
// "Annotate parameter 's' as @NonNls" "true-preview"
|
||||
// "Annotate parameter 's' as '@NonNls'" "true-preview"
|
||||
class Foo {
|
||||
public void doTest() {
|
||||
doStringTest("test");
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
|
||||
// "Annotate method 'doTest' as @NonNls" "true-preview"
|
||||
// "Annotate method 'doTest' as '@NonNls'" "true-preview"
|
||||
class Foo {
|
||||
@NonNls
|
||||
public String doTest() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
|
||||
// "Annotate variable 'a' as @NonNls" "true-preview"
|
||||
// "Annotate variable 'a' as '@NonNls'" "true-preview"
|
||||
class Foo {
|
||||
public void doTest() {
|
||||
@NonNls String a = "test";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
|
||||
// "Annotate variable 'a' as @NonNls" "true-preview"
|
||||
// "Annotate variable 'a' as '@NonNls'" "true-preview"
|
||||
class Foo {
|
||||
public void doTest() {
|
||||
@NonNls String a = (s("test"));
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
|
||||
// "Annotate variable 'a' as @NonNls" "true-preview"
|
||||
// "Annotate variable 'a' as '@NonNls'" "true-preview"
|
||||
class Foo {
|
||||
public void doTest() {
|
||||
@NonNls String a = (this.s("test"));
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Annotate field 'out' as @NonNls" "true"
|
||||
// "Annotate field 'out' as '@NonNls'" "true"
|
||||
class Foo {
|
||||
public void doTest() {
|
||||
System.out.println("Test");
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Annotate variable 'a' as @NonNls" "true-preview"
|
||||
// "Annotate variable 'a' as '@NonNls'" "true-preview"
|
||||
class Foo {
|
||||
public boolean doTest() {
|
||||
String a;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Annotate method 'test' as @NonNls" "true-preview"
|
||||
// "Annotate method 'test' as '@NonNls'" "true-preview"
|
||||
class Foo {
|
||||
Foo test(String s) {
|
||||
return this;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Annotate variable 'a' as @NonNls" "true-preview"
|
||||
// "Annotate variable 'a' as '@NonNls'" "true-preview"
|
||||
class Foo {
|
||||
public void doTest() {
|
||||
String a = new String("te<caret>st");
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Annotate variable 'a' as @NonNls" "true-preview"
|
||||
// "Annotate variable 'a' as '@NonNls'" "true-preview"
|
||||
class Foo {
|
||||
public void doTest() {
|
||||
String a;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Annotate variable 'a' as @NonNls" "true-preview"
|
||||
// "Annotate variable 'a' as '@NonNls'" "true-preview"
|
||||
class Foo {
|
||||
public boolean doTest() {
|
||||
String a;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Annotate field 'field' as @NonNls" "true-preview"
|
||||
// "Annotate field 'field' as '@NonNls'" "true-preview"
|
||||
class Foo {
|
||||
String field = "t<caret>ext";
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Annotate parameter 'sb' as @NonNls" "true-preview"
|
||||
// "Annotate parameter 'sb' as '@NonNls'" "true-preview"
|
||||
class Foo {
|
||||
java.util.function.Consumer<StringBuilder> consumerTest() {
|
||||
return sb -> sb.append("<caret>foo");
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Annotate parameter 'sb' as @NonNls" "true-preview"
|
||||
// "Annotate parameter 'sb' as '@NonNls'" "true-preview"
|
||||
class Foo {
|
||||
java.util.function.Consumer<StringBuilder> consumerTest() {
|
||||
return sb -> sb.append("<caret>foo");
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Annotate parameter 's' as @Nls" "true-preview"
|
||||
// "Annotate parameter 's' as '@Nls'" "true-preview"
|
||||
class Foo {
|
||||
String foo(@org.jetbrains.annotations.Nls String s) { return s;}
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Annotate parameter 'obj' as @NonNls" "true-preview"
|
||||
// "Annotate parameter 'obj' as '@NonNls'" "true-preview"
|
||||
import java.util.Optional;
|
||||
|
||||
class Foo {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Annotate parameter 'obj' as @NonNls" "false"
|
||||
// "Annotate parameter 'obj' as '@NonNls'" "false"
|
||||
import java.util.Optional;
|
||||
|
||||
class Foo {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Annotate parameter 's' as @NonNls" "true-preview"
|
||||
// "Annotate parameter 's' as '@NonNls'" "true-preview"
|
||||
class Foo {
|
||||
public void doTest() {
|
||||
doStringTest("te<caret>st");
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Annotate method 'doTest' as @NonNls" "true-preview"
|
||||
// "Annotate method 'doTest' as '@NonNls'" "true-preview"
|
||||
class Foo {
|
||||
public String doTest() {
|
||||
return "t<caret>ext";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Annotate variable 'a' as @NonNls" "true-preview"
|
||||
// "Annotate variable 'a' as '@NonNls'" "true-preview"
|
||||
class Foo {
|
||||
public void doTest() {
|
||||
String a = "t<caret>est";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Annotate variable 'a' as @NonNls" "true-preview"
|
||||
// "Annotate variable 'a' as '@NonNls'" "true-preview"
|
||||
class Foo {
|
||||
public void doTest() {
|
||||
String a = (s("t<caret>est"));
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Annotate variable 'a' as @NonNls" "true-preview"
|
||||
// "Annotate variable 'a' as '@NonNls'" "true-preview"
|
||||
class Foo {
|
||||
public void doTest() {
|
||||
String a = (this.s("t<caret>est"));
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Annotate field 'out' as @NonNls" "true"
|
||||
// "Annotate field 'out' as '@NonNls'" "true"
|
||||
class Foo {
|
||||
public void doTest() {
|
||||
System.out.println("Te<caret>st");
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Annotate annotation 'Test' as @Retention(RetentionPolicy.RUNTIME)" "true-preview"
|
||||
// "Annotate annotation 'Test' as '@Retention(RetentionPolicy.RUNTIME)'" "true-preview"
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Annotate annotation 'Test' as @Retention(RetentionPolicy.RUNTIME)" "true-preview"
|
||||
// "Annotate annotation 'Test' as '@Retention(RetentionPolicy.RUNTIME)'" "true-preview"
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Annotate annotation 'Test' as @Retention(RetentionPolicy.RUNTIME)" "true-preview"
|
||||
// "Annotate annotation 'Test' as '@Retention(RetentionPolicy.RUNTIME)'" "true-preview"
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Annotate annotation 'NotNull' as @Retention(RetentionPolicy.RUNTIME)" "false"
|
||||
// "Annotate annotation 'NotNull' as '@Retention(RetentionPolicy.RUNTIME)'" "false"
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Annotate annotation 'Test' as @Retention(RetentionPolicy.RUNTIME)" "true-preview"
|
||||
// "Annotate annotation 'Test' as '@Retention(RetentionPolicy.RUNTIME)'" "true-preview"
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Target;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Annotate annotation 'Subst' as @Retention(RetentionPolicy.RUNTIME)" "false"
|
||||
// "Annotate annotation 'Subst' as '@Retention(RetentionPolicy.RUNTIME)'" "false"
|
||||
import org.intellij.lang.annotations.Subst;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
@@ -364,7 +364,7 @@ public class NullableStuffInspectionTest extends LightJavaCodeInsightFixtureTest
|
||||
String oldDefault = manager.getDefaultNotNull();
|
||||
try {
|
||||
manager.setDefaultNotNull("typeUse.NotNull");
|
||||
doTestWithFix("Annotate as @NotNull");
|
||||
doTestWithFix("Annotate as '@NotNull'");
|
||||
}
|
||||
finally {
|
||||
manager.setDefaultNotNull(oldDefault);
|
||||
@@ -381,7 +381,7 @@ public class NullableStuffInspectionTest extends LightJavaCodeInsightFixtureTest
|
||||
String oldDefault = manager.getDefaultNotNull();
|
||||
try {
|
||||
manager.setDefaultNotNull("typeUse.NotNull");
|
||||
doTestWithFix("Annotate as @NotNull");
|
||||
doTestWithFix("Annotate as '@NotNull'");
|
||||
}
|
||||
finally {
|
||||
manager.setDefaultNotNull(oldDefault);
|
||||
|
||||
@@ -388,7 +388,7 @@ class JavaJUnitMalformedDeclarationInspectionTest : JUnitMalformedDeclarationIns
|
||||
@ParameterizedTest
|
||||
void foo(String param) { }
|
||||
}
|
||||
""".trimIndent(), "Annotate class 'Test' as @TestInstance")
|
||||
""".trimIndent(), "Annotate class 'Test' as '@TestInstance'")
|
||||
}
|
||||
fun `test malformed parameterized introduce method source quickfix`() {
|
||||
myFixture.testQuickFix(ULanguage.JAVA, """
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Annotate method 'test' as @Override" "true"
|
||||
// "Annotate method 'test' as '@Override'" "true"
|
||||
class Super {
|
||||
void test() {}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Annotate method 'test' as @Override" "true"
|
||||
// "Annotate method 'test' as '@Override'" "true"
|
||||
class Super {
|
||||
void test() {}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
|
||||
// "Annotate parameter 'str' as @NonNls" "true"
|
||||
// "Annotate parameter 'str' as '@NonNls'" "true"
|
||||
class X {
|
||||
void test(@NonNls String str) {
|
||||
String result = "foo" + str;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Annotate parameter 'str' as @NonNls" "true"
|
||||
// "Annotate parameter 'str' as '@NonNls'" "true"
|
||||
class X {
|
||||
void test(String str) {
|
||||
String result = "foo" +<caret> str;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
|
||||
// "Annotate variable 'foo' as @NonNls" "true"
|
||||
// "Annotate variable 'foo' as '@NonNls'" "true"
|
||||
class X {
|
||||
void test() {
|
||||
@NonNls String foo = "bar";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Annotate variable 'foo' as @NonNls" "true"
|
||||
// "Annotate variable 'foo' as '@NonNls'" "true"
|
||||
class X {
|
||||
void test() {
|
||||
String foo = "bar";
|
||||
|
||||
@@ -24,7 +24,7 @@ public class AddSerialAnnotationFixTest extends LightJavaInspectionTestCase {
|
||||
"class Test implements Serializable {\n" +
|
||||
" private static final long /*'serialVersionUID' can be annotated with '@Serial' annotation*//*_*/serialVersionUID/**/ = 7874493593505141603L;\n" +
|
||||
"}");
|
||||
checkQuickFix("Annotate field 'serialVersionUID' as @Serial", "import java.io.*;\n" +
|
||||
checkQuickFix("Annotate field 'serialVersionUID' as '@Serial'", "import java.io.*;\n" +
|
||||
"class Test implements Serializable {\n" +
|
||||
" @Serial\n" +
|
||||
" private static final long serialVersionUID = 7874493593505141603L;\n" +
|
||||
@@ -38,7 +38,7 @@ public class AddSerialAnnotationFixTest extends LightJavaInspectionTestCase {
|
||||
" return 1;\n" +
|
||||
" }\n" +
|
||||
"}");
|
||||
checkQuickFix("Annotate method 'readResolve' as @Serial", "import java.io.*;\n" +
|
||||
checkQuickFix("Annotate method 'readResolve' as '@Serial'", "import java.io.*;\n" +
|
||||
"class Test implements Serializable {\n" +
|
||||
" @Serial\n" +
|
||||
" protected Object readResolve() throws ObjectStreamException {\n" +
|
||||
|
||||
@@ -38,7 +38,7 @@ public class RedundantSlf4jDefinitionInspectionTest extends LombokInspectionTest
|
||||
|
||||
public void testRedundantSlf4jDefinition() {
|
||||
doTest();
|
||||
checkQuickFix("Annotate class 'RedundantSlf4jDefinition' as @Slf4j");
|
||||
checkQuickFix("Annotate class 'RedundantSlf4jDefinition' as '@Slf4j'");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user