Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 442426

Summary: NPE in ProblemHandler.handle during some background build
Product: [Eclipse Project] JDT Reporter: Marcel Bruch <marcel.bruch>
Component: CoreAssignee: shankha banerjee <shankhba>
Status: VERIFIED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: jarthana, shankhba, srikanth_sankaran
Version: 4.5   
Target Milestone: 4.5 M2   
Hardware: PC   
OS: Mac OS X   
Whiteboard:

Description Marcel Bruch CLA 2014-08-23 06:58:27 EDT
I can't say much about this issue but it probably should not come up to the logs. 
Thus, I though I should report it, hoping that this stacktrace and location in code may ring some bell in someone's head.

It seems that this error appeared in a workspace build job in the background with a currently invalid/broken target platform.



eclipse.buildId=4.4.0.I20140606-1215
java.version=1.8.0
java.vendor=Oracle Corporation
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=de_DE
Framework arguments:  -product org.eclipse.epp.package.standard.product -keyring /Users/Marcel/.eclipse_keyring -showlocation
Command-line arguments:  -os macosx -ws cocoa -arch x86_64 -product org.eclipse.epp.package.standard.product -keyring /Users/Marcel/.eclipse_keyring -showlocation

org.eclipse.core.resources
Error
Sat Aug 23 12:53:03 CEST 2014
Problems occurred when invoking code from plug-in: "org.eclipse.core.resources".

java.lang.NullPointerException
	at org.eclipse.jdt.internal.compiler.problem.ProblemHandler.handle(ProblemHandler.java:129)
	at org.eclipse.jdt.internal.compiler.problem.ProblemHandler.handle(ProblemHandler.java:208)
	at org.eclipse.jdt.internal.compiler.problem.ProblemReporter.handle(ProblemReporter.java:2365)
	at org.eclipse.jdt.internal.compiler.problem.ProblemReporter.rawTypeReference(ProblemReporter.java:7133)
	at org.eclipse.jdt.internal.compiler.ast.TypeReference.internalResolveType(TypeReference.java:500)
	at org.eclipse.jdt.internal.compiler.ast.TypeReference.resolveType(TypeReference.java:563)
	at org.eclipse.jdt.internal.compiler.ast.TypeReference.resolveType(TypeReference.java:559)
	at org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.resolveTypeFor(SourceTypeBinding.java:1706)
	at org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.fields(SourceTypeBinding.java:880)
	at org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.faultInTypesForFieldsAndMethods(SourceTypeBinding.java:850)
	at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.faultInTypes(CompilationUnitScope.java:450)
	at org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:763)
	at org.eclipse.jdt.internal.compiler.ProcessTaskManager.run(ProcessTaskManager.java:137)
	at java.lang.Thread.run(Thread.java:744)
Comment 1 Jay Arthanareeswaran CLA 2014-08-26 00:16:20 EDT
Hmm.. I wonder how the CompilationResult#compilationUnit can ever be null. These are the times I think we should start using null analysis in our code.


Do you find any error/warning that should be reported in the workspace but not? If you find something strange or have more information about this, please let us know.
Comment 2 Marcel Bruch CLA 2014-08-26 01:02:17 EDT
(In reply to Jayaprakash Arthanareeswaran from comment #1)
> Do you find any error/warning that should be reported in the workspace but
> not?

As said, I get this error message whenever I activate an invalid target platform 
that does not contain all required jar dependencies. There is an error preceding the build error:

org.eclipse.core.runtime.CoreException: Problems occurred getting the plug-ins in this container
	at org.eclipse.pde.internal.core.PluginModelManager.getExternalBundles(PluginModelManager.java:604)
	at org.eclipse.pde.internal.core.PluginModelManager.initializeTable(PluginModelManager.java:525)
	at org.eclipse.pde.internal.core.PluginModelManager.targetReloaded(PluginModelManager.java:473)
	at org.eclipse.pde.core.target.LoadTargetDefinitionJob.resetPlatform(LoadTargetDefinitionJob.java:229)
	at org.eclipse.pde.core.target.LoadTargetDefinitionJob.runInWorkspace(LoadTargetDefinitionJob.java:150)
	at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Contains: Unable to locate installable unit org.eclipse.m2e.feature.feature.group
Contains: Unable to locate installable unit org.eclipse.m2e.feature.feature.group
Contains: Unable to locate installable unit org.eclipse.m2e.feature.feature.group
Contains: Unable to locate installable unit org.eclipse.m2e.feature.feature.group
Contains: Unable to locate installable unit org.eclipse.m2e.feature.feature.group
Contains: Unable to locate installable unit org.eclipse.m2e.feature.feature.group
Contains: Unable to locate installable unit org.eclipse.m2e.feature.feature.group
Contains: Unable to locate installable unit org.eclipse.m2e.feature.feature.group
Contains: Unable to locate installable unit org.eclipse.m2e.feature.feature.group
Contains: Unable to locate installable unit org.eclipse.m2e.feature.feature.group



To some extend this is reproducible for me and our workspace setup. I'm not sure this can reduced to a simple example. If you really need this, I could try. It will take a few hours to create a reproducible small setup I think.

FWIW, I'm discussing the PDE related part in Bug 442427.

> If you find something strange or have more information about this,
> please let us know.
Comment 3 shankha banerjee CLA 2014-08-28 02:41:05 EDT
Please see Bug 442755 for a test case.
Looks like they are duplicates.

Bug 407376 could also be related.
Comment 4 shankha banerjee CLA 2014-08-28 06:22:22 EDT
(In reply to shankha banerjee from comment #3)
> Bug 407376 could also be related.

Bug 407376 is a different issue.
Comment 5 Srikanth Sankaran CLA 2014-09-03 03:53:19 EDT
Same as bug 442755

*** This bug has been marked as a duplicate of bug 442755 ***
Comment 6 Jay Arthanareeswaran CLA 2014-09-17 03:53:52 EDT
Verified for 4.5 M2 using build I20140916-2000