Community
Participate
Working Groups
Build ID: WTP - I20080424170254 Here is the stack trace when input is set on the editor: java.lang.NullPointerException at org.eclipse.wst.jsdt.web.ui.internal.style.java.LineStyleProviderForJSDT.addJavaTextAttribute(LineStyleProviderForJSDT.java:143) at org.eclipse.wst.jsdt.web.ui.internal.style.java.LineStyleProviderForJSDT.loadColors(LineStyleProviderForJSDT.java:250) at org.eclipse.wst.sse.ui.internal.provisional.style.AbstractLineStyleProvider.getTextAttributes(AbstractLineStyleProvider.java:182) at org.eclipse.wst.jsdt.web.ui.internal.style.java.LineStyleProviderForJSDT.prepareRegions(LineStyleProviderForJSDT.java:260) at org.eclipse.wst.sse.ui.internal.rules.StructuredDocumentDamagerRepairer.createPresentation(StructuredDocumentDamagerRepairer.java:48) at org.eclipse.wst.sse.ui.internal.provisional.style.StructuredPresentationReconciler.createPresentation(StructuredPresentationReconciler.java:864) at org.eclipse.wst.sse.ui.internal.provisional.style.StructuredPresentationReconciler.processDamage(StructuredPresentationReconciler.java:991) at org.eclipse.wst.sse.ui.internal.provisional.style.StructuredPresentationReconciler$InternalListener.textChanged(StructuredPresentationReconciler.java:577) at org.eclipse.jface.text.TextViewer.updateTextListeners(TextViewer.java:2647) at org.eclipse.jface.text.TextViewer.fireRedrawChanged(TextViewer.java:4684) at org.eclipse.jface.text.TextViewer.enabledRedrawing(TextViewer.java:4724) at org.eclipse.jface.text.TextViewer.enabledRedrawing(TextViewer.java:4692) at org.eclipse.jface.text.TextViewer.setRedraw(TextViewer.java:4779) at org.eclipse.jface.text.TextViewer.setRedraw(TextViewer.java:4751) at org.eclipse.jface.text.TextViewer.setVisibleRegion(TextViewer.java:3469) at org.eclipse.jface.text.source.projection.ProjectionViewer.setVisibleRegion(ProjectionViewer.java:696) at org.eclipse.ui.texteditor.AbstractTextEditor.setHighlightRange(AbstractTextEditor.java:5936) More information:
The LineStyleProvider's been "released" from the ReconcilerHighlighter, but the instance is still being used by the corresponding StructuredDocumentDamagerRepairer, which hasn't been updated.
Created attachment 98916 [details] patch This problem stemmed from the editor setting its input, and then configuring the viewer. When the viewer was reconfigured, the reconciler highlighter was being uninstalled, but not reinstalled on the new viewer configuration. Additionally, the viewer was not having its presentation reconciler updated to use the one provided by the new viewer configuration.
Patch looks good. In the next release we should review whether the reconciler highlighter is really needed.
Actually, Nick take another look at this when you do a Save As on a JSP file containing a JavaScript section. Something weird happens if you keep inserting near the front of that section.
This seems to be a problem that existed before this patch went in. Opened Bug 231878 to address the issue mentioned.
Approving because the problem is unrelated. This is a problem without a workaround whenever input is reset on the editor, something that's supported by superclasses and heavily used in certain adopter product features as well as Save As. I've tested it as well as Nick, and the risk is low as it now uninstalls the presentation reconciler and installs a fresh new copy when the input is reset.
Just to clarify ... what is the "bad thing" for the end user? Is it just messages in the log, or does something worse happen. Thanks.
(In reply to comment #7) > Just to clarify ... what is the "bad thing" for the end user? Is it just > messages in the log, or does something worse happen. > > Thanks. > The "bad thing" is not caused by this patch, and has had bug 231878 opened for it. What the end user can expect to see is errors in the log, and an incomplete structured text editor, which presents problems like: Smart Insert Mode will be switched off, the source viewer configuration will not be updated (causing syntax highlighting problems among other things), and more errors occur when you try to close the editor. Hopefully I clarified the right "bad thing".
released
Verified in S-3.0RC4-20080610084135.