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

Bug 320725

Summary: SourceViewer.java: NPE on Quick Fix after disabling spelling
Product: [WebTools] WTP Source Editing Reporter: Andrey Vakunov <wako.an>
Component: wst.sseAssignee: wst.sse <wst.sse-inbox>
Status: RESOLVED FIXED QA Contact: Nitin Dahyabhai <thatnitind>
Severity: minor    
Priority: P3 CC: rakes123
Version: unspecified   
Target Milestone: 3.3 M1   
Hardware: All   
OS: All   
Whiteboard:

Description Andrey Vakunov CLA 2010-07-23 10:16:04 EDT
Build Identifier: Version: 3.6.0 Build id: I20100608-0911

After disabling spell checking I've got next NPE:
java.lang.NullPointerException
	at org.eclipse.jface.text.source.SourceViewer.doOperation(SourceViewer.java:920)
	at org.eclipse.jface.text.source.projection.ProjectionViewer.doOperation(ProjectionViewer.java:1534)
	at org.eclipse.wst.sse.ui.internal.StructuredTextViewer.doOperation(StructuredTextViewer.java:597)
	at org.eclipse.ui.texteditor.TextOperationAction$1.run(TextOperationAction.java:131)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
....

Reproducible: Always

Steps to Reproduce:
1. Create simple text file in workspace (i.e. 'test.txt') with content (i.e. 'hallo warld')
2. Open created file using 'Standalone Structured Source Editor'
3. Spelling and Quick Fix(by "Ctrl+1") working fine. Doesn't close editor.
4. Goto "Preferences/General/Editors/Text Editors/Spelling"
5. Disable spell checking.
6. Spelling are still in editor.
7. Try call Quick Fix("Ctrl+1"). NPE as a result.
Comment 1 Andrey Vakunov CLA 2010-07-23 10:18:56 EDT
This bug doesn't reproduce in simple 'Text editor'.
Comment 2 Rakesh CLA 2010-07-23 10:57:20 EDT
I think , structured source editor is not meant for txt file .This editor works on StructuredModel which is null in case of text files.
Comment 3 Nitin Dahyabhai CLA 2010-07-23 16:37:48 EDT
Can't reproduce, but that editor shouldn't be there.