Bug 103741 - Problem turning off Java 5 Support with @annotation pointcut (TypeX.java:821)
Summary: Problem turning off Java 5 Support with @annotation pointcut (TypeX.java:821)
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P2 enhancement (vote)
Target Milestone: 1.5.0RC1   Edit
Assignee: Adrian Colyer CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 104207 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-07-13 19:19 EDT by Ron Bodkin CLA
Modified: 2005-11-04 04:05 EST (History)
1 user (show)

See Also:


Attachments
zipped up project in this bad state (700.15 KB, application/x-zip-compressed)
2005-07-13 19:25 EDT, Ron Bodkin CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ron Bodkin CLA 2005-07-13 19:19:43 EDT
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)
Comment 1 Ron Bodkin CLA 2005-07-13 19:25:09 EDT
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.
Comment 2 Ron Bodkin CLA 2005-07-13 19:26:41 EDT
Even removing & re-adding the AspectJ nature doesn't fix this bug for me!
Comment 3 Ron Bodkin CLA 2005-07-13 19:54:22 EDT
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)

Comment 4 Matt Chapman CLA 2005-07-14 08:50:37 EDT
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.
Comment 5 Matt Chapman CLA 2005-07-18 08:31:48 EDT
*** Bug 104207 has been marked as a duplicate of this bug. ***
Comment 6 Dean Wampler CLA 2005-07-18 21:59:56 EDT
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".
Comment 7 Dean Wampler CLA 2005-07-18 23:43:47 EDT
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.)
Comment 8 Adrian Colyer CLA 2005-08-26 11:37:01 EDT
for investigation in M4
Comment 9 Andrew Clement CLA 2005-10-05 03:32:54 EDT
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' ?
Comment 10 Adrian Colyer CLA 2005-10-28 06:48:50 EDT
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.
Comment 11 Adrian Colyer CLA 2005-11-04 04:05:23 EST
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 ;)).