aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraclement <aclement>2005-11-28 17:44:35 +0000
committeraclement <aclement>2005-11-28 17:44:35 +0000
commitb6980f2f7b2697e41b454a16d3a7bd1e0135aa8d (patch)
treee9588758e74d8587cc925e3de87f935d3dfc1442
parent8e14e21ab33d44d6fcfdcdf3576569e1e9e69995 (diff)
downloadaspectj-b6980f2f7b2697e41b454a16d3a7bd1e0135aa8d.tar.gz
aspectj-b6980f2f7b2697e41b454a16d3a7bd1e0135aa8d.zip
Further changes for 118192
-rw-r--r--weaver/src/org/aspectj/weaver/reflect/ReflectionBasedReferenceTypeDelegate.java7
-rw-r--r--weaver/testsrc/org/aspectj/weaver/reflect/ReflectionBasedReferenceTypeDelegateTest.java17
-rw-r--r--weaver5/java5-testsrc/org/aspectj/weaver/TestJava5ReflectionBasedReferenceTypeDelegate.java16
3 files changed, 22 insertions, 18 deletions
diff --git a/weaver/src/org/aspectj/weaver/reflect/ReflectionBasedReferenceTypeDelegate.java b/weaver/src/org/aspectj/weaver/reflect/ReflectionBasedReferenceTypeDelegate.java
index 2dd8a3d41..ef61c7f2f 100644
--- a/weaver/src/org/aspectj/weaver/reflect/ReflectionBasedReferenceTypeDelegate.java
+++ b/weaver/src/org/aspectj/weaver/reflect/ReflectionBasedReferenceTypeDelegate.java
@@ -297,7 +297,12 @@ public class ReflectionBasedReferenceTypeDelegate implements ReferenceTypeDelega
* @see org.aspectj.weaver.ReferenceTypeDelegate#getSuperclass()
*/
public ResolvedType getSuperclass() {
- if (this.myClass.getSuperclass() == null) return null;
+ if (this.myClass.getSuperclass() == null) {
+ if (myClass==Object.class) {
+ return null;
+ }
+ return world.resolve(UnresolvedType.OBJECT);
+ }
return ReflectionBasedReferenceTypeDelegateFactory
.resolveTypeInWorld(this.myClass.getSuperclass(),world);
}
diff --git a/weaver/testsrc/org/aspectj/weaver/reflect/ReflectionBasedReferenceTypeDelegateTest.java b/weaver/testsrc/org/aspectj/weaver/reflect/ReflectionBasedReferenceTypeDelegateTest.java
index 2a86a1c47..cc0407c5c 100644
--- a/weaver/testsrc/org/aspectj/weaver/reflect/ReflectionBasedReferenceTypeDelegateTest.java
+++ b/weaver/testsrc/org/aspectj/weaver/reflect/ReflectionBasedReferenceTypeDelegateTest.java
@@ -238,23 +238,6 @@ public class ReflectionBasedReferenceTypeDelegateTest extends TestCase {
assertTrue("Superclass for Map generic type should be Object but was "+rt2,rt2.equals(UnresolvedType.OBJECT));
}
- public void testGenericInterfaceSuperclass_ReflectionWorldResolution() {
-
- UnresolvedType javaUtilMap = UnresolvedType.forName("java.util.Map");
-
- ReferenceType rawType = (ReferenceType) world.resolve(javaUtilMap);
- assertTrue("Should be the raw type ?!? "+rawType.getTypekind(),rawType.isRawType());
-
- ReferenceType genericType = (ReferenceType)rawType.getGenericType();
- assertTrue("Should be the generic type ?!? "+genericType.getTypekind(),genericType.isGenericType());
-
- ResolvedType rt = rawType.getSuperclass();
- assertTrue("Superclass for Map raw type should be Object but was "+rt,rt.equals(UnresolvedType.OBJECT));
-
- ResolvedType rt2 = genericType.getSuperclass();
- assertTrue("Superclass for Map generic type should be Object but was "+rt2,rt2.equals(UnresolvedType.OBJECT));
- }
-
// todo: array of int
protected void setUp() throws Exception {
diff --git a/weaver5/java5-testsrc/org/aspectj/weaver/TestJava5ReflectionBasedReferenceTypeDelegate.java b/weaver5/java5-testsrc/org/aspectj/weaver/TestJava5ReflectionBasedReferenceTypeDelegate.java
index a91e674bc..530dd9844 100644
--- a/weaver5/java5-testsrc/org/aspectj/weaver/TestJava5ReflectionBasedReferenceTypeDelegate.java
+++ b/weaver5/java5-testsrc/org/aspectj/weaver/TestJava5ReflectionBasedReferenceTypeDelegate.java
@@ -44,5 +44,21 @@ public class TestJava5ReflectionBasedReferenceTypeDelegate extends ReflectionBas
world.resolve("java.lang.Class").getGenericType();
}
+ public void testGenericInterfaceSuperclass_ReflectionWorldResolution() {
+
+ UnresolvedType javaUtilMap = UnresolvedType.forName("java.util.Map");
+
+ ReferenceType rawType = (ReferenceType) world.resolve(javaUtilMap);
+ assertTrue("Should be the raw type ?!? "+rawType.getTypekind(),rawType.isRawType());
+
+ ReferenceType genericType = (ReferenceType)rawType.getGenericType();
+ assertTrue("Should be the generic type ?!? "+genericType.getTypekind(),genericType.isGenericType());
+
+ ResolvedType rt = rawType.getSuperclass();
+ assertTrue("Superclass for Map raw type should be Object but was "+rt,rt.equals(UnresolvedType.OBJECT));
+
+ ResolvedType rt2 = genericType.getSuperclass();
+ assertTrue("Superclass for Map generic type should be Object but was "+rt2,rt2.equals(UnresolvedType.OBJECT));
+ }
}