Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 354049 - LinkWithEditorOutlineContribution deregister method is unsafe
Summary: LinkWithEditorOutlineContribution deregister method is unsafe
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: SR2   Edit
Assignee: Jan Koehnlein CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-05 15:28 EDT by Samantha Chan CLA
Modified: 2017-09-19 17:09 EDT (History)
4 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 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