Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 350241 - Potential NPE in LazyLinkingResource removeDiagnostic
Summary: Potential NPE in LazyLinkingResource removeDiagnostic
Status: CLOSED FIXED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 2.0.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: SR1   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-24 08:18 EDT by Mark Christiaens CLA
Modified: 2017-09-19 17:15 EDT (History)
3 users (show)

See Also:
sebastian.zarnekow: indigo+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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