From 3876a7dfcc371e3be43276c58bb792a09ed23c40 Mon Sep 17 00:00:00 2001
From: Andy Clement
Date: Fri, 20 Apr 2018 09:45:31 -0700
Subject: [PATCH] Working towards 1.9.1
---
docs/dist/doc/README-191.html | 52 ++++++++++
docs/dist/doc/index.html | 1 +
.../org/aspectj/ajdt/ajc/messages.properties | 4 +-
.../org/aspectj/systemtest/AllTests19.java | 2 +
.../systemtest/ajc191/AllTestsAspectJ191.java | 1 +
.../systemtest/ajc191/SanityTestsJava10.java | 98 +++++++++++++++++++
.../org/aspectj/systemtest/ajc191/ajc191.xml | 2 +-
.../systemtest/ajc191/sanity-tests-10.xml | 70 +++++++++++++
8 files changed, 227 insertions(+), 3 deletions(-)
create mode 100644 docs/dist/doc/README-191.html
create mode 100644 tests/src/org/aspectj/systemtest/ajc191/SanityTestsJava10.java
create mode 100644 tests/src/org/aspectj/systemtest/ajc191/sanity-tests-10.xml
diff --git a/docs/dist/doc/README-191.html b/docs/dist/doc/README-191.html
new file mode 100644
index 000000000..4c891d208
--- /dev/null
+++ b/docs/dist/doc/README-191.html
@@ -0,0 +1,52 @@
+
+
+AspectJ 1.9.1 Readme
+
+
+
+
+
+© Copyright 2018 Contributors.
+All rights reserved.
+
+The full list of resolved issues in 1.9.1 is available
+here.
+
+AspectJ 1.9.1
+
+Java 10 support
+AspectJ has updated to a recent JDT compiler version (commit #abe06abe4ce1 - 9-Apr-2018). With this update it
+now supports Java10. This means you can use the 'var' support. A simple example of combining var with
+an aspect:
+
+
+public class Code3 {
+ public static void main(String []argv) {
+ var x = "hello";
+ System.out.println(x.getClass());
+ }
+}
+
+aspect X {
+ before(): call(* *.getClass()) && target(String) {
+ System.out.println(thisJoinPointStaticPart);
+ }
+}
+
+
+ README's
|
Changes and porting guide for AspectJ
+ 1.9.1,
1.9.0,
1.8.10,
1.8.10,
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/messages.properties b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/messages.properties
index 4aa9defc4..516af38f6 100644
--- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/messages.properties
+++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/messages.properties
@@ -4,8 +4,8 @@
The -Xlintfile:lint.properties allows fine-grained control. In tools.jar, see
org/aspectj/weaver/XlintDefault.properties for the default behavior and a template to copy.
### AspectJ-specific messages
-compiler.name = AspectJ Compiler 1.9.0
-compiler.version = Eclipse Compiler #1bfc7b4202e874c(Feb2018), 3.14
+compiler.name = AspectJ Compiler 1.9.1
+compiler.version = Eclipse Compiler #abe06abe4ce1(Apr2018), 3.14
compiler.copyright =
diff --git a/tests/src/org/aspectj/systemtest/AllTests19.java b/tests/src/org/aspectj/systemtest/AllTests19.java
index 4835a6154..8cb86d449 100644
--- a/tests/src/org/aspectj/systemtest/AllTests19.java
+++ b/tests/src/org/aspectj/systemtest/AllTests19.java
@@ -11,6 +11,7 @@
package org.aspectj.systemtest;
import org.aspectj.systemtest.ajc190.AllTestsAspectJ190;
+import org.aspectj.systemtest.ajc191.AllTestsAspectJ191;
import junit.framework.Test;
import junit.framework.TestSuite;
@@ -21,6 +22,7 @@ public class AllTests19 {
TestSuite suite = new TestSuite("AspectJ System Test Suite - 1.9");
// $JUnit-BEGIN$
suite.addTest(AllTestsAspectJ190.suite());
+ suite.addTest(AllTestsAspectJ191.suite());
suite.addTest(AllTests18.suite());
// $JUnit-END$
return suite;
diff --git a/tests/src/org/aspectj/systemtest/ajc191/AllTestsAspectJ191.java b/tests/src/org/aspectj/systemtest/ajc191/AllTestsAspectJ191.java
index a42ad5b4c..8588b845b 100644
--- a/tests/src/org/aspectj/systemtest/ajc191/AllTestsAspectJ191.java
+++ b/tests/src/org/aspectj/systemtest/ajc191/AllTestsAspectJ191.java
@@ -19,6 +19,7 @@ public class AllTestsAspectJ191 {
TestSuite suite = new TestSuite("AspectJ 1.9.1 tests");
// $JUnit-BEGIN$
suite.addTest(Ajc191Tests.suite());
+ suite.addTest(SanityTestsJava10.suite());
// $JUnit-END$
return suite;
}
diff --git a/tests/src/org/aspectj/systemtest/ajc191/SanityTestsJava10.java b/tests/src/org/aspectj/systemtest/ajc191/SanityTestsJava10.java
new file mode 100644
index 000000000..f4b8f3698
--- /dev/null
+++ b/tests/src/org/aspectj/systemtest/ajc191/SanityTestsJava10.java
@@ -0,0 +1,98 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2081 IBM and 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://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.aspectj.systemtest.ajc191;
+
+import java.io.File;
+
+import org.aspectj.apache.bcel.classfile.JavaClass;
+import org.aspectj.testing.XMLBasedAjcTestCase;
+
+import junit.framework.Test;
+
+/*
+ * Some very trivial tests that help verify things are OK.
+ * These are a copy of the earlier Sanity Tests created for 1.6 but these supply the -10 option
+ * to check code generation and modification with that version specified.
+ *
+ * @author Andy Clement
+ */
+public class SanityTestsJava10 extends org.aspectj.testing.XMLBasedAjcTestCase {
+
+ // Incredibly trivial test programs that check the compiler works at all (these are easy-ish to debug)
+ public void testSimpleJava_A() {
+ runTest("simple - a");
+ }
+
+ public void testSimpleJava_B() {
+ runTest("simple - b");
+ }
+
+ public void testSimpleCode_C() {
+ runTest("simple - c");
+ }
+
+ public void testSimpleCode_D() {
+ runTest("simple - d");
+ }
+
+ public void testSimpleCode_E() {
+ runTest("simple - e");
+ }
+
+ public void testSimpleCode_F() {
+ runTest("simple - f");
+ }
+
+ public void testSimpleCode_G() {
+ runTest("simple - g");
+ }
+
+ public void testSimpleCode_H() {
+ runTest("simple - h", true);
+ }
+
+ public void testSimpleCode_I() {
+ runTest("simple - i");
+ }
+
+ public void testVersionCorrect1() throws ClassNotFoundException {
+ runTest("simple - j");
+ checkVersion("A", 54, 0);
+ }
+
+ public void testVersionCorrect2() throws ClassNotFoundException {
+ runTest("simple - k");
+ checkVersion("A", 54, 0);
+ }
+
+ public void testVersionCorrect4() throws ClassNotFoundException { // check it is 49.0 when -1.5 is specified
+ runTest("simple - m");
+ checkVersion("A", 49, 0);
+ }
+
+ private void checkVersion(String classname, int major, int minor) throws ClassNotFoundException {
+ JavaClass jc = getClassFrom(ajc.getSandboxDirectory(), classname);
+ if (jc.getMajor() != major) {
+ fail("Expected major version to be " + major + " but was " + jc.getMajor());
+ }
+ if (jc.getMinor() != minor) {
+ fail("Expected minor version to be " + minor + " but was " + jc.getMinor());
+ }
+ }
+
+ // ///////////////////////////////////////
+ public static Test suite() {
+ return XMLBasedAjcTestCase.loadSuite(SanityTestsJava10.class);
+ }
+
+ @Override
+ protected File getSpecFile() {
+ return getClassResource("sanity-tests-10.xml");
+ }
+
+}
diff --git a/tests/src/org/aspectj/systemtest/ajc191/ajc191.xml b/tests/src/org/aspectj/systemtest/ajc191/ajc191.xml
index ab14b9e73..3a87375e9 100644
--- a/tests/src/org/aspectj/systemtest/ajc191/ajc191.xml
+++ b/tests/src/org/aspectj/systemtest/ajc191/ajc191.xml
@@ -28,7 +28,7 @@
-
+
diff --git a/tests/src/org/aspectj/systemtest/ajc191/sanity-tests-10.xml b/tests/src/org/aspectj/systemtest/ajc191/sanity-tests-10.xml
new file mode 100644
index 000000000..a6bdbd938
--- /dev/null
+++ b/tests/src/org/aspectj/systemtest/ajc191/sanity-tests-10.xml
@@ -0,0 +1,70 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
--
2.39.5
|