Java inspection: Added a fix for single-value annotations where the annotation doesn't have a 'value()' method and therefore "Expand Annotation to Normal Form" fix couldn't be applied (IDEA-158456, IDEA-157727)

This commit is contained in:
Pavel Dolgov
2016-07-19 19:10:32 +03:00
parent e261b412a4
commit 3773948686
16 changed files with 309 additions and 2 deletions

View File

@@ -0,0 +1,10 @@
// "Add 'type='" "true"
class T {
@interface A {
String[] type();
}
@A(type = "t")
void foo() {
}
}

View File

@@ -0,0 +1,11 @@
// "Add 'name='" "true"
class T {
@interface A {
int size();
String name();
}
@A(name = "a")
void foo() {
}
}

View File

@@ -0,0 +1,11 @@
// "Add 'type='" "true"
class T {
@interface A {
String name();
String type();
}
@A(type = "a", name = "b")
void foo() {
}
}

View File

@@ -0,0 +1,10 @@
// "Add 'type='" "true"
class T {
@interface A {
String[] type();
}
@A(<caret>"t")
void foo() {
}
}

View File

@@ -0,0 +1,11 @@
// "Add 'name='" "true"
class T {
@interface A {
int size();
String name();
}
@A(<caret>"a")
void foo() {
}
}

View File

@@ -0,0 +1,11 @@
// "Add 'type='" "true"
class T {
@interface A {
String name();
String type();
}
@A(<caret>"a", name = "b")
void foo() {
}
}

View File

@@ -0,0 +1,11 @@
// "Add 'name='" "false"
class T {
@interface A {
String name();
String type();
}
@A(<caret>"a", name = "b")
void foo() {
}
}

View File

@@ -0,0 +1,10 @@
// "Add 'type='" "false"
class T {
@interface A {
String[] type();
}
@A(<caret>42)
void foo() {
}
}

View File

@@ -0,0 +1,10 @@
// "Add 'size='" "false"
class T {
@interface A {
int size();
}
@A(<caret>"a")
void foo() {
}
}