Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#215 ExplicitInitialization gives too much warning

release_3.3
closed
Tests (17)
5
2012-10-10
2004-03-04
Linus Tolke
No

If I have a file:
public interface file {
int TOKEN_first = 0x00;
int TOKEN_second = 0x01;
int TOKEN_third = 0x02;
}
I get the warning Variable 'TOKEN_first' explicitly
initialized to '0' (default value for its type.

If I remove the = 0x00 checkstyle is silent but then the
compiler says:
file.java:2: = expected
int TOKEN_first;

Clearly checkstyle and the compiler cannot both be
satisfied here. I'd say that checkstyle is wrong.

Discussion

  • Logged In: YES
    user_id=746148

    Fix committed to CVS for 3.4