diff options
author | Andy Clement <aclement@pivotal.io> | 2016-01-27 11:49:38 -0800 |
---|---|---|
committer | Andy Clement <aclement@pivotal.io> | 2016-01-27 11:49:38 -0800 |
commit | 4bee355d22f5dd4bb2120ca725f0c8b9eb904976 (patch) | |
tree | 1fc55b64cb91c0540dfa13f1ab523af6be0852c9 /org.aspectj.matcher | |
parent | 9be47cc3a9ead4208d6247fcc5da7216c231278a (diff) | |
download | aspectj-4bee355d22f5dd4bb2120ca725f0c8b9eb904976.tar.gz aspectj-4bee355d22f5dd4bb2120ca725f0c8b9eb904976.zip |
Fix 486612: Can lose a super type bound when weaving a type using generics in its declaration
Diffstat (limited to 'org.aspectj.matcher')
-rw-r--r-- | org.aspectj.matcher/src/org/aspectj/weaver/TypeVariable.java | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/org.aspectj.matcher/src/org/aspectj/weaver/TypeVariable.java b/org.aspectj.matcher/src/org/aspectj/weaver/TypeVariable.java index 2e0409bc9..d67bbd8dc 100644 --- a/org.aspectj.matcher/src/org/aspectj/weaver/TypeVariable.java +++ b/org.aspectj.matcher/src/org/aspectj/weaver/TypeVariable.java @@ -151,9 +151,9 @@ public class TypeVariable { 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); @@ -254,7 +254,9 @@ public class TypeVariable { 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(":"); @@ -272,8 +274,8 @@ public class TypeVariable { 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++) { |