From ded957880d146cd57ab73b9ed254882d6c4e855a Mon Sep 17 00:00:00 2001 From: Andy Clement Date: Thu, 28 Nov 2019 10:25:54 -0800 Subject: [PATCH] Debug for 551732 --- .../aspectj/weaver/BoundedReferenceType.java | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/BoundedReferenceType.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/BoundedReferenceType.java index 62bd4d23a..e0a7a680e 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/BoundedReferenceType.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/BoundedReferenceType.java @@ -1,10 +1,10 @@ /* ******************************************************************* * Copyright (c) 2010 Contributors. - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html + * All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution and is available at + * http://eclipse.org/legal/epl-v10.html * ******************************************************************/ package org.aspectj.weaver; @@ -12,12 +12,12 @@ import java.util.Map; /** * A BoundedReferenceType is the result of a generics wildcard expression ? extends String, ? super Foo etc.. - * + * * The "signature" for a bounded reference type follows the generic signature specification in section 4.4 of JVM spec: *,+,- plus * signature strings. - * + * * The bound may be a type variable (e.g. ? super T) - * + * * @author Adrian Colyer * @author Andy Clement */ @@ -106,7 +106,12 @@ public class BoundedReferenceType extends ReferenceType { parameterizedAdditionalInterfaces[i] = (ReferenceType) additionalInterfaceBounds[i].parameterize(typeBindings); } if (this.kind == EXTENDS) { - return new BoundedReferenceType((ReferenceType) getUpperBound().parameterize(typeBindings), true, world, + UnresolvedType parameterizedUpperBound = getUpperBound().parameterize(typeBindings); + if (!(parameterizedUpperBound instanceof ReferenceType)) { + throw new IllegalStateException("DEBUG551732: Unexpected problem processing bounds. Parameterizing "+getUpperBound()+" produced "+parameterizedUpperBound+ + " (Type: "+parameterizedUpperBound==null?"null":parameterizedUpperBound.getClass().getName()+") (typeBindings="+typeBindings+")"); + } + return new BoundedReferenceType((ReferenceType) parameterizedUpperBound, true, world, parameterizedAdditionalInterfaces); } else { // (this.kind == SUPER) -- 2.39.5