fixing bug#2123003

This commit is contained in:
Travis Schneeberger 2009-04-01 02:33:26 +00:00
parent 597b8dd90c
commit f8cb0a41bc
2 changed files with 27 additions and 0 deletions

View File

@ -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) {

View File

@ -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";
}
}