From 4bee355d22f5dd4bb2120ca725f0c8b9eb904976 Mon Sep 17 00:00:00 2001 From: Andy Clement Date: Wed, 27 Jan 2016 11:49:38 -0800 Subject: Fix 486612: Can lose a super type bound when weaving a type using generics in its declaration --- .../src/org/aspectj/weaver/TypeVariable.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'org.aspectj.matcher') 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++) { -- cgit v1.2.3