Community
Participate
Working Groups
the following class results in "can't find type $Local$" in the problem view, with the latest (1.3.0.20050819153037 for Eclipse 3.1) build. public class A { public Object f() { return new Object() { public String toString() { return "f"; } }; } } I created an AspectJ project with only this class in it. It only causes that problem if the project is an AspectJ project, not in a Java project. The problem sometimes disappears when editing the file, in that case cleaning the project makes it come back. For example, one way to make it disappear is to remove the toString() method, save (error disappear), put the method back (still no error), clean the project (error is back).
This happens with the latest command line compiler *only* if you compile it with -emacssym (which mimics building the structure model, which AJDT always wants) ajc -emacssym -1.5 A.java The stack trace from the ASM builder to the problem is as follows: BcelWorld(World).handleRequiredMissingTypeDuringResolution(UnresolvedType) line: 219 BcelWorld(World).resolve(UnresolvedType, boolean) line: 204 BcelWorld(World).resolve(UnresolvedType) line: 124 EclipseFactory.makeResolvedMember(MethodBinding, TypeBinding) line: 419 EclipseFactory.makeResolvedMember(MethodBinding) line: 391 AsmHierarchyBuilder.genBytecodeInfo(MethodDeclaration, IProgramElement) line: 501 AsmHierarchyBuilder.visit(MethodDeclaration, ClassScope) line: 376 AjMethodDeclaration(MethodDeclaration).traverse(ASTVisitor, ClassScope) line: 185 TypeDeclaration.traverse(ASTVisitor, BlockScope) line: 1238 QualifiedAllocationExpression.traverse(ASTVisitor, BlockScope) line: 392 ReturnStatement.traverse(ASTVisitor, BlockScope) line: 222 AjMethodDeclaration(MethodDeclaration).traverse(ASTVisitor, ClassScope) line: 212 TypeDeclaration.traverse(ASTVisitor, CompilationUnitScope) line: 1183 CompilationUnitDeclaration.traverse(ASTVisitor, CompilationUnitScope) line: 339 AsmHierarchyBuilder.internalBuild(CompilationUnitDeclaration, IHierarchy) line: 142 AsmHierarchyBuilder.buildStructureForCompilationUnit(CompilationUnitDeclaration, IHierarchy, AjBuildConfig) line: 82 Note, this also affects us building our shadows copy of the JDT compiler.
This also affects the Spacewar sample, when the debug configuration is used.
I've commited the fix for this bug. It will be available in the next published AspectJ build, and AJDT will be then be able to pick up and incorporate a new ajde....
i've checked the fixed version into AJDT cvs.
fix available.