diff options
author | Andy Clement <aclement@pivotal.io> | 2019-04-03 10:23:44 -0700 |
---|---|---|
committer | Andy Clement <aclement@pivotal.io> | 2019-04-03 10:23:44 -0700 |
commit | 0e2c95a36900fe913f5d768e7f4632034ddf005b (patch) | |
tree | f7f1bb92dfbae87de0a8998491e863490984aa0a /weaver | |
parent | dbb2c59fcfa6837f1fde9e0c1f0d04751c9268ee (diff) | |
download | aspectj-0e2c95a36900fe913f5d768e7f4632034ddf005b.tar.gz aspectj-0e2c95a36900fe913f5d768e7f4632034ddf005b.zip |
Updated with Java12 support
Diffstat (limited to 'weaver')
-rw-r--r-- | weaver/src/test/java/org/aspectj/weaver/bcel/BcelGenericSignatureToTypeXTestCase.java | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/weaver/src/test/java/org/aspectj/weaver/bcel/BcelGenericSignatureToTypeXTestCase.java b/weaver/src/test/java/org/aspectj/weaver/bcel/BcelGenericSignatureToTypeXTestCase.java index 58f774840..03ded4f6d 100644 --- a/weaver/src/test/java/org/aspectj/weaver/bcel/BcelGenericSignatureToTypeXTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/bcel/BcelGenericSignatureToTypeXTestCase.java @@ -13,11 +13,14 @@ package org.aspectj.weaver.bcel; import junit.framework.TestCase; +import java.util.Arrays; + import org.aspectj.apache.bcel.Repository; import org.aspectj.apache.bcel.classfile.JavaClass; import org.aspectj.apache.bcel.classfile.Signature; import org.aspectj.util.GenericSignature; import org.aspectj.util.GenericSignatureParser; +import org.aspectj.util.LangUtil; import org.aspectj.util.GenericSignature.ClassSignature; import org.aspectj.weaver.UnresolvedType; @@ -44,12 +47,19 @@ public class BcelGenericSignatureToTypeXTestCase extends TestCase { UnresolvedType superclass = BcelGenericSignatureToTypeXConverter.classTypeSignature2TypeX(cSig.superclassSignature, cSig.formalTypeParameters, world); assertEquals("Ljava/lang/Object;", superclass.getSignature()); - assertEquals("2 superinterfaces", 2, cSig.superInterfaceSignatures.length); - UnresolvedType comparable = BcelGenericSignatureToTypeXConverter.classTypeSignature2TypeX(cSig.superInterfaceSignatures[0], + System.out.println(Arrays.toString(cSig.superInterfaceSignatures)); + if (LangUtil.is12VMOrGreater()) { + // [Ljava/lang/constant/Constable;, Ljava/lang/Comparable<TE;>;, Ljava/io/Serializable;] + assertEquals("3 superinterfaces but "+Arrays.toString(cSig.superInterfaceSignatures), 3, cSig.superInterfaceSignatures.length); + } else { + assertEquals("2 superinterfaces", 2, cSig.superInterfaceSignatures.length); + } + int idx = LangUtil.is12VMOrGreater()?1:0; + UnresolvedType comparable = BcelGenericSignatureToTypeXConverter.classTypeSignature2TypeX(cSig.superInterfaceSignatures[idx++], cSig.formalTypeParameters, world); assertEquals("Pjava/lang/Comparable<TE;>;", comparable.getSignature()); UnresolvedType serializable = BcelGenericSignatureToTypeXConverter.classTypeSignature2TypeX( - cSig.superInterfaceSignatures[1], cSig.formalTypeParameters, world); + cSig.superInterfaceSignatures[idx++], cSig.formalTypeParameters, world); assertEquals("Ljava/io/Serializable;", serializable.getSignature()); } |