Bug 25900 NPE in CompilationUnitEditor
Build I20021105++ - load JUnit - expand a CU - delete CU on disk - select a field of expanded CU - open type hierarchy ==> you get an editor saying that the file doesn't exist on disk - close editor java.lang.NullPointerException at org.eclipse.jdt.internal.ui.javaeditor.LinePainter.drawHighlightLine (LinePainter.java:110) at org.eclipse.jdt.internal.ui.javaeditor.LinePainter.deactivate (LinePainter.java:128) at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor.stopLineHighlightin g(CompilationUnitEditor.java:1142) at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor.dispose (CompilationUnitEditor.java:1350) at org.eclipse.ui.internal.WorkbenchPage$5.run(WorkbenchPage.java:910) at org.eclipse.core.internal.runtime.InternalPlatform.run (InternalPlatform.java:839) at org.eclipse.core.runtime.Platform.run(Platform.java:413) at org.eclipse.ui.internal.WorkbenchPage.disposePart (WorkbenchPage.java:908) at org.eclipse.ui.internal.WorkbenchPage.closeEditor (WorkbenchPage.java:723) at org.eclipse.ui.internal.WorkbenchPage.closeEditor (WorkbenchPage.java:690) at org.eclipse.ui.internal.EditorPane.doHide(EditorPane.java:83) at org.eclipse.ui.internal.EditorWorkbook$1.itemClosed (EditorWorkbook.java:121) at org.eclipse.swt.custom.CTabFolder.closeNotify(CTabFolder.java:304) at org.eclipse.swt.custom.CTabFolder.access$13(CTabFolder.java:294) at org.eclipse.swt.custom.CTabFolder$4.handleEvent(CTabFolder.java:434) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:77) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:825) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1692) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1410) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1419) at org.eclipse.ui.internal.Workbench.run(Workbench.java:1402) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:831) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:432) at EclipseRuntimeLauncher.main(EclipseRuntimeLauncher.java:24)
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
/*
		 * @see org.eclipse.swt.custom.VerifyKeyListener#verifyKey(org.eclipse.swt.events.VerifyEvent)
		 */
		public void verifyKey(VerifyEvent event) {			
			if (!event.doit)
				return;
			final ISourceViewer sourceViewer= getSourceViewer();
			IDocument document= sourceViewer.getDocument();
			final Point selection= sourceViewer.getSelectedRange();
			final int offset= selection.x;
			final int length= selection.y;
			switch (event.character) {
			case '(':
			case '[':
				if (!fCloseBrackets || !isResfOfLineEmpty(document, offset + length))
					return;
			
			case '"':
				if (event.character == '"' && !fCloseStrings)
					return;
				
				try {		
					ITypedRegion partition= document.getPartition(offset);
					if (! IDocument.DEFAULT_CONTENT_TYPE.equals(partition.getType()) && partition.getOffset() != offset)
						return;
					final char character= event.character;
					final char closingCharacter= getPeerCharacter(character);		
					final StringBuffer buffer= new StringBuffer();
					buffer.append(character);