[java-highlighting] IDEA-216120 Provide fix for the "Illegal initializer for ..." error

GitOrigin-RevId: edf4f5e72243afe44f0bcbbacd2e753a2e5faf1e
This commit is contained in:
Andrey.Cherkasov
2021-03-12 03:36:28 +03:00
committed by intellij-monorepo-bot
parent a2745001a9
commit 430ad9a42a
10 changed files with 121 additions and 2 deletions

View File

@@ -0,0 +1,10 @@
// "Replace array initializer with its element" "true"
class X {
@interface MyAnnotation {
String value();
}
@MyAnnotation(/*1*//*2*/value = "blah")
void foo() {}
}

View File

@@ -0,0 +1,10 @@
// "Replace array initializer with its element" "true"
class X {
@interface MyAnnotation {
String value();
}
@MyAnnotation(value = {/*1*/"blah"/*2*/}<caret>)
void foo() {}
}

View File

@@ -0,0 +1,10 @@
// "Replace array initializer with its element" "false"
class X {
@interface MyAnnotation {
String value();
}
@MyAnnotation(value = {"one", "two"}<caret>)
void foo() {}
}

View File

@@ -0,0 +1,10 @@
// "Replace array initializer with its element" "false"
class X {
@interface MyAnnotation {
String value();
}
@MyAnnotation(value = {}<caret>)
void foo() {}
}