Bug 69586 [misc] BadLocationException in AbstractLineTracker.getLineNumberOfOffset()
Eclipse 3.0 final Just saw the following exception in my log. I can't tell what I was doing at that time, though. --- snip --- org.eclipse.jface.text.BadLocationException at org.eclipse.jface.text.AbstractLineTracker.getLineNumberOfOffset(AbstractLineTracker.java:155) at org.eclipse.jface.text.AbstractDocument.getLineOfOffset(AbstractDocument.java:781) at org.eclipse.jdt.internal.ui.text.correction.QuickAssistLightBulbUpdater.hasQuickFixLightBulb(QuickAssistLightBulbUpdater.java:263) at org.eclipse.jdt.internal.ui.text.correction.QuickAssistLightBulbUpdater.doSelectionChanged(QuickAssistLightBulbUpdater.java:216) at org.eclipse.jdt.internal.ui.text.correction.QuickAssistLightBulbUpdater.access$0(QuickAssistLightBulbUpdater.java:205) at org.eclipse.jdt.internal.ui.text.correction.QuickAssistLightBulbUpdater$1.selectionChanged(QuickAssistLightBulbUpdater.java:129) at org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManager$PartListenerGroup.calculateASTandInform(SelectionListenerWithASTManager.java:164) at org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManager$3.run(SelectionListenerWithASTManager.java:136) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:66) --- snap ---
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/QuickAssistLightBulbUpdater.java
if (cu != null) {
					installSelectionListener();
					Point point= fViewer.getSelectedRange();
					ASTParser parser= ASTParser.newParser(ASTProvider.AST_LEVEL);
					parser.setSource(cu);
					parser.setResolveBindings(true);
					CompilationUnit astRoot= (CompilationUnit) parser.createAST(null);
					doSelectionChanged(point.x, point.y, astRoot);
				}
			} else {
				uninstallSelectionListener();
			}			
		}
	}	
	
	private ICompilationUnit getCompilationUnit() {
		IEditorInput input= fEditor.getEditorInput();
		Object elem= input.getAdapter(IJavaElement.class);
		if (elem instanceof ICompilationUnit) {
			return (ICompilationUnit) elem;
		}
		return null;
	}
	
	private IAnnotationModel getAnnotationModel() {
		return JavaUI.getDocumentProvider().getAnnotationModel(fEditor.getEditorInput());
	}
	
	private IDocument getDocument() {
		return JavaUI.getDocumentProvider().getDocument(fEditor.getEditorInput());