Community
Participate
Working Groups
Build Identifier: I20100608-0911 The following AspectJ feature, 329268, introduces new types of TypePattern nodes. As AJDT still relies on DefaultTypePattern which the AspectJ feature no longer generates, AJDT must be updated to support the new type of TypePattern nodes. AJDT breaks if the AspectJ feature is used, as AJDT is expecting DefaultTypePatterns, and due to this in certain places in AJSourceIndexerRequestor, ClassCastExceptions are thrown. AJDT should be swept to remove DefaultTypePattern and replace them with appropriate TypePattern nodes. Example of where AJDT breaks with the TypePattern AspectJ feature: java.lang.ClassCastException: org.aspectj.org.eclipse.jdt.core.dom.WildTypePattern cannot be cast to org.aspectj.org.eclipse.jdt.core.dom.DefaultTypePattern at org.eclipse.ajdt.core.codeconversion.AJSourceIndexerRequestor.enterField(AJSourceIndexerRequestor.java:77) at org.eclipse.jdt.internal.compiler.SourceElementNotifier.notifySourceElementRequestor(SourceElementNotifier.java:506) at org.eclipse.jdt.internal.compiler.SourceElementNotifier.notifySourceElementRequestor(SourceElementNotifier.java:670) at org.eclipse.jdt.internal.compiler.SourceElementNotifier.notifySourceElementRequestor(SourceElementNotifier.java:439) at org.eclipse.jdt.internal.compiler.SourceElementParser.parseCompilationUnit(SourceElementParser.java:921) at org.codehaus.jdt.groovy.integration.internal.MultiplexingIndexingParser.parseCompilationUnit(MultiplexingIndexingParser.java:83) at org.eclipse.jdt.internal.core.search.indexing.SourceIndexer.indexDocument(SourceIndexer.java:68) at org.eclipse.jdt.internal.core.search.JavaSearchParticipant.indexDocument(JavaSearchParticipant.java:72) at org.eclipse.jdt.internal.core.search.indexing.IndexManager.indexDocument(IndexManager.java:466) at org.eclipse.jdt.internal.core.search.indexing.IndexManager$1.execute(IndexManager.java:866) at org.eclipse.jdt.internal.core.search.processing.JobManager.run(JobManager.java:404) at java.lang.Thread.run(Thread.java:619) Reproducible: Always Steps to Reproduce: 1. With the AspectJ patch from 329268 applied and built, in a runtime workbench create a new aspect: public aspect AJTest { declare parents : Foo extends Bar; class Foo { } class Bar { } } 2. Save it to compile. 3. ClassCastExcception thrown in AJSourceIndexerRequestor
Created attachment 183099 [details] Minimal changes to AJDT to support AspectJ feature 329268 This patch contains bare minimum changes to AJDT to support new TypePattern nodes as defined in the AspectJ feature 329268, as well as some NPE fixes that occur in ExtraTypeReferenceFinder when searching for types. This patch should only be applied after AspectJ feature 329268 has been committed to the AspectJ build. This patch only contains support for TypePattern nodes that contain identifiers, as well as AnyWithAnnotationTypePattern and TypeCategoryTypePattern. Additional visitor methods need to be implemented to handle the other new type pattern nodes in AJSourceIndexerRequestor.
Thanks for the patch It has been applied. I will be committing it shortly.
Comment on attachment 183099 [details] Minimal changes to AJDT to support AspectJ feature 329268 iplog
Patch looks good. Next step is to refactor AJDT so that it uses the enhance AspectJ ast nodes as described in bug 329268.