]> source.dussan.org Git - aspectj.git/commitdiff
Fix to allow pertypewithin aspectOf() to cope with 1.5 generic form of java.lang...
authoraclement <aclement>
Tue, 18 Jan 2005 14:26:36 +0000 (14:26 +0000)
committeraclement <aclement>
Tue, 18 Jan 2005 14:26:36 +0000 (14:26 +0000)
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java

index 89587eeadd12316cf2ca6670960a5155fc846ba2..9c49259b4126f0e73de63f59127c07e384c900c7 100644 (file)
@@ -285,7 +285,14 @@ public class EclipseFactory {
                } else {
                        String n = typeX.getName();
                        char[][] name = CharOperation.splitOn('.', n.toCharArray());
-                       return lookupEnvironment.getType(name);
+                       ReferenceBinding rb = lookupEnvironment.getType(name);
+                       // XXX We do this because the pertypewithin aspectOf(Class) generated method needs it.  Without this
+                       // we don't get a 'rawtype' as the argument type for a messagesend to aspectOf() and this leads to 
+                       // a compile error if some client class calls aspectOf(A.class) or similar as it says Class<A> isn't
+                       // compatible with Class<T>
+                       if (n.equals("java.lang.Class")) 
+                               rb = lookupEnvironment.createRawType(rb,rb.enclosingType());
+                       return rb;
                }
        }