fixing bug#2123003
This commit is contained in:
parent
597b8dd90c
commit
f8cb0a41bc
|
|
@ -138,6 +138,14 @@ public class RequireThisCheck extends DeclarationCollector
|
|||
{
|
||||
final int parentType = aAST.getParent().getType();
|
||||
|
||||
if (parentType == TokenTypes.ANNOTATION_MEMBER_VALUE_PAIR
|
||||
|| parentType == TokenTypes.ANNOTATION
|
||||
|| parentType == TokenTypes.ANNOTATION_FIELD_DEF)
|
||||
{
|
||||
//cannot refer to 'this' from annotations
|
||||
return;
|
||||
}
|
||||
|
||||
// let's check method calls
|
||||
if (parentType == TokenTypes.METHOD_CALL) {
|
||||
if (mCheckMethods) {
|
||||
|
|
|
|||
|
|
@ -51,3 +51,22 @@ enum MyEnum
|
|||
z = 0;
|
||||
}
|
||||
}
|
||||
|
||||
class Bug2123003 {
|
||||
@Rock(band = "GnR")
|
||||
private String band;
|
||||
|
||||
class Inner {
|
||||
@Rock(band = {"GnR"})
|
||||
private String band;
|
||||
}
|
||||
|
||||
class Inner2 {
|
||||
@Rock(band = {(true) ? "GnR" : "Tool"})
|
||||
private String band;
|
||||
}
|
||||
|
||||
@interface Rock {
|
||||
String[] band() default "Metallica";
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue