Community
Participate
Working Groups
Build ID: M20060921-0945 Steps To Reproduce: 1. Install the latest AJDT 1.4.1 for Eclipse 3.2.1 2. Create a new class like this: import java.util.Map; public class DelegatingMap<K, V> implements Map<K, V> { protected final Map<K, V> delegate; public DelegatingMap(Map<K, V> delegate) { super(); this.delegate = delegate; } } 3. Save it and get an Internal compiler error: java.lang.NullPointerException at org.aspectj.ajdt.internal.compiler.problem.AjProblemReporter.abstractMethodMustBeImplemented(AjProblemReporter.java:231) at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodVerifier.checkAbstractMethod(MethodVerifier.java:96) at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodVerifier.checkMethods(MethodVerifier.java:269) at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Method ... pter.java:102) at org.aspectj.ajde.internal.AspectJBuildManager$CompilerThread.run(AspectJBuildManager.java:191) More information:
Build ID: M20060921-0945 AJDT Version: 1.4.1.200611230655 AspectJ version: 1.5.3.200611221118 I get 12 problems, all errors, all of the type: "The type DelegatingMap<K,V> must implement the inherited abstract method Map<K,V>.clear()" I don't get any NPE.
*** Bug 166517 has been marked as a duplicate of this bug. ***
Reassigning to aspectj...
This could also be a dup of bug 162601 (they display the same stack trace) Felix - were you using the same project when you raised 162601?
I have been able to reproduce the issue in a new Java project in Eclipse, that I then converted into an AspectJ project. Creating the above class proved to be only the last step, I had to create a working aspect as well. Below are the additional types I created. The DelegatingMap should be created after all the other types are in place. Saving it will produce the exception. package test; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; @Documented @Target({ ElementType.FIELD }) @Retention(RetentionPolicy.RUNTIME) public @interface Relationship { } ************************************************************************ package test; import java.util.HashSet; import java.util.Set; public class PersistentDomainObject { @Relationship private Set<PersistentDomainObject> objects = new HashSet<PersistentDomainObject>(); /** * @return the objects */ public Set<PersistentDomainObject> getObjects() { return objects; } /** * @param objects the objects to set */ public void setObjects(Set<PersistentDomainObject> objects) { this.objects = objects; } } ********************************************************************** package test; import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.annotation.Around; import org.aspectj.lang.annotation.Aspect; @Aspect public class RelationshipAspect { /** * */ public RelationshipAspect() { super(); } @Around("get(@test.Relationship * test.PersistentDomainObject+.*)") public Object aroundGet(ProceedingJoinPoint thisJoinPoint) throws Throwable { Object result = thisJoinPoint.proceed(); return result; } @Around("set(@test.Relationship test.PersistentDomainObject+ test..*.*)") public Object aroundSet(ProceedingJoinPoint thisJoinPoint) throws Throwable { Object result = thisJoinPoint.proceed(); return result; } }
You can probably mark bug# 162601 as a duplicate of this one. The stack trace is the same, but I was never able to reproduce it reliably.
*** Bug 162601 has been marked as a duplicate of this bug. ***
Marking the product as aspectj since this bug relates to the compiler and is just been seen when the compiler is invoked via ajdt.
check if this is a core AJ bug or a bug because of the eclipse compiler version we are based on. if it is the latter we will fix it in 1.6 when we move to the new compiler.
*** Bug 176737 has been marked as a duplicate of this bug. ***
*** Bug 184523 has been marked as a duplicate of this bug. ***
I've just spent some time trying to recreate this but it won't fail for me - we have possibly fixed it 'by accident' between when it was last seen and now...
Created attachment 93616 [details] ajcore dump Hi Andy, sorry, have to disappoint you there. I'm still getting this error with 1.5.4 final when compiling with iajc. I don't get it from AJDT though... Hope this helps... Ludger
After putting InfrastructureAspects.jar on the aspectpath (it was only on the classpath before), the problem went away. But the compiler should react a bit more graceful than throwing an exception here. How about "Missing types on aspect path" or something like that?
With the info you gave me in your last comment, I've been able to address this. It won't NPE now and should complain about a missing type instead.
i'm now persuing further variants of "abstract method must be implemented' under bug 242797. I've fixed another 5 or 6 cases under that bug already (available in 1.6.2 aspectj dev builds), so I'm closing this one as a dup of that where I'll continue to persue any more that arise. *** This bug has been marked as a duplicate of bug 242797 ***