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

Bug 350241

Summary: Potential NPE in LazyLinkingResource removeDiagnostic
Product: [Modeling] TMF Reporter: Mark Christiaens <mark.g.j.christiaens>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: jan, mark.g.j.christiaens, sebastian.zarnekow
Version: 2.0.0Flags: sebastian.zarnekow: indigo+
Target Milestone: SR1   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Mark Christiaens CLA 2011-06-24 08:18:55 EDT
Build Identifier: 20110301-1815

According to the contract of org.eclipse.xtext.linking.ILinkingDiagnosticMessageProvider.getUnresolvedProxyMessage(ILinkingDiagnosticContext) it can return a null pointer.  That null then propagates to org.eclipse.xtext.linking.lazy.LazyLinkingResource.getDiagnosticList(DiagnosticMessage) and causes an NPE.

By default, Xtext doesn't run into this but it is a problem when the ILinkingDiagnosticMessageProvider is replaced.

Reproducible: Always
Comment 1 Mark Christiaens CLA 2011-06-24 08:20:44 EDT
Currently, my workaround is to inject a modified LazyLinkingResource with:

@Override
	protected List<Diagnostic> getDiagnosticList(DiagnosticMessage message)
			throws AssertionError {
		if (message != null) {
		return super.getDiagnosticList(message);
		}
		
		return ImmutableList.of (); 
	}
Comment 2 Jan Koehnlein CLA 2011-07-07 07:15:23 EDT
FIx pushed to MASTER.
Comment 3 Karsten Thoms CLA 2017-09-19 17:04:07 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 4 Karsten Thoms CLA 2017-09-19 17:15:54 EDT
Closing all bugs that were set to RESOLVED before Neon.0