NullPointerException from Eclipse compiler
I am getting the following message from my Eclipse compiler and my project won't compile ....
Internal compiler error: java.lang.NullPointerException in org.eclipse.jdt.internal.compiler.problem.ProblemReporter.missingTypeInMethod (ProblemReporter.java:5075)
I've tried updating Eclipse, restarting eclipse, closing and opening a project, refreshing, cleaning / restoring, etc. I have no idea.
source to share
It seems like bug 250297 , fixed in eclipse 3.4.2. Also fixed in 3.5 (M4, Nov 2008, as mentioned in this JDT release note )
The crash occurs at the line (→>):
public void missingTypeInMethod(MessageSend messageSend, MethodBinding method)
{
List missingTypes = method.collectMissingTypes(null);
>>> TypeBinding missingType = (TypeBinding) missingTypes.get(0);
This indicates that although we have identified the missing type (with which we are trying to file a complaint), we are unable to find it inside the method signature ...
So ... if you are using a "older" version of eclipse (like 3.4 or 3.4.1), a good solution is to upgrade (that is, install a new fresh version of eclipse, 3.4.2 or 3.5.1) while reusing the same the same workspace.
The error should be gone.
source to share