diff options
author | Andy Clement <aclement@pivotal.io> | 2018-02-21 12:10:36 -0800 |
---|---|---|
committer | Andy Clement <aclement@pivotal.io> | 2018-02-21 12:10:36 -0800 |
commit | 4d129674586cbf6cef232e5ba1a74e75708103b1 (patch) | |
tree | 05e80c5bf9ef2e7a826a683c0aaa7e26e3888d56 | |
parent | 5c6d9b239f14d245c35eec6ea3650d290e9ccb9c (diff) | |
download | aspectj-4d129674586cbf6cef232e5ba1a74e75708103b1.tar.gz aspectj-4d129674586cbf6cef232e5ba1a74e75708103b1.zip |
Updates for 1.9.0.RC4 - latest JDTV1_9_0_RC4
-rw-r--r-- | build/usedForMavenUpload_milestone/aspectjrt.pom | 2 | ||||
-rw-r--r-- | build/usedForMavenUpload_milestone/aspectjtools.pom | 2 | ||||
-rw-r--r-- | build/usedForMavenUpload_milestone/aspectjweaver.pom | 2 | ||||
-rw-r--r-- | docs/dist/doc/README-190.html | 38 | ||||
-rw-r--r-- | org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/AjcTestCase.java | 24 | ||||
-rw-r--r-- | org.eclipse.jdt.core/jdtcore-for-aspectj-src.zip | bin | 5198233 -> 5198151 bytes | |||
-rw-r--r-- | org.eclipse.jdt.core/jdtcore-for-aspectj.jar | bin | 10579928 -> 10579833 bytes | |||
-rw-r--r-- | tests/bugs190/modules/iii/Azpect.java | 11 | ||||
-rw-r--r-- | tests/bugs190/modules/iii/UsesJAXB.java | 7 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc190/Ajc190Tests.java | 4 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc190/ModuleTests.java | 25 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc190/ajc190.xml | 37 |
12 files changed, 134 insertions, 18 deletions
diff --git a/build/usedForMavenUpload_milestone/aspectjrt.pom b/build/usedForMavenUpload_milestone/aspectjrt.pom index 0ecddc2a1..4fafffc63 100644 --- a/build/usedForMavenUpload_milestone/aspectjrt.pom +++ b/build/usedForMavenUpload_milestone/aspectjrt.pom @@ -5,7 +5,7 @@ <groupId>org.aspectj</groupId> <artifactId>aspectjrt</artifactId> <packaging>jar</packaging> - <version>1.9.0.BETA-7</version> + <version>1.9.0.RC4</version> <name>AspectJ runtime</name> <description>The runtime needed to execute a program using AspectJ</description> <url>http://www.aspectj.org</url> diff --git a/build/usedForMavenUpload_milestone/aspectjtools.pom b/build/usedForMavenUpload_milestone/aspectjtools.pom index 3c8b62ef1..7ad6b32ce 100644 --- a/build/usedForMavenUpload_milestone/aspectjtools.pom +++ b/build/usedForMavenUpload_milestone/aspectjtools.pom @@ -5,7 +5,7 @@ <groupId>org.aspectj</groupId> <artifactId>aspectjtools</artifactId> <packaging>jar</packaging> - <version>1.9.0.BETA-7</version> + <version>1.9.0.RC4</version> <name>AspectJ tools</name> <description>Tools from the AspectJ project</description> <url>http://www.aspectj.org</url> diff --git a/build/usedForMavenUpload_milestone/aspectjweaver.pom b/build/usedForMavenUpload_milestone/aspectjweaver.pom index e44a95c8a..9567196ad 100644 --- a/build/usedForMavenUpload_milestone/aspectjweaver.pom +++ b/build/usedForMavenUpload_milestone/aspectjweaver.pom @@ -5,7 +5,7 @@ <groupId>org.aspectj</groupId> <artifactId>aspectjweaver</artifactId> <packaging>jar</packaging> - <version>1.9.0.BETA-7</version> + <version>1.9.0.RC4</version> <name>AspectJ weaver</name> <description>The AspectJ weaver introduces advices to java classes</description> <url>http://www.aspectj.org</url> diff --git a/docs/dist/doc/README-190.html b/docs/dist/doc/README-190.html index e90042f6f..0033afded 100644 --- a/docs/dist/doc/README-190.html +++ b/docs/dist/doc/README-190.html @@ -1,6 +1,6 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <html> <head> -<title>AspectJ 1.9.0.RC3 Readme</title> +<title>AspectJ 1.9.0.RC4 Readme</title> <style type="text/css"> <!-- P { margin-left: 20px; } @@ -17,33 +17,53 @@ © Copyright 2018 Contributors. All rights reserved. </small></div> -<h1>AspectJ 1.9.0.RC3 Readme</h1> +<p>The full list of resolved issues in 1.9.0 is available +<a href="https://bugs.eclipse.org/bugs/buglist.cgi?bug_status=RESOLVED&bug_status=VERIFIED&bug_status=CLOSED&f0=OP&f1=OP&f3=CP&f4=CP&j1=OR&list_id=16866879&product=AspectJ&query_format=advanced&target_milestone=1.9.0">here</a></h2>.</p> + +<h1>AspectJ 1.9.0.RC4</h1> + +<p>Primary changes in RC4 are to add support for <compilerArg> in the Ant task. This enables users of the Ant task to +pass in options supported by the underlying AspectJ but not yet surfaced elsewhere. Particularly useful with Java9 which includes +a number of module related commands. For example, here is an iajc usage with compilerArg that is passing <tt>--add-modules java.xml.bind</tt>: + +<pre><code> + <iajc destdir="bin" failonerror="true" + showWeaveInfo="true" source="1.9" target="1.9" + debug="true" fork="true" maxmem="256m"> + <compilerArg value="--add-modules"/> + <compilerArg value="java.xml.bind"/> + <src path="src" /> + <classpath> + <pathelement location="${aspectj.home}/lib/aspectjrt.jar"/> + </classpath> + </iajc> +</code></pre> + +<li>1.9.0.RC4 available 21-Feb-2018</li> + +<h1>AspectJ 1.9.0.RC3</h1> <p>Primary changes in RC3 are to upgrade JDT and pickup all the fixes for Java9 that have gone into it over the last few months.</p> <li>1.9.0.RC3 available 5-Feb-2018</li> -<h1>AspectJ 1.9.0.RC2 Readme</h1> +<h1>AspectJ 1.9.0.RC2</h1> -<p>The full list of resolved issues in 1.9.0 is available -<a href="https://bugs.eclipse.org/bugs/buglist.cgi?bug_status=RESOLVED&bug_status=VERIFIED&bug_status=CLOSED&f0=OP&f1=OP&f3=CP&f4=CP&j1=OR&list_id=16866879&product=AspectJ&query_format=advanced&target_milestone=1.9.0">here</a></h2>.</p> <ul> <li>1.9.0.RC2 available 9-Nov-2017 </ul> -<h3>1.9.0.RC2 changes</h3> - <p>Key change in 1.9.0.RC2 is actually to be more tolerant of JDK10. The version handling has been somewhat overhauled so AspectJ 9 will behave better on Java 10 and future JDKs. This should put AspectJ in a better place if new JDK versions are going to arrive thick and fast. +<h1>AspectJ 1.9.0.RC1</h1> <ul> + <li>1.9.0.RC1 available 20-Oct-2017 </ul> -<h3>1.9.0.RC1 changes</h3> - <p>This is the first release candidate of AspectJ 1.9.0 - the version of AspectJ to be based on Java9. It includes a recent version of the Eclipse Java9 compiler (from jdt core, commit #062ac5d7a6bf9).</p> diff --git a/org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/AjcTestCase.java b/org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/AjcTestCase.java index 73a6589af..302739e71 100644 --- a/org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/AjcTestCase.java +++ b/org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/AjcTestCase.java @@ -691,6 +691,30 @@ public class AjcTestCase extends TestCase { e.printStackTrace(); } return lastRunResult; + } else if (vmargs!=null && (vmargs.contains("--add-modules") || vmargs.contains("--limit-modules") || vmargs.contains("--add-reads"))) { + // If --add-modules supplied, need to fork the test + try { +// if (mp.indexOf("$runtime") != -1) { +// mp = mp.replace(mp.indexOf("$runtime"),"$runtime".length(),TestUtil.aspectjrtPath().toString()); +// } + if (cp.indexOf("aspectjrt")==-1) { + cp.append(File.pathSeparator).append(TestUtil.aspectjrtPath().getPath()); + } + String command = LangUtil.getJavaExecutable().getAbsolutePath() + " " +vmargs+ (cp.length()==0?"":" -classpath " + cp) + " " + className ; + System.out.println("Command is "+command); + // Command is executed using ProcessBuilder to allow setting CWD for ajc sandbox compliance + ProcessBuilder pb = new ProcessBuilder(tokenizeCommand(command)); + pb.directory( new File(ajc.getSandboxDirectory().getAbsolutePath())); + exec = pb.start(); + BufferedReader stdInput = new BufferedReader(new InputStreamReader(exec.getInputStream())); + BufferedReader stdError = new BufferedReader(new InputStreamReader(exec.getErrorStream())); + exec.waitFor(); + lastRunResult = createResultFromBufferReaders(command,stdInput, stdError); + } catch (Exception e) { + System.out.println("Error executing module test: " + e); + e.printStackTrace(); + } + return lastRunResult; } else { cp.append(DEFAULT_CLASSPATH_ENTRIES); URL[] urls = getURLs(cp.toString()); diff --git a/org.eclipse.jdt.core/jdtcore-for-aspectj-src.zip b/org.eclipse.jdt.core/jdtcore-for-aspectj-src.zip Binary files differindex 98af63215..6fd88f22c 100644 --- a/org.eclipse.jdt.core/jdtcore-for-aspectj-src.zip +++ b/org.eclipse.jdt.core/jdtcore-for-aspectj-src.zip diff --git a/org.eclipse.jdt.core/jdtcore-for-aspectj.jar b/org.eclipse.jdt.core/jdtcore-for-aspectj.jar Binary files differindex 3f565a980..577b4be39 100644 --- a/org.eclipse.jdt.core/jdtcore-for-aspectj.jar +++ b/org.eclipse.jdt.core/jdtcore-for-aspectj.jar diff --git a/tests/bugs190/modules/iii/Azpect.java b/tests/bugs190/modules/iii/Azpect.java new file mode 100644 index 000000000..b3be5af7f --- /dev/null +++ b/tests/bugs190/modules/iii/Azpect.java @@ -0,0 +1,11 @@ +import javax.xml.transform.TransformerFactory;
+import javax.xml.bind.JAXBContext;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.w3c.dom.Document;
+
+aspect Azpect {
+ before(JAXBContext x): execution(* m(JAXBContext)) && args(x) {
+ System.out.println(x);
+ }
+}
diff --git a/tests/bugs190/modules/iii/UsesJAXB.java b/tests/bugs190/modules/iii/UsesJAXB.java index 5eb9e59bc..9c0277490 100644 --- a/tests/bugs190/modules/iii/UsesJAXB.java +++ b/tests/bugs190/modules/iii/UsesJAXB.java @@ -18,4 +18,11 @@ public class UsesJAXB { JAXBContext context;
}
+ public void m(JAXBContext jc) {
+ }
+
+ public static void main(String[] argv) {
+ System.out.println("UsesJAXB.running...");
+ new UsesJAXB().m(null);
+ }
}
diff --git a/tests/src/org/aspectj/systemtest/ajc190/Ajc190Tests.java b/tests/src/org/aspectj/systemtest/ajc190/Ajc190Tests.java index 52830ab28..613c1247a 100644 --- a/tests/src/org/aspectj/systemtest/ajc190/Ajc190Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc190/Ajc190Tests.java @@ -38,10 +38,6 @@ public class Ajc190Tests extends XMLBasedAjcTestCaseForJava9OrLater { public void testWeaveModule() throws Exception { runTest("weave module"); } - - public void testUsesJaxb() { - runTest("java use of java.xml.bind"); - } // --- diff --git a/tests/src/org/aspectj/systemtest/ajc190/ModuleTests.java b/tests/src/org/aspectj/systemtest/ajc190/ModuleTests.java index 9828aa17a..763d05547 100644 --- a/tests/src/org/aspectj/systemtest/ajc190/ModuleTests.java +++ b/tests/src/org/aspectj/systemtest/ajc190/ModuleTests.java @@ -21,6 +21,8 @@ import junit.framework.Test; /** * Building and weaving with modules in the picture. * + * Module options from http://openjdk.java.net/jeps/261 + * * @author Andy Clement * */ @@ -63,11 +65,32 @@ public class ModuleTests extends XMLBasedAjcTestCaseForJava9OrLater { // runTest("module path vs classpath 2"); // } + // --add-modules + // This tests that when using --add-modules with one of the JDK modules (in the jmods subfolder of the JDK) // that it can be found without needing to set --module-path (this seems to be implicitly included by javac too) public void testAddModules1() { - runTest("java use of java.xml.bind"); + runTest("compile use of java.xml.bind"); + } + + // This tests that we can use add-modules to pull in something from the JDK jmods package and that + // when subsequently weaving we can see types from those modules + public void testWovenAfterAddModules() { + runTest("weave use of java.xml.bind"); + } + + // --limit-modules + public void testLimitModules1() { + runTest("limit modules 1"); + } + + // --add-reads + public void testAddReads1() { + runTest("add reads 1"); } + + + // --- /* For the specified class, check that each method has a stackmap attribute */ private void checkStackMapExistence(String classname, String toIgnore) throws ClassNotFoundException { diff --git a/tests/src/org/aspectj/systemtest/ajc190/ajc190.xml b/tests/src/org/aspectj/systemtest/ajc190/ajc190.xml index 2239d62c4..b69926377 100644 --- a/tests/src/org/aspectj/systemtest/ajc190/ajc190.xml +++ b/tests/src/org/aspectj/systemtest/ajc190/ajc190.xml @@ -118,10 +118,45 @@ --> </ajc-test> - <ajc-test dir="bugs190/modules/iii" title="java use of java.xml.bind"> + <ajc-test dir="bugs190/modules/iii" title="compile use of java.xml.bind"> <compile files="UsesJAXB.java" options="--add-modules java.xml.bind -1.9"/> + <run class="UsesJAXB" vmargs="--add-modules java.xml.bind"> + <stdout> + <line text="UsesJAXB.running..."/> + </stdout> + </run> </ajc-test> + <ajc-test dir="bugs190/modules/iii" title="weave use of java.xml.bind"> + <compile files="UsesJAXB.java Azpect.java" options="--add-modules java.xml.bind -1.9"/> + <run class="UsesJAXB" vmargs="--add-modules java.xml.bind"> + <stdout> + <line text="UsesJAXB.running..."/> + <line text="null"/> + </stdout> + </run> + </ajc-test> + + <ajc-test dir="bugs190/modules/iii" title="limit modules 1"> + <compile files="UsesJAXB.java Azpect.java" options="--limit-modules java.xml.bind -1.9"/> + <run class="UsesJAXB" vmargs="--limit-modules java.xml.bind"> + <stdout> + <line text="UsesJAXB.running..."/> + <line text="null"/> + </stdout> + </run> + </ajc-test> + + <ajc-test dir="bugs190/modules/iii" title="add reads 1"> + <compile files="UsesJAXB.java Azpect.java" options="--add-reads java.sql=java.xml.bind --add-modules java.sql -1.9"/> + <run class="UsesJAXB" vmargs="--add-modules java.xml.bind "> + <stdout> + <line text="UsesJAXB.running..."/> + <line text="null"/> + </stdout> + </run> + </ajc-test> + <!-- <compile files="module-info.java aaa/bbb/A.java" options="-1.9" outjar="module.jar" aspectpath="foo.jar"/> <compile files="module-info.java aaa/bbb/A.java" options="-1.9" outjar="my.module.jar"/> |