]> source.dussan.org Git - aspectj.git/commitdiff
Debug for 551732
authorAndy Clement <aclement@pivotal.io>
Thu, 28 Nov 2019 18:25:54 +0000 (10:25 -0800)
committerAndy Clement <aclement@pivotal.io>
Thu, 28 Nov 2019 18:25:54 +0000 (10:25 -0800)
org.aspectj.matcher/src/main/java/org/aspectj/weaver/BoundedReferenceType.java

index 62bd4d23a4be9f950aa804b164f7228ca6773512..e0a7a680e1a76b5733e2f8d5877469c937255c02 100644 (file)
@@ -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)