From 00b76289a20e67377b15a544ccaad117bc123048 Mon Sep 17 00:00:00 2001 From: aclement Date: Tue, 18 Jan 2005 14:26:36 +0000 Subject: [PATCH] Fix to allow pertypewithin aspectOf() to cope with 1.5 generic form of java.lang.Class --- .../ajdt/internal/compiler/lookup/EclipseFactory.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java index 89587eead..9c49259b4 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java @@ -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 isn't + // compatible with Class + if (n.equals("java.lang.Class")) + rb = lookupEnvironment.createRawType(rb,rb.enclosingType()); + return rb; } } -- 2.39.5