Project: AspectJ
Bug 119352 AjType.getSupertype breaks for null
Reported: 2005-12-05 23:04:42 | Status: resolved fixed

I ran into this while using reflection proxies with LTW... See attached patches for these test cases and my fix: public void testObjectSupertype() { AjType<?> objectSuper = AjTypeSystem.getAjType(Object.class).getSupertype(); assertNull(objectSuper); } public void testInterfaceSupertype() { AjType<?> serializableSuper = AjTypeSystem.getAjType(Serializable.class).getSupertype(); assertNull(serializableSuper); } public AjType<? super T> getSupertype() { Class<? super T> superclass = clazz.getSuperclass(); return superclass==null ? null : (AjType<? super T>) new AjTypeImpl(superclass); }

Files changed in fix:
aspectj5rt/java5-src/org/aspectj/internal/lang/reflect/AjTypeImpl.java aspectj5rt/java5-testsrc/org/aspectj/internal/lang/reflect/AjTypeTests.java