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

Bug 539849

Summary: TemplateStore.getRegistry can cause NullPointerException
Product: [Eclipse Project] Platform Reporter: Stephan Wahlbrink <sw>
Component: TextAssignee: Roland Grunberg <rgrunber>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: karsten.thoms, loskutov
Version: 4.9   
Target Milestone: 4.10 M3   
Hardware: All   
OS: All   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=535964
https://git.eclipse.org/r/130816
https://git.eclipse.org/c/platform/eclipse.platform.text.git/commit/?id=d3020689a3538017aa8a765b3f28c4f06f867956
Whiteboard:

Description Stephan Wahlbrink CLA 2018-10-05 10:44:57 EDT
The new implementation of TemplateStore.getRegistry does not take into account, that super.getRegistry() can return null.
Comment 1 Stephan Wahlbrink CLA 2018-10-05 10:45:16 EDT
Why not simply cast the registry to org.eclipse.jface.text.templates.ContextTypeRegistry? As far as I can see, the constructors doesn't allow another type.
Comment 2 Andrey Loskutov CLA 2018-10-05 11:26:26 EDT
Roland, please check. *At least* we should fix NPE, because getRegistry() can return null, it is a valid use case.
Comment 3 Eclipse Genie CLA 2018-10-11 13:42:17 EDT
New Gerrit change created: https://git.eclipse.org/r/130816