if (superclass != null) {
ResolvedType rt = superclass.resolve(world);
- // if (!superclass.isTypeVariableReference() && rt.isInterface()) {
- // throw new IllegalStateException("Why is the type an interface? " + rt);
- // }
+// if (!superclass.isTypeVariableReference() && rt.isInterface()) {
+// throw new IllegalStateException("Why is the type an interface? " + rt);
+// }
superclass = rt;
}
firstbound = getFirstBound().resolve(world);
StringBuffer sb = new StringBuffer();
sb.append(name);
sb.append(":");
- sb.append(superclass.getSignature());
+ if (superInterfaces.length == 0 || !superclass.getSignature().equals(UnresolvedType.OBJECT.getSignature())) {
+ sb.append(superclass.getSignature());
+ }
if (superInterfaces.length != 0) {
for (int i = 0; i < superInterfaces.length; i++) {
sb.append(":");
StringBuffer sb = new StringBuffer();
sb.append(name);
sb.append(":");
- if (superInterfaces.length == 0) {
- sb.append(((ResolvedType) superclass).getSignatureForAttribute());
+ if (superInterfaces.length == 0 || !superclass.getSignature().equals(UnresolvedType.OBJECT.getSignature())) {
+ sb.append(((ReferenceType)superclass).getSignatureForAttribute());
}
if (superInterfaces.length != 0) {
for (int i = 0; i < superInterfaces.length; i++) {
--- /dev/null
+aspect Azpect {
+ declare parents: B implements I;
+ declare parents: D implements I;
+ before(): staticinitialization(!Azpect){}
+}
+
+interface I {}
--- /dev/null
+import java.io.*;
+
+public class Code {
+ public static void main(String []argv) {
+ }
+}
+
+class B<T extends SomeClass & SomeInterface> extends C<T> implements Serializable {
+}
+
+class C<T> {}
+
+class SomeClass {}
+interface SomeInterface {}
+interface SomeOtherInterface {}
+
+class D<T extends SomeInterface&SomeOtherInterface> {}
import junit.framework.Test;
+import org.aspectj.apache.bcel.classfile.JavaClass;
import org.aspectj.testing.XMLBasedAjcTestCase;
/**
*/
public class Ajc189Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
+ public void testLostBounds() throws Exception {
+ runTest("lost bounds");
+ // This type has I added via declare parents
+ JavaClass jc = getClassFrom(ajc.getSandboxDirectory(), "B");
+ assertEquals("<T:LSomeClass;:LSomeInterface;>LC<TT;>;Ljava/io/Serializable;LI;",jc.getGenericSignature());
+ jc = getClassFrom(ajc.getSandboxDirectory(), "D");
+ assertEquals("<T::LSomeInterface;:LSomeOtherInterface;>Ljava/lang/Object;LI;",jc.getGenericSignature());
+ }
+
public void testWhileNPE_486203() throws Exception {
runTest("while npe");
}
- public void testOverweaving_352389() throws Exception {
- runTest("overweaving");
- }
+// public void testOverweaving_352389() throws Exception {
+// runTest("overweaving");
+// }
// ---
<suite>
+<ajc-test dir="bugs189/486612" title="lost bounds">
+ <compile files="Code.java Azpect.java" options="-1.8"/>
+</ajc-test>
+
+
<ajc-test dir="bugs189/486203" title="while npe">
<compile files="While.java" options="-1.8"/>
</ajc-test>