Community
Participate
Working Groups
After upgrade from 4.4.2 to 4.5.0RC3 compilation of some sources fails with Internal compiler error: java.lang.NullPointerException at org.eclipse.jdt.internal.compiler.ast.WhileStatement.doesNotCompleteNormally(WhileStatement.java:294) Reduced test case: import java.util.function.Consumer; class While { void m() { t(Long.class, value -> { int x = 1; while (--x >= 0) ; }); } <T> void t(Class<T> clazz, Consumer<T> object) { } } The same code with with for (; ...;) instead of while (...) compiles normally.
Reproduced in master. Looks like we are accessing the constant early during shape analysis? Sasi, please take a look.
The binary expression is not resolved yet and that's why we see a null at this location. Using a for instead of while works because ForStatement.doesNotCompleteNormally handles the case when constant is null while the implementation in WhileStatement doesn't. Should be a straight forward fix
New Gerrit change created: https://git.eclipse.org/r/51084
Jay, please take a look at the (fairly simple) change above. Thanks
Sasi, please go ahead and release this in master if you are happy with test results. We will wait for M1 before putting this in 4.5.1.
Gerrit change https://git.eclipse.org/r/51084 was merged to [master]. Commit: http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?id=43191caefaa8fabb3434b14cf3063f1b06673205
(In reply to comment #5) > Sasi, please go ahead and release this in master if you are happy with test > results. We will wait for M1 before putting this in 4.5.1. done
*** Bug 473232 has been marked as a duplicate of this bug. ***
Released to 451 via http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?h=R4_5_maintenance&id=6c5843e58bcfe9b5a5c74d90e553fae2dd666aef
Verified for 4.6 M1 with build I20150803-2000.
Verified for Eclipse Mars 4.5 SR1 (4.5.1) Build id: M20150819-1000