Project: AspectJ
Bug 91053 Generics problem with Set - does not compile with AspectJ 5
Reported: 2005-04-11 17:15:13 | Status: resolved fixed

I tried different things to remove compiler warnings about generics which you get when you switch to JDK 5 and use collections. At last I fall back to JDK 1.4. The following code compiles with AspectJ 5 and JDK compliance level 1.4: public aspect SubjectAspect { private Set Subject.observers = new HashSet(); public void Subject.addObserver(SubjectObserver observer) { observers.add(observer); } ... } After switching to compliance level 5.0 I get an error message "The method add(E) in the type Set<E> is not applicable for the arguments (SubjectObserver)". I don't know if it is a similar problem like #87550 but I means for older projects which use collections that they can't switch to JDK 1.5

Files changed in fix:
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java tests/src/org/aspectj/systemtest/ajc150/GenericsTests.java weaver/src/org/aspectj/weaver/TypeX.java weaver/src/org/aspectj/weaver/World.java