Bug 61508 Internal error in sematic highlighting job
I20040506 + Plug-in Export 05.07 While importing plug-in and fragments via PDE I got the following exception: !ENTRY org.eclipse.core.runtime 4 2 Mai 08, 2004 19:00:00.334 !MESSAGE An internal error occurred during: "Semantic Highlighting Job". !STACK 0 java.lang.NullPointerException at org.eclipse.jdt.internal.ui.javaeditor.SemanticHighlightingReconciler$PositionC ollector.visit(SemanticHighlightingReconciler.java:75) at org.eclipse.jdt.core.dom.SimpleName.accept0(SimpleName.java:145) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2456) at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:2503) at org.eclipse.jdt.core.dom.MethodInvocation.accept0 (MethodInvocation.java:241) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2456) at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:2503) at org.eclipse.jdt.core.dom.ExpressionStatement.accept0 (ExpressionStatement.java:141) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2456) at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:2503) at org.eclipse.jdt.core.dom.IfStatement.accept0(IfStatement.java:187) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2456) at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2526) at org.eclipse.jdt.core.dom.Block.accept0(Block.java:133) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2456) at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:2503) at org.eclipse.jdt.core.dom.MethodDeclaration.accept0 (MethodDeclaration.java:499) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2456) at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2526) at org.eclipse.jdt.core.dom.TypeDeclaration.accept0 (TypeDeclaration.java:474) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2456) at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2526) at org.eclipse.jdt.core.dom.CompilationUnit.accept0 (CompilationUnit.java:290) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2456) at org.eclipse.jdt.internal.ui.javaeditor.SemanticHighlightingReconciler.reconcile Positions(SemanticHighlightingReconciler.java:212) at org.eclipse.jdt.internal.ui.javaeditor.SemanticHighlightingReconciler.reconcile d(SemanticHighlightingReconciler.java:178) at org.eclipse.jdt.internal.ui.javaeditor.SemanticHighlightingReconciler$1.run (SemanticHighlightingReconciler.java:311) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:66)
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/SemanticHighlightingPresenter.java
* @see org.eclipse.jface.text.ITextPresentationListener#applyTextPresentation(org.eclipse.jface.text.TextPresentation)
	 */
	public void applyTextPresentation(TextPresentation textPresentation) {
		IRegion region= textPresentation.getExtent();
		int i= computeIndexAtOffset(fPositions, region.getOffset()), n= computeIndexAtOffset(fPositions, region.getOffset() + region.getLength());
		if (n - i > 2) {
			List ranges= new ArrayList(n - i);
			for (; i < n; i++) {
				HighlightedPosition position= (HighlightedPosition) fPositions.get(i);
				if (!position.isDeleted())
					ranges.add(position.createStyleRange());
			}
			StyleRange[] array= new StyleRange[ranges.size()];
			array= (StyleRange[]) ranges.toArray(array);
			textPresentation.replaceStyleRanges(array);
		} else {
			for (; i < n; i++) {
				HighlightedPosition position= (HighlightedPosition) fPositions.get(i);
				if (!position.isDeleted())
					textPresentation.replaceStyleRange(position.createStyleRange());
			}
		}
	}
	/*
	 * @see org.eclipse.jface.text.ITextInputListener#inputDocumentAboutToBeChanged(org.eclipse.jface.text.IDocument, org.eclipse.jface.text.IDocument)
	 */
	public void inputDocumentAboutToBeChanged(IDocument oldInput, IDocument newInput) {
		setCanceled(true);
		releaseDocument(oldInput);
		resetState();