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

Bug 354049

Summary: LinkWithEditorOutlineContribution deregister method is unsafe
Product: [Modeling] TMF Reporter: Samantha Chan <chanskw>
Component: XtextAssignee: Jan Koehnlein <jan>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: jan, mkomor, sebastian.zarnekow, tmf.xtext-inbox
Version: 2.0.0Flags: sebastian.zarnekow: indigo+
Target Milestone: SR2   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Samantha Chan CLA 2011-08-05 15:28:36 EDT
I am getting NPE when trying to dispose a customized OutlinePage.  The reason is in the deregister method from LinkWithEditorOutlineContribution:

	@Override
	public void deregister(OutlinePage outlinePage) {
		super.deregister(outlinePage);
		OutlineWithEditorLinker outlineWithEditorLinker = page2linker.remove(outlinePage);
		outlineWithEditorLinker.deactivate();
		getPreferenceStoreAccess().getPreferenceStore().removePropertyChangeListener(outlineWithEditorLinker);
	}

In here, page2linker.remove(...) may return null.  You then call outlineWithEditorLinker.deactivate() without checking its return value... and resulted in the NPE.
Comment 1 Samantha Chan CLA 2011-08-10 11:42:40 EDT
Is it possible to target this for the next 2.0 SR?
Thanks!
Comment 2 Sebastian Zarnekow CLA 2011-08-16 17:11:33 EDT
Scheduled for 2.1
Comment 3 Jan Koehnlein CLA 2011-08-30 11:06:45 EDT
Pushed an NPE guard to master.
Comment 4 Karsten Thoms CLA 2017-09-19 16:57:52 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 5 Karsten Thoms CLA 2017-09-19 17:09:08 EDT
Closing all bugs that were set to RESOLVED before Neon.0