From 6dc09db0ca1589f8c53c4dca054e3a852eaaecba Mon Sep 17 00:00:00 2001 From: Alexander Kriegisch Date: Mon, 21 Mar 2022 10:45:00 +0700 Subject: Prepare code, tests and docs for Java 18 - JDT Core dependency in pom.xml - Constants.java - LangUtil.java - AjcTask.java - messages_aspectj.properties - XMLBasedAjcTestCaseForJava17Only.java - XMLBasedAjcTestCaseForJava18*.java - tests/bugs199 - tests/features199 - JavaVersionCompatibility.md - README-199.html - GitHub CI build Signed-off-by: Alexander Kriegisch --- .github/workflows/maven.yml | 2 +- .../java/org/aspectj/apache/bcel/Constants.java | 6 +- docs/dist/doc/JavaVersionCompatibility.md | 1 + docs/dist/doc/README-198.html | 9 +- docs/dist/doc/README-199.html | 126 +++++++++++++++ .../compiler/batch/messages_aspectj.properties | 2 +- pom.xml | 2 +- .../org/aspectj/tools/ant/taskdefs/AjcTask.java | 15 +- .../testing/XMLBasedAjcTestCaseForJava17Only.java | 6 +- .../testing/XMLBasedAjcTestCaseForJava18Only.java | 40 +++++ .../XMLBasedAjcTestCaseForJava18OrLater.java | 27 ++++ tests/bugs198/github_115/A.java | 32 ---- tests/bugs198/github_115/B.java | 33 ---- tests/bugs198/github_120/C.java | 64 -------- tests/bugs198/github_120/D.java | 33 ---- tests/bugs198/github_122/E.java | 30 ---- tests/bugs198/github_125/Application.java | 11 -- tests/bugs199/github_115/A.java | 32 ++++ tests/bugs199/github_115/B.java | 33 ++++ tests/bugs199/github_120/C.java | 64 ++++++++ tests/bugs199/github_120/D.java | 33 ++++ tests/bugs199/github_122/E.java | 30 ++++ tests/bugs199/github_125/Application.java | 11 ++ .../java18/SwitchPatternPreview2Aspect.aj | 28 ++++ .../java18/SwitchPatternPreview2Error.java | 31 ++++ .../java18/SwitchPatternPreview2OK.java | 38 +++++ .../aspectj/systemtest/ajc198/Ajc198TestsJava.java | 54 +++---- .../systemtest/ajc198/AllTestsAspectJ198.java | 3 + .../aspectj/systemtest/ajc198/Bugs198Tests.java | 27 ---- .../aspectj/systemtest/ajc199/Ajc199TestsJava.java | 32 ++++ .../systemtest/ajc199/AllTestsAspectJ199.java | 31 ++++ .../aspectj/systemtest/ajc199/Bugs199Tests.java | 56 +++++++ .../ajc199/Java18PreviewFeaturesTests.java | 69 ++++++++ .../systemtest/ajc199/SanityTestsJava18.java | 87 ++++++++++ .../org/aspectj/systemtest/ajc198/ajc198.xml | 69 +------- .../org/aspectj/systemtest/ajc199/ajc199.xml | 177 +++++++++++++++++++++ .../aspectj/systemtest/ajc199/sanity-tests-18.xml | 70 ++++++++ util/src/main/java/org/aspectj/util/LangUtil.java | 4 + 38 files changed, 1072 insertions(+), 346 deletions(-) create mode 100644 docs/dist/doc/README-199.html create mode 100644 testing/src/test/java/org/aspectj/testing/XMLBasedAjcTestCaseForJava18Only.java create mode 100644 testing/src/test/java/org/aspectj/testing/XMLBasedAjcTestCaseForJava18OrLater.java delete mode 100644 tests/bugs198/github_115/A.java delete mode 100644 tests/bugs198/github_115/B.java delete mode 100644 tests/bugs198/github_120/C.java delete mode 100644 tests/bugs198/github_120/D.java delete mode 100644 tests/bugs198/github_122/E.java delete mode 100644 tests/bugs198/github_125/Application.java create mode 100644 tests/bugs199/github_115/A.java create mode 100644 tests/bugs199/github_115/B.java create mode 100644 tests/bugs199/github_120/C.java create mode 100644 tests/bugs199/github_120/D.java create mode 100644 tests/bugs199/github_122/E.java create mode 100644 tests/bugs199/github_125/Application.java create mode 100644 tests/features199/java18/SwitchPatternPreview2Aspect.aj create mode 100644 tests/features199/java18/SwitchPatternPreview2Error.java create mode 100644 tests/features199/java18/SwitchPatternPreview2OK.java create mode 100644 tests/src/test/java/org/aspectj/systemtest/ajc199/Ajc199TestsJava.java create mode 100644 tests/src/test/java/org/aspectj/systemtest/ajc199/AllTestsAspectJ199.java create mode 100644 tests/src/test/java/org/aspectj/systemtest/ajc199/Bugs199Tests.java create mode 100644 tests/src/test/java/org/aspectj/systemtest/ajc199/Java18PreviewFeaturesTests.java create mode 100644 tests/src/test/java/org/aspectj/systemtest/ajc199/SanityTestsJava18.java create mode 100644 tests/src/test/resources/org/aspectj/systemtest/ajc199/ajc199.xml create mode 100644 tests/src/test/resources/org/aspectj/systemtest/ajc199/sanity-tests-18.xml diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 9160a83b1..3e2564c77 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -19,7 +19,7 @@ jobs: strategy: fail-fast: false matrix: - java: [ 11, 17 ] + java: [ 11, 17, 18-ea ] runs-on: ubuntu-latest diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/Constants.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/Constants.java index 1ce3682d3..3c1c12daf 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/Constants.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/Constants.java @@ -98,8 +98,10 @@ public interface Constants { short MINOR_16 = 0; short MAJOR_17 = 61; short MINOR_17 = 0; -// short MAJOR_18 = 62; -// short MINOR_18 = 0; + short MAJOR_18 = 62; + short MINOR_18 = 0; +// short MAJOR_19 = 63; +// short MINOR_19 = 0; int PREVIEW_MINOR_VERSION = 65535; diff --git a/docs/dist/doc/JavaVersionCompatibility.md b/docs/dist/doc/JavaVersionCompatibility.md index be557d462..18a7dcae7 100644 --- a/docs/dist/doc/JavaVersionCompatibility.md +++ b/docs/dist/doc/JavaVersionCompatibility.md @@ -7,6 +7,7 @@ be easily concluded from the AspectJ version number anymore, and we are sorry fo AspectJ version | Java version | Comments ----------------|--------------|-------- +1.9.9 | 18 1.9.8 | 17 | AspectJ compiler requires JDK 11+ during build time. During runtime, AspectJ still only requires Java 8+ for both compile-time and load-time weaving. Pure Java code can be compiled down to as old as 1.3 byte code level. 1.9.7 | 15, 16 1.9.6 | 14 diff --git a/docs/dist/doc/README-198.html b/docs/dist/doc/README-198.html index 5beb81e3d..6b79b5ab9 100644 --- a/docs/dist/doc/README-198.html +++ b/docs/dist/doc/README-198.html @@ -73,7 +73,8 @@ Cross-compilation to legacy JDK : An example class which only works correctly on JDK 8 when compiled with --release 8 due to API changes in - the JDK. Simply -source 8 -target 8 would not be enough in this case. + the JDK. Simply -source 8 -target 8 would not be enough in this case. +
  • Pattern matching for switch @@ -109,12 +110,6 @@ craft a condy class with ASM.
  • -
  • - Improvements for if() pointcuts in annotation syntax, see issues - #115, - #120, - #122. -
  • Thanks to Andrey Turbanov for several clean code contributions and to Dmitry Mikhaylov for fixing a potential concurrency problem. diff --git a/docs/dist/doc/README-199.html b/docs/dist/doc/README-199.html new file mode 100644 index 000000000..8e09cd918 --- /dev/null +++ b/docs/dist/doc/README-199.html @@ -0,0 +1,126 @@ + + + + +AspectJ 1.9.9 Readme + + + + +
    © Copyright 2022 Contributors. All rights reserved.
    + +

    AspectJ 1.9.9

    + +

    + Please note that Bugzilla for issue management is deprecated and new issues should be filed as + GitHub issues. + The list of issues addressed for 1.9.9 can be found + here for Bugzilla + and here for GitHub issues. +

    + +

    New features

    + +

    + AspectJ 1.9.9 supports Java 18 and its final and preview + features, such as: +

    +
      +
    • Pattern matching for switch (preview 2)
    • +
    + +

    Improvements

    + +

    Code examples

    + +

    + You can find some sample code in the AspectJ test suite under the respective AspectJ version in which the features + were first supported (possibly as JVM preview features): +

    + + +

    Other changes and bug fixes

    + +
      +
    • + Fix a bug which led to NullPointerExceptions if too many JAR archives were on the classpath. Too many here + means the value system property org.aspectj.weaver.openarchives (1,000 by default). The AspectJ compiler is + meant to close archives upon cache exhaustion and then re-open them if it needs them again later. Re-opening was + broken, now the compiler works reliably even for cache sizes as small as 20. See issue + #125. +
    • +
    • + Improvements for if() pointcuts in annotation syntax, see issues + #115, + #120, + #122. +
    • +
    • + Thanks to Andrey Turbanov for several clean code contributions. +
    • +
    + +

    AspectJ usage hints

    + +

    AspectJ compiler build system requirements

    + +

    + Since 1.9.7, the AspectJ compiler ajc (contained in the aspectjtools library) no longer works on + JDKs 8 to 10. The minimum compile-time requirement is now JDK 11 due to upstream changes in the Eclipse Java Compiler + (subset of JDT Core), which AspectJ is a fork of. You can still compile to legacy target versions as low as Java 1.3 + when compiling plain Java code or using plain Java ITD constructs which do not require the AspectJ runtime + aspectjrt, but the compiler itself needs JDK 11+. Just like in previous AspectJ versions, both the runtime + aspectjrt and the load-time weaver aspectjweaver still only require JRE 8+. +

    + +

    Use LTW on Java 16+

    + +

    + Please note that if you want to use load-time weaving on Java 16+, the weaving agent collides with + JEP 396 (Strongly Encapsulate JDK Internals by Default) and related + subsequent JEPs. Therefore, you need to set the JVM parameter --add-opens java.base/java.lang=ALL-UNNAMED in + order to enable aspect weaving. This is due to the fact that the weaver uses internal APIs for which we have not found + an adequate replacement yet when defining classes in different classloaders. +

    + +

    Compile with Java preview features

    + +

    + For features marked as preview on a given JDK, you need to compile with ajc --enable-preview and run with + java --enable-preview on that JDK. +

    +

    + Please note that you cannot run code compiled with preview features on any other JDK than the one used for + compilation. For example, records compiled with preview on JDK 15 cannot be used on JDK 16 without recompilation. This + is a JVM limitation unrelated to AspectJ. Also, e.g. sealed classes are preview-1 on JDK 15 and preview-2 on JDK 16. + You still need to recompile, no matter what. +

    + +
    + +

    + Available: 1.9.9 available DD-MMM-2022 +

    + + + + diff --git a/org.aspectj.ajdt.core/src/main/resources/org/aspectj/org/eclipse/jdt/internal/compiler/batch/messages_aspectj.properties b/org.aspectj.ajdt.core/src/main/resources/org/aspectj/org/eclipse/jdt/internal/compiler/batch/messages_aspectj.properties index a54d7ec22..153469df0 100644 --- a/org.aspectj.ajdt.core/src/main/resources/org/aspectj/org/eclipse/jdt/internal/compiler/batch/messages_aspectj.properties +++ b/org.aspectj.ajdt.core/src/main/resources/org/aspectj/org/eclipse/jdt/internal/compiler/batch/messages_aspectj.properties @@ -1,5 +1,5 @@ compiler.name = AspectJ Compiler -compiler.version = Eclipse Compiler f8768b6899a6a2 (15Sep2021) - Java17 +compiler.version = Eclipse Compiler a721c849b3f9d5 (18Mar2022) - Java18 compiler.copyright = misc.version = {0} {1} - {2} {3} diff --git a/pom.xml b/pom.xml index ed9ec5fb1..3e988779c 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ true - 1.9.9-SNAPSHOT + 1.9.9.j18-SNAPSHOT 9.2 1.6.3 2.6.2 diff --git a/taskdefs/src/main/java/org/aspectj/tools/ant/taskdefs/AjcTask.java b/taskdefs/src/main/java/org/aspectj/tools/ant/taskdefs/AjcTask.java index e49580dbe..260d16d90 100644 --- a/taskdefs/src/main/java/org/aspectj/tools/ant/taskdefs/AjcTask.java +++ b/taskdefs/src/main/java/org/aspectj/tools/ant/taskdefs/AjcTask.java @@ -250,9 +250,18 @@ public class AjcTask extends MatchingTask { public static final String COMMAND_EDITOR_NAME = AjcTask.class.getName() + ".COMMAND_EDITOR"; - static final String[] TARGET_INPUTS = new String[] { "1.1", "1.2", "1.3", "1.4", "1.5", "1.6", "1.7", "1.8", "1.9", "9", "10", "11", "12", "13", "14", "15", "16", "17" }; - static final String[] SOURCE_INPUTS = new String[] { "1.3", "1.4", "1.5", "1.6", "1.7", "1.8", "1.9", "9", "10", "11", "12", "13", "14", "15", "16", "17" }; - static final String[] COMPLIANCE_INPUTS = new String[] { "-1.3", "-1.4", "-1.5", "-1.6", "-1.7", "-1.8", "-1.9", "-9", "-10", "-11", "-12", "-13", "-14", "-15", "-16", "-17" }; + static final String[] TARGET_INPUTS = new String[] { + "1.1", "1.2", "1.3", "1.4", "1.5", "1.6", "1.7", "1.8", "1.9", "9", + "10", "11", "12", "13", "14", "15", "16", "17", "18" + }; + static final String[] SOURCE_INPUTS = new String[] { + "1.3", "1.4", "1.5", "1.6", "1.7", "1.8", "1.9", "9", + "10", "11", "12", "13", "14", "15", "16", "17", "18" + }; + static final String[] COMPLIANCE_INPUTS = new String[] { + "-1.3", "-1.4", "-1.5", "-1.6", "-1.7", "-1.8", "-1.9", "-9", + "-10", "-11", "-12", "-13", "-14", "-15", "-16", "-17", "-18" + }; private static final ICommandEditor COMMAND_EDITOR; diff --git a/testing/src/test/java/org/aspectj/testing/XMLBasedAjcTestCaseForJava17Only.java b/testing/src/test/java/org/aspectj/testing/XMLBasedAjcTestCaseForJava17Only.java index 0c351c69a..78941fcab 100644 --- a/testing/src/test/java/org/aspectj/testing/XMLBasedAjcTestCaseForJava17Only.java +++ b/testing/src/test/java/org/aspectj/testing/XMLBasedAjcTestCaseForJava17Only.java @@ -20,21 +20,21 @@ public abstract class XMLBasedAjcTestCaseForJava17Only extends XMLBasedAjcTestCa @Override public void setUp() throws Exception { // Activate this block after upgrading to JDT Core Java 18 - /* throw new IllegalStateException( "These tests need a Java 17 level AspectJ compiler " + "(e.g. because they use version-specific preview features). " + "This compiler does not support preview features of a previous version anymore." ); - */ // Activate this block before upgrading to JDT Core Java 18 + /* if (!LangUtil.is17VMOrGreater() || LangUtil.is18VMOrGreater()) { throw new IllegalStateException( "These tests should be run on Java 17 only " + "(e.g. because they use version-specific preview features)" ); - } super.setUp(); + } + */ } } diff --git a/testing/src/test/java/org/aspectj/testing/XMLBasedAjcTestCaseForJava18Only.java b/testing/src/test/java/org/aspectj/testing/XMLBasedAjcTestCaseForJava18Only.java new file mode 100644 index 000000000..ba4d00605 --- /dev/null +++ b/testing/src/test/java/org/aspectj/testing/XMLBasedAjcTestCaseForJava18Only.java @@ -0,0 +1,40 @@ +/* ******************************************************************* + * Copyright (c) 2021 Contributors + * All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * ******************************************************************/ +package org.aspectj.testing; + +import org.aspectj.util.LangUtil; + +/** + * Makes sure tests are running on the right level of JDK. + * + * @author Alexander Kriegisch + */ +public abstract class XMLBasedAjcTestCaseForJava18Only extends XMLBasedAjcTestCase { + + @Override + public void setUp() throws Exception { + // Activate this block after upgrading to JDT Core Java 19 + /* + throw new IllegalStateException( + "These tests need a Java 18 level AspectJ compiler " + + "(e.g. because they use version-specific preview features). " + + "This compiler does not support preview features of a previous version anymore." + ); + */ + // Activate this block before upgrading to JDT Core Java 19 + if (!LangUtil.is18VMOrGreater() || LangUtil.is19VMOrGreater()) { + throw new IllegalStateException( + "These tests should be run on Java 18 only " + + "(e.g. because they use version-specific preview features)" + ); + } + super.setUp(); + } + +} diff --git a/testing/src/test/java/org/aspectj/testing/XMLBasedAjcTestCaseForJava18OrLater.java b/testing/src/test/java/org/aspectj/testing/XMLBasedAjcTestCaseForJava18OrLater.java new file mode 100644 index 000000000..9b9efdd34 --- /dev/null +++ b/testing/src/test/java/org/aspectj/testing/XMLBasedAjcTestCaseForJava18OrLater.java @@ -0,0 +1,27 @@ +/* ******************************************************************* + * Copyright (c) 2021 Contributors + * All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * ******************************************************************/ +package org.aspectj.testing; + +import org.aspectj.util.LangUtil; + +/** + * Makes sure tests are running on the right level of JDK. + * + * @author Alexander Kriegisch + */ +public abstract class XMLBasedAjcTestCaseForJava18OrLater extends XMLBasedAjcTestCase { + + @Override + public void setUp() throws Exception { + if (!LangUtil.is18VMOrGreater()) + throw new IllegalStateException("These tests should be run on Java 18 or later"); + super.setUp(); + } + +} diff --git a/tests/bugs198/github_115/A.java b/tests/bugs198/github_115/A.java deleted file mode 100644 index 07df21f10..000000000 --- a/tests/bugs198/github_115/A.java +++ /dev/null @@ -1,32 +0,0 @@ -import org.aspectj.lang.annotation.Aspect; -import org.aspectj.lang.annotation.Before; -import org.aspectj.lang.annotation.Pointcut; - -public class A { - - public static void main(String []argv) { - System.out.println("A.main"); - } - -} - -@Aspect -class Azpect { - - @Pointcut("if(false)") - public void isFalse() { } - - @Pointcut("if(true)") - public void isTrue() { } - - @Before("isTrue() && execution(* A.main(..))") - public void beforeTrue() { - System.out.println("Azpect.beforeTrue"); - } - - @Before("isFalse() && execution(* A.main(..))") - public void beforeFalse() { - System.out.println("Azpect.beforeFalse"); - } -} - diff --git a/tests/bugs198/github_115/B.java b/tests/bugs198/github_115/B.java deleted file mode 100644 index eba199b67..000000000 --- a/tests/bugs198/github_115/B.java +++ /dev/null @@ -1,33 +0,0 @@ -import org.aspectj.lang.annotation.Aspect; -import org.aspectj.lang.annotation.Before; -import org.aspectj.lang.annotation.Pointcut; - -public class B { - - public static void main(String []argv) { - System.out.println("B.main"); - } - -} - -@Aspect -abstract class AbstractAzpect { - - @Pointcut - public abstract void isTrue(); - - @Before("isTrue() && execution(* B.main(..))") - public void beforeFalse() { - System.out.println("Azpect.beforeFalse"); - } -} - -@Aspect -class Azpect extends AbstractAzpect { - - @Override - @Pointcut("if(true)") - public void isTrue() { } - -} - diff --git a/tests/bugs198/github_120/C.java b/tests/bugs198/github_120/C.java deleted file mode 100644 index 4af57af24..000000000 --- a/tests/bugs198/github_120/C.java +++ /dev/null @@ -1,64 +0,0 @@ -import org.aspectj.lang.annotation.Aspect; -import org.aspectj.lang.annotation.Before; -import org.aspectj.lang.annotation.Pointcut; - -/** - * This test is exploring situations where an if() pointcut is used with a parameter - * and yet a reference pointcut referring to it is not binding the parameter. - */ -public class C { - - int i; - - C(int i) { - this.i = i; - } - - public static void main(String []argv) { - new C(1).run(); - } - - public void run() { - System.out.println("C.run() executing"); - } - - public String toString() { - return "C("+i+")"; - } - -} - -@Aspect -abstract class Azpect1 { - - @Pointcut("if(false)") - public void isCondition() {} - - @Before("isCondition() && execution(* C.run(..))") - public void beforeAdvice() { - System.out.println("Azpect1.beforeAdvice executing"); - } - -} - -@Aspect -class Azpect2 extends Azpect1 { - @Pointcut("check(*)") - public void isCondition() { } - - @Pointcut("this(c) && if()") - public static boolean check(C c) { - System.out.println("check if() pointcut running on "+c.toString()); - return true; - } -} -// -//abstract aspect A { -// pointcut isCondition(): if(false); -// before(): isCondition() && execution(* C.run(..)) { System.out.println("A.before"); } -//} -// -//aspect B extends A { -// pointcut isCondition(): check(*); -// pointcut check(Object o): this(o) && if(o.toString().equals("abc")); -//} \ No newline at end of file diff --git a/tests/bugs198/github_120/D.java b/tests/bugs198/github_120/D.java deleted file mode 100644 index 2ecdaa574..000000000 --- a/tests/bugs198/github_120/D.java +++ /dev/null @@ -1,33 +0,0 @@ -import org.aspectj.lang.annotation.Aspect; -import org.aspectj.lang.annotation.Before; -import org.aspectj.lang.annotation.Pointcut; - -/** - * This test is exploring situations where an if() pointcut is used with a parameter - * and yet a reference pointcut referring to it is not binding the parameter. - */ -public class D { - - - public static void main(String []argv) { - new D().run(); - } - - public void run() { - System.out.println("D.run() executing"); - } - - public boolean isTrue() { - return true; - } - -} - -@Aspect class Azpect { - - @Pointcut("this(d) && if()") public static boolean method(D d) { return d.isTrue(); } - - @Before("method(*) && execution(* D.run(..))") public void beforeAdvice() { - System.out.println("advice running"); - } -} \ No newline at end of file diff --git a/tests/bugs198/github_122/E.java b/tests/bugs198/github_122/E.java deleted file mode 100644 index 29c818285..000000000 --- a/tests/bugs198/github_122/E.java +++ /dev/null @@ -1,30 +0,0 @@ -import org.aspectj.lang.annotation.Aspect; -import org.aspectj.lang.annotation.Before; -import org.aspectj.lang.annotation.Pointcut; - -/** - * Test !if() pointcuts - */ -public class E { - - public static void main(String []argv) { - new E().run(); - } - - public void run() { - System.out.println("E.run() executing"); - } - -} - -@Aspect class Azpect { - - @Pointcut("!bar()") - public static void foo() {} - - @Pointcut("if()") public static boolean bar() { return false; } - - @Before("foo() && execution(* E.run(..))") public void beforeAdvice() { - System.out.println("advice running"); - } -} \ No newline at end of file diff --git a/tests/bugs198/github_125/Application.java b/tests/bugs198/github_125/Application.java deleted file mode 100644 index 7e893fc1a..000000000 --- a/tests/bugs198/github_125/Application.java +++ /dev/null @@ -1,11 +0,0 @@ -public class Application { - public static void main(String[] argv) { - System.out.println("Hello world!"); - } - - static aspect MyAspect { - before(): execution(* Application.main(..)) { - System.out.println("Before advice"); - } - } -} diff --git a/tests/bugs199/github_115/A.java b/tests/bugs199/github_115/A.java new file mode 100644 index 000000000..07df21f10 --- /dev/null +++ b/tests/bugs199/github_115/A.java @@ -0,0 +1,32 @@ +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Before; +import org.aspectj.lang.annotation.Pointcut; + +public class A { + + public static void main(String []argv) { + System.out.println("A.main"); + } + +} + +@Aspect +class Azpect { + + @Pointcut("if(false)") + public void isFalse() { } + + @Pointcut("if(true)") + public void isTrue() { } + + @Before("isTrue() && execution(* A.main(..))") + public void beforeTrue() { + System.out.println("Azpect.beforeTrue"); + } + + @Before("isFalse() && execution(* A.main(..))") + public void beforeFalse() { + System.out.println("Azpect.beforeFalse"); + } +} + diff --git a/tests/bugs199/github_115/B.java b/tests/bugs199/github_115/B.java new file mode 100644 index 000000000..eba199b67 --- /dev/null +++ b/tests/bugs199/github_115/B.java @@ -0,0 +1,33 @@ +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Before; +import org.aspectj.lang.annotation.Pointcut; + +public class B { + + public static void main(String []argv) { + System.out.println("B.main"); + } + +} + +@Aspect +abstract class AbstractAzpect { + + @Pointcut + public abstract void isTrue(); + + @Before("isTrue() && execution(* B.main(..))") + public void beforeFalse() { + System.out.println("Azpect.beforeFalse"); + } +} + +@Aspect +class Azpect extends AbstractAzpect { + + @Override + @Pointcut("if(true)") + public void isTrue() { } + +} + diff --git a/tests/bugs199/github_120/C.java b/tests/bugs199/github_120/C.java new file mode 100644 index 000000000..4af57af24 --- /dev/null +++ b/tests/bugs199/github_120/C.java @@ -0,0 +1,64 @@ +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Before; +import org.aspectj.lang.annotation.Pointcut; + +/** + * This test is exploring situations where an if() pointcut is used with a parameter + * and yet a reference pointcut referring to it is not binding the parameter. + */ +public class C { + + int i; + + C(int i) { + this.i = i; + } + + public static void main(String []argv) { + new C(1).run(); + } + + public void run() { + System.out.println("C.run() executing"); + } + + public String toString() { + return "C("+i+")"; + } + +} + +@Aspect +abstract class Azpect1 { + + @Pointcut("if(false)") + public void isCondition() {} + + @Before("isCondition() && execution(* C.run(..))") + public void beforeAdvice() { + System.out.println("Azpect1.beforeAdvice executing"); + } + +} + +@Aspect +class Azpect2 extends Azpect1 { + @Pointcut("check(*)") + public void isCondition() { } + + @Pointcut("this(c) && if()") + public static boolean check(C c) { + System.out.println("check if() pointcut running on "+c.toString()); + return true; + } +} +// +//abstract aspect A { +// pointcut isCondition(): if(false); +// before(): isCondition() && execution(* C.run(..)) { System.out.println("A.before"); } +//} +// +//aspect B extends A { +// pointcut isCondition(): check(*); +// pointcut check(Object o): this(o) && if(o.toString().equals("abc")); +//} \ No newline at end of file diff --git a/tests/bugs199/github_120/D.java b/tests/bugs199/github_120/D.java new file mode 100644 index 000000000..2ecdaa574 --- /dev/null +++ b/tests/bugs199/github_120/D.java @@ -0,0 +1,33 @@ +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Before; +import org.aspectj.lang.annotation.Pointcut; + +/** + * This test is exploring situations where an if() pointcut is used with a parameter + * and yet a reference pointcut referring to it is not binding the parameter. + */ +public class D { + + + public static void main(String []argv) { + new D().run(); + } + + public void run() { + System.out.println("D.run() executing"); + } + + public boolean isTrue() { + return true; + } + +} + +@Aspect class Azpect { + + @Pointcut("this(d) && if()") public static boolean method(D d) { return d.isTrue(); } + + @Before("method(*) && execution(* D.run(..))") public void beforeAdvice() { + System.out.println("advice running"); + } +} \ No newline at end of file diff --git a/tests/bugs199/github_122/E.java b/tests/bugs199/github_122/E.java new file mode 100644 index 000000000..29c818285 --- /dev/null +++ b/tests/bugs199/github_122/E.java @@ -0,0 +1,30 @@ +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Before; +import org.aspectj.lang.annotation.Pointcut; + +/** + * Test !if() pointcuts + */ +public class E { + + public static void main(String []argv) { + new E().run(); + } + + public void run() { + System.out.println("E.run() executing"); + } + +} + +@Aspect class Azpect { + + @Pointcut("!bar()") + public static void foo() {} + + @Pointcut("if()") public static boolean bar() { return false; } + + @Before("foo() && execution(* E.run(..))") public void beforeAdvice() { + System.out.println("advice running"); + } +} \ No newline at end of file diff --git a/tests/bugs199/github_125/Application.java b/tests/bugs199/github_125/Application.java new file mode 100644 index 000000000..7e893fc1a --- /dev/null +++ b/tests/bugs199/github_125/Application.java @@ -0,0 +1,11 @@ +public class Application { + public static void main(String[] argv) { + System.out.println("Hello world!"); + } + + static aspect MyAspect { + before(): execution(* Application.main(..)) { + System.out.println("Before advice"); + } + } +} diff --git a/tests/features199/java18/SwitchPatternPreview2Aspect.aj b/tests/features199/java18/SwitchPatternPreview2Aspect.aj new file mode 100644 index 000000000..ee5dbbd68 --- /dev/null +++ b/tests/features199/java18/SwitchPatternPreview2Aspect.aj @@ -0,0 +1,28 @@ +import java.util.Locale; + +aspect SwitchPatternPreview2Aspect { + Object around(Object o): execution(* doSomethingWithObject(*)) && args(o) { + System.out.println( + switch (o) { + case -1, 1 -> "special case:" + o; + case Integer i && i > 0 -> "positive integer: " + o; + case Integer i -> "other integer: " + o; + default -> "non-integer: " + o; + } + ); + return proceed(o); + } +} + +class Application { + public static void main(String[] args) { + doSomethingWithObject(-1); + doSomethingWithObject(0); + doSomethingWithObject(42); + doSomethingWithObject(-99); + doSomethingWithObject("test"); + doSomethingWithObject(null); + } + + public static Object doSomethingWithObject(Object o) { return o; } +} diff --git a/tests/features199/java18/SwitchPatternPreview2Error.java b/tests/features199/java18/SwitchPatternPreview2Error.java new file mode 100644 index 000000000..b1652aad3 --- /dev/null +++ b/tests/features199/java18/SwitchPatternPreview2Error.java @@ -0,0 +1,31 @@ +/** + * Inspired by examples in https://openjdk.java.net/jeps/420 + */ +public class SwitchPatternPreview2Error { + static void constantLabelMustAppearBeforePattern1(Object o) { + switch (o) { + case Integer i && i > 0 -> System.out.println("positive integer: " + o); + case -1, 1 -> System.out.println("special case:" + o); + case Integer i -> System.out.println("other integer: " + o); + default -> System.out.println("non-integer: " + o); + } + } + + static void constantLabelMustAppearBeforePattern2(Object o) { + switch (o) { + case -1, 1 -> System.out.println("special case:" + o); + case Integer i -> System.out.println("other integer: " + o); + case Integer i && i > 0 -> System.out.println("positive integer: " + o); + default -> System.out.println("non-integer: " + o); + } + } + + static void constantLabelMustAppearBeforePattern3(Object o) { + switch (o) { + case Integer i && i > 0 -> System.out.println("positive integer: " + o); + case Integer i -> System.out.println("other integer: " + o); + case -1, 1 -> System.out.println("special case:" + o); + default -> System.out.println("non-integer: " + o); + } + } +} diff --git a/tests/features199/java18/SwitchPatternPreview2OK.java b/tests/features199/java18/SwitchPatternPreview2OK.java new file mode 100644 index 000000000..859583b6d --- /dev/null +++ b/tests/features199/java18/SwitchPatternPreview2OK.java @@ -0,0 +1,38 @@ +import java.util.List; + +/** + * Inspired by examples in https://openjdk.java.net/jeps/420 + */ +public class SwitchPatternPreview2OK { + public static void main(String[] args) { + constantLabelMustAppearBeforePattern(-1); + constantLabelMustAppearBeforePattern(0); + constantLabelMustAppearBeforePattern(42); + constantLabelMustAppearBeforePattern(-99); + constantLabelMustAppearBeforePattern(Integer.valueOf(123)); + constantLabelMustAppearBeforePattern(null); + + System.out.println(testGenericSealedExhaustive(new B())); + } + + static String constantLabelMustAppearBeforePattern(Object o) { + switch (o) { + case -1, 1 -> System.out.println("special case:" + o); + case Integer i && i > 0 -> System.out.println("positive integer: " + o); + case Integer i -> System.out.println("other integer: " + o); + default -> System.out.println("non-integer: " + o); + } + return o.toString(); + } + + sealed interface I permits A, B {} + final static class A implements I {} + final static class B implements I {} + + static int testGenericSealedExhaustive(I i) { + return switch (i) { + // Exhaustive as no A case possible! + case B bi -> 42; + }; + } +} diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc198/Ajc198TestsJava.java b/tests/src/test/java/org/aspectj/systemtest/ajc198/Ajc198TestsJava.java index ef597c8f1..3e6ead467 100644 --- a/tests/src/test/java/org/aspectj/systemtest/ajc198/Ajc198TestsJava.java +++ b/tests/src/test/java/org/aspectj/systemtest/ajc198/Ajc198TestsJava.java @@ -17,35 +17,29 @@ import org.aspectj.testing.XMLBasedAjcTestCaseForJava17OrLater; */ public class Ajc198TestsJava extends XMLBasedAjcTestCaseForJava17OrLater { - public void testSealedClassWithLegalSubclasses() { - runTest("sealed class with legal subclasses"); - // TODO: replace 0 by Constants.PREVIEW_MINOR_VERSION after no longer using EA - // build, but final JDK version - checkVersion("Employee", Constants.MAJOR_17, 0 /* Constants.PREVIEW_MINOR_VERSION */); - checkVersion("Manager", Constants.MAJOR_17, 0 /* Constants.PREVIEW_MINOR_VERSION */); - } - - public void testSealedClassWithIllegalSubclass() { - runTest("sealed class with illegal subclass"); - // TODO: replace 0 by Constants.PREVIEW_MINOR_VERSION after no longer using EA - // build, but final JDK version - checkVersion("Person", Constants.MAJOR_17, 0 /* Constants.PREVIEW_MINOR_VERSION */); - } - - public void testWeaveSealedClass() { - runTest("weave sealed class"); - // TODO: replace 0 by Constants.PREVIEW_MINOR_VERSION after no longer using EA - // build, but final JDK version - checkVersion("PersonAspect", Constants.MAJOR_17, 0 /* Constants.PREVIEW_MINOR_VERSION */); - } - - public static Test suite() { - return XMLBasedAjcTestCase.loadSuite(Ajc198TestsJava.class); - } - - @Override - protected java.net.URL getSpecFile() { - return getClassResource("ajc198.xml"); - } + public void testSealedClassWithLegalSubclasses() { + runTest("sealed class with legal subclasses"); + checkVersion("Employee", Constants.MAJOR_17, Constants.MINOR_17); + checkVersion("Manager", Constants.MAJOR_17, Constants.MINOR_17); + } + + public void testSealedClassWithIllegalSubclass() { + runTest("sealed class with illegal subclass"); + checkVersion("Person", Constants.MAJOR_17, Constants.MINOR_17); + } + + public void testWeaveSealedClass() { + runTest("weave sealed class"); + checkVersion("PersonAspect", Constants.MAJOR_17, Constants.MINOR_17); + } + + public static Test suite() { + return XMLBasedAjcTestCase.loadSuite(Ajc198TestsJava.class); + } + + @Override + protected java.net.URL getSpecFile() { + return getClassResource("ajc198.xml"); + } } diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc198/AllTestsAspectJ198.java b/tests/src/test/java/org/aspectj/systemtest/ajc198/AllTestsAspectJ198.java index 3cfc7a149..929b5749d 100644 --- a/tests/src/test/java/org/aspectj/systemtest/ajc198/AllTestsAspectJ198.java +++ b/tests/src/test/java/org/aspectj/systemtest/ajc198/AllTestsAspectJ198.java @@ -29,9 +29,12 @@ public class AllTestsAspectJ198 { suite.addTest(SanityTestsJava17.suite()); suite.addTest(Ajc198TestsJava.suite()); } + // Do not run tests using a previous compiler's preview features anymore. They would all fail. + /* if (LangUtil.is17VMOrGreater() && !LangUtil.is18VMOrGreater()) { suite.addTest(Java17PreviewFeaturesTests.suite()); } + */ return suite; } } diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc198/Bugs198Tests.java b/tests/src/test/java/org/aspectj/systemtest/ajc198/Bugs198Tests.java index 7982ec630..cb3b781bb 100644 --- a/tests/src/test/java/org/aspectj/systemtest/ajc198/Bugs198Tests.java +++ b/tests/src/test/java/org/aspectj/systemtest/ajc198/Bugs198Tests.java @@ -21,33 +21,6 @@ public class Bugs198Tests extends XMLBasedAjcTestCase { runTest("ITD annotation with mandatory parameter via aspectpath"); } - public void testAnnotationStyleSpecialIfClauses() { - runTest("annotation style A"); - } - - public void testAnnotationStylePointcutInheritanceWithIfClauses() { - runTest("annotation style B"); - } - - public void testAnnotationStyleSpecialIfClauses2_gh120() { - runTest("annotation style C"); - } - - public void testAnnotationStyleSpecialIfClauses3_gh120() { - runTest("annotation style D"); - } - - public void testAnnotationStyleNegatedIf_gh122() { - runTest("annotation style negated if"); - } - - public void testGitHub_125() { - try (PropertyEnvironment env = ScopedSystemProperties.newPropertyEnvironment()) { - env.setProperty("org.aspectj.weaver.openarchives", "20"); - runTest("compiler can re-open closed JARs"); - } - } - public static Test suite() { return XMLBasedAjcTestCase.loadSuite(Bugs198Tests.class); } diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc199/Ajc199TestsJava.java b/tests/src/test/java/org/aspectj/systemtest/ajc199/Ajc199TestsJava.java new file mode 100644 index 000000000..7040deba4 --- /dev/null +++ b/tests/src/test/java/org/aspectj/systemtest/ajc199/Ajc199TestsJava.java @@ -0,0 +1,32 @@ +/******************************************************************************* + * Copyright (c) 2021 Contributors + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + *******************************************************************************/ +package org.aspectj.systemtest.ajc199; + +import junit.framework.Test; +import org.aspectj.testing.XMLBasedAjcTestCase; +import org.aspectj.testing.XMLBasedAjcTestCaseForJava18OrLater; + +/** + * @author Alexander Kriegisch + */ +public class Ajc199TestsJava extends XMLBasedAjcTestCaseForJava18OrLater { + + public void testDummyJava18() { + runTest("dummy Java 18"); + } + + public static Test suite() { + return XMLBasedAjcTestCase.loadSuite(Ajc199TestsJava.class); + } + + @Override + protected java.net.URL getSpecFile() { + return getClassResource("ajc199.xml"); + } + +} diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc199/AllTestsAspectJ199.java b/tests/src/test/java/org/aspectj/systemtest/ajc199/AllTestsAspectJ199.java new file mode 100644 index 000000000..9cb01eec8 --- /dev/null +++ b/tests/src/test/java/org/aspectj/systemtest/ajc199/AllTestsAspectJ199.java @@ -0,0 +1,31 @@ +/******************************************************************************* + * Copyright (c) 2021 Contributors + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + *******************************************************************************/ +package org.aspectj.systemtest.ajc199; + +import junit.framework.Test; +import junit.framework.TestSuite; +import org.aspectj.util.LangUtil; + +/** + * @author Alexander Kriegisch + */ +public class AllTestsAspectJ199 { + + public static Test suite() { + TestSuite suite = new TestSuite("AspectJ 1.9.9 tests"); + suite.addTest(Bugs199Tests.suite()); + if (LangUtil.is18VMOrGreater()) { + suite.addTest(SanityTestsJava18.suite()); + suite.addTest(Ajc199TestsJava.suite()); + } + if (LangUtil.is18VMOrGreater() && !LangUtil.is19VMOrGreater()) { + suite.addTest(Java18PreviewFeaturesTests.suite()); + } + return suite; + } +} diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc199/Bugs199Tests.java b/tests/src/test/java/org/aspectj/systemtest/ajc199/Bugs199Tests.java new file mode 100644 index 000000000..f72f3c44c --- /dev/null +++ b/tests/src/test/java/org/aspectj/systemtest/ajc199/Bugs199Tests.java @@ -0,0 +1,56 @@ +/******************************************************************************* + * Copyright (c) 2021 Contributors + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + *******************************************************************************/ +package org.aspectj.systemtest.ajc199; + +import io.bmuskalla.system.properties.PropertyEnvironment; +import io.bmuskalla.system.properties.ScopedSystemProperties; +import junit.framework.Test; +import org.aspectj.testing.XMLBasedAjcTestCase; + +/** + * @author Alexander Kriegisch + */ +public class Bugs199Tests extends XMLBasedAjcTestCase { + + public void testAnnotationStyleSpecialIfClauses() { + runTest("annotation style A"); + } + + public void testAnnotationStylePointcutInheritanceWithIfClauses() { + runTest("annotation style B"); + } + + public void testAnnotationStyleSpecialIfClauses2_gh120() { + runTest("annotation style C"); + } + + public void testAnnotationStyleSpecialIfClauses3_gh120() { + runTest("annotation style D"); + } + + public void testAnnotationStyleNegatedIf_gh122() { + runTest("annotation style negated if"); + } + + public void testGitHub_125() { + try (PropertyEnvironment env = ScopedSystemProperties.newPropertyEnvironment()) { + env.setProperty("org.aspectj.weaver.openarchives", "20"); + runTest("compiler can re-open closed JARs"); + } + } + + public static Test suite() { + return XMLBasedAjcTestCase.loadSuite(Bugs199Tests.class); + } + + @Override + protected java.net.URL getSpecFile() { + return getClassResource("ajc199.xml"); + } + +} diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc199/Java18PreviewFeaturesTests.java b/tests/src/test/java/org/aspectj/systemtest/ajc199/Java18PreviewFeaturesTests.java new file mode 100644 index 000000000..8d586b440 --- /dev/null +++ b/tests/src/test/java/org/aspectj/systemtest/ajc199/Java18PreviewFeaturesTests.java @@ -0,0 +1,69 @@ +/******************************************************************************* + * Copyright (c) 2021 Contributors + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + *******************************************************************************/ +package org.aspectj.systemtest.ajc199; + +import junit.framework.Test; +import org.aspectj.apache.bcel.Constants; +import org.aspectj.testing.XMLBasedAjcTestCase; +import org.aspectj.testing.XMLBasedAjcTestCaseForJava18Only; + +/** + * @author Alexander Kriegisch + */ +public class Java18PreviewFeaturesTests extends XMLBasedAjcTestCaseForJava18Only { + + public void testSwitchPatternMatchingCaseLabelDominatedByPrecedingError() { + runTest("switch pattern matching error"); + } + + public void testSwitchPatternMatchingJava() { + runTest("switch pattern matching java"); + checkVersion("SwitchPatternOK", Constants.MAJOR_18, Constants.PREVIEW_MINOR_VERSION); + } + + public void testSwitchPatternMatchingAspect() { + runTest("switch pattern matching aspect"); + checkVersion("SwitchPatternAspect", Constants.MAJOR_18, Constants.PREVIEW_MINOR_VERSION); + checkVersion("Application", Constants.MAJOR_18, Constants.PREVIEW_MINOR_VERSION); + checkVersion("Shape", Constants.MAJOR_18, Constants.PREVIEW_MINOR_VERSION); + checkVersion("S", Constants.MAJOR_18, Constants.PREVIEW_MINOR_VERSION); + } + + // TODO: + // JDT Core does not seem to have implemented JEP 420 yet, + // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=576746. + // Therefore, deactivate the special tests for now. +/* + public void testSwitchPatternMatchingPreview2Error() { + runTest("switch pattern matching preview 2 error"); + } + + public void testSwitchPatternMatchingPreview2Java() { + runTest("switch pattern matching preview 2 java"); + checkVersion("SwitchPatternOK", Constants.MAJOR_18, Constants.PREVIEW_MINOR_VERSION); + } + + public void testSwitchPatternMatchingPreview2Aspect() { + runTest("switch pattern matching preview 2 aspect"); + checkVersion("SwitchPatternAspect", Constants.MAJOR_18, Constants.PREVIEW_MINOR_VERSION); + checkVersion("Application", Constants.MAJOR_18, Constants.PREVIEW_MINOR_VERSION); + checkVersion("Shape", Constants.MAJOR_18, Constants.PREVIEW_MINOR_VERSION); + checkVersion("S", Constants.MAJOR_18, Constants.PREVIEW_MINOR_VERSION); + } +*/ + + public static Test suite() { + return XMLBasedAjcTestCase.loadSuite(Java18PreviewFeaturesTests.class); + } + + @Override + protected java.net.URL getSpecFile() { + return getClassResource("ajc199.xml"); + } + +} diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc199/SanityTestsJava18.java b/tests/src/test/java/org/aspectj/systemtest/ajc199/SanityTestsJava18.java new file mode 100644 index 000000000..d86e11454 --- /dev/null +++ b/tests/src/test/java/org/aspectj/systemtest/ajc199/SanityTestsJava18.java @@ -0,0 +1,87 @@ +/******************************************************************************* + * Copyright (c) 2021 Contributors + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + *******************************************************************************/ +package org.aspectj.systemtest.ajc199; + +import junit.framework.Test; +import org.aspectj.testing.XMLBasedAjcTestCase; +import org.aspectj.testing.XMLBasedAjcTestCaseForJava18OrLater; + +/* + * 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 -17 option + * to check code generation and modification with that version specified. + * + * @author Alexander Kriegisch + */ +public class SanityTestsJava18 extends XMLBasedAjcTestCaseForJava18OrLater { + + public static final int bytecode_version_for_JDK_level = 62; + + // 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() { + runTest("simple - j"); + checkVersion("A", bytecode_version_for_JDK_level, 0); + } + + public void testVersionCorrect2() { + runTest("simple - k"); + checkVersion("A", bytecode_version_for_JDK_level, 0); + } + + public void testVersionCorrect4() { + runTest("simple - m"); + // Must be 49.0 when -1.5 is specified + checkVersion("A", 49, 0); + } + + public static Test suite() { + return XMLBasedAjcTestCase.loadSuite(SanityTestsJava18.class); + } + + @Override + protected java.net.URL getSpecFile() { + return getClassResource("sanity-tests-18.xml"); + } + +} diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc198/ajc198.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc198/ajc198.xml index 0eb413baa..85bd872b3 100644 --- a/tests/src/test/resources/org/aspectj/systemtest/ajc198/ajc198.xml +++ b/tests/src/test/resources/org/aspectj/systemtest/ajc198/ajc198.xml @@ -95,76 +95,9 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc199/ajc199.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc199/ajc199.xml new file mode 100644 index 000000000..f76858a3b --- /dev/null +++ b/tests/src/test/resources/org/aspectj/systemtest/ajc199/ajc199.xml @@ -0,0 +1,177 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc199/sanity-tests-18.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc199/sanity-tests-18.xml new file mode 100644 index 000000000..30c9660a1 --- /dev/null +++ b/tests/src/test/resources/org/aspectj/systemtest/ajc199/sanity-tests-18.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/util/src/main/java/org/aspectj/util/LangUtil.java b/util/src/main/java/org/aspectj/util/LangUtil.java index af1e21d29..7e1c2a253 100644 --- a/util/src/main/java/org/aspectj/util/LangUtil.java +++ b/util/src/main/java/org/aspectj/util/LangUtil.java @@ -194,6 +194,10 @@ public class LangUtil { return 18 <= vmVersion; } + public static boolean is19VMOrGreater() { + return 19 <= vmVersion; + } + /** * Shorthand for "if null, throw IllegalArgumentException" * -- cgit v1.2.3 From 09d5772dba8fa81ed6ee1a74ae7e7721cfc3787c Mon Sep 17 00:00:00 2001 From: Alexander Kriegisch Date: Mon, 21 Mar 2022 11:30:38 +0700 Subject: Use '-Djava.security.manager=allow' on Java 18+ (JEP 411) JEP 411: Deprecate the Security Manager for Removal, see https://openjdk.java.net/jeps/411. As of Java 18, the new API for blocking System.exit is not available yet, see https://bugs.openjdk.java.net/browse/JDK-8199704. Signed-off-by: Alexander Kriegisch --- pom.xml | 14 ++++++++++++++ .../java/org/aspectj/testing/harness/bridge/JavaRun.java | 3 +++ 2 files changed, 17 insertions(+) diff --git a/pom.xml b/pom.xml index 3e988779c..d262f8d92 100644 --- a/pom.xml +++ b/pom.xml @@ -207,6 +207,20 @@ --add-opens java.base/java.lang=ALL-UNNAMED + + jdk-18-to-xx + + [18,) + + + + -Djava.security.manager=allow + + release diff --git a/testing/src/test/java/org/aspectj/testing/harness/bridge/JavaRun.java b/testing/src/test/java/org/aspectj/testing/harness/bridge/JavaRun.java index 93ca14e70..fa3315396 100644 --- a/testing/src/test/java/org/aspectj/testing/harness/bridge/JavaRun.java +++ b/testing/src/test/java/org/aspectj/testing/harness/bridge/JavaRun.java @@ -600,6 +600,9 @@ public class JavaRun implements IAjcRun { public static class Spec extends AbstractRunSpec { static { try { + // TODO: Deprecate the Security Manager for Removal, see https://openjdk.java.net/jeps/411. + // As of Java 18, the new API for blocking System.exit is not available yet, see + // https://bugs.openjdk.java.net/browse/JDK-8199704. System.setSecurityManager(RunSecurityManager.ME); } catch (Throwable t) { System.err.println("JavaRun: Security manager set - no System.exit() protection"); -- cgit v1.2.3 From 4075a0bd136c083a67d6ddf7c2e73bddf345af5a Mon Sep 17 00:00:00 2001 From: Alexander Kriegisch Date: Wed, 23 Mar 2022 08:14:58 +0700 Subject: Use static imports for file and path separator constants It makes concatenated paths a little more readable. Signed-off-by: Alexander Kriegisch --- .../src/test/java/org/aspectj/tools/ajc/Ajc.java | 19 ++++++----- .../java/org/aspectj/tools/ajc/AjcTestCase.java | 37 ++++++++++++---------- 2 files changed, 31 insertions(+), 25 deletions(-) diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/Ajc.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/Ajc.java index ee49dc10a..e34ce3a38 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/Ajc.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/Ajc.java @@ -36,6 +36,9 @@ import org.aspectj.bridge.context.CompilationAndWeavingContext; import org.aspectj.testing.util.TestUtil; import org.aspectj.util.FileUtil; +import static java.io.File.pathSeparator; +import static java.io.File.separator; + /** * The Ajc class is intended for use as part of a unit-test suite, it drives the AspectJ compiler and lets you check the compilation * results. Compilations run in a sandbox that is created in C:\temp\ajcSandbox or /tmp/ajcSandbox depending on your platform. @@ -51,13 +54,13 @@ public class Ajc { private static final String BUILD_OUTPUT_FOLDER = "target"; public static final String outputFolder(String module) { - return File.pathSeparator + ".." +File.separator + module + File.separator + BUILD_OUTPUT_FOLDER + File.separator + "classes"; + return pathSeparator + ".." + separator + module + separator + BUILD_OUTPUT_FOLDER + separator + "classes"; } public static final String outputFolders(String... modules) { StringBuilder s = new StringBuilder(); for (String module: modules) { - s.append(File.pathSeparator + ".." +File.separator + module + File.separator + BUILD_OUTPUT_FOLDER + File.separator + "classes"); + s.append(pathSeparator + ".." + separator + module + separator + BUILD_OUTPUT_FOLDER + separator + "classes"); } return s.toString(); } @@ -67,7 +70,7 @@ public class Ajc { outputFolder("testing-client") + outputFolder("runtime") + outputFolder("bcel-builder") - + File.pathSeparator + ".." + File.separator + "lib" + File.separator + "junit" + File.separator + "junit.jar" + + File.pathSeparator + ".." + separator + "lib" + separator + "junit" + separator + "junit.jar" + outputFolder("bridge") + outputFolder("loadtime") + outputFolder("weaver") @@ -321,17 +324,17 @@ public class Ajc { hasOutdir = true; } boolean isOutjar = args[i].equals("-outjar"); - StringTokenizer strTok = new StringTokenizer(args[++i], File.pathSeparator); + StringTokenizer strTok = new StringTokenizer(args[++i], pathSeparator); while (strTok.hasMoreTokens()) { File f = new File(strTok.nextToken()); buff.append(adjustFileOrDir(f, copyThisTime, isOutjar).getAbsolutePath()); if (strTok.hasMoreTokens()) - buff.append(File.pathSeparator); + buff.append(pathSeparator); } newArgs[i] = buff.toString(); if (args[i - 1].equals("-classpath")) { hasClasspath = true; - newArgs[i] = newArgs[i] + File.pathSeparator + TESTER_PATH + File.pathSeparator + newArgs[i] = newArgs[i] + pathSeparator + TESTER_PATH + pathSeparator + getSandboxDirectory().getAbsolutePath(); } } else { @@ -348,7 +351,7 @@ public class Ajc { newArgs = new String[oldArgs.length + 2]; System.arraycopy(oldArgs, 0, newArgs, 0, oldArgs.length); newArgs[oldArgs.length] = "-classpath"; - newArgs[oldArgs.length + 1] = TESTER_PATH + File.pathSeparator + getSandboxDirectory().getAbsolutePath(); + newArgs[oldArgs.length + 1] = TESTER_PATH + pathSeparator + getSandboxDirectory().getAbsolutePath(); } if (!hasOutdir) { String[] oldArgs = newArgs; @@ -366,7 +369,7 @@ public class Ajc { if (!from.isAbsolute()) { ret = new File(sandbox, from.getPath()); File fromParent = from.getParentFile(); - String relativeToPath = (fromParent != null) ? (fromParent.getPath() + File.separator) : ""; + String relativeToPath = (fromParent != null) ? (fromParent.getPath() + separator) : ""; if (baseDir != null) { from = new File(baseDir, from.getPath()); // if (ensureDirsExist) { diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjcTestCase.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjcTestCase.java index 0bf08886c..b6ae38ba1 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjcTestCase.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjcTestCase.java @@ -37,6 +37,9 @@ import org.aspectj.util.LangUtil; import junit.framework.TestCase; +import static java.io.File.pathSeparator; +import static java.io.File.separator; + /** * A TestCase class that acts as the superclass for all test cases wishing to drive the ajc compiler. *

    @@ -65,7 +68,7 @@ public abstract class AjcTestCase extends TestCase { public static final String CLASSPATH_ASM = Arrays.stream(System.getProperty("java.class.path") - .split(File.pathSeparator)) + .split(pathSeparator)) .filter(path -> path.replace('\\', '/').contains("org/ow2/asm/")) .findFirst() .orElseThrow(() -> new RuntimeException("ASM library not found on classpath")); @@ -73,13 +76,13 @@ public abstract class AjcTestCase extends TestCase { // see Ajc and AntSpec public static final String DEFAULT_CLASSPATH_ENTRIES = Ajc.outputFolders("bridge","util","loadtime","weaver","asm","testing-client","runtime","org.aspectj.matcher") - + File.pathSeparator + ".." + File.separator + "lib" + File.separator + "junit" + File.separator + "junit.jar" - + File.pathSeparator + ".." + File.separator + "lib" + File.separator + "bcel" + File.separator + "bcel.jar" - + File.pathSeparator + ".." + File.separator + "lib" + File.separator + "bcel" + File.separator + "bcel-verifier.jar" - + File.pathSeparator + CLASSPATH_ASM - + File.pathSeparator + ".." + File.separator + "lib" + File.separator + "test" + File.separator + "testing-client.jar" + + pathSeparator + ".." + separator + "lib" + separator + "junit" + separator + "junit.jar" + + pathSeparator + ".." + separator + "lib" + separator + "bcel" + separator + "bcel.jar" + + pathSeparator + ".." + separator + "lib" + separator + "bcel" + separator + "bcel-verifier.jar" + + pathSeparator + CLASSPATH_ASM + + pathSeparator + ".." + separator + "lib" + separator + "test" + separator + "testing-client.jar" // hmmm, this next one should perhaps point to an aj-build jar... - + File.pathSeparator + ".." + File.separator + "lib" + File.separator + "test" + File.separator + "aspectjrt.jar" + + pathSeparator + ".." + separator + "lib" + separator + "test" + separator + "aspectjrt.jar" ; /* @@ -149,7 +152,7 @@ public abstract class AjcTestCase extends TestCase { char[] chars = srcFile.toCharArray(); for (char c : chars) { if ((c == '\\') || (c == '/')) { - srcFileName.append(File.separator); + srcFileName.append(separator); } else { srcFileName.append(c); } @@ -580,7 +583,7 @@ public abstract class AjcTestCase extends TestCase { if (classpath != null) { // allow replacing this special variable, rather than copying all files to allow tests of jars that don't end in .jar cp.append(substituteSandbox(classpath)); - cp.append(File.pathSeparator); + cp.append(pathSeparator); } if (moduleName == null) { // When running modules, we want more control so don't try to be helpful by adding all jars @@ -590,7 +593,7 @@ public abstract class AjcTestCase extends TestCase { StringBuilder mp = new StringBuilder(); if (modulepath != null) { mp.append(substituteSandbox(modulepath)); - mp.append(File.pathSeparator); + mp.append(pathSeparator); } URLClassLoader sandboxLoader; @@ -620,7 +623,7 @@ public abstract class AjcTestCase extends TestCase { File directory = new File ("."); String absPath = directory.getAbsolutePath(); - String javaagent= absPath+File.separator+".."+File.separator+"aj-build"+File.separator+"dist"+File.separator+"tools"+File.separator+"lib"+File.separator+"aspectjweaver.jar"; + String javaagent= absPath+separator+".."+separator+"aj-build"+separator+"dist"+separator+"tools"+separator+"lib"+separator+"aspectjweaver.jar"; try { String command ="java " +vmargs+ " -classpath " + cp +" -javaagent:"+javaagent + " " + className ; @@ -650,7 +653,7 @@ public abstract class AjcTestCase extends TestCase { mp = mp.replace(mp.indexOf("$runtime"),"$runtime".length(),TestUtil.aspectjrtPath().toString()); } if (cp.indexOf("aspectjrt")==-1) { - cp.append(TestUtil.aspectjrtPath().getPath()).append(File.pathSeparator); + cp.append(TestUtil.aspectjrtPath().getPath()).append(pathSeparator); } String command = LangUtil.getJavaExecutable().getAbsolutePath() + " " +vmargs+ (cp.length()==0?"":" -classpath " + cp) + " -p "+mp+" --module "+moduleName ; if (Ajc.verbose) { @@ -676,7 +679,7 @@ public abstract class AjcTestCase extends TestCase { // mp = mp.replace(mp.indexOf("$runtime"),"$runtime".length(),TestUtil.aspectjrtPath().toString()); // } if (cp.indexOf("aspectjrt")==-1) { - cp.append(File.pathSeparator).append(TestUtil.aspectjrtPath().getPath()); + cp.append(pathSeparator).append(TestUtil.aspectjrtPath().getPath()); } String command = LangUtil.getJavaExecutable().getAbsolutePath() + " " +vmargs+ (cp.length()==0?"":" -classpath " + cp) + " " + className ; if (Ajc.verbose) { @@ -867,7 +870,7 @@ public abstract class AjcTestCase extends TestCase { } private URL[] getURLs(String classpath) { - StringTokenizer strTok = new StringTokenizer(classpath, File.pathSeparator); + StringTokenizer strTok = new StringTokenizer(classpath, pathSeparator); URL[] urls = new URL[strTok.countTokens()]; try { for (int i = 0; i < urls.length; i++) { @@ -926,7 +929,7 @@ public abstract class AjcTestCase extends TestCase { cpIndex++; String[] newargs = new String[args.length]; System.arraycopy(args, 0, newargs, 0, args.length); - newargs[cpIndex] = args[cpIndex] + File.pathSeparator + TestUtil.aspectjrtPath().getPath(); + newargs[cpIndex] = args[cpIndex] + pathSeparator + TestUtil.aspectjrtPath().getPath(); args = newargs; } } @@ -934,7 +937,7 @@ public abstract class AjcTestCase extends TestCase { if (needsJRTFS) { if (!args[cpIndex].contains(LangUtil.JRT_FS)) { String jrtfsPath = LangUtil.getJrtFsFilePath(); - args[cpIndex] = jrtfsPath + File.pathSeparator + args[cpIndex]; + args[cpIndex] = jrtfsPath + pathSeparator + args[cpIndex]; } } return args; @@ -1014,7 +1017,7 @@ public abstract class AjcTestCase extends TestCase { File[] files = dir.listFiles(); for (File file : files) { if (file.getName().endsWith(".jar")) { - buff.append(File.pathSeparator); + buff.append(pathSeparator); buff.append(file.getAbsolutePath()); } else if (file.isDirectory()) { getAnyJars(file, buff); -- cgit v1.2.3 From 1ff8e0915c4a47e63415069d1cee33e6493a638f Mon Sep 17 00:00:00 2001 From: Alexander Kriegisch Date: Wed, 23 Mar 2022 08:26:45 +0700 Subject: Use 1.9.9-SNAPSHOT AspectJ libraries in libs/test, libs/aspectj/lib Signed-off-by: Alexander Kriegisch --- lib/aspectj/lib/aspectjrt.jar | Bin 119031 -> 122989 bytes lib/aspectj/lib/aspectjtools.jar | Bin 6631040 -> 14592707 bytes lib/test/aspectjrt.jar | Bin 121274 -> 122989 bytes 3 files changed, 0 insertions(+), 0 deletions(-) diff --git a/lib/aspectj/lib/aspectjrt.jar b/lib/aspectj/lib/aspectjrt.jar index 935830ebc..5e5174445 100644 Binary files a/lib/aspectj/lib/aspectjrt.jar and b/lib/aspectj/lib/aspectjrt.jar differ diff --git a/lib/aspectj/lib/aspectjtools.jar b/lib/aspectj/lib/aspectjtools.jar index e4efdaf34..dfa45c6ef 100644 Binary files a/lib/aspectj/lib/aspectjtools.jar and b/lib/aspectj/lib/aspectjtools.jar differ diff --git a/lib/test/aspectjrt.jar b/lib/test/aspectjrt.jar index fe29ee5e6..5e5174445 100644 Binary files a/lib/test/aspectjrt.jar and b/lib/test/aspectjrt.jar differ -- cgit v1.2.3 From a385d8b6613b4dbdce81880a84cd709fb09026d6 Mon Sep 17 00:00:00 2001 From: Alexander Kriegisch Date: Wed, 23 Mar 2022 08:37:16 +0700 Subject: Fix broken 'useFullLTW' test mode It was referring to a no longer existent weaver under aj-build/dist/tools/lib/aspectjweaver.jar, which now has been replaced by the new file lib/aspectj/lib/aspectjweaver.jar. Several tests were broken, not finding the agent. But because those tests make no assertions, nobody ever noticed. Only when I had to change some LTW tests from in-process to full LTW mode (see next commit) due to them now obviously calling some code paths which need '--add-opens', I even noticed the problem. Signed-off-by: Alexander Kriegisch --- lib/aspectj/lib/aspectjweaver.jar | Bin 0 -> 2062888 bytes .../test/java/org/aspectj/tools/ajc/AjcTestCase.java | 8 ++++++-- 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 lib/aspectj/lib/aspectjweaver.jar diff --git a/lib/aspectj/lib/aspectjweaver.jar b/lib/aspectj/lib/aspectjweaver.jar new file mode 100644 index 000000000..12bfd44cd Binary files /dev/null and b/lib/aspectj/lib/aspectjweaver.jar differ diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjcTestCase.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjcTestCase.java index b6ae38ba1..f0e7673a0 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjcTestCase.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjcTestCase.java @@ -29,6 +29,7 @@ import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.StringTokenizer; +import java.util.stream.Collectors; import org.aspectj.bridge.IMessage; import org.aspectj.bridge.ISourceLocation; @@ -623,9 +624,12 @@ public abstract class AjcTestCase extends TestCase { File directory = new File ("."); String absPath = directory.getAbsolutePath(); - String javaagent= absPath+separator+".."+separator+"aj-build"+separator+"dist"+separator+"tools"+separator+"lib"+separator+"aspectjweaver.jar"; + String javaagent = absPath + separator + ".." + separator + "lib" + separator + "aspectj" + separator + "lib" + separator + "aspectjweaver.jar"; + String defaultCpAbsolute = Arrays.stream(DEFAULT_CLASSPATH_ENTRIES.split(pathSeparator)) + .map(path -> new File(path).getAbsolutePath()) + .collect(Collectors.joining(pathSeparator)); try { - String command ="java " +vmargs+ " -classpath " + cp +" -javaagent:"+javaagent + " " + className ; + String command = "java " + vmargs + " -classpath " + cp + pathSeparator + defaultCpAbsolute + " -javaagent:" + javaagent + " " + className; // Command is executed using ProcessBuilder to allow setting CWD for ajc sandbox compliance ProcessBuilder pb = new ProcessBuilder(tokenizeCommand(command)); -- cgit v1.2.3 From 5288ef1c1c8be2df85e59740f41622f4cfb9d899 Mon Sep 17 00:00:00 2001 From: Alexander Kriegisch Date: Wed, 23 Mar 2022 08:43:57 +0700 Subject: AtAjLTWTests: 4 test cases switched to 'useFullLTW' mode After the Java 18 JDT Core upgrade, some LTW tests are failing and have to be switched from in-process to full LTW mode due to them now obviously calling some code paths which need '--add-opens'. Signed-off-by: Alexander Kriegisch --- .../systemtest/ajc150/ataspectj/AtAjLTWTests.java | 7 ++++--- .../org/aspectj/systemtest/ajc150/ataspectj/ltw.xml | 20 ++++++++++---------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc150/ataspectj/AtAjLTWTests.java b/tests/src/test/java/org/aspectj/systemtest/ajc150/ataspectj/AtAjLTWTests.java index c7be1944c..e06a3b0c3 100644 --- a/tests/src/test/java/org/aspectj/systemtest/ajc150/ataspectj/AtAjLTWTests.java +++ b/tests/src/test/java/org/aspectj/systemtest/ajc150/ataspectj/AtAjLTWTests.java @@ -121,11 +121,12 @@ public class AtAjLTWTests extends XMLBasedAjcTestCase { public void testLTWDumpClosure() { runTest("LTW DumpTest closure"); - File f = new File("_ajdump/ataspectj/DumpTestTheDump$AjcClosure1.class"); + // Test runs with 'usefullltw="true"' -> dump files are created in the sandbox directory + File f = new File(ajc.getSandboxDirectory() + "/_ajdump/ataspectj/DumpTestTheDump$AjcClosure1.class"); assertTrue("Missing dump file " + f.getAbsolutePath(), f.exists()); - // tidy up... - f = new File("_ajdump"); + // tidy up... (should not be necessary in sandbox directory, but does not hurt) + f = new File(ajc.getSandboxDirectory() + "/_ajdump"); FileUtil.deleteContents(f); f.delete(); } diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc150/ataspectj/ltw.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc150/ataspectj/ltw.xml index a72fa4ebf..9dfc4afe4 100644 --- a/tests/src/test/resources/org/aspectj/systemtest/ajc150/ataspectj/ltw.xml +++ b/tests/src/test/resources/org/aspectj/systemtest/ajc150/ataspectj/ltw.xml @@ -95,7 +95,7 @@ options="-1.5"/> - + - + @@ -163,7 +163,7 @@ files="ataspectj/ltwlog/Aspect1.java" options="-1.5 -XterminateAfterCompilation" > - + @@ -182,7 +182,7 @@ files="ataspectj/ltwlog/Aspect1.java" options="-1.5 -XterminateAfterCompilation" > - + @@ -207,7 +207,7 @@ files="ataspectj/ltwlog/Aspect1.java" options="-1.5 -XterminateAfterCompilation" > - + @@ -233,7 +233,7 @@ files="ataspectj/ltwlog/Aspect1.java" options="-1.5 -XterminateAfterCompilation" > - + @@ -290,7 +290,7 @@ files="ataspectj/ConcreteAtAspectTest.java,ataspectj/TestHelper.java" options="-1.5 -XterminateAfterCompilation" /> - + @@ -298,7 +298,7 @@ files="ataspectj/ConcreteAspectTest.aj,ataspectj/TestHelper.java" options="-1.5 -Xdev:NoAtAspectJProcessing -XterminateAfterCompilation" /> - + @@ -306,7 +306,7 @@ files="ataspectj/ConcretePrecedenceAspectTest.java,ataspectj/TestHelper.java" options="-1.5 -Xdev:NoAtAspectJProcessing -XterminateAfterCompilation" /> - + @@ -346,4 +346,4 @@ - \ No newline at end of file + -- cgit v1.2.3 From 356ab9a26ec3dd307e5beac3988d8bc6a4f00e16 Mon Sep 17 00:00:00 2001 From: Alexander Kriegisch Date: Wed, 23 Mar 2022 08:45:46 +0700 Subject: AJDT Core: use JUnit 4 from class path instead of 3.8 from lib/junit Signed-off-by: Alexander Kriegisch --- .../src/test/java/org/aspectj/tools/ajc/Ajc.java | 3 ++- .../src/test/java/org/aspectj/tools/ajc/AjcTestCase.java | 8 +++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/Ajc.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/Ajc.java index e34ce3a38..a256f6d90 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/Ajc.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/Ajc.java @@ -38,6 +38,7 @@ import org.aspectj.util.FileUtil; import static java.io.File.pathSeparator; import static java.io.File.separator; +import static org.aspectj.tools.ajc.AjcTestCase.CLASSPATH_JUNIT; /** * The Ajc class is intended for use as part of a unit-test suite, it drives the AspectJ compiler and lets you check the compilation @@ -70,7 +71,7 @@ public class Ajc { outputFolder("testing-client") + outputFolder("runtime") + outputFolder("bcel-builder") - + File.pathSeparator + ".." + separator + "lib" + separator + "junit" + separator + "junit.jar" + + pathSeparator + CLASSPATH_JUNIT + outputFolder("bridge") + outputFolder("loadtime") + outputFolder("weaver") diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjcTestCase.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjcTestCase.java index f0e7673a0..10b6d09dd 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjcTestCase.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjcTestCase.java @@ -73,11 +73,17 @@ public abstract class AjcTestCase extends TestCase { .filter(path -> path.replace('\\', '/').contains("org/ow2/asm/")) .findFirst() .orElseThrow(() -> new RuntimeException("ASM library not found on classpath")); + public static final String CLASSPATH_JUNIT = + Arrays.stream(System.getProperty("java.class.path") + .split(pathSeparator)) + .filter(path -> path.replace('\\', '/').contains("/junit/junit/")) + .findFirst() + .orElseThrow(() -> new RuntimeException("JUnit library not found on classpath")); // see Ajc and AntSpec public static final String DEFAULT_CLASSPATH_ENTRIES = Ajc.outputFolders("bridge","util","loadtime","weaver","asm","testing-client","runtime","org.aspectj.matcher") - + pathSeparator + ".." + separator + "lib" + separator + "junit" + separator + "junit.jar" + + pathSeparator + CLASSPATH_JUNIT + pathSeparator + ".." + separator + "lib" + separator + "bcel" + separator + "bcel.jar" + pathSeparator + ".." + separator + "lib" + separator + "bcel" + separator + "bcel-verifier.jar" + pathSeparator + CLASSPATH_ASM -- cgit v1.2.3 From 8c15d83a466843b5dba8ba454329baaca0080cc5 Mon Sep 17 00:00:00 2001 From: Alexander Kriegisch Date: Wed, 23 Mar 2022 10:08:50 +0700 Subject: A few dozen more tests need 'useFullLTW' mode Signed-off-by: Alexander Kriegisch --- .../org/aspectj/systemtest/ajc152/Ajc152Tests.java | 2 +- .../org/aspectj/systemtest/ajc150/ajc150.xml | 14 +-- .../org/aspectj/systemtest/ajc150/ltw/ltw.xml | 2 +- .../org/aspectj/systemtest/ajc151/ajc151.xml | 92 ++++++++--------- .../org/aspectj/systemtest/ajc152/ajc152.xml | 12 +-- .../aspectj/systemtest/ajc152/synchronization.xml | 114 ++++++++++----------- .../org/aspectj/systemtest/ajc153/ajc153.xml | 8 +- .../org/aspectj/systemtest/ajc154/ajc154.xml | 4 +- .../org/aspectj/systemtest/ajc1612/ajc1612.xml | 24 ++--- .../org/aspectj/systemtest/ajc162/ajc162.xml | 6 +- .../org/aspectj/systemtest/ajc164/ajc164.xml | 2 +- .../org/aspectj/systemtest/ajc170/ajc170.xml | 4 +- .../org/aspectj/systemtest/ajc180/ajc180.xml | 8 +- .../org/aspectj/systemtest/ajc1810/ajc1810.xml | 2 +- 14 files changed, 147 insertions(+), 147 deletions(-) diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc152/Ajc152Tests.java b/tests/src/test/java/org/aspectj/systemtest/ajc152/Ajc152Tests.java index 8bcdb63e0..da8d057b1 100644 --- a/tests/src/test/java/org/aspectj/systemtest/ajc152/Ajc152Tests.java +++ b/tests/src/test/java/org/aspectj/systemtest/ajc152/Ajc152Tests.java @@ -168,7 +168,7 @@ public class Ajc152Tests extends org.aspectj.testing.XMLBasedAjcTestCase { } public void testLTWGeneratedAspectAbstractMethod_pr125480() { - runTest("aop.xml aspect inheriting abstract method "); + runTest("aop.xml aspect inheriting abstract method"); } public void testLTWGeneratedAspectAbstractMethod_pr125480_2() { diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc150/ajc150.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc150/ajc150.xml index 7963070e0..0eb724096 100644 --- a/tests/src/test/resources/org/aspectj/systemtest/ajc150/ajc150.xml +++ b/tests/src/test/resources/org/aspectj/systemtest/ajc150/ajc150.xml @@ -6174,7 +6174,7 @@ - + @@ -6184,7 +6184,7 @@ - + @@ -6194,7 +6194,7 @@ - + @@ -6204,7 +6204,7 @@ - + @@ -6214,7 +6214,7 @@ - + @@ -6225,7 +6225,7 @@ - + @@ -6235,7 +6235,7 @@ - + diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc150/ltw/ltw.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc150/ltw/ltw.xml index 652ddecd5..975b35cd8 100644 --- a/tests/src/test/resources/org/aspectj/systemtest/ajc150/ltw/ltw.xml +++ b/tests/src/test/resources/org/aspectj/systemtest/ajc150/ltw/ltw.xml @@ -215,7 +215,7 @@ - + diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc151/ajc151.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc151/ajc151.xml index 8d8cd66b8..f92d235e2 100644 --- a/tests/src/test/resources/org/aspectj/systemtest/ajc151/ajc151.xml +++ b/tests/src/test/resources/org/aspectj/systemtest/ajc151/ajc151.xml @@ -4,7 +4,7 @@ - + @@ -20,7 +20,7 @@ - + @@ -36,7 +36,7 @@ - + @@ -53,7 +53,7 @@ - + @@ -70,7 +70,7 @@ - + @@ -99,7 +99,7 @@ - + @@ -120,23 +120,23 @@ - + - + - - + + - - + + @@ -153,7 +153,7 @@ - + @@ -167,19 +167,19 @@ - + - - + + - - + + - + @@ -191,32 +191,32 @@ - + - - + + - + - + - + - + @@ -227,7 +227,7 @@ - + @@ -239,7 +239,7 @@ - + @@ -248,12 +248,12 @@ - + - + @@ -264,7 +264,7 @@ - + @@ -272,18 +272,18 @@ - + - + - + @@ -292,11 +292,11 @@ - + - + @@ -307,17 +307,17 @@ - + - + - + @@ -345,7 +345,7 @@ - + @@ -379,7 +379,7 @@ - + @@ -390,10 +390,10 @@ - + - + @@ -403,8 +403,8 @@ - - + + @@ -415,4 +415,4 @@ - \ No newline at end of file + diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc152/ajc152.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc152/ajc152.xml index 13297309c..91ec24385 100644 --- a/tests/src/test/resources/org/aspectj/systemtest/ajc152/ajc152.xml +++ b/tests/src/test/resources/org/aspectj/systemtest/ajc152/ajc152.xml @@ -448,10 +448,10 @@ - + - + @@ -462,7 +462,7 @@ - + @@ -600,7 +600,7 @@ - + @@ -611,7 +611,7 @@ - + @@ -621,7 +621,7 @@ - + diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc152/synchronization.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc152/synchronization.xml index 99096fa53..f2c8cb02b 100644 --- a/tests/src/test/resources/org/aspectj/systemtest/ajc152/synchronization.xml +++ b/tests/src/test/resources/org/aspectj/systemtest/ajc152/synchronization.xml @@ -2,7 +2,7 @@ - + @@ -15,7 +15,7 @@ - + @@ -36,7 +36,7 @@ - + @@ -57,7 +57,7 @@ - + @@ -78,7 +78,7 @@ - + @@ -110,19 +110,19 @@ - + - + - + @@ -130,7 +130,7 @@ - + @@ -138,7 +138,7 @@ - + @@ -148,7 +148,7 @@ - + @@ -163,11 +163,11 @@ - + - + @@ -184,7 +184,7 @@ - + @@ -199,7 +199,7 @@ - + @@ -214,7 +214,7 @@ - + @@ -238,7 +238,7 @@ - + @@ -258,7 +258,7 @@ - + @@ -272,7 +272,7 @@ - + @@ -283,7 +283,7 @@ - + @@ -294,7 +294,7 @@ - + @@ -305,7 +305,7 @@ - + @@ -316,7 +316,7 @@ - + @@ -324,7 +324,7 @@ - + @@ -336,8 +336,8 @@ - - + + @@ -349,8 +349,8 @@ - - + + @@ -362,8 +362,8 @@ - - + + @@ -375,8 +375,8 @@ - - + + @@ -395,8 +395,8 @@ - - + + @@ -415,22 +415,22 @@ - - + + - + - + - + @@ -439,7 +439,7 @@ - + @@ -449,11 +449,11 @@ - + - - + + @@ -468,7 +468,7 @@ - + @@ -483,7 +483,7 @@ - + @@ -500,7 +500,7 @@ - + @@ -513,7 +513,7 @@ - + @@ -537,7 +537,7 @@ - + @@ -561,7 +561,7 @@ - + @@ -585,8 +585,8 @@ - - + + @@ -598,8 +598,8 @@ - - + + @@ -611,7 +611,7 @@ - + @@ -626,7 +626,7 @@ - + @@ -638,8 +638,8 @@ - - + + diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc153/ajc153.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc153/ajc153.xml index 00bf094bc..21103699b 100644 --- a/tests/src/test/resources/org/aspectj/systemtest/ajc153/ajc153.xml +++ b/tests/src/test/resources/org/aspectj/systemtest/ajc153/ajc153.xml @@ -742,7 +742,7 @@ - + @@ -773,7 +773,7 @@ - + @@ -789,7 +789,7 @@ - + @@ -804,7 +804,7 @@ - + diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc154/ajc154.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc154/ajc154.xml index a0d38cb6c..4031ead6f 100644 --- a/tests/src/test/resources/org/aspectj/systemtest/ajc154/ajc154.xml +++ b/tests/src/test/resources/org/aspectj/systemtest/ajc154/ajc154.xml @@ -118,7 +118,7 @@ - + @@ -212,7 +212,7 @@ - + diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc1612/ajc1612.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc1612/ajc1612.xml index 650bdea43..11049dcf9 100644 --- a/tests/src/test/resources/org/aspectj/systemtest/ajc1612/ajc1612.xml +++ b/tests/src/test/resources/org/aspectj/systemtest/ajc1612/ajc1612.xml @@ -24,7 +24,7 @@ - + @@ -42,7 +42,7 @@ - + @@ -60,7 +60,7 @@ - + @@ -79,7 +79,7 @@ - + @@ -91,7 +91,7 @@ - + @@ -103,7 +103,7 @@ - + @@ -115,7 +115,7 @@ - + @@ -127,7 +127,7 @@ - + @@ -136,7 +136,7 @@ - + @@ -146,7 +146,7 @@ - + @@ -156,7 +156,7 @@ - + @@ -168,7 +168,7 @@ - + diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc162/ajc162.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc162/ajc162.xml index e45a21509..94725fab8 100644 --- a/tests/src/test/resources/org/aspectj/systemtest/ajc162/ajc162.xml +++ b/tests/src/test/resources/org/aspectj/systemtest/ajc162/ajc162.xml @@ -15,7 +15,7 @@ - + @@ -26,7 +26,7 @@ - + @@ -36,7 +36,7 @@ - + diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc164/ajc164.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc164/ajc164.xml index a14d8d0e7..53f705bda 100644 --- a/tests/src/test/resources/org/aspectj/systemtest/ajc164/ajc164.xml +++ b/tests/src/test/resources/org/aspectj/systemtest/ajc164/ajc164.xml @@ -56,7 +56,7 @@ - + diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc170/ajc170.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc170/ajc170.xml index f3f18f6d9..21fb5348c 100644 --- a/tests/src/test/resources/org/aspectj/systemtest/ajc170/ajc170.xml +++ b/tests/src/test/resources/org/aspectj/systemtest/ajc170/ajc170.xml @@ -134,7 +134,7 @@ - + @@ -147,7 +147,7 @@ - + diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc180/ajc180.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc180/ajc180.xml index 257f5972c..2f62c5169 100644 --- a/tests/src/test/resources/org/aspectj/systemtest/ajc180/ajc180.xml +++ b/tests/src/test/resources/org/aspectj/systemtest/ajc180/ajc180.xml @@ -5,19 +5,19 @@ - + - + - + @@ -25,7 +25,7 @@ - + diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc1810/ajc1810.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc1810/ajc1810.xml index 90fcbc1e7..3fe89bee5 100644 --- a/tests/src/test/resources/org/aspectj/systemtest/ajc1810/ajc1810.xml +++ b/tests/src/test/resources/org/aspectj/systemtest/ajc1810/ajc1810.xml @@ -5,7 +5,7 @@ - + -- cgit v1.2.3 From 63d5e3e893bd149245465de1610716930998dec8 Mon Sep 17 00:00:00 2001 From: Alexander Kriegisch Date: Wed, 23 Mar 2022 11:55:22 +0700 Subject: Fix more LTW tests Signed-off-by: Alexander Kriegisch --- .../src/test/java/org/aspectj/testing/RunSpec.java | 8 ++++-- .../org/aspectj/systemtest/ajc150/ltw/ltw.xml | 31 ++++++++++++++++++++-- .../org/aspectj/systemtest/ajc1612/ajc1612.xml | 2 +- 3 files changed, 36 insertions(+), 5 deletions(-) diff --git a/testing/src/test/java/org/aspectj/testing/RunSpec.java b/testing/src/test/java/org/aspectj/testing/RunSpec.java index d687ae86b..534ed6374 100644 --- a/testing/src/test/java/org/aspectj/testing/RunSpec.java +++ b/testing/src/test/java/org/aspectj/testing/RunSpec.java @@ -22,7 +22,7 @@ import java.util.StringTokenizer; import org.aspectj.tools.ajc.AjcTestCase; import org.aspectj.util.FileUtil; -import static org.aspectj.util.LangUtil.is16VMOrGreater; +import static org.aspectj.util.LangUtil.is9VMOrGreater; /** * @author Adrian Colyer @@ -70,7 +70,11 @@ public class RunSpec implements ITestStep { // On Java 16+, LTW no longer works without this parameter. Add the argument here and not in AjcTestCase::run, // because even if 'useLTW' and 'useFullLTW' are not set, we might in the future have tests for weaver attachment // during runtime. See also docs/dist/doc/README-187.html. - vmargs += is16VMOrGreater() ? " --add-opens java.base/java.lang=ALL-UNNAMED" : ""; + // + // The reason for setting this parameter for Java 9+ instead of 16+ is that it helps to avoid the JVM printing + // unwanted illegal access warnings during weaving in 'useFullLTW' mode, either making existing tests fail or + // having to assert on the warning messages. + vmargs += is9VMOrGreater() ? " --add-opens java.base/java.lang=ALL-UNNAMED" : ""; AjcTestCase.RunResult rr = inTestCase.run(getClassToRun(), getModuleToRun(), args, vmargs, getClasspath(), getModulepath(), useLtw, "true".equalsIgnoreCase(usefullltw)); diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc150/ltw/ltw.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc150/ltw/ltw.xml index 975b35cd8..6e66e388e 100644 --- a/tests/src/test/resources/org/aspectj/systemtest/ajc150/ltw/ltw.xml +++ b/tests/src/test/resources/org/aspectj/systemtest/ajc150/ltw/ltw.xml @@ -221,7 +221,7 @@ - + @@ -229,6 +229,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -244,7 +271,7 @@ text="this affected type is not exposed to the weaver: TestITDMethod" /> + ltw="aop-abstractaspect.xml" usefullltw="true"> diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc1612/ajc1612.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc1612/ajc1612.xml index 11049dcf9..aade93bf6 100644 --- a/tests/src/test/resources/org/aspectj/systemtest/ajc1612/ajc1612.xml +++ b/tests/src/test/resources/org/aspectj/systemtest/ajc1612/ajc1612.xml @@ -13,7 +13,7 @@ - + -- cgit v1.2.3 From 2d2110f364609d3002643947fc89a9dc10a7c97b Mon Sep 17 00:00:00 2001 From: Alexander Kriegisch Date: Wed, 23 Mar 2022 12:49:24 +0700 Subject: Introduce AjcTestCase.DEFAULT_FULL_LTW_CLASSPATH_ENTRIES In 'useFullLTW' mode, aspectjweaver.jar is a Java agent. Therefore, what is contained in there does not need to be on the classpath. Signed-off-by: Alexander Kriegisch --- .../test/java/org/aspectj/tools/ajc/AjcTestCase.java | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjcTestCase.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjcTestCase.java index 10b6d09dd..801318a16 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjcTestCase.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjcTestCase.java @@ -80,14 +80,21 @@ public abstract class AjcTestCase extends TestCase { .findFirst() .orElseThrow(() -> new RuntimeException("JUnit library not found on classpath")); - // see Ajc and AntSpec - public static final String DEFAULT_CLASSPATH_ENTRIES = - Ajc.outputFolders("bridge","util","loadtime","weaver","asm","testing-client","runtime","org.aspectj.matcher") + // In 'useFullLTW' mode, aspectjweaver.jar is a Java agent. Therefore, what is contained in there + // does not need to be on the classpath. + public static final String DEFAULT_FULL_LTW_CLASSPATH_ENTRIES = + Ajc.outputFolders("testing-client") + pathSeparator + CLASSPATH_JUNIT + + pathSeparator + ".." + separator + "lib" + separator + "test" + separator + "testing-client.jar" + ; + + // See Ajc and AntSpec + public static final String DEFAULT_CLASSPATH_ENTRIES = + DEFAULT_FULL_LTW_CLASSPATH_ENTRIES + + Ajc.outputFolders("bridge", "util", "loadtime", "weaver", "asm", "runtime", "org.aspectj.matcher") + pathSeparator + ".." + separator + "lib" + separator + "bcel" + separator + "bcel.jar" + pathSeparator + ".." + separator + "lib" + separator + "bcel" + separator + "bcel-verifier.jar" + pathSeparator + CLASSPATH_ASM - + pathSeparator + ".." + separator + "lib" + separator + "test" + separator + "testing-client.jar" // hmmm, this next one should perhaps point to an aj-build jar... + pathSeparator + ".." + separator + "lib" + separator + "test" + separator + "aspectjrt.jar" ; @@ -631,7 +638,7 @@ public abstract class AjcTestCase extends TestCase { File directory = new File ("."); String absPath = directory.getAbsolutePath(); String javaagent = absPath + separator + ".." + separator + "lib" + separator + "aspectj" + separator + "lib" + separator + "aspectjweaver.jar"; - String defaultCpAbsolute = Arrays.stream(DEFAULT_CLASSPATH_ENTRIES.split(pathSeparator)) + String defaultCpAbsolute = Arrays.stream(DEFAULT_FULL_LTW_CLASSPATH_ENTRIES.split(pathSeparator)) .map(path -> new File(path).getAbsolutePath()) .collect(Collectors.joining(pathSeparator)); try { -- cgit v1.2.3 From 2337e33ea1f3b0ab3610c62e7c426f27538ff53e Mon Sep 17 00:00:00 2001 From: Alexander Kriegisch Date: Wed, 23 Mar 2022 12:51:36 +0700 Subject: Make sure that program arguments are passed through in full LTW mode This fixes e.g. LTWTests.testDeclareAbstractAspect, which passes on names of ITD methods to the test program, which in turn executes those methods via reflection. Signed-off-by: Alexander Kriegisch --- .../java/org/aspectj/tools/ajc/AjcTestCase.java | 31 ++++++++++++---------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjcTestCase.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjcTestCase.java index 801318a16..e0533b008 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjcTestCase.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjcTestCase.java @@ -84,7 +84,7 @@ public abstract class AjcTestCase extends TestCase { // does not need to be on the classpath. public static final String DEFAULT_FULL_LTW_CLASSPATH_ENTRIES = Ajc.outputFolders("testing-client") - + pathSeparator + CLASSPATH_JUNIT + + pathSeparator + CLASSPATH_JUNIT + pathSeparator + ".." + separator + "lib" + separator + "test" + separator + "testing-client.jar" ; @@ -92,12 +92,12 @@ public abstract class AjcTestCase extends TestCase { public static final String DEFAULT_CLASSPATH_ENTRIES = DEFAULT_FULL_LTW_CLASSPATH_ENTRIES + Ajc.outputFolders("bridge", "util", "loadtime", "weaver", "asm", "runtime", "org.aspectj.matcher") - + pathSeparator + ".." + separator + "lib" + separator + "bcel" + separator + "bcel.jar" - + pathSeparator + ".." + separator + "lib" + separator + "bcel" + separator + "bcel-verifier.jar" - + pathSeparator + CLASSPATH_ASM - // hmmm, this next one should perhaps point to an aj-build jar... - + pathSeparator + ".." + separator + "lib" + separator + "test" + separator + "aspectjrt.jar" - ; + + pathSeparator + ".." + separator + "lib" + separator + "bcel" + separator + "bcel.jar" + + pathSeparator + ".." + separator + "lib" + separator + "bcel" + separator + "bcel-verifier.jar" + + pathSeparator + CLASSPATH_ASM + // hmmm, this next one should perhaps point to an aj-build jar... + + pathSeparator + ".." + separator + "lib" + separator + "test" + separator + "aspectjrt.jar" + ; /* * Save reference to real stderr and stdout before starting redirection @@ -587,11 +587,11 @@ public abstract class AjcTestCase extends TestCase { */ public RunResult run(String className, String moduleName, String[] args, String vmargs, final String classpath, String modulepath, boolean useLTW, boolean useFullLTW) { - if (args != null) { - for (int i = 0; i < args.length; i++) { - args[i] = substituteSandbox(args[i]); - } - } + if (args == null) + args = new String[0]; + for (int i = 0; i < args.length; i++) + args[i] = substituteSandbox(args[i]); + lastRunResult = null; StringBuilder cp = new StringBuilder(); if (classpath != null) { @@ -642,8 +642,11 @@ public abstract class AjcTestCase extends TestCase { .map(path -> new File(path).getAbsolutePath()) .collect(Collectors.joining(pathSeparator)); try { - String command = "java " + vmargs + " -classpath " + cp + pathSeparator + defaultCpAbsolute + " -javaagent:" + javaagent + " " + className; - + String command = + "java " + vmargs + + " -classpath " + cp + pathSeparator + defaultCpAbsolute + + " -javaagent:" + javaagent + " " + + className + " " + String.join(" ", args); // 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())); -- cgit v1.2.3 From f75b7deda8aea78e78335387dde42ba9b5938201 Mon Sep 17 00:00:00 2001 From: Alexander Kriegisch Date: Wed, 23 Mar 2022 12:53:17 +0700 Subject: Add TODO to maven.yml for switch to JDK 18 final TODO: switch from 18-ea to 18, as soon as Temurin offers the download on https://adoptium.net/releases.html. Signed-off-by: Alexander Kriegisch --- .github/workflows/maven.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 3e2564c77..0a013bf15 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -19,6 +19,7 @@ jobs: strategy: fail-fast: false matrix: + # TODO: switch from 18-ea to 18, as soon as Temurin offers the download on https://adoptium.net/releases.html java: [ 11, 17, 18-ea ] runs-on: ubuntu-latest -- cgit v1.2.3 From 8ba1445b28ad396c34633aebd334e5259f815a55 Mon Sep 17 00:00:00 2001 From: Alexander Kriegisch Date: Wed, 23 Mar 2022 15:51:42 +0700 Subject: Move GH-128 tests from 1.9.8 to 1.9.9 bugs test suite after merge Signed-off-by: Alexander Kriegisch --- tests/bugs198/github_128/Application.java | 42 --- tests/bugs198/github_128/MarkerA.java | 9 - tests/bugs198/github_128/MarkerB.java | 9 - .../github_128/annotation_syntax/MarkerAAspect.aj | 21 -- .../github_128/annotation_syntax/MarkerBAspect.aj | 37 --- .../github_128/native_syntax/MarkerAAspect.aj | 15 - .../github_128/native_syntax/MarkerBAspect.aj | 27 -- tests/bugs199/github_128/Application.java | 42 +++ tests/bugs199/github_128/MarkerA.java | 9 + tests/bugs199/github_128/MarkerB.java | 9 + .../github_128/annotation_syntax/MarkerAAspect.aj | 21 ++ .../github_128/annotation_syntax/MarkerBAspect.aj | 37 +++ .../github_128/native_syntax/MarkerAAspect.aj | 15 + .../github_128/native_syntax/MarkerBAspect.aj | 27 ++ .../aspectj/systemtest/ajc198/Bugs198Tests.java | 17 -- .../aspectj/systemtest/ajc199/Bugs199Tests.java | 17 ++ .../org/aspectj/systemtest/ajc198/ajc198.xml | 316 --------------------- .../org/aspectj/systemtest/ajc199/ajc199.xml | 316 +++++++++++++++++++++ 18 files changed, 493 insertions(+), 493 deletions(-) delete mode 100644 tests/bugs198/github_128/Application.java delete mode 100644 tests/bugs198/github_128/MarkerA.java delete mode 100644 tests/bugs198/github_128/MarkerB.java delete mode 100644 tests/bugs198/github_128/annotation_syntax/MarkerAAspect.aj delete mode 100644 tests/bugs198/github_128/annotation_syntax/MarkerBAspect.aj delete mode 100644 tests/bugs198/github_128/native_syntax/MarkerAAspect.aj delete mode 100644 tests/bugs198/github_128/native_syntax/MarkerBAspect.aj create mode 100644 tests/bugs199/github_128/Application.java create mode 100644 tests/bugs199/github_128/MarkerA.java create mode 100644 tests/bugs199/github_128/MarkerB.java create mode 100644 tests/bugs199/github_128/annotation_syntax/MarkerAAspect.aj create mode 100644 tests/bugs199/github_128/annotation_syntax/MarkerBAspect.aj create mode 100644 tests/bugs199/github_128/native_syntax/MarkerAAspect.aj create mode 100644 tests/bugs199/github_128/native_syntax/MarkerBAspect.aj diff --git a/tests/bugs198/github_128/Application.java b/tests/bugs198/github_128/Application.java deleted file mode 100644 index 9a4a7312f..000000000 --- a/tests/bugs198/github_128/Application.java +++ /dev/null @@ -1,42 +0,0 @@ -import java.util.concurrent.ExecutionException; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.Future; - -public class Application { - static int proceedTimesOuter; - static int proceedTimesInner; - static boolean useThreadPool = false; - static ExecutorService executorService = Executors.newFixedThreadPool(2); - - @MarkerA - @MarkerB - public void doSomething() { - System.out.println(" Doing something"); - } - - public static void main(String[] args) throws ExecutionException, InterruptedException { - proceedTimesOuter = Integer.parseInt(args[0]); - proceedTimesInner = Integer.parseInt(args[1]); - useThreadPool = args.length > 2 && args[2].trim().equalsIgnoreCase("true"); - if (useThreadPool) - prepopulateFixedThreadPool(); - - new Application().doSomething(); - Thread.sleep(500); - } - - private static void prepopulateFixedThreadPool() throws InterruptedException, ExecutionException { - Future future1 = executorService.submit(() -> { - try { Thread.sleep(250); } - catch (InterruptedException e) { e.printStackTrace(); } - }); - Future future2 = executorService.submit(() -> { - try { Thread.sleep(250); } - catch (InterruptedException e) { e.printStackTrace(); } - }); - future1.get(); - future2.get(); - } - -} diff --git a/tests/bugs198/github_128/MarkerA.java b/tests/bugs198/github_128/MarkerA.java deleted file mode 100644 index 89e60978c..000000000 --- a/tests/bugs198/github_128/MarkerA.java +++ /dev/null @@ -1,9 +0,0 @@ -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -@Retention(RUNTIME) -@Target(METHOD) -public @interface MarkerA {} diff --git a/tests/bugs198/github_128/MarkerB.java b/tests/bugs198/github_128/MarkerB.java deleted file mode 100644 index 6f6aa3dd0..000000000 --- a/tests/bugs198/github_128/MarkerB.java +++ /dev/null @@ -1,9 +0,0 @@ -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -@Retention(RUNTIME) -@Target(METHOD) -public @interface MarkerB {} diff --git a/tests/bugs198/github_128/annotation_syntax/MarkerAAspect.aj b/tests/bugs198/github_128/annotation_syntax/MarkerAAspect.aj deleted file mode 100644 index d090ed9ea..000000000 --- a/tests/bugs198/github_128/annotation_syntax/MarkerAAspect.aj +++ /dev/null @@ -1,21 +0,0 @@ -import org.aspectj.lang.ProceedingJoinPoint; -import org.aspectj.lang.annotation.Around; -import org.aspectj.lang.annotation.Aspect; -import org.aspectj.lang.annotation.DeclarePrecedence; - -@Aspect -@DeclarePrecedence("MarkerAAspect, MarkerBAspect") -public class MarkerAAspect { - @Around("@annotation(MarkerA) && execution(* *(..))") - public Object intercept(ProceedingJoinPoint thisJoinPoint) throws Throwable { - System.out.println(">> Outer intercept"); - Object result = null; - for (int i = 0; i < Application.proceedTimesOuter; i++) { - System.out.println(" >> Outer proceed"); - result = thisJoinPoint.proceed(); - System.out.println(" << Outer proceed"); - } - System.out.println("<< Outer intercept"); - return result; - } -} diff --git a/tests/bugs198/github_128/annotation_syntax/MarkerBAspect.aj b/tests/bugs198/github_128/annotation_syntax/MarkerBAspect.aj deleted file mode 100644 index d5548f9da..000000000 --- a/tests/bugs198/github_128/annotation_syntax/MarkerBAspect.aj +++ /dev/null @@ -1,37 +0,0 @@ -import org.aspectj.lang.ProceedingJoinPoint; -import org.aspectj.lang.annotation.Around; -import org.aspectj.lang.annotation.Aspect; - -import java.util.concurrent.ExecutionException; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; - -@Aspect -public class MarkerBAspect { - @Around("@annotation(MarkerB) && execution(* *(..))") - public Object intercept(ProceedingJoinPoint thisJoinPoint) throws Throwable { - Runnable runnable = new Runnable() { - @Override - public void run() { - try { - for (int i = 0; i < Application.proceedTimesInner; i++) { - System.out.println(" >> Inner proceed"); - thisJoinPoint.proceed(); - System.out.println(" << Inner proceed"); - } - } - catch (Throwable throwable) { - throwable.printStackTrace(System.out); - } - } - }; - - System.out.println(" >> Inner intercept"); - if (Application.useThreadPool) - Application.executorService.submit(runnable); - else - new Thread(runnable).start(); - System.out.println(" << Inner intercept"); - return null; - } -} diff --git a/tests/bugs198/github_128/native_syntax/MarkerAAspect.aj b/tests/bugs198/github_128/native_syntax/MarkerAAspect.aj deleted file mode 100644 index 5e2ac5424..000000000 --- a/tests/bugs198/github_128/native_syntax/MarkerAAspect.aj +++ /dev/null @@ -1,15 +0,0 @@ -public aspect MarkerAAspect { - declare precedence : MarkerAAspect, MarkerBAspect; - - Object around() : @annotation(MarkerA) && execution(* *(..)) { - System.out.println(">> Outer intercept"); - Object result = null; - for (int i = 0; i < Application.proceedTimesOuter; i++) { - System.out.println(" >> Outer proceed"); - result = proceed(); - System.out.println(" << Outer proceed"); - } - System.out.println("<< Outer intercept"); - return result; - } -} diff --git a/tests/bugs198/github_128/native_syntax/MarkerBAspect.aj b/tests/bugs198/github_128/native_syntax/MarkerBAspect.aj deleted file mode 100644 index 52e95d1eb..000000000 --- a/tests/bugs198/github_128/native_syntax/MarkerBAspect.aj +++ /dev/null @@ -1,27 +0,0 @@ -public aspect MarkerBAspect { - Object around() : @annotation(MarkerB) && execution(* *(..)) { - Runnable runnable = new Runnable() { - @Override - public void run() { - try { - for (int i = 0; i < Application.proceedTimesInner; i++) { - System.out.println(" >> Inner proceed"); - proceed(); - System.out.println(" << Inner proceed"); - } - } - catch (Throwable throwable) { - throwable.printStackTrace(System.out); - } - } - }; - - System.out.println(" >> Inner intercept"); - if (Application.useThreadPool) - Application.executorService.submit(runnable); - else - new Thread(runnable).start(); - System.out.println(" << Inner intercept"); - return null; - } -} diff --git a/tests/bugs199/github_128/Application.java b/tests/bugs199/github_128/Application.java new file mode 100644 index 000000000..9a4a7312f --- /dev/null +++ b/tests/bugs199/github_128/Application.java @@ -0,0 +1,42 @@ +import java.util.concurrent.ExecutionException; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; + +public class Application { + static int proceedTimesOuter; + static int proceedTimesInner; + static boolean useThreadPool = false; + static ExecutorService executorService = Executors.newFixedThreadPool(2); + + @MarkerA + @MarkerB + public void doSomething() { + System.out.println(" Doing something"); + } + + public static void main(String[] args) throws ExecutionException, InterruptedException { + proceedTimesOuter = Integer.parseInt(args[0]); + proceedTimesInner = Integer.parseInt(args[1]); + useThreadPool = args.length > 2 && args[2].trim().equalsIgnoreCase("true"); + if (useThreadPool) + prepopulateFixedThreadPool(); + + new Application().doSomething(); + Thread.sleep(500); + } + + private static void prepopulateFixedThreadPool() throws InterruptedException, ExecutionException { + Future future1 = executorService.submit(() -> { + try { Thread.sleep(250); } + catch (InterruptedException e) { e.printStackTrace(); } + }); + Future future2 = executorService.submit(() -> { + try { Thread.sleep(250); } + catch (InterruptedException e) { e.printStackTrace(); } + }); + future1.get(); + future2.get(); + } + +} diff --git a/tests/bugs199/github_128/MarkerA.java b/tests/bugs199/github_128/MarkerA.java new file mode 100644 index 000000000..89e60978c --- /dev/null +++ b/tests/bugs199/github_128/MarkerA.java @@ -0,0 +1,9 @@ +import static java.lang.annotation.ElementType.METHOD; +import static java.lang.annotation.RetentionPolicy.RUNTIME; + +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +@Retention(RUNTIME) +@Target(METHOD) +public @interface MarkerA {} diff --git a/tests/bugs199/github_128/MarkerB.java b/tests/bugs199/github_128/MarkerB.java new file mode 100644 index 000000000..6f6aa3dd0 --- /dev/null +++ b/tests/bugs199/github_128/MarkerB.java @@ -0,0 +1,9 @@ +import static java.lang.annotation.ElementType.METHOD; +import static java.lang.annotation.RetentionPolicy.RUNTIME; + +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +@Retention(RUNTIME) +@Target(METHOD) +public @interface MarkerB {} diff --git a/tests/bugs199/github_128/annotation_syntax/MarkerAAspect.aj b/tests/bugs199/github_128/annotation_syntax/MarkerAAspect.aj new file mode 100644 index 000000000..d090ed9ea --- /dev/null +++ b/tests/bugs199/github_128/annotation_syntax/MarkerAAspect.aj @@ -0,0 +1,21 @@ +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.DeclarePrecedence; + +@Aspect +@DeclarePrecedence("MarkerAAspect, MarkerBAspect") +public class MarkerAAspect { + @Around("@annotation(MarkerA) && execution(* *(..))") + public Object intercept(ProceedingJoinPoint thisJoinPoint) throws Throwable { + System.out.println(">> Outer intercept"); + Object result = null; + for (int i = 0; i < Application.proceedTimesOuter; i++) { + System.out.println(" >> Outer proceed"); + result = thisJoinPoint.proceed(); + System.out.println(" << Outer proceed"); + } + System.out.println("<< Outer intercept"); + return result; + } +} diff --git a/tests/bugs199/github_128/annotation_syntax/MarkerBAspect.aj b/tests/bugs199/github_128/annotation_syntax/MarkerBAspect.aj new file mode 100644 index 000000000..d5548f9da --- /dev/null +++ b/tests/bugs199/github_128/annotation_syntax/MarkerBAspect.aj @@ -0,0 +1,37 @@ +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; + +import java.util.concurrent.ExecutionException; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; + +@Aspect +public class MarkerBAspect { + @Around("@annotation(MarkerB) && execution(* *(..))") + public Object intercept(ProceedingJoinPoint thisJoinPoint) throws Throwable { + Runnable runnable = new Runnable() { + @Override + public void run() { + try { + for (int i = 0; i < Application.proceedTimesInner; i++) { + System.out.println(" >> Inner proceed"); + thisJoinPoint.proceed(); + System.out.println(" << Inner proceed"); + } + } + catch (Throwable throwable) { + throwable.printStackTrace(System.out); + } + } + }; + + System.out.println(" >> Inner intercept"); + if (Application.useThreadPool) + Application.executorService.submit(runnable); + else + new Thread(runnable).start(); + System.out.println(" << Inner intercept"); + return null; + } +} diff --git a/tests/bugs199/github_128/native_syntax/MarkerAAspect.aj b/tests/bugs199/github_128/native_syntax/MarkerAAspect.aj new file mode 100644 index 000000000..5e2ac5424 --- /dev/null +++ b/tests/bugs199/github_128/native_syntax/MarkerAAspect.aj @@ -0,0 +1,15 @@ +public aspect MarkerAAspect { + declare precedence : MarkerAAspect, MarkerBAspect; + + Object around() : @annotation(MarkerA) && execution(* *(..)) { + System.out.println(">> Outer intercept"); + Object result = null; + for (int i = 0; i < Application.proceedTimesOuter; i++) { + System.out.println(" >> Outer proceed"); + result = proceed(); + System.out.println(" << Outer proceed"); + } + System.out.println("<< Outer intercept"); + return result; + } +} diff --git a/tests/bugs199/github_128/native_syntax/MarkerBAspect.aj b/tests/bugs199/github_128/native_syntax/MarkerBAspect.aj new file mode 100644 index 000000000..52e95d1eb --- /dev/null +++ b/tests/bugs199/github_128/native_syntax/MarkerBAspect.aj @@ -0,0 +1,27 @@ +public aspect MarkerBAspect { + Object around() : @annotation(MarkerB) && execution(* *(..)) { + Runnable runnable = new Runnable() { + @Override + public void run() { + try { + for (int i = 0; i < Application.proceedTimesInner; i++) { + System.out.println(" >> Inner proceed"); + proceed(); + System.out.println(" << Inner proceed"); + } + } + catch (Throwable throwable) { + throwable.printStackTrace(System.out); + } + } + }; + + System.out.println(" >> Inner intercept"); + if (Application.useThreadPool) + Application.executorService.submit(runnable); + else + new Thread(runnable).start(); + System.out.println(" << Inner intercept"); + return null; + } +} diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc198/Bugs198Tests.java b/tests/src/test/java/org/aspectj/systemtest/ajc198/Bugs198Tests.java index 8453bc163..cb3b781bb 100644 --- a/tests/src/test/java/org/aspectj/systemtest/ajc198/Bugs198Tests.java +++ b/tests/src/test/java/org/aspectj/systemtest/ajc198/Bugs198Tests.java @@ -21,23 +21,6 @@ public class Bugs198Tests extends XMLBasedAjcTestCase { runTest("ITD annotation with mandatory parameter via aspectpath"); } - public void testAsyncProceedNestedAroundAdvice_gh128() { - runTest("asynchronous proceed for nested around-advice (@AspectJ)"); - } - - public void testAsyncProceedNestedAroundAdviceThreadPool_gh128() { - // TODO: future improvement, see https://github.com/eclipse/org.aspectj/issues/141 - // runTest("asynchronous proceed for nested around-advice (@AspectJ, thread pool)"); - } - - public void testAsyncProceedNestedAroundAdviceNative_gh128() { - runTest("asynchronous proceed for nested around-advice (native)"); - } - - public void testAsyncProceedNestedAroundAdviceNativeThreadPool_gh128() { - runTest("asynchronous proceed for nested around-advice (native, thread pool)"); - } - public static Test suite() { return XMLBasedAjcTestCase.loadSuite(Bugs198Tests.class); } diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc199/Bugs199Tests.java b/tests/src/test/java/org/aspectj/systemtest/ajc199/Bugs199Tests.java index f72f3c44c..d8939593b 100644 --- a/tests/src/test/java/org/aspectj/systemtest/ajc199/Bugs199Tests.java +++ b/tests/src/test/java/org/aspectj/systemtest/ajc199/Bugs199Tests.java @@ -44,6 +44,23 @@ public class Bugs199Tests extends XMLBasedAjcTestCase { } } + public void testAsyncProceedNestedAroundAdvice_gh128() { + runTest("asynchronous proceed for nested around-advice (@AspectJ)"); + } + + public void testAsyncProceedNestedAroundAdviceThreadPool_gh128() { + // TODO: future improvement, see https://github.com/eclipse/org.aspectj/issues/141 + // runTest("asynchronous proceed for nested around-advice (@AspectJ, thread pool)"); + } + + public void testAsyncProceedNestedAroundAdviceNative_gh128() { + runTest("asynchronous proceed for nested around-advice (native)"); + } + + public void testAsyncProceedNestedAroundAdviceNativeThreadPool_gh128() { + runTest("asynchronous proceed for nested around-advice (native, thread pool)"); + } + public static Test suite() { return XMLBasedAjcTestCase.loadSuite(Bugs199Tests.class); } diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc198/ajc198.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc198/ajc198.xml index 6f2a34274..85bd872b3 100644 --- a/tests/src/test/resources/org/aspectj/systemtest/ajc198/ajc198.xml +++ b/tests/src/test/resources/org/aspectj/systemtest/ajc198/ajc198.xml @@ -100,320 +100,4 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc199/ajc199.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc199/ajc199.xml index f76858a3b..f0510e79a 100644 --- a/tests/src/test/resources/org/aspectj/systemtest/ajc199/ajc199.xml +++ b/tests/src/test/resources/org/aspectj/systemtest/ajc199/ajc199.xml @@ -174,4 +174,320 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3 From 6403cc20326190dbc9646b0f9b1819f1bb47fc39 Mon Sep 17 00:00:00 2001 From: Alexander Kriegisch Date: Wed, 23 Mar 2022 15:52:26 +0700 Subject: Rename testGitHub_125 to testCompilerCanReopenClosedJARs_gh125 Signed-off-by: Alexander Kriegisch --- tests/src/test/java/org/aspectj/systemtest/ajc199/Bugs199Tests.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc199/Bugs199Tests.java b/tests/src/test/java/org/aspectj/systemtest/ajc199/Bugs199Tests.java index d8939593b..b83448935 100644 --- a/tests/src/test/java/org/aspectj/systemtest/ajc199/Bugs199Tests.java +++ b/tests/src/test/java/org/aspectj/systemtest/ajc199/Bugs199Tests.java @@ -37,7 +37,7 @@ public class Bugs199Tests extends XMLBasedAjcTestCase { runTest("annotation style negated if"); } - public void testGitHub_125() { + public void testCompilerCanReopenClosedJARs_gh125() { try (PropertyEnvironment env = ScopedSystemProperties.newPropertyEnvironment()) { env.setProperty("org.aspectj.weaver.openarchives", "20"); runTest("compiler can re-open closed JARs"); -- cgit v1.2.3 From 50190a1918e66769e0037542054645add1ff8204 Mon Sep 17 00:00:00 2001 From: Alexander Kriegisch Date: Thu, 24 Mar 2022 15:16:29 +0700 Subject: Upgrade to latest JDT Core Java 18 changes, activate J18 preview tests Signed-off-by: Alexander Kriegisch --- .../compiler/batch/messages_aspectj.properties | 2 +- .../java18/SwitchPatternPreview2Aspect.aj | 30 ++++--- .../java18/SwitchPatternPreview2Error.java | 31 ------- .../java18/SwitchPatternPreview2Error1.java | 13 +++ .../java18/SwitchPatternPreview2Error2.java | 21 +++++ .../java18/SwitchPatternPreview2OK.java | 95 +++++++++++++++++++--- .../ajc199/Java18PreviewFeaturesTests.java | 20 ++--- .../org/aspectj/systemtest/ajc199/ajc199.xml | 33 +++++++- 8 files changed, 171 insertions(+), 74 deletions(-) delete mode 100644 tests/features199/java18/SwitchPatternPreview2Error.java create mode 100644 tests/features199/java18/SwitchPatternPreview2Error1.java create mode 100644 tests/features199/java18/SwitchPatternPreview2Error2.java diff --git a/org.aspectj.ajdt.core/src/main/resources/org/aspectj/org/eclipse/jdt/internal/compiler/batch/messages_aspectj.properties b/org.aspectj.ajdt.core/src/main/resources/org/aspectj/org/eclipse/jdt/internal/compiler/batch/messages_aspectj.properties index 153469df0..23bd98c02 100644 --- a/org.aspectj.ajdt.core/src/main/resources/org/aspectj/org/eclipse/jdt/internal/compiler/batch/messages_aspectj.properties +++ b/org.aspectj.ajdt.core/src/main/resources/org/aspectj/org/eclipse/jdt/internal/compiler/batch/messages_aspectj.properties @@ -1,5 +1,5 @@ compiler.name = AspectJ Compiler -compiler.version = Eclipse Compiler a721c849b3f9d5 (18Mar2022) - Java18 +compiler.version = Eclipse Compiler d3a80f1f9b2f8a (21Mar2022) - Java18 compiler.copyright = misc.version = {0} {1} - {2} {3} diff --git a/tests/features199/java18/SwitchPatternPreview2Aspect.aj b/tests/features199/java18/SwitchPatternPreview2Aspect.aj index ee5dbbd68..4170b4d15 100644 --- a/tests/features199/java18/SwitchPatternPreview2Aspect.aj +++ b/tests/features199/java18/SwitchPatternPreview2Aspect.aj @@ -1,28 +1,26 @@ -import java.util.Locale; - aspect SwitchPatternPreview2Aspect { - Object around(Object o): execution(* doSomethingWithObject(*)) && args(o) { + Object around(Integer i): execution(* doSomethingWithInteger(*)) && args(i) { System.out.println( - switch (o) { - case -1, 1 -> "special case:" + o; - case Integer i && i > 0 -> "positive integer: " + o; - case Integer i -> "other integer: " + o; - default -> "non-integer: " + o; + switch (i) { + case null -> "value unavailable: " + i; + case -1, 1 -> "absolute value 1: " + i; + case Integer value && value > 0 -> "positive integer: " + i; + default -> "other integer: " + i; } ); - return proceed(o); + return proceed(i); } } class Application { public static void main(String[] args) { - doSomethingWithObject(-1); - doSomethingWithObject(0); - doSomethingWithObject(42); - doSomethingWithObject(-99); - doSomethingWithObject("test"); - doSomethingWithObject(null); + doSomethingWithInteger(-1); + doSomethingWithInteger(0); + doSomethingWithInteger(42); + doSomethingWithInteger(-99); + doSomethingWithInteger(Integer.valueOf(123)); + doSomethingWithInteger(null); } - public static Object doSomethingWithObject(Object o) { return o; } + public static Object doSomethingWithInteger(Integer o) { return o; } } diff --git a/tests/features199/java18/SwitchPatternPreview2Error.java b/tests/features199/java18/SwitchPatternPreview2Error.java deleted file mode 100644 index b1652aad3..000000000 --- a/tests/features199/java18/SwitchPatternPreview2Error.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Inspired by examples in https://openjdk.java.net/jeps/420 - */ -public class SwitchPatternPreview2Error { - static void constantLabelMustAppearBeforePattern1(Object o) { - switch (o) { - case Integer i && i > 0 -> System.out.println("positive integer: " + o); - case -1, 1 -> System.out.println("special case:" + o); - case Integer i -> System.out.println("other integer: " + o); - default -> System.out.println("non-integer: " + o); - } - } - - static void constantLabelMustAppearBeforePattern2(Object o) { - switch (o) { - case -1, 1 -> System.out.println("special case:" + o); - case Integer i -> System.out.println("other integer: " + o); - case Integer i && i > 0 -> System.out.println("positive integer: " + o); - default -> System.out.println("non-integer: " + o); - } - } - - static void constantLabelMustAppearBeforePattern3(Object o) { - switch (o) { - case Integer i && i > 0 -> System.out.println("positive integer: " + o); - case Integer i -> System.out.println("other integer: " + o); - case -1, 1 -> System.out.println("special case:" + o); - default -> System.out.println("non-integer: " + o); - } - } -} diff --git a/tests/features199/java18/SwitchPatternPreview2Error1.java b/tests/features199/java18/SwitchPatternPreview2Error1.java new file mode 100644 index 000000000..342b848aa --- /dev/null +++ b/tests/features199/java18/SwitchPatternPreview2Error1.java @@ -0,0 +1,13 @@ +/** + * Inspired by examples in https://openjdk.java.net/jeps/420 + */ +public class SwitchPatternPreview2Error1 { + static void constantLabelsMustAppearBeforePatterns1(Integer i) { + switch (i) { + case null -> System.out.println("value unavailable: " + i); + case Integer value && value > 0 -> System.out.println("positive integer: " + i); + case -1, 1 -> System.out.println("absolute value 1: " + i); + default -> System.out.println("other integer: " + i); + } + } +} diff --git a/tests/features199/java18/SwitchPatternPreview2Error2.java b/tests/features199/java18/SwitchPatternPreview2Error2.java new file mode 100644 index 000000000..3cee435e0 --- /dev/null +++ b/tests/features199/java18/SwitchPatternPreview2Error2.java @@ -0,0 +1,21 @@ +/** + * Inspired by examples in https://openjdk.java.net/jeps/420 + */ +public class SwitchPatternPreview2Error2 { + static void constantLabelsMustAppearBeforePatterns2(Object o) { + switch (o) { + case null -> System.out.println("value unavailable: " + o); + // This seems to be a bug in JEP 420 implementation. Those constants should be compatible with 'Object'. + // case -1, 1 -> System.out.println("absolute value 1: " + o); + // case "hello" -> System.out.println("string value: " + o); + + // 'Integer value' dominates the next two, more specific ones -> error + case Integer value -> System.out.println("other integer: " + o); + case Integer value && (value == 1 || value == -1) -> System.out.println("absolute value 1: " + o); + case Integer value && value > 0 -> System.out.println("positive integer: " + o); + + case String value && value.startsWith("hello") -> System.out.println("greeting: " + o); + default -> System.out.println("other type: " + o); + } + } +} diff --git a/tests/features199/java18/SwitchPatternPreview2OK.java b/tests/features199/java18/SwitchPatternPreview2OK.java index 859583b6d..b36b26bf2 100644 --- a/tests/features199/java18/SwitchPatternPreview2OK.java +++ b/tests/features199/java18/SwitchPatternPreview2OK.java @@ -1,30 +1,104 @@ -import java.util.List; - /** * Inspired by examples in https://openjdk.java.net/jeps/420 */ public class SwitchPatternPreview2OK { public static void main(String[] args) { - constantLabelMustAppearBeforePattern(-1); - constantLabelMustAppearBeforePattern(0); - constantLabelMustAppearBeforePattern(42); - constantLabelMustAppearBeforePattern(-99); - constantLabelMustAppearBeforePattern(Integer.valueOf(123)); - constantLabelMustAppearBeforePattern(null); +// constantLabelMustAppearBeforePattern(-1); +// constantLabelMustAppearBeforePattern(0); +// constantLabelMustAppearBeforePattern(42); +// constantLabelMustAppearBeforePattern(-99); +// constantLabelMustAppearBeforePattern(Integer.valueOf(123)); +// constantLabelMustAppearBeforePattern(null); + + constantLabelMustAppearBeforePatternInteger(-1); + constantLabelMustAppearBeforePatternInteger(0); + constantLabelMustAppearBeforePatternInteger(42); + constantLabelMustAppearBeforePatternInteger(-99); + constantLabelMustAppearBeforePatternInteger(Integer.valueOf(123)); + constantLabelMustAppearBeforePatternInteger(null); - System.out.println(testGenericSealedExhaustive(new B())); +// System.out.println(testGenericSealedExhaustive(new B())); } + /** + * According to an example from JEP 420, this should work, but it does not, neither with Javac nor ECJ. + * + * See: + * https://openjdk.java.net/jeps/420#1b--Dominance-of-pattern-labels + * https://bugs.openjdk.java.net/browse/JDK-8273326 + * https://bugs.eclipse.org/bugs/show_bug.cgi?id=579355 + * + * TODO: reactivate when implemented or move to preview 3 with Java 19, Eclipse 4.24. + */ + /* static String constantLabelMustAppearBeforePattern(Object o) { switch (o) { + case null -> System.out.println("value unavailable: " + i); case -1, 1 -> System.out.println("special case:" + o); case Integer i && i > 0 -> System.out.println("positive integer: " + o); case Integer i -> System.out.println("other integer: " + o); default -> System.out.println("non-integer: " + o); } - return o.toString(); + return i == null ? "null" : i.toString(); + } + */ + + static String constantLabelMustAppearBeforePatternInteger(Integer i) { + switch (i) { + case null -> System.out.println("value unavailable: " + i); + case -1, 1 -> System.out.println("absolute value 1: " + i); + case Integer value && value > 0 -> System.out.println("positive integer: " + i); + default -> System.out.println("other integer: " + i); + } + return i == null ? "null" : i.toString(); + } + + static void nullCanAppearAfterConstantLabel(Integer i) { + switch (i) { + case -1, 1 -> System.out.println("absolute value 1: " + i); + case null -> System.out.println("value unavailable: " + i); + case Integer value && value > 0 -> System.out.println("positive integer: " + i); + default -> System.out.println("other integer: " + i); + } + } + + static void defaultCanAppearBeforePattern(Integer i) { + switch (i) { + case null -> System.out.println("value unavailable: " + i); + case -1, 1 -> System.out.println("absolute value 1: " + i); + default -> System.out.println("other integer: " + i); + case Integer value && value > 0 -> System.out.println("positive integer: " + i); + } + } + + static void defaultCanAppearBeforeNull(Integer i) { + switch (i) { + case -1, 1 -> System.out.println("absolute value 1: " + i); + default -> System.out.println("other integer: " + i); + case null -> System.out.println("value unavailable: " + i); + case Integer value && value > 0 -> System.out.println("positive integer: " + i); + } + } + + static void defaultCanAppearBeforeConstantLabel(Integer i) { + switch (i) { + case null -> System.out.println("value unavailable: " + i); + default -> System.out.println("other integer: " + i); + case -1, 1 -> System.out.println("absolute value 1: " + i); + case Integer value && value > 0 -> System.out.println("positive integer: " + i); + } } + /** + * According to an example from JEP 420, this should work, and it does with Javac, but not with ECJ. + * + * See: + * https://openjdk.java.net/jeps/420#2--Exhaustiveness-of-switch-expressions-and-statements + * https://bugs.eclipse.org/bugs/show_bug.cgi?id=579360 + * + * TODO: reactivate when implemented or move to preview 3 with Java 19, Eclipse 4.24. + */ + /* sealed interface I permits A, B {} final static class A implements I {} final static class B implements I {} @@ -35,4 +109,5 @@ public class SwitchPatternPreview2OK { case B bi -> 42; }; } + */ } diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc199/Java18PreviewFeaturesTests.java b/tests/src/test/java/org/aspectj/systemtest/ajc199/Java18PreviewFeaturesTests.java index 8d586b440..dbe6f733a 100644 --- a/tests/src/test/java/org/aspectj/systemtest/ajc199/Java18PreviewFeaturesTests.java +++ b/tests/src/test/java/org/aspectj/systemtest/ajc199/Java18PreviewFeaturesTests.java @@ -34,28 +34,24 @@ public class Java18PreviewFeaturesTests extends XMLBasedAjcTestCaseForJava18Only checkVersion("S", Constants.MAJOR_18, Constants.PREVIEW_MINOR_VERSION); } - // TODO: - // JDT Core does not seem to have implemented JEP 420 yet, - // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=576746. - // Therefore, deactivate the special tests for now. -/* - public void testSwitchPatternMatchingPreview2Error() { - runTest("switch pattern matching preview 2 error"); + public void testSwitchPatternMatchingPreview2Error1() { + runTest("switch pattern matching preview 2 error 1"); + } + + public void testSwitchPatternMatchingPreview2Error2() { + runTest("switch pattern matching preview 2 error 2"); } public void testSwitchPatternMatchingPreview2Java() { runTest("switch pattern matching preview 2 java"); - checkVersion("SwitchPatternOK", Constants.MAJOR_18, Constants.PREVIEW_MINOR_VERSION); + checkVersion("SwitchPatternPreview2OK", Constants.MAJOR_18, Constants.PREVIEW_MINOR_VERSION); } public void testSwitchPatternMatchingPreview2Aspect() { runTest("switch pattern matching preview 2 aspect"); - checkVersion("SwitchPatternAspect", Constants.MAJOR_18, Constants.PREVIEW_MINOR_VERSION); + checkVersion("SwitchPatternPreview2Aspect", Constants.MAJOR_18, Constants.PREVIEW_MINOR_VERSION); checkVersion("Application", Constants.MAJOR_18, Constants.PREVIEW_MINOR_VERSION); - checkVersion("Shape", Constants.MAJOR_18, Constants.PREVIEW_MINOR_VERSION); - checkVersion("S", Constants.MAJOR_18, Constants.PREVIEW_MINOR_VERSION); } -*/ public static Test suite() { return XMLBasedAjcTestCase.loadSuite(Java18PreviewFeaturesTests.class); diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc199/ajc199.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc199/ajc199.xml index f0510e79a..7baeea086 100644 --- a/tests/src/test/resources/org/aspectj/systemtest/ajc199/ajc199.xml +++ b/tests/src/test/resources/org/aspectj/systemtest/ajc199/ajc199.xml @@ -58,18 +58,34 @@ - - + + - + + + + + + + + + - + + + + + + + + + @@ -91,6 +108,13 @@ + + + + + + + -- cgit v1.2.3 From 3ddb113287f28521ee3471ec4fce99253dbf58dd Mon Sep 17 00:00:00 2001 From: Alexander Kriegisch Date: Thu, 24 Mar 2022 15:25:37 +0700 Subject: Add JDT Core and bcel-builder to test classpath At present, no tests are failing without those resources, but for good measure, I added them anyway, because then the same path could in the future also be used for stand-alone compilation tests which are not triggered in-process via AJDT interface but, not unlike "full LTW" test execution mode, in a separate JVM. Signed-off-by: Alexander Kriegisch --- .../src/test/java/org/aspectj/tools/ajc/AjcTestCase.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjcTestCase.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjcTestCase.java index e0533b008..7a1ad855b 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjcTestCase.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjcTestCase.java @@ -73,6 +73,12 @@ public abstract class AjcTestCase extends TestCase { .filter(path -> path.replace('\\', '/').contains("org/ow2/asm/")) .findFirst() .orElseThrow(() -> new RuntimeException("ASM library not found on classpath")); + public static final String CLASSPATH_JDT_CORE = + Arrays.stream(System.getProperty("java.class.path") + .split(pathSeparator)) + .filter(path -> path.replace('\\', '/').contains("/org/aspectj/org.eclipse.jdt.core/")) + .findFirst() + .orElseThrow(() -> new RuntimeException("AspectJ JDT Core library not found on classpath")); public static final String CLASSPATH_JUNIT = Arrays.stream(System.getProperty("java.class.path") .split(pathSeparator)) @@ -90,10 +96,11 @@ public abstract class AjcTestCase extends TestCase { // See Ajc and AntSpec public static final String DEFAULT_CLASSPATH_ENTRIES = - DEFAULT_FULL_LTW_CLASSPATH_ENTRIES + - Ajc.outputFolders("bridge", "util", "loadtime", "weaver", "asm", "runtime", "org.aspectj.matcher") + DEFAULT_FULL_LTW_CLASSPATH_ENTRIES + + Ajc.outputFolders("bridge", "util", "loadtime", "weaver", "asm", "runtime", "org.aspectj.matcher", "bcel-builder") + pathSeparator + ".." + separator + "lib" + separator + "bcel" + separator + "bcel.jar" + pathSeparator + ".." + separator + "lib" + separator + "bcel" + separator + "bcel-verifier.jar" + + pathSeparator + CLASSPATH_JDT_CORE + pathSeparator + CLASSPATH_ASM // hmmm, this next one should perhaps point to an aj-build jar... + pathSeparator + ".." + separator + "lib" + separator + "test" + separator + "aspectjrt.jar" -- cgit v1.2.3 From 3cd4e9e248df841635c59ffb23e6c5d82af7c4c1 Mon Sep 17 00:00:00 2001 From: Alexander Kriegisch Date: Thu, 24 Mar 2022 16:04:03 +0700 Subject: Add AllTestsAspectJ199.suite() to AllTests19 Signed-off-by: Alexander Kriegisch --- tests/src/test/java/org/aspectj/systemtest/AllTests19.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/src/test/java/org/aspectj/systemtest/AllTests19.java b/tests/src/test/java/org/aspectj/systemtest/AllTests19.java index 7223aff59..d14bc54cb 100644 --- a/tests/src/test/java/org/aspectj/systemtest/AllTests19.java +++ b/tests/src/test/java/org/aspectj/systemtest/AllTests19.java @@ -18,6 +18,7 @@ import junit.framework.Test; import junit.framework.TestSuite; import org.aspectj.systemtest.ajc197.AllTestsAspectJ197; import org.aspectj.systemtest.ajc198.AllTestsAspectJ198; +import org.aspectj.systemtest.ajc199.AllTestsAspectJ199; /** * @author Andy Clement @@ -36,6 +37,7 @@ public class AllTests19 { suite.addTest(AllTestsAspectJ196.suite()); suite.addTest(AllTestsAspectJ197.suite()); suite.addTest(AllTestsAspectJ198.suite()); + suite.addTest(AllTestsAspectJ199.suite()); suite.addTest(AllTests18.suite()); // $JUnit-END$ return suite; -- cgit v1.2.3 From b7d3e96ea778b48a5b3bbe445ecaa90ca97a5094 Mon Sep 17 00:00:00 2001 From: Alexander Kriegisch Date: Thu, 24 Mar 2022 16:04:45 +0700 Subject: Update README-199.html Signed-off-by: Alexander Kriegisch --- docs/dist/doc/README-199.html | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/dist/doc/README-199.html b/docs/dist/doc/README-199.html index 8e09cd918..8c9c7ecfc 100644 --- a/docs/dist/doc/README-199.html +++ b/docs/dist/doc/README-199.html @@ -39,6 +39,17 @@

    Improvements

    +

    + In annotation style aspects, asynchronous proceed() calls in @Around advice now works in threads + created from within the advice. Previously, this was only working in native syntax aspects. There is still a + limitation with regard to asynchronous proceed, if you do not create the thread in the advice but want to use e.g. + an ExecutorService with its own thread pool. This still is not working in annotation style aspects, only in + native syntax ones. +

    +

    + See issue #128 and + pull request #132 for more details. +

    Code examples

    @@ -56,6 +67,11 @@ Pattern matching for switch, preview 2

  • +
  • + + Asynchronous proceed in native vs. annotation style syntax + +
  • Other changes and bug fixes

    -- cgit v1.2.3 From 486b22487379b1a788433ebb8b206a30fde15ac0 Mon Sep 17 00:00:00 2001 From: Alexander Kriegisch Date: Thu, 24 Mar 2022 17:24:42 +0700 Subject: Bump JDT Core to 1.9.9 Signed-off-by: Alexander Kriegisch --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d262f8d92..4e1bac8ca 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ true - 1.9.9.j18-SNAPSHOT + 1.9.9 9.2 1.6.3 2.6.2 -- cgit v1.2.3 From f25573c72a9016204c32205633a7014a8b2bb99b Mon Sep 17 00:00:00 2001 From: Alexander Kriegisch Date: Thu, 24 Mar 2022 17:46:53 +0700 Subject: Set version to 1.9.9 Signed-off-by: Alexander Kriegisch --- ajbrowser/pom.xml | 2 +- ajde.core/pom.xml | 2 +- ajde/pom.xml | 2 +- ajdoc/pom.xml | 2 +- asm/pom.xml | 2 +- aspectjmatcher/pom.xml | 2 +- aspectjrt/pom.xml | 2 +- aspectjtools/pom.xml | 2 +- aspectjweaver/pom.xml | 2 +- bcel-builder/pom.xml | 2 +- bridge/pom.xml | 2 +- build/pom.xml | 2 +- docs/dist/doc/README-199.html | 2 +- docs/pom.xml | 2 +- installer/pom.xml | 2 +- lib/aspectj/lib/aspectjrt.jar | Bin 122989 -> 125110 bytes lib/aspectj/lib/aspectjtools.jar | Bin 14592707 -> 14621202 bytes lib/aspectj/lib/aspectjweaver.jar | Bin 2062888 -> 2088162 bytes lib/pom.xml | 2 +- lib/test/aspectjrt.jar | Bin 122989 -> 125110 bytes loadtime/pom.xml | 2 +- org.aspectj.ajdt.core/pom.xml | 2 +- org.aspectj.matcher/pom.xml | 2 +- pom.xml | 2 +- run-all-junit-tests/pom.xml | 2 +- runtime/pom.xml | 2 +- taskdefs/pom.xml | 2 +- testing-client/pom.xml | 2 +- testing-drivers/pom.xml | 2 +- testing-util/pom.xml | 2 +- testing/pom.xml | 2 +- tests/pom.xml | 2 +- util/pom.xml | 2 +- weaver/pom.xml | 2 +- 34 files changed, 30 insertions(+), 30 deletions(-) diff --git a/ajbrowser/pom.xml b/ajbrowser/pom.xml index 4df5cf765..3120352eb 100644 --- a/ajbrowser/pom.xml +++ b/ajbrowser/pom.xml @@ -6,7 +6,7 @@ org.aspectj aspectj-parent - 1.9.9-SNAPSHOT + 1.9.9 ajbrowser diff --git a/ajde.core/pom.xml b/ajde.core/pom.xml index 9d2bdde5d..2f3bc066a 100644 --- a/ajde.core/pom.xml +++ b/ajde.core/pom.xml @@ -6,7 +6,7 @@ org.aspectj aspectj-parent - 1.9.9-SNAPSHOT + 1.9.9 ajde.core diff --git a/ajde/pom.xml b/ajde/pom.xml index 4991c9f36..64bcc6f5d 100644 --- a/ajde/pom.xml +++ b/ajde/pom.xml @@ -6,7 +6,7 @@ org.aspectj aspectj-parent - 1.9.9-SNAPSHOT + 1.9.9 ajde diff --git a/ajdoc/pom.xml b/ajdoc/pom.xml index 0218e17f0..c1fcad63d 100644 --- a/ajdoc/pom.xml +++ b/ajdoc/pom.xml @@ -6,7 +6,7 @@ org.aspectj aspectj-parent - 1.9.9-SNAPSHOT + 1.9.9 ajdoc diff --git a/asm/pom.xml b/asm/pom.xml index d2a24d706..dd398e701 100644 --- a/asm/pom.xml +++ b/asm/pom.xml @@ -6,7 +6,7 @@ org.aspectj aspectj-parent - 1.9.9-SNAPSHOT + 1.9.9 asm diff --git a/aspectjmatcher/pom.xml b/aspectjmatcher/pom.xml index b34180220..9f2cb4416 100644 --- a/aspectjmatcher/pom.xml +++ b/aspectjmatcher/pom.xml @@ -6,7 +6,7 @@ org.aspectj aspectj-parent - 1.9.9-SNAPSHOT + 1.9.9 aspectjmatcher diff --git a/aspectjrt/pom.xml b/aspectjrt/pom.xml index f9614eaef..9903f5d54 100644 --- a/aspectjrt/pom.xml +++ b/aspectjrt/pom.xml @@ -6,7 +6,7 @@ org.aspectj aspectj-parent - 1.9.9-SNAPSHOT + 1.9.9 aspectjrt diff --git a/aspectjtools/pom.xml b/aspectjtools/pom.xml index 2533e145a..bf685277a 100644 --- a/aspectjtools/pom.xml +++ b/aspectjtools/pom.xml @@ -6,7 +6,7 @@ org.aspectj aspectj-parent - 1.9.9-SNAPSHOT + 1.9.9 aspectjtools diff --git a/aspectjweaver/pom.xml b/aspectjweaver/pom.xml index 668b72985..3dd9f8eba 100644 --- a/aspectjweaver/pom.xml +++ b/aspectjweaver/pom.xml @@ -6,7 +6,7 @@ org.aspectj aspectj-parent - 1.9.9-SNAPSHOT + 1.9.9 aspectjweaver diff --git a/bcel-builder/pom.xml b/bcel-builder/pom.xml index 0f14ab58f..37b655502 100644 --- a/bcel-builder/pom.xml +++ b/bcel-builder/pom.xml @@ -6,7 +6,7 @@ org.aspectj aspectj-parent - 1.9.9-SNAPSHOT + 1.9.9 bcel-builder diff --git a/bridge/pom.xml b/bridge/pom.xml index 893c1040e..0d501846e 100644 --- a/bridge/pom.xml +++ b/bridge/pom.xml @@ -6,7 +6,7 @@ org.aspectj aspectj-parent - 1.9.9-SNAPSHOT + 1.9.9 bridge diff --git a/build/pom.xml b/build/pom.xml index 87b72257a..6abfeabbf 100644 --- a/build/pom.xml +++ b/build/pom.xml @@ -6,7 +6,7 @@ org.aspectj aspectj-parent - 1.9.9-SNAPSHOT + 1.9.9 build diff --git a/docs/dist/doc/README-199.html b/docs/dist/doc/README-199.html index 8c9c7ecfc..e39db1909 100644 --- a/docs/dist/doc/README-199.html +++ b/docs/dist/doc/README-199.html @@ -134,7 +134,7 @@

    - Available: 1.9.9 available DD-MMM-2022 + Available: 1.9.9 available 24-Mar-2022

    diff --git a/docs/pom.xml b/docs/pom.xml index c2a8d2f18..10c29ffc2 100644 --- a/docs/pom.xml +++ b/docs/pom.xml @@ -5,7 +5,7 @@ org.aspectj aspectj-parent - 1.9.9-SNAPSHOT + 1.9.9 docs diff --git a/installer/pom.xml b/installer/pom.xml index 9ae8957bb..4d575a4b5 100644 --- a/installer/pom.xml +++ b/installer/pom.xml @@ -6,7 +6,7 @@ org.aspectj aspectj-parent - 1.9.9-SNAPSHOT + 1.9.9 installer diff --git a/lib/aspectj/lib/aspectjrt.jar b/lib/aspectj/lib/aspectjrt.jar index 5e5174445..d319bb18c 100644 Binary files a/lib/aspectj/lib/aspectjrt.jar and b/lib/aspectj/lib/aspectjrt.jar differ diff --git a/lib/aspectj/lib/aspectjtools.jar b/lib/aspectj/lib/aspectjtools.jar index dfa45c6ef..130539fd4 100644 Binary files a/lib/aspectj/lib/aspectjtools.jar and b/lib/aspectj/lib/aspectjtools.jar differ diff --git a/lib/aspectj/lib/aspectjweaver.jar b/lib/aspectj/lib/aspectjweaver.jar index 12bfd44cd..e1f1fdfa8 100644 Binary files a/lib/aspectj/lib/aspectjweaver.jar and b/lib/aspectj/lib/aspectjweaver.jar differ diff --git a/lib/pom.xml b/lib/pom.xml index 49d9103e9..b7fe8be46 100644 --- a/lib/pom.xml +++ b/lib/pom.xml @@ -7,7 +7,7 @@ org.aspectj aspectj-parent - 1.9.9-SNAPSHOT + 1.9.9 lib diff --git a/lib/test/aspectjrt.jar b/lib/test/aspectjrt.jar index 5e5174445..d319bb18c 100644 Binary files a/lib/test/aspectjrt.jar and b/lib/test/aspectjrt.jar differ diff --git a/loadtime/pom.xml b/loadtime/pom.xml index 73897a9fd..85407da73 100644 --- a/loadtime/pom.xml +++ b/loadtime/pom.xml @@ -6,7 +6,7 @@ org.aspectj aspectj-parent - 1.9.9-SNAPSHOT + 1.9.9 loadtime diff --git a/org.aspectj.ajdt.core/pom.xml b/org.aspectj.ajdt.core/pom.xml index 0aa31ae4a..efeb18a4b 100644 --- a/org.aspectj.ajdt.core/pom.xml +++ b/org.aspectj.ajdt.core/pom.xml @@ -6,7 +6,7 @@ org.aspectj aspectj-parent - 1.9.9-SNAPSHOT + 1.9.9 org.aspectj.ajdt.core diff --git a/org.aspectj.matcher/pom.xml b/org.aspectj.matcher/pom.xml index 9be544784..ff0c25f58 100644 --- a/org.aspectj.matcher/pom.xml +++ b/org.aspectj.matcher/pom.xml @@ -6,7 +6,7 @@ org.aspectj aspectj-parent - 1.9.9-SNAPSHOT + 1.9.9 org.aspectj.matcher diff --git a/pom.xml b/pom.xml index 4e1bac8ca..0724a17da 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.aspectj aspectj-parent - 1.9.9-SNAPSHOT + 1.9.9 pom AspectJ Parent Project diff --git a/run-all-junit-tests/pom.xml b/run-all-junit-tests/pom.xml index 3e2357312..19fe6948d 100644 --- a/run-all-junit-tests/pom.xml +++ b/run-all-junit-tests/pom.xml @@ -6,7 +6,7 @@ org.aspectj aspectj-parent - 1.9.9-SNAPSHOT + 1.9.9 run-all-junit-tests diff --git a/runtime/pom.xml b/runtime/pom.xml index 834943106..6c421b365 100644 --- a/runtime/pom.xml +++ b/runtime/pom.xml @@ -6,7 +6,7 @@ org.aspectj aspectj-parent - 1.9.9-SNAPSHOT + 1.9.9 runtime diff --git a/taskdefs/pom.xml b/taskdefs/pom.xml index 7185b9b5f..3380ea46f 100644 --- a/taskdefs/pom.xml +++ b/taskdefs/pom.xml @@ -6,7 +6,7 @@ org.aspectj aspectj-parent - 1.9.9-SNAPSHOT + 1.9.9 taskdefs diff --git a/testing-client/pom.xml b/testing-client/pom.xml index 401fff9f9..55ddc05a0 100644 --- a/testing-client/pom.xml +++ b/testing-client/pom.xml @@ -6,7 +6,7 @@ org.aspectj aspectj-parent - 1.9.9-SNAPSHOT + 1.9.9 testing-client diff --git a/testing-drivers/pom.xml b/testing-drivers/pom.xml index 37052d85f..446d4a4ec 100644 --- a/testing-drivers/pom.xml +++ b/testing-drivers/pom.xml @@ -6,7 +6,7 @@ org.aspectj aspectj-parent - 1.9.9-SNAPSHOT + 1.9.9 testing-drivers diff --git a/testing-util/pom.xml b/testing-util/pom.xml index 4324b06df..aced91a4b 100644 --- a/testing-util/pom.xml +++ b/testing-util/pom.xml @@ -6,7 +6,7 @@ org.aspectj aspectj-parent - 1.9.9-SNAPSHOT + 1.9.9 testing-util diff --git a/testing/pom.xml b/testing/pom.xml index 2314f1cd4..acd4dd8e3 100644 --- a/testing/pom.xml +++ b/testing/pom.xml @@ -6,7 +6,7 @@ org.aspectj aspectj-parent - 1.9.9-SNAPSHOT + 1.9.9 testing diff --git a/tests/pom.xml b/tests/pom.xml index 33801c2f5..767e2dd15 100644 --- a/tests/pom.xml +++ b/tests/pom.xml @@ -6,7 +6,7 @@ org.aspectj aspectj-parent - 1.9.9-SNAPSHOT + 1.9.9 tests diff --git a/util/pom.xml b/util/pom.xml index e02f6255e..2a28e82c7 100644 --- a/util/pom.xml +++ b/util/pom.xml @@ -6,7 +6,7 @@ org.aspectj aspectj-parent - 1.9.9-SNAPSHOT + 1.9.9 util diff --git a/weaver/pom.xml b/weaver/pom.xml index 0e03383a0..982343761 100644 --- a/weaver/pom.xml +++ b/weaver/pom.xml @@ -6,7 +6,7 @@ org.aspectj aspectj-parent - 1.9.9-SNAPSHOT + 1.9.9 weaver -- cgit v1.2.3 From 1851f96e25a2037faacb3373a357d523c7e202e1 Mon Sep 17 00:00:00 2001 From: Alexander Kriegisch Date: Thu, 24 Mar 2022 17:56:14 +0700 Subject: Set version to 1.9.10-SNAPSHOT Signed-off-by: Alexander Kriegisch --- ajbrowser/pom.xml | 2 +- ajde.core/pom.xml | 2 +- ajde/pom.xml | 2 +- ajdoc/pom.xml | 2 +- asm/pom.xml | 2 +- aspectjmatcher/pom.xml | 2 +- aspectjrt/pom.xml | 2 +- aspectjtools/pom.xml | 2 +- aspectjweaver/pom.xml | 2 +- bcel-builder/pom.xml | 2 +- bridge/pom.xml | 2 +- build/pom.xml | 2 +- docs/pom.xml | 2 +- installer/pom.xml | 2 +- lib/pom.xml | 2 +- loadtime/pom.xml | 2 +- org.aspectj.ajdt.core/pom.xml | 2 +- org.aspectj.matcher/pom.xml | 2 +- pom.xml | 2 +- run-all-junit-tests/pom.xml | 2 +- runtime/pom.xml | 2 +- taskdefs/pom.xml | 2 +- testing-client/pom.xml | 2 +- testing-drivers/pom.xml | 2 +- testing-util/pom.xml | 2 +- testing/pom.xml | 2 +- tests/pom.xml | 2 +- util/pom.xml | 2 +- weaver/pom.xml | 2 +- 29 files changed, 29 insertions(+), 29 deletions(-) diff --git a/ajbrowser/pom.xml b/ajbrowser/pom.xml index 3120352eb..191e5c248 100644 --- a/ajbrowser/pom.xml +++ b/ajbrowser/pom.xml @@ -6,7 +6,7 @@ org.aspectj aspectj-parent - 1.9.9 + 1.9.10-SNAPSHOT ajbrowser diff --git a/ajde.core/pom.xml b/ajde.core/pom.xml index 2f3bc066a..eefb3a411 100644 --- a/ajde.core/pom.xml +++ b/ajde.core/pom.xml @@ -6,7 +6,7 @@ org.aspectj aspectj-parent - 1.9.9 + 1.9.10-SNAPSHOT ajde.core diff --git a/ajde/pom.xml b/ajde/pom.xml index 64bcc6f5d..51679ae2d 100644 --- a/ajde/pom.xml +++ b/ajde/pom.xml @@ -6,7 +6,7 @@ org.aspectj aspectj-parent - 1.9.9 + 1.9.10-SNAPSHOT ajde diff --git a/ajdoc/pom.xml b/ajdoc/pom.xml index c1fcad63d..50922a65c 100644 --- a/ajdoc/pom.xml +++ b/ajdoc/pom.xml @@ -6,7 +6,7 @@ org.aspectj aspectj-parent - 1.9.9 + 1.9.10-SNAPSHOT ajdoc diff --git a/asm/pom.xml b/asm/pom.xml index dd398e701..ff1bdc1ed 100644 --- a/asm/pom.xml +++ b/asm/pom.xml @@ -6,7 +6,7 @@ org.aspectj aspectj-parent - 1.9.9 + 1.9.10-SNAPSHOT asm diff --git a/aspectjmatcher/pom.xml b/aspectjmatcher/pom.xml index 9f2cb4416..f707b22e6 100644 --- a/aspectjmatcher/pom.xml +++ b/aspectjmatcher/pom.xml @@ -6,7 +6,7 @@ org.aspectj aspectj-parent - 1.9.9 + 1.9.10-SNAPSHOT aspectjmatcher diff --git a/aspectjrt/pom.xml b/aspectjrt/pom.xml index 9903f5d54..22a47dd29 100644 --- a/aspectjrt/pom.xml +++ b/aspectjrt/pom.xml @@ -6,7 +6,7 @@ org.aspectj aspectj-parent - 1.9.9 + 1.9.10-SNAPSHOT aspectjrt diff --git a/aspectjtools/pom.xml b/aspectjtools/pom.xml index bf685277a..441df685d 100644 --- a/aspectjtools/pom.xml +++ b/aspectjtools/pom.xml @@ -6,7 +6,7 @@ org.aspectj aspectj-parent - 1.9.9 + 1.9.10-SNAPSHOT aspectjtools diff --git a/aspectjweaver/pom.xml b/aspectjweaver/pom.xml index 3dd9f8eba..a173b769c 100644 --- a/aspectjweaver/pom.xml +++ b/aspectjweaver/pom.xml @@ -6,7 +6,7 @@ org.aspectj aspectj-parent - 1.9.9 + 1.9.10-SNAPSHOT aspectjweaver diff --git a/bcel-builder/pom.xml b/bcel-builder/pom.xml index 37b655502..f2f8ca305 100644 --- a/bcel-builder/pom.xml +++ b/bcel-builder/pom.xml @@ -6,7 +6,7 @@ org.aspectj aspectj-parent - 1.9.9 + 1.9.10-SNAPSHOT bcel-builder diff --git a/bridge/pom.xml b/bridge/pom.xml index 0d501846e..20411313c 100644 --- a/bridge/pom.xml +++ b/bridge/pom.xml @@ -6,7 +6,7 @@ org.aspectj aspectj-parent - 1.9.9 + 1.9.10-SNAPSHOT bridge diff --git a/build/pom.xml b/build/pom.xml index 6abfeabbf..23ae6dd97 100644 --- a/build/pom.xml +++ b/build/pom.xml @@ -6,7 +6,7 @@ org.aspectj aspectj-parent - 1.9.9 + 1.9.10-SNAPSHOT build diff --git a/docs/pom.xml b/docs/pom.xml index 10c29ffc2..39a7c0f7f 100644 --- a/docs/pom.xml +++ b/docs/pom.xml @@ -5,7 +5,7 @@ org.aspectj aspectj-parent - 1.9.9 + 1.9.10-SNAPSHOT docs diff --git a/installer/pom.xml b/installer/pom.xml index 4d575a4b5..499c48f16 100644 --- a/installer/pom.xml +++ b/installer/pom.xml @@ -6,7 +6,7 @@ org.aspectj aspectj-parent - 1.9.9 + 1.9.10-SNAPSHOT installer diff --git a/lib/pom.xml b/lib/pom.xml index b7fe8be46..9c6e60b66 100644 --- a/lib/pom.xml +++ b/lib/pom.xml @@ -7,7 +7,7 @@ org.aspectj aspectj-parent - 1.9.9 + 1.9.10-SNAPSHOT lib diff --git a/loadtime/pom.xml b/loadtime/pom.xml index 85407da73..c940bab30 100644 --- a/loadtime/pom.xml +++ b/loadtime/pom.xml @@ -6,7 +6,7 @@ org.aspectj aspectj-parent - 1.9.9 + 1.9.10-SNAPSHOT loadtime diff --git a/org.aspectj.ajdt.core/pom.xml b/org.aspectj.ajdt.core/pom.xml index efeb18a4b..37b5fb181 100644 --- a/org.aspectj.ajdt.core/pom.xml +++ b/org.aspectj.ajdt.core/pom.xml @@ -6,7 +6,7 @@ org.aspectj aspectj-parent - 1.9.9 + 1.9.10-SNAPSHOT org.aspectj.ajdt.core diff --git a/org.aspectj.matcher/pom.xml b/org.aspectj.matcher/pom.xml index ff0c25f58..bc4ac7896 100644 --- a/org.aspectj.matcher/pom.xml +++ b/org.aspectj.matcher/pom.xml @@ -6,7 +6,7 @@ org.aspectj aspectj-parent - 1.9.9 + 1.9.10-SNAPSHOT org.aspectj.matcher diff --git a/pom.xml b/pom.xml index 0724a17da..71fb2bd66 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.aspectj aspectj-parent - 1.9.9 + 1.9.10-SNAPSHOT pom AspectJ Parent Project diff --git a/run-all-junit-tests/pom.xml b/run-all-junit-tests/pom.xml index 19fe6948d..583acfae1 100644 --- a/run-all-junit-tests/pom.xml +++ b/run-all-junit-tests/pom.xml @@ -6,7 +6,7 @@ org.aspectj aspectj-parent - 1.9.9 + 1.9.10-SNAPSHOT run-all-junit-tests diff --git a/runtime/pom.xml b/runtime/pom.xml index 6c421b365..e66954933 100644 --- a/runtime/pom.xml +++ b/runtime/pom.xml @@ -6,7 +6,7 @@ org.aspectj aspectj-parent - 1.9.9 + 1.9.10-SNAPSHOT runtime diff --git a/taskdefs/pom.xml b/taskdefs/pom.xml index 3380ea46f..55f5436e0 100644 --- a/taskdefs/pom.xml +++ b/taskdefs/pom.xml @@ -6,7 +6,7 @@ org.aspectj aspectj-parent - 1.9.9 + 1.9.10-SNAPSHOT taskdefs diff --git a/testing-client/pom.xml b/testing-client/pom.xml index 55ddc05a0..864dac12c 100644 --- a/testing-client/pom.xml +++ b/testing-client/pom.xml @@ -6,7 +6,7 @@ org.aspectj aspectj-parent - 1.9.9 + 1.9.10-SNAPSHOT testing-client diff --git a/testing-drivers/pom.xml b/testing-drivers/pom.xml index 446d4a4ec..e22c688a2 100644 --- a/testing-drivers/pom.xml +++ b/testing-drivers/pom.xml @@ -6,7 +6,7 @@ org.aspectj aspectj-parent - 1.9.9 + 1.9.10-SNAPSHOT testing-drivers diff --git a/testing-util/pom.xml b/testing-util/pom.xml index aced91a4b..a596d0c99 100644 --- a/testing-util/pom.xml +++ b/testing-util/pom.xml @@ -6,7 +6,7 @@ org.aspectj aspectj-parent - 1.9.9 + 1.9.10-SNAPSHOT testing-util diff --git a/testing/pom.xml b/testing/pom.xml index acd4dd8e3..ae7fd0d9a 100644 --- a/testing/pom.xml +++ b/testing/pom.xml @@ -6,7 +6,7 @@ org.aspectj aspectj-parent - 1.9.9 + 1.9.10-SNAPSHOT testing diff --git a/tests/pom.xml b/tests/pom.xml index 767e2dd15..21efac3cc 100644 --- a/tests/pom.xml +++ b/tests/pom.xml @@ -6,7 +6,7 @@ org.aspectj aspectj-parent - 1.9.9 + 1.9.10-SNAPSHOT tests diff --git a/util/pom.xml b/util/pom.xml index 2a28e82c7..ca3e31e75 100644 --- a/util/pom.xml +++ b/util/pom.xml @@ -6,7 +6,7 @@ org.aspectj aspectj-parent - 1.9.9 + 1.9.10-SNAPSHOT util diff --git a/weaver/pom.xml b/weaver/pom.xml index 982343761..966f6791a 100644 --- a/weaver/pom.xml +++ b/weaver/pom.xml @@ -6,7 +6,7 @@ org.aspectj aspectj-parent - 1.9.9 + 1.9.10-SNAPSHOT weaver -- cgit v1.2.3 From 8b83f579fe653ebaa452239eb40c3b666494adf0 Mon Sep 17 00:00:00 2001 From: Alexander Kriegisch Date: Thu, 24 Mar 2022 18:39:16 +0700 Subject: Fix AjcTaskTest by correctly identifying snapshot versions This avoids the corresponding "bad version number found in" warnings. Signed-off-by: Alexander Kriegisch --- .../java/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java index 301839e1f..08bf00d54 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java @@ -1321,7 +1321,7 @@ public class AjBuildManager implements IOutputClassFileNameProvider, IBinarySour */ private String checkRtJar(AjBuildConfig buildConfig) { // omitting dev info - if (Version.getText().equals(Version.DEVELOPMENT) || Version.getText().endsWith("BUILD-SNAPSHOT")) { + if (Version.getText().equals(Version.DEVELOPMENT) || Version.getText().endsWith("-SNAPSHOT")) { // in the development version we can't do this test usefully // MessageUtil.info(holder, "running development version of aspectj compiler"); return null; @@ -1359,7 +1359,7 @@ public class AjBuildManager implements IOutputClassFileNameProvider, IBinarySour } } // assume that users of development aspectjrt.jar know what they're doing - if (version != null && (Version.DEVELOPMENT.equals(version) || version.endsWith("BUILD-SNAPSHOT"))) { + if (version != null && (Version.DEVELOPMENT.equals(version) || version.endsWith("-SNAPSHOT"))) { // MessageUtil.info(holder, // "running with development version of aspectjrt.jar in " + // p.getAbsolutePath()); -- cgit v1.2.3 From cde74b890dc45e6523b895dda71f87287bdc933f Mon Sep 17 00:00:00 2001 From: Alexander Kriegisch Date: Thu, 24 Mar 2022 23:16:09 +0700 Subject: IDE.md: update AJDT update site infos for 4.23 Also add some Eclipse, AspectJ and Java version information to the existing update sites. Signed-off-by: Alexander Kriegisch --- docs/developer/IDE.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/developer/IDE.md b/docs/developer/IDE.md index 98a74dafd..70a090980 100644 --- a/docs/developer/IDE.md +++ b/docs/developer/IDE.md @@ -32,9 +32,10 @@ projects using AspectJ Maven Plugin. #### AspectJ Development Tools (AJDT) Use an update sites corresponding to your Eclipse version (minimal version listed): -* Eclipse 2021-09 (4.21): https://download.eclipse.org/tools/ajdt/421/dev/update -* Eclipse 2021-03 (4.19): https://download.eclipse.org/tools/ajdt/419/dev/update -* Eclipse 2018-12 (4.10): https://download.eclipse.org/tools/ajdt/410/dev/update +* Eclipse 2022-03 (4.23), AspectJ 1.9.9, Java 18: https://download.eclipse.org/tools/ajdt/423/dev/update +* Eclipse 2021-09 (4.21), AspectJ 1.9.8, Java 17: https://download.eclipse.org/tools/ajdt/421/dev/update +* Eclipse 2021-03 (4.19), AspectJ 1.9.7, Java 16: https://download.eclipse.org/tools/ajdt/419/dev/update +* Eclipse 2018-12 (4.10), AspectJ 1.9.6, Java 14: https://download.eclipse.org/tools/ajdt/410/dev/update * For older versions, please refer to https://www.eclipse.org/ajdt/downloads (page was not updated in a long time, and I have no write access). -- cgit v1.2.3