Project: JDT
Bug 139565 [syntax highlighting] Two errors during Eclipse startup with opened classfile editors
Reported: 2006-05-01 14:20:20 | Status: verified fixed

Using 3.2 RC2, on restart of Eclipse I have seen 2 errors in log (see below). In Eclipse workspace I had 13 Java editors from the last session, some of them with classes from my projects (source in my projects), and some of them from eclipse libraries, referenced by my plugin, like org.eclipse.jdt.internal.core.ClassFile or org.eclipse.jdt.internal.core.BufferManager. I couldn't reproduce these errors on the next restart of Eclipse with the same editor set. It seems that we have here some race conditions during startup. eclipse.buildId=I20060428-1315 java.version=1.5.0_06 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=de_DE Framework arguments: -showLocation Command-line arguments: -os win32 -ws win32 -arch x86 -showLocation -clean Error Mon May 01 20:03:09 CEST 2006 Error in JDT Core during AST creation java.lang.IllegalStateException: Workspace is closed. at org.eclipse.core.resources.ResourcesPlugin.getWorkspace(ResourcesPlugin.java:329) at org.eclipse.jdt.core.JavaConventions.validateClassFileName(JavaConventions.java:197) at org.eclipse.jdt.internal.core.ClassFile.validateClassFile(ClassFile.java:558) at org.eclipse.jdt.internal.core.ClassFile.buildStructure(ClassFile.java:82) at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:229) at org.eclipse.jdt.internal.core.BinaryMember.generateInfos(BinaryMember.java:47) at org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:505) at org.eclipse.jdt.internal.core.BinaryType.getElementInfo(BinaryType.java:281) at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:235) at org.eclipse.jdt.internal.core.SearchableEnvironment.find(SearchableEnvironment.java:88) at org.eclipse.jdt.internal.core.SearchableEnvironment.findType(SearchableEnvironment.java:152) at org.eclipse.jdt.internal.core.CancelableNameEnvironment.findType(CancelableNameEnvironment.java:50) at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.askForType(LookupEnvironment.java:96) at org.eclipse.jdt.internal.compiler.lookup.UnresolvedReferenceBinding.resolve(UnresolvedReferenceBinding.java:43) at org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.resolveType(BinaryTypeBinding.java:131) at org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.resolveTypesFor(BinaryTypeBinding.java:884) at org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.getMethods(BinaryTypeBinding.java:766) at org.eclipse.jdt.internal.compiler.lookup.Scope.getConstructor(Scope.java:1601) at org.eclipse.jdt.internal.compiler.ast.AllocationExpression.resolveType(AllocationExpression.java:301) at org.eclipse.jdt.internal.compiler.ast.Expression.resolveTypeExpecting(Expression.java:899) at org.eclipse.jdt.internal.compiler.ast.ThrowStatement.resolve(ThrowStatement.java:64) at org.eclipse.jdt.internal.compiler.ast.Block.resolveUsing(Block.java:115) at org.eclipse.jdt.internal.compiler.ast.TryStatement.resolve(TryStatement.java:707) at org.eclipse.jdt.internal.compiler.ast.Block.resolve(Block.java:101) at org.eclipse.jdt.internal.compiler.ast.IfStatement.resolve(IfStatement.java:234) at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolveStatements(AbstractMethodDeclaration.java:432) at org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(MethodDeclaration.java:179) at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclaration.java:403) at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1054) at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1101) at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.resolve(CompilationUnitDeclaration.java:353) at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:882) at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:508) at org.eclipse.jdt.core.dom.ASTParser.internalCreateAST(ASTParser.java:833) at org.eclipse.jdt.core.dom.ASTParser.createAST(ASTParser.java:631) at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider$1.run(ASTProvider.java:605) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.createAST(ASTProvider.java:600) at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.getAST(ASTProvider.java:514) at org.eclipse.jdt.internal.ui.javaeditor.SemanticHighlightingReconciler$1.run(SemanticHighlightingReconciler.java:425) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58) ------------- eclipse.buildId=I20060428-1315 java.version=1.5.0_06 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=de_DE Framework arguments: -showLocation Command-line arguments: -os win32 -ws win32 -arch x86 -showLocation -clean Error Mon May 01 20:03:09 CEST 2006 Problems occurred when invoking code from plug-in: "org.eclipse.jdt.ui". java.lang.IllegalStateException: Workspace is closed. at org.eclipse.core.resources.ResourcesPlugin.getWorkspace(ResourcesPlugin.java:329) at org.eclipse.jdt.core.JavaConventions.validateClassFileName(JavaConventions.java:197) at org.eclipse.jdt.internal.core.ClassFile.validateClassFile(ClassFile.java:558) at org.eclipse.jdt.internal.core.ClassFile.buildStructure(ClassFile.java:82) at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:229) at org.eclipse.jdt.internal.core.BinaryMember.generateInfos(BinaryMember.java:47) at org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:505) at org.eclipse.jdt.internal.core.BinaryType.getElementInfo(BinaryType.java:281) at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:235) at org.eclipse.jdt.internal.core.SearchableEnvironment.find(SearchableEnvironment.java:88) at org.eclipse.jdt.internal.core.SearchableEnvironment.findType(SearchableEnvironment.java:152) at org.eclipse.jdt.internal.core.CancelableNameEnvironment.findType(CancelableNameEnvironment.java:50) at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.askForType(LookupEnvironment.java:96) at org.eclipse.jdt.internal.compiler.lookup.UnresolvedReferenceBinding.resolve(UnresolvedReferenceBinding.java:43) at org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.resolveType(BinaryTypeBinding.java:131) at org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.resolveTypesFor(BinaryTypeBinding.java:884) at org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.getMethods(BinaryTypeBinding.java:766) at org.eclipse.jdt.internal.compiler.lookup.Scope.getConstructor(Scope.java:1601) at org.eclipse.jdt.internal.compiler.ast.AllocationExpression.resolveType(AllocationExpression.java:301) at org.eclipse.jdt.internal.compiler.ast.Expression.resolveTypeExpecting(Expression.java:899) at org.eclipse.jdt.internal.compiler.ast.ThrowStatement.resolve(ThrowStatement.java:64) at org.eclipse.jdt.internal.compiler.ast.Block.resolveUsing(Block.java:115) at org.eclipse.jdt.internal.compiler.ast.TryStatement.resolve(TryStatement.java:707) at org.eclipse.jdt.internal.compiler.ast.Block.resolve(Block.java:101) at org.eclipse.jdt.internal.compiler.ast.IfStatement.resolve(IfStatement.java:234) at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolveStatements(AbstractMethodDeclaration.java:432) at org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(MethodDeclaration.java:179) at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclaration.java:403) at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1054) at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1101) at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.resolve(CompilationUnitDeclaration.java:353) at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:882) at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:508) at org.eclipse.jdt.core.dom.ASTParser.internalCreateAST(ASTParser.java:833) at org.eclipse.jdt.core.dom.ASTParser.createAST(ASTParser.java:631) at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider$1.run(ASTProvider.java:605) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.createAST(ASTProvider.java:600) at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.getAST(ASTProvider.java:514) at org.eclipse.jdt.internal.ui.javaeditor.SemanticHighlightingReconciler$1.run(SemanticHighlightingReconciler.java:425) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)

Files changed in fix:
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/SemanticHighlightingReconciler.java