Bug 51541 NPE restoring scrapbook editor
build I20040210-0800 plus latest UI and Text from HEAD When running my target eclipse, I got an error restoring a scrapbook editor that had been saved during the previous session. The log has the following. The line in question is: StyledText styledText= fSourceViewer.getTextWidget(); *** int caret= widgetOffset2ModelOffset(fSourceViewer, styledText.getCaretOffset()); !ENTRY org.eclipse.core.runtime 4 2 Feb 10, 2004 15:49:26.780 !MESSAGE Problems occurred when invoking code from plug- in: "org.eclipse.core.runtime". !STACK 0 java.lang.NullPointerException at org.eclipse.ui.texteditor.AbstractTextEditor.getCursorPosition (AbstractTextEditor.java:4399) at org.eclipse.ui.texteditor.AbstractTextEditor.updateStatusField (AbstractTextEditor.java:4357) at org.eclipse.ui.texteditor.AbstractTextEditor.setStatusField (AbstractTextEditor.java:4104) at org.eclipse.ui.texteditor.BasicTextEditorActionContributor.doSetActiveEditor (BasicTextEditorActionContributor.java:215) at org.eclipse.ui.texteditor.BasicTextEditorActionContributor.setActiveEditor (BasicTextEditorActionContributor.java:229) at org.eclipse.jdt.internal.ui.javaeditor.BasicJavaEditorActionContributor.setActiv eEditor(BasicJavaEditorActionContributor.java:187) at org.eclipse.jdt.internal.ui.javaeditor.BasicEditorActionContributor.setActiveEdi tor(BasicEditorActionContributor.java:83) at org.eclipse.jdt.internal.debug.ui.snippeteditor.SnippetEditorActionContributor.s etActiveEditor(SnippetEditorActionContributor.java:74) at org.eclipse.ui.internal.EditorActionBars.partChanged (EditorActionBars.java:291) at org.eclipse.ui.internal.WorkbenchPage$2.run(WorkbenchPage.java:474) at org.eclipse.core.internal.runtime.InternalPlatform.run (InternalPlatform.java:819) at org.eclipse.core.runtime.Platform.run(Platform.java:493) at org.eclipse.ui.internal.WorkbenchPage.activatePart (WorkbenchPage.java:466) at org.eclipse.ui.internal.WorkbenchPage.onActivate (WorkbenchPage.java:1953) at org.eclipse.ui.internal.WorkbenchWindow$6.run (WorkbenchWindow.java:1824) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:84) at org.eclipse.ui.internal.WorkbenchWindow.setActivePage (WorkbenchWindow.java:1811) at org.eclipse.ui.internal.WorkbenchWindow.restoreState (WorkbenchWindow.java:1406) at org.eclipse.ui.internal.Workbench.restoreState(Workbench.java:1369) at org.eclipse.ui.internal.Workbench.access$8(Workbench.java:1337) at org.eclipse.ui.internal.Workbench$11.run(Workbench.java:1259) at org.eclipse.core.internal.runtime.InternalPlatform.run (InternalPlatform.java:819) at org.eclipse.core.runtime.Platform.run(Platform.java:493) at org.eclipse.ui.internal.Workbench.openPreviousWorkbenchState (Workbench.java:1215) at org.eclipse.ui.internal.Workbench.init(Workbench.java:894) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1503) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench (Workbench.java:265) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:139) at org.eclipse.ui.internal.ide.IDEApplication.run (IDEApplication.java:47) at org.eclipse.core.internal.runtime.PlatformActivator$1.run (PlatformActivator.java:257) at org.eclipse.core.runtime.adaptor.EclipseStarter.run (EclipseStarter.java:108) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.eclipse.core.launcher.Main.basicRun(Main.java:279) at org.eclipse.core.launcher.Main.run(Main.java:742) at org.eclipse.core.launcher.Main.main(Main.java:581)
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/spelling/SpellReconcileStrategy.java
final ISpellCheckEngine engine= SpellCheckEngine.getInstance();
				final ISpellChecker checker= engine.createSpellChecker(locale, fPreferences);
				if (checker != null) {
					for (int index= 0; index < partitions.length; index++) {
						partition= partitions[index];
						if (!partition.getType().equals(IDocument.DEFAULT_CONTENT_TYPE))
							checker.execute(new SpellCheckIterator(fDocument, partition, locale));
					}
				}
			} catch (BadLocationException exception) {
				
			} finally {
				fRequestor.endReporting();
			}
		}
	}
	/*
	 * @see org.eclipse.jface.text.reconciler.IReconcilingStrategy#setDocument(org.eclipse.jface.text.IDocument)
	 */
	public final void setDocument(final IDocument document) {
		fDocument= document;
	}
	/*
	 * @see org.eclipse.jface.text.reconciler.IReconcilingStrategyExtension#setProgressMonitor(org.eclipse.core.runtime.IProgressMonitor)
	 */
	public final void setProgressMonitor(final IProgressMonitor monitor) {
		
	}
}