Community
Participate
Working Groups
When investigating Bug 334222, I noticed that files opened with a Structured Text Editor that do not have a known content type are unable to open. For example, create an .svg file and force it to open with the XML editor using the Open With... dialog. java.lang.NullPointerException at org.eclipse.wst.sse.ui.StructuredTextEditor$CharacterPairListener.installCompletionListener(StructuredTextEditor.java:865) at org.eclipse.wst.sse.ui.StructuredTextEditor.createPartControl(StructuredTextEditor.java:1544) at org.eclipse.ui.part.MultiPageEditorPart.addPage(MultiPageEditorPart.java:241) While I know we don't really support this method of opening these files without an appropriate content type, we should at least be able to display the text.
This is also a regression.
Created attachment 186779 [details] patch
* Explain why you believe this is a stop-ship defect. Or, if it is a "hotbug" (requested by an adopter) please document it as such. This is a regression in terms of opening unsupported content types in the StructuredTextEditor. The editor no longer even displays content. * Is there a work-around? If so, why do you believe the work-around is insufficient? No * How has the fix been tested? Is there a test case attached to the bugzilla record? Has a JUnit Test been added? Adhoc testing. * Give a brief technical overview. Who has reviewed this fix? The problem is that an unsupported content type is not returning a content assistant facade. During the initialization process, this null facade is generating an NPE causing the editor to open but display the "Error loading editor" message instead of the actual contents of the file. Nitin has reviewed the fix. * What is the risk associated with this fix? None. Just needed a null-pointer check.
Code checked in. Thanks for the quick reviews.