Fixed 1257599 - RequireThis should know that there are enum and inteface definitions :)
This commit is contained in:
parent
63695b43c3
commit
2e2047a853
|
|
@ -175,6 +175,8 @@ public class RequireThisCheck extends DeclarationCollector
|
|||
|| parentType == TokenTypes.CTOR_DEF
|
||||
|| parentType == TokenTypes.METHOD_DEF
|
||||
|| parentType == TokenTypes.CLASS_DEF
|
||||
|| parentType == TokenTypes.ENUM_DEF
|
||||
|| parentType == TokenTypes.INTERFACE_DEF
|
||||
|| parentType == TokenTypes.PARAMETER_DEF)
|
||||
{
|
||||
// it's being declared; no problem
|
||||
|
|
|
|||
|
|
@ -19,3 +19,19 @@ enum Enum1
|
|||
return ""; //some custom implementation
|
||||
}
|
||||
}
|
||||
|
||||
interface TestRequireThisEnum
|
||||
{
|
||||
enum DAY_OF_WEEK
|
||||
{
|
||||
SUNDAY,
|
||||
MONDAY,
|
||||
TUESDAY,
|
||||
WEDNESDAY,
|
||||
THURSDAY,
|
||||
FRIDAY,
|
||||
SATURDAY
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -51,4 +51,12 @@ public class RequireThisCheckTest extends BaseCheckTestCase
|
|||
getPath("coding" + File.separator + "InputRequireThis.java"),
|
||||
expected);
|
||||
}
|
||||
|
||||
public void testGenerics() throws Exception
|
||||
{
|
||||
final DefaultConfiguration checkConfig =
|
||||
createCheckConfig(RequireThisCheck.class);
|
||||
final String[] expected = {};
|
||||
verify(checkConfig, getPath("Input15Extensions.java"), expected);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,11 @@
|
|||
<p>Fixed Bugs:</p>
|
||||
|
||||
<ul>
|
||||
<li>Removed all reference to the usage checks (bug 1256662).</li>
|
||||
<li>Removed all reference to the usage checks (bug
|
||||
1256662).</li>
|
||||
|
||||
<li>RequireThis now handle inner enums better (bug 1257599)</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<p>Other improvements:</p>
|
||||
|
|
|
|||
Loading…
Reference in New Issue