Community
Participate
Working Groups
I had a project that I was compiling using Java 5 source support. I turned off java 5 support but accidentally left in an @annotation pointcut in it. When recompiling, I get an error dialog BCException thrown: Bad type signature: <missing> When I restart I get this in my error log, and if I compile the same message. java.lang.ClassCastException: org.eclipse.core.internal.resources.Project at org.eclipse.ajdt.core.javaelements.AJCompilationUnit.<init> (AJCompilationUnit.java:118) at org.eclipse.ajdt.core.AspectJCore.create(AspectJCore.java:137) at org.eclipse.ajdt.core.AspectJCore.create(AspectJCore.java:38) at org.eclipse.ajdt.core.model.AJProjectModel$Persistence.loadJavaElements (AJProjectModel.java:633) at org.eclipse.ajdt.core.model.AJProjectModel$Persistence.loadModel (AJProjectModel.java:568) at org.eclipse.ajdt.core.model.AJProjectModel.loadModel (AJProjectModel.java:136) at org.eclipse.ajdt.core.model.AJModel.getModelForProject(AJModel.java:83) at org.eclipse.ajdt.core.model.AJModel.isAdvised(AJModel.java:126) at org.eclipse.ajdt.internal.buildconfig.ImageDecorator.decorateImage (ImageDecorator.java:207) at org.eclipse.ui.internal.decorators.FullDecoratorDefinition.decorateImage (FullDecoratorDefinition.java:111) at org.eclipse.ui.internal.decorators.FullImageDecoratorRunnable.run (FullImageDecoratorRunnable.java:28) at org.eclipse.core.internal.runtime.InternalPlatform.run (InternalPlatform.java:1044) at org.eclipse.core.runtime.Platform.run(Platform.java:783) at org.eclipse.ui.internal.decorators.DecoratorManager.safeDecorateImage (DecoratorManager.java:395) at org.eclipse.ui.internal.decorators.DecoratorManager.decorateImage (DecoratorManager.java:360) at org.eclipse.jface.viewers.DecoratingLabelProvider.getImage (DecoratingLabelProvider.java:84) at org.eclipse.jface.viewers.DecoratingLabelProvider.updateLabel (DecoratingLabelProvider.java:212) at org.eclipse.jface.viewers.StructuredViewer.buildLabel (StructuredViewer.java:1855) at org.eclipse.jface.viewers.TreeViewer.doUpdateItem(TreeViewer.java:228) at org.eclipse.jface.viewers.AbstractTreeViewer$UpdateItemSafeRunnable.run (AbstractTreeViewer.java:85) at org.eclipse.core.internal.runtime.InternalPlatform.run (InternalPlatform.java:1044) at org.eclipse.core.runtime.Platform.run(Platform.java:783) at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:44) at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:148) at org.eclipse.jface.viewers.AbstractTreeViewer.doUpdateItem (AbstractTreeViewer.java:621) at org.eclipse.jface.viewers.StructuredViewer$UpdateItemSafeRunnable.run (StructuredViewer.java:434) at org.eclipse.core.internal.runtime.InternalPlatform.run (InternalPlatform.java:1044) at org.eclipse.core.runtime.Platform.run(Platform.java:783) at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:44) at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:148)
Created attachment 24709 [details] zipped up project in this bad state The full zip is too big. I had to remove spring-1.2.1.jar from the lib folder to make it small enough to upload... In fact, even after removing any Java 5 code the project is STILL in a bad state.
Even removing & re-adding the AspectJ nature doesn't fix this bug for me!
I found this stack trace in the .log file under .metadata, giving some data on the Bad type popup... !ENTRY org.eclipse.ajdt.ui 4 0 2005-07-13 15:30:12.445 !MESSAGE BCException thrown: Bad type signature: <missing> !STACK 0 org.aspectj.weaver.BCException: Bad type signature: <missing> at org.aspectj.weaver.TypeX.signatureToName(TypeX.java:821) at org.aspectj.weaver.TypeX.getName(TypeX.java:329) at org.aspectj.weaver.bcel.BcelWorld.resolveObjectType (BcelWorld.java:221) at org.aspectj.weaver.World.resolveObjectType(World.java:160) at org.aspectj.weaver.World.resolve(World.java:132) at org.aspectj.weaver.patterns.ExactAnnotationTypePattern.resolveBindings (ExactAnnotationTypePattern.java:148) at org.aspectj.weaver.patterns.AnnotationPointcut.resolveBindings (AnnotationPointcut.java:162) at org.aspectj.weaver.patterns.NotPointcut.resolveBindings (NotPointcut.java:106) at org.aspectj.weaver.patterns.AndPointcut.resolveBindings (AndPointcut.java:112) at org.aspectj.weaver.patterns.Pointcut.resolve(Pointcut.java:231) at org.aspectj.ajdt.internal.compiler.ast.PointcutDesignator.finishResolveTypes (PointcutDesignator.java:82) at org.aspectj.ajdt.internal.compiler.ast.PointcutDeclaration.resolveStatements (PointcutDeclaration.java:164) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.res olve(AbstractMethodDeclaration.java:397) at org.aspectj.ajdt.internal.compiler.ast.PointcutDeclaration.resolvePointcut (PointcutDeclaration.java:145) at org.aspectj.ajdt.internal.compiler.lookup.AjLookupEnvironment.resolvePointcutDe clarations(AjLookupEnvironment.java:283) at org.aspectj.ajdt.internal.compiler.lookup.AjLookupEnvironment.completeTypeBindi ngs(AjLookupEnvironment.java:179) at org.aspectj.org.eclipse.jdt.internal.compiler.Compiler.beginToCompile (Compiler.java:302) at org.aspectj.org.eclipse.jdt.internal.compiler.Compiler.compile (Compiler.java:316) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performCompilation (AjBuildManager.java:727) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.doBuild (AjBuildManager.java:206) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.doBuild (AjBuildManager.java:166) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.incrementalBuild (AjBuildManager.java:147) at org.aspectj.ajde.internal.CompilerAdapter.compile (CompilerAdapter.java:116) at org.aspectj.ajde.internal.AspectJBuildManager$CompilerThread.run (AspectJBuildManager.java:191)
I'm passing over to AspectJ because the main problem here is the BCException from the compiler (which I can reproduce with the attached project). The ClassCastException from AJDT (which I couldn't reproduce) may or may not be related, but it shouldn't stop anything working, so I suggest we revisit that after the compiler bug is fixed. There are a few AJ bugs already with similiar "Bad type signature" errors, but I couldn't find any exactly the same as this one.
*** Bug 104207 has been marked as a duplicate of this bug. ***
I'm seeing the same error with code where I've removed the annotation implementations, commented out all use of annotations in source code, but left PCDs with annotation "matchers".
Could this have something to do with adding constructors to aspects? I only started seeing this problem when I added a few constructors to some existing aspects, to initialize some newly-added properties with default values. (Those weren't the only changes, however.)
for investigation in M4
Is it possible to ask you recreate this with a recent AJDT? We have changed the handling of 'missing' *and* we have changed the reporting of errors to give us more context about what AJ was doing at the time things went wrong. I've tried to create this failure from the command line and couldnt (used -emacssym too). I was also wondering if this only happens on an incremental compile and that when you do a full compile it 'goes away' ?
We should check for use of Java 5 only features (such as the @xxx pcd family) and make sure that a friendly error message is issued in a project that is compiled without -1.5.
Compiler now prevents use of any of the @xxx pcd family, annotations patterns in signature and type patterns, and the declare @xxx series if compliance level is not Java 5 or greater (planning for the future ;)).