diff options
author | Andy Clement <aclement@pivotal.io> | 2018-04-18 13:15:22 -0700 |
---|---|---|
committer | Andy Clement <aclement@pivotal.io> | 2018-04-18 13:15:22 -0700 |
commit | 836beab108ef4be8b59c1ad9c8596ce959bdf1c7 (patch) | |
tree | 9346f87088aceecb16fad6f3b70753235051f504 /weaver | |
parent | b2cb18ef127097ad2c258b9d061cc70b5fb19432 (diff) | |
download | aspectj-836beab108ef4be8b59c1ad9c8596ce959bdf1c7.tar.gz aspectj-836beab108ef4be8b59c1ad9c8596ce959bdf1c7.zip |
Support Java10
Diffstat (limited to 'weaver')
-rw-r--r-- | weaver/.classpath | 2 | ||||
-rw-r--r-- | weaver/testsrc/org/aspectj/weaver/bcel/WeaveTestCase.java | 21 |
2 files changed, 16 insertions, 7 deletions
diff --git a/weaver/.classpath b/weaver/.classpath index 995d885a7..dd355f8e5 100644 --- a/weaver/.classpath +++ b/weaver/.classpath @@ -13,6 +13,6 @@ <classpathentry kind="lib" path="/lib/bcel/bcel.jar" sourcepath="/lib/bcel/bcel-src.zip"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/> <classpathentry combineaccessrules="false" kind="src" path="/org.aspectj.matcher"/> - <classpathentry kind="lib" path="/lib/asm/asm-6.0.renamed.jar"/> + <classpathentry kind="lib" path="/lib/asm/asm-6.1.1.renamed.jar"/> <classpathentry kind="output" path="bin"/> </classpath> diff --git a/weaver/testsrc/org/aspectj/weaver/bcel/WeaveTestCase.java b/weaver/testsrc/org/aspectj/weaver/bcel/WeaveTestCase.java index f6f3ab40e..d39299ace 100644 --- a/weaver/testsrc/org/aspectj/weaver/bcel/WeaveTestCase.java +++ b/weaver/testsrc/org/aspectj/weaver/bcel/WeaveTestCase.java @@ -118,12 +118,8 @@ public abstract class WeaveTestCase extends TestCase { gen = classType.getLazyClassGen(); // new LazyClassGen(classType); } try { - File possibleVmSpecificFile = new File(TESTDATA_DIR,outName + "." + LangUtil.getVmVersionString()+".txt"); - if (possibleVmSpecificFile.exists()) { - checkClass(gen, outDirPath, outName + "." + LangUtil.getVmVersionString()+".txt"); - } else { - checkClass(gen, outDirPath, outName + ".txt"); - } + String filenameToUse = findMostRelevantFile(outName); + checkClass(gen, outDirPath, filenameToUse); if (runTests) { System.out.println("*******RUNNING: " + outName + " " + name + " *******"); TestUtil.runMain(makeClassPath(outDirPath), name); @@ -137,6 +133,19 @@ public abstract class WeaveTestCase extends TestCase { throw e; } } + + public String findMostRelevantFile(String name) { + double version = LangUtil.getVmVersion(); + while (version > 0) { + String possibleFileName = name+"."+Double.toString(version)+".txt"; + if (new File(TESTDATA_DIR, possibleFileName).exists()) { + return possibleFileName; + } + version--; + } + // Use the standard file + return name+".txt"; + } public String makeClassPath(String outDir) { return outDir + File.pathSeparator + getTraceJar() + File.pathSeparator + classDir + File.pathSeparator |