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

Bug 343989

Summary: NPE When Closing Multi-Page Editor with StructuredTextEditor page
Product: [WebTools] WTP Source Editing Reporter: Daniel Johnson <danijoh2>
Component: wst.sseAssignee: wst.sse <wst.sse-inbox>
Status: CLOSED DUPLICATE QA Contact: Nitin Dahyabhai <thatnitind>
Severity: normal    
Priority: P3 CC: nsand.dev
Version: unspecified   
Target Milestone: ---   
Hardware: Macintosh   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Daniel Johnson CLA 2011-04-27 12:29:21 EDT
I have a class that extends org.eclipse.ui.forms.editor.FormEditor and in the addPages() method I create a StructuredTextEditor page:

source = new StructuredTextEditor();
index = addPage(source, getEditorInput());
setActivePage(index);

When I close the editor I get this exception:

!ENTRY org.eclipse.wst.sse.ui 4 4 2011-04-27 08:55:55.899
!MESSAGE problem with reconciling
!STACK 0
java.lang.NullPointerException
	at org.eclipse.wst.sse.ui.internal.projection.AbstractStructuredFoldingStrategy.markInvalidAnnotationsForDeletion(AbstractStructuredFoldingStrategy.java:294)
	at org.eclipse.wst.sse.ui.internal.projection.AbstractStructuredFoldingStrategy.reconcile(AbstractStructuredFoldingStrategy.java:194)
	at org.eclipse.wst.sse.ui.internal.reconcile.DocumentRegionProcessor.process(DocumentRegionProcessor.java:312)
	at org.eclipse.wst.sse.ui.internal.reconcile.StructuredRegionProcessor.process(StructuredRegionProcessor.java:248)
	at org.eclipse.wst.sse.ui.internal.reconcile.DirtyRegionProcessor.run(DirtyRegionProcessor.java:667)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

I thought maybe I wasn't disposing something correctly, so I put a break point in my dispose() method, but the exception gets thrown between closing the editor and before the dispose() method gets called.

I tried stepping through org.eclipse.ui.internal.WorkbenchPage closeEditors() method, but when I step through it the exception does not get thrown, so my guess is some running jobs are not properly cancelled when the editor is closed. I am using org.eclipse.wst.see.ui 1.2.2.v201008232126
Comment 1 Nick Sandonato CLA 2011-04-27 12:37:18 EDT
Hi, Daniel. This was addressed through Bug 342985. THanks for your report.

*** This bug has been marked as a duplicate of bug 342985 ***
Comment 2 Daniel Johnson CLA 2011-04-27 12:43:48 EDT
Oops my bad. I didn't realize normal search doesn't search comments too. Thanks for the quick response. Cheers!