]> source.dussan.org Git - aspectj.git/commitdiff
Updates for 1.9.0.RC4 - latest JDT V1_9_0_RC4
authorAndy Clement <aclement@pivotal.io>
Wed, 21 Feb 2018 20:10:36 +0000 (12:10 -0800)
committerAndy Clement <aclement@pivotal.io>
Wed, 21 Feb 2018 20:10:36 +0000 (12:10 -0800)
12 files changed:
build/usedForMavenUpload_milestone/aspectjrt.pom
build/usedForMavenUpload_milestone/aspectjtools.pom
build/usedForMavenUpload_milestone/aspectjweaver.pom
docs/dist/doc/README-190.html
org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/AjcTestCase.java
org.eclipse.jdt.core/jdtcore-for-aspectj-src.zip
org.eclipse.jdt.core/jdtcore-for-aspectj.jar
tests/bugs190/modules/iii/Azpect.java [new file with mode: 0644]
tests/bugs190/modules/iii/UsesJAXB.java
tests/src/org/aspectj/systemtest/ajc190/Ajc190Tests.java
tests/src/org/aspectj/systemtest/ajc190/ModuleTests.java
tests/src/org/aspectj/systemtest/ajc190/ajc190.xml

index 0ecddc2a1224b7c58d806b7e316e8e15ad28bebe..4fafffc639d311f4362e81324ec27fe008aacb02 100644 (file)
@@ -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>
index 3c8b62ef19fe992685aa11e36b7622fcbb14da51..7ad6b32ce540dad0e1ec1c89754554cdb99637f7 100644 (file)
@@ -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>
index e44a95c8a694edb87bd56f97cdfbcc9a5f5f8b41..9567196ad679b9dc1030079754ec2a6228591e00 100644 (file)
@@ -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>
index e90042f6f9106085a90c1bc3ceca97df5c2e8070..0033afdedd4c15fea09c0b26ac4b28392d5b6718 100644 (file)
@@ -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; }
 &copy; 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 &lt;compilerArg&gt; 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>
+  &lt;iajc destdir="bin" failonerror="true"
+     showWeaveInfo="true" source="1.9" target="1.9"
+     debug="true"  fork="true"  maxmem="256m"&gt;
+     &lt;compilerArg value="--add-modules"/&gt;
+     &lt;compilerArg value="java.xml.bind"/&gt;
+    &lt;src path="src" /&gt;
+    &lt;classpath&gt;
+            &lt;pathelement location="${aspectj.home}/lib/aspectjrt.jar"/&gt;
+    &lt;/classpath&gt;
+ &lt;/iajc&gt;
+</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>
 
index 73a6589af24f105e85643adfc32fdd382bb0c382..302739e71990030197222b8440eb8f52ba46fc83 100644 (file)
@@ -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());
index 98af63215d1983475ed5129280a1b2c983bb4ab1..6fd88f22c1dcea4dc3281f4a8e534c305ef44a71 100644 (file)
Binary files a/org.eclipse.jdt.core/jdtcore-for-aspectj-src.zip and b/org.eclipse.jdt.core/jdtcore-for-aspectj-src.zip differ
index 3f565a980ec712cad8eacede57b3ea6822615465..577b4be39e49aadd083e6fa52149cbc08c44b4cc 100644 (file)
Binary files a/org.eclipse.jdt.core/jdtcore-for-aspectj.jar and b/org.eclipse.jdt.core/jdtcore-for-aspectj.jar differ
diff --git a/tests/bugs190/modules/iii/Azpect.java b/tests/bugs190/modules/iii/Azpect.java
new file mode 100644 (file)
index 0000000..b3be5af
--- /dev/null
@@ -0,0 +1,11 @@
+import javax.xml.transform.TransformerFactory;\r
+import javax.xml.bind.JAXBContext;\r
+import javax.xml.parsers.DocumentBuilderFactory;\r
+\r
+import org.w3c.dom.Document;\r
+\r
+aspect Azpect {\r
+       before(JAXBContext x): execution(* m(JAXBContext)) && args(x) {\r
+               System.out.println(x);\r
+       }\r
+}\r
index 5eb9e59bc4977e0d13214cf25c4fc8eca769761c..9c0277490541ed1178664b889c22bbc8e2fa0270 100644 (file)
@@ -18,4 +18,11 @@ public class UsesJAXB {
         JAXBContext context;\r
     }\r
 \r
+    public void m(JAXBContext jc) {\r
+    }\r
+\r
+    public static void main(String[] argv) {\r
+           System.out.println("UsesJAXB.running...");\r
+           new UsesJAXB().m(null);\r
+    }\r
 }\r
index 52830ab28e0cd12bca74c2699a1f035b042ac5f8..613c1247a17f0cb10b0dbfcfc6f5e0930c87a9bb 100644 (file)
@@ -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");
-       }
 
        // ---
 
index 9828aa17af3991017a61f960d0b8c320396e6524..763d05547095eff843b12984bb804ebdebf66bfa 100644 (file)
@@ -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 {
index 2239d62c4e429d7ca579442a1284b85bdd619f05..b699263770302bf3feb16bc82e1361a2f5c0ce79 100644 (file)
      -->
   </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"/>