#182 ArrayTypeStyle should only check variable/parameter decls

release_3.3
closed
Other (70)
3
2012-10-10
2003-11-26
Lars Kühne
No

ArrayTypeStyle raises false alarms when checking method
return types with javaStyle=false. Example: Checking

public class Test
{
public Test[] getTests(Test test)
{
return null;
}
}

with configuration

<module name="TreeWalker">
<module name="ArrayTypeStyle">
<property name="javaStyle" value="false"/>
</module>
</module>

results in "Test.java:3:16: Array brackets at illegal
position."

My C is a bit rusty, but I think there is no way to fix
the above code so that ArrayTypeStyle does not
complain. It seems that C style is only applicable in
variable/parameter declarations.

Discussion

  • Logged In: YES
    user_id=746148

    Fix committed to CVS for 3.3