#287 Java 5.0 for:each breaks OneMethodPrivateFieldCheck

release_4.0
closed
5
2012-10-10
2005-01-25
Vincent Jorrand
No

OneMethodPrivateFieldCheck results in a
NullPointerException when using the new for:each syntax.

For example: (note that there is no private variable
involved)

public class CSError {
final void f() {
String[] sa = {"a", "b"};
for (String s : sa) {
}
}
}

Discussion

  • Logged In: YES
    user_id=1196641

    Actually all 5 usage checks result in a NullPointerException
    in the above case.

     
  • Logged In: YES
    user_id=1022106

    I've confirmed this bug. The entire transmorgify package
    needs to be augmented for Java 5 - not handling foreach
    statements in TableMaker.processFor() is what's causing this
    NPE.

     
  • Logged In: YES
    user_id=1022106

    Fixed - some time ago, actually. Issue hadn't been updated.