diff options
author | Alexander Kriegisch <Alexander@Kriegisch.name> | 2022-03-24 23:20:42 +0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-24 23:20:42 +0700 |
commit | ad4a42ce1d7d2110f0b9cda5c97dd43215062802 (patch) | |
tree | 8314868802131b423e38f54c6ab43899ae50646f | |
parent | bd663a7e645a1cb6f357259dfe880855c7016e21 (diff) | |
parent | cde74b890dc45e6523b895dda71f87287bdc933f (diff) | |
download | aspectj-ad4a42ce1d7d2110f0b9cda5c97dd43215062802.tar.gz aspectj-ad4a42ce1d7d2110f0b9cda5c97dd43215062802.zip |
Merge pull request #140 from kriegaex/java-18
Prepare code, tests and docs for Java 18
95 files changed, 1637 insertions, 711 deletions
diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 9160a83b1..0a013bf15 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -19,7 +19,8 @@ jobs: strategy: fail-fast: false matrix: - java: [ 11, 17 ] + # 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 diff --git a/ajbrowser/pom.xml b/ajbrowser/pom.xml index 4df5cf765..191e5c248 100644 --- a/ajbrowser/pom.xml +++ b/ajbrowser/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.aspectj</groupId> <artifactId>aspectj-parent</artifactId> - <version>1.9.9-SNAPSHOT</version> + <version>1.9.10-SNAPSHOT</version> </parent> <artifactId>ajbrowser</artifactId> diff --git a/ajde.core/pom.xml b/ajde.core/pom.xml index 9d2bdde5d..eefb3a411 100644 --- a/ajde.core/pom.xml +++ b/ajde.core/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.aspectj</groupId> <artifactId>aspectj-parent</artifactId> - <version>1.9.9-SNAPSHOT</version> + <version>1.9.10-SNAPSHOT</version> </parent> <artifactId>ajde.core</artifactId> diff --git a/ajde/pom.xml b/ajde/pom.xml index 4991c9f36..51679ae2d 100644 --- a/ajde/pom.xml +++ b/ajde/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.aspectj</groupId> <artifactId>aspectj-parent</artifactId> - <version>1.9.9-SNAPSHOT</version> + <version>1.9.10-SNAPSHOT</version> </parent> <artifactId>ajde</artifactId> diff --git a/ajdoc/pom.xml b/ajdoc/pom.xml index 0218e17f0..50922a65c 100644 --- a/ajdoc/pom.xml +++ b/ajdoc/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.aspectj</groupId> <artifactId>aspectj-parent</artifactId> - <version>1.9.9-SNAPSHOT</version> + <version>1.9.10-SNAPSHOT</version> </parent> <artifactId>ajdoc</artifactId> diff --git a/asm/pom.xml b/asm/pom.xml index d2a24d706..ff1bdc1ed 100644 --- a/asm/pom.xml +++ b/asm/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.aspectj</groupId> <artifactId>aspectj-parent</artifactId> - <version>1.9.9-SNAPSHOT</version> + <version>1.9.10-SNAPSHOT</version> </parent> <artifactId>asm</artifactId> diff --git a/aspectjmatcher/pom.xml b/aspectjmatcher/pom.xml index b34180220..f707b22e6 100644 --- a/aspectjmatcher/pom.xml +++ b/aspectjmatcher/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.aspectj</groupId> <artifactId>aspectj-parent</artifactId> - <version>1.9.9-SNAPSHOT</version> + <version>1.9.10-SNAPSHOT</version> </parent> <artifactId>aspectjmatcher</artifactId> diff --git a/aspectjrt/pom.xml b/aspectjrt/pom.xml index f9614eaef..22a47dd29 100644 --- a/aspectjrt/pom.xml +++ b/aspectjrt/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.aspectj</groupId> <artifactId>aspectj-parent</artifactId> - <version>1.9.9-SNAPSHOT</version> + <version>1.9.10-SNAPSHOT</version> </parent> <artifactId>aspectjrt</artifactId> diff --git a/aspectjtools/pom.xml b/aspectjtools/pom.xml index 2533e145a..441df685d 100644 --- a/aspectjtools/pom.xml +++ b/aspectjtools/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.aspectj</groupId> <artifactId>aspectj-parent</artifactId> - <version>1.9.9-SNAPSHOT</version> + <version>1.9.10-SNAPSHOT</version> </parent> <artifactId>aspectjtools</artifactId> diff --git a/aspectjweaver/pom.xml b/aspectjweaver/pom.xml index 668b72985..a173b769c 100644 --- a/aspectjweaver/pom.xml +++ b/aspectjweaver/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.aspectj</groupId> <artifactId>aspectj-parent</artifactId> - <version>1.9.9-SNAPSHOT</version> + <version>1.9.10-SNAPSHOT</version> </parent> <artifactId>aspectjweaver</artifactId> diff --git a/bcel-builder/pom.xml b/bcel-builder/pom.xml index 0f14ab58f..f2f8ca305 100644 --- a/bcel-builder/pom.xml +++ b/bcel-builder/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.aspectj</groupId> <artifactId>aspectj-parent</artifactId> - <version>1.9.9-SNAPSHOT</version> + <version>1.9.10-SNAPSHOT</version> </parent> <artifactId>bcel-builder</artifactId> 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/bridge/pom.xml b/bridge/pom.xml index 893c1040e..20411313c 100644 --- a/bridge/pom.xml +++ b/bridge/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.aspectj</groupId> <artifactId>aspectj-parent</artifactId> - <version>1.9.9-SNAPSHOT</version> + <version>1.9.10-SNAPSHOT</version> </parent> <artifactId>bridge</artifactId> diff --git a/build/pom.xml b/build/pom.xml index 87b72257a..23ae6dd97 100644 --- a/build/pom.xml +++ b/build/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.aspectj</groupId> <artifactId>aspectj-parent</artifactId> - <version>1.9.9-SNAPSHOT</version> + <version>1.9.10-SNAPSHOT</version> </parent> <artifactId>build</artifactId> 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). 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 </a>: An example class which only works correctly on JDK 8 when compiled with <tt>--release 8</tt> due to API changes in - the JDK. Simply <tt>-source 8 -target 8</tt> would not be enough in this case.</li> + the JDK. Simply <tt>-source 8 -target 8</tt> would not be enough in this case. + </li> <li> <a href="https://github.com/eclipse/org.aspectj/tree/master/tests/features198/java17"> Pattern matching for switch @@ -110,12 +111,6 @@ craft a condy class with ASM</a>. </li> <li> - Improvements for <tt>if()</tt> pointcuts in annotation syntax, see issues - <a href="https://github.com/eclipse/org.aspectj/issues/115">#115</a>, - <a href="https://github.com/eclipse/org.aspectj/issues/120">#120</a>, - <a href="https://github.com/eclipse/org.aspectj/issues/122">#122</a>. - </li> - <li> Thanks to Andrey Turbanov for several clean code contributions and to Dmitry Mikhaylov for fixing a potential concurrency problem. </li> diff --git a/docs/dist/doc/README-199.html b/docs/dist/doc/README-199.html new file mode 100644 index 000000000..e39db1909 --- /dev/null +++ b/docs/dist/doc/README-199.html @@ -0,0 +1,142 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<html> + +<head> +<title>AspectJ 1.9.9 Readme</title> +<style type="text/css"> + <!-- + P { margin-left: 20px; } + PRE { margin-left: 20px; } + LI { margin-left: 20px; } + H4 { margin-left: 20px; } + H3 { margin-left: 10px; } + --> +</style> +</head> + +<body> +<div align="right"><small>© Copyright 2022 Contributors. All rights reserved.</small></div> + +<h1>AspectJ 1.9.9</h1> + +<p> + Please note that Bugzilla for issue management is deprecated and new issues should be filed as + <a href="https://github.com/eclipse/org.aspectj/issues/new">GitHub issues</a>. + The list of issues addressed for 1.9.9 can be found + <a href="https://bugs.eclipse.org/bugs/buglist.cgi?bug_status=RESOLVED&bug_status=VERIFIED&bug_status=CLOSED&f0=OP&f1=OP&f3=CP&f4=CP&j1=OR&list_id=16866879&product=AspectJ&query_format=advanced&target_milestone=1.9.9">here for Bugzilla</a> + and <a href="https://github.com/eclipse/org.aspectj/issues?q=is%3Aissue+is%3Aclosed++milestone%3A1.9.9">here for GitHub issues</a>. +</p> + +<h2>New features</h2> + +<p> + AspectJ 1.9.9 supports <a href="https://openjdk.java.net/projects/jdk/18/">Java 18</a> and its final and preview + features, such as: +</p> +<ul> + <li>Pattern matching for <tt>switch</tt> (preview 2)</li> +</ul> + +<h2>Improvements</h2> + +<p> + In annotation style aspects, asynchronous <tt>proceed()</tt> calls in <tt>@Around</tt> 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 <tt>ExecutorService</tt> with its own thread pool. This still is not working in annotation style aspects, only in + native syntax ones. +</p> +<p> + See <a href="https://github.com/eclipse/org.aspectj/issues/128">issue #128</a> and + <a href="https://github.com/eclipse/org.aspectj/pull/132">pull request #132</a> for more details. +</p> +<h2>Code examples</h2> + +<p> + 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): +</p> +<ul> + <li> + <a href="https://github.com/eclipse/org.aspectj/tree/master/tests/features198/java17"> + Pattern matching for switch, preview 1 + </a> + </li> + <li> + <a href="https://github.com/eclipse/org.aspectj/tree/master/tests/features199/java18"> + Pattern matching for switch, preview 2 + </a> + </li> + <li> + <a href="https://github.com/eclipse/org.aspectj/tree/master/tests/bugs199/github_128"> + Asynchronous proceed in native vs. annotation style syntax + </a> + </li> +</ul> + +<h2>Other changes and bug fixes</h2> + +<ul> + <li> + Fix a bug which led to <tt>NullPointerException</tt>s if too many JAR archives were on the classpath. Too many here + means the value system property <tt>org.aspectj.weaver.openarchives</tt> (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 + <a href="https://github.com/eclipse/org.aspectj/issues/125">#125</a>. + </li> + <li> + Improvements for <tt>if()</tt> pointcuts in annotation syntax, see issues + <a href="https://github.com/eclipse/org.aspectj/issues/115">#115</a>, + <a href="https://github.com/eclipse/org.aspectj/issues/120">#120</a>, + <a href="https://github.com/eclipse/org.aspectj/issues/122">#122</a>. + </li> + <li> + Thanks to Andrey Turbanov for several clean code contributions. + </li> +</ul> + +<h2>AspectJ usage hints</h2> + +<h3>AspectJ compiler build system requirements</h3> + +<p> + Since 1.9.7, the AspectJ compiler <tt>ajc</tt> (contained in the <tt>aspectjtools</tt> 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 + <tt>aspectjrt</tt>, but the compiler itself needs JDK 11+. Just like in previous AspectJ versions, both the runtime + <tt>aspectjrt</tt> and the load-time weaver <tt>aspectjweaver</tt> still only require JRE 8+. +</p> + +<h3>Use LTW on Java 16+</h3> + +<p> + Please note that if you want to use load-time weaving on Java 16+, the weaving agent collides with + <a href="https://openjdk.java.net/jeps/396">JEP 396 (Strongly Encapsulate JDK Internals by Default)</a> and related + subsequent JEPs. Therefore, you need to set the JVM parameter <tt>--add-opens java.base/java.lang=ALL-UNNAMED</tt> 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. +</p> + +<h3>Compile with Java preview features</h3> + +<p> + For features marked as preview on a given JDK, you need to compile with <tt>ajc --enable-preview</tt> and run with + <tt>java --enable-preview</tt> on that JDK. +</p> +<p> + 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. +</p> + +<hr> + +<p> + <b>Available:</b> 1.9.9 available 24-Mar-2022 +</p> + +</body> + +</html> diff --git a/docs/pom.xml b/docs/pom.xml index c2a8d2f18..39a7c0f7f 100644 --- a/docs/pom.xml +++ b/docs/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.aspectj</groupId> <artifactId>aspectj-parent</artifactId> - <version>1.9.9-SNAPSHOT</version> + <version>1.9.10-SNAPSHOT</version> </parent> <artifactId>docs</artifactId> diff --git a/installer/pom.xml b/installer/pom.xml index 9ae8957bb..499c48f16 100644 --- a/installer/pom.xml +++ b/installer/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.aspectj</groupId> <artifactId>aspectj-parent</artifactId> - <version>1.9.9-SNAPSHOT</version> + <version>1.9.10-SNAPSHOT</version> </parent> <artifactId>installer</artifactId> diff --git a/lib/aspectj/lib/aspectjrt.jar b/lib/aspectj/lib/aspectjrt.jar Binary files differindex 935830ebc..d319bb18c 100644 --- a/lib/aspectj/lib/aspectjrt.jar +++ b/lib/aspectj/lib/aspectjrt.jar diff --git a/lib/aspectj/lib/aspectjtools.jar b/lib/aspectj/lib/aspectjtools.jar Binary files differindex e4efdaf34..130539fd4 100644 --- a/lib/aspectj/lib/aspectjtools.jar +++ b/lib/aspectj/lib/aspectjtools.jar diff --git a/lib/aspectj/lib/aspectjweaver.jar b/lib/aspectj/lib/aspectjweaver.jar Binary files differnew file mode 100644 index 000000000..e1f1fdfa8 --- /dev/null +++ b/lib/aspectj/lib/aspectjweaver.jar diff --git a/lib/pom.xml b/lib/pom.xml index 49d9103e9..9c6e60b66 100644 --- a/lib/pom.xml +++ b/lib/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.aspectj</groupId> <artifactId>aspectj-parent</artifactId> - <version>1.9.9-SNAPSHOT</version> + <version>1.9.10-SNAPSHOT</version> </parent> <artifactId>lib</artifactId> diff --git a/lib/test/aspectjrt.jar b/lib/test/aspectjrt.jar Binary files differindex fe29ee5e6..d319bb18c 100644 --- a/lib/test/aspectjrt.jar +++ b/lib/test/aspectjrt.jar diff --git a/loadtime/pom.xml b/loadtime/pom.xml index 73897a9fd..c940bab30 100644 --- a/loadtime/pom.xml +++ b/loadtime/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.aspectj</groupId> <artifactId>aspectj-parent</artifactId> - <version>1.9.9-SNAPSHOT</version> + <version>1.9.10-SNAPSHOT</version> </parent> <artifactId>loadtime</artifactId> diff --git a/org.aspectj.ajdt.core/pom.xml b/org.aspectj.ajdt.core/pom.xml index 0aa31ae4a..37b5fb181 100644 --- a/org.aspectj.ajdt.core/pom.xml +++ b/org.aspectj.ajdt.core/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.aspectj</groupId> <artifactId>aspectj-parent</artifactId> - <version>1.9.9-SNAPSHOT</version> + <version>1.9.10-SNAPSHOT</version> </parent> <artifactId>org.aspectj.ajdt.core</artifactId> 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()); 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..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 f8768b6899a6a2 (15Sep2021) - Java17 +compiler.version = Eclipse Compiler d3a80f1f9b2f8a (21Mar2022) - Java18 compiler.copyright = misc.version = {0} {1} - {2} {3} 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..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 @@ -36,6 +36,10 @@ 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; +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 * results. Compilations run in a sandbox that is created in C:\temp\ajcSandbox or /tmp/ajcSandbox depending on your platform. @@ -51,13 +55,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 +71,7 @@ public class Ajc { outputFolder("testing-client") + outputFolder("runtime") + outputFolder("bcel-builder") - + File.pathSeparator + ".." + File.separator + "lib" + File.separator + "junit" + File.separator + "junit.jar" + + pathSeparator + CLASSPATH_JUNIT + outputFolder("bridge") + outputFolder("loadtime") + outputFolder("weaver") @@ -321,17 +325,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 +352,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 +370,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..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 @@ -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; @@ -37,6 +38,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. * <p> @@ -65,22 +69,42 @@ 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")); + 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)) + .filter(path -> path.replace('\\', '/').contains("/junit/junit/")) + .findFirst() + .orElseThrow(() -> new RuntimeException("JUnit library not found on classpath")); + + // 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 + // 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" - // hmmm, this next one should perhaps point to an aj-build jar... - + File.pathSeparator + ".." + File.separator + "lib" + File.separator + "test" + File.separator + "aspectjrt.jar" - ; + 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" + ; /* * Save reference to real stderr and stdout before starting redirection @@ -149,7 +173,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); } @@ -570,17 +594,17 @@ 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) { // 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 +614,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,10 +644,16 @@ 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 + "lib" + separator + "aspectj" + separator + "lib" + separator + "aspectjweaver.jar"; + String defaultCpAbsolute = Arrays.stream(DEFAULT_FULL_LTW_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 + " " + 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())); @@ -650,7 +680,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 +706,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 +897,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 +956,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 +964,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 +1044,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); diff --git a/org.aspectj.matcher/pom.xml b/org.aspectj.matcher/pom.xml index 9be544784..bc4ac7896 100644 --- a/org.aspectj.matcher/pom.xml +++ b/org.aspectj.matcher/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.aspectj</groupId> <artifactId>aspectj-parent</artifactId> - <version>1.9.9-SNAPSHOT</version> + <version>1.9.10-SNAPSHOT</version> </parent> <artifactId>org.aspectj.matcher</artifactId> @@ -5,7 +5,7 @@ <groupId>org.aspectj</groupId> <artifactId>aspectj-parent</artifactId> - <version>1.9.9-SNAPSHOT</version> + <version>1.9.10-SNAPSHOT</version> <packaging>pom</packaging> <name>AspectJ Parent Project</name> @@ -21,7 +21,7 @@ <maven.javadoc.skip>true</maven.javadoc.skip> <!-- Dependency versions --> - <jdt.core.version>1.9.9-SNAPSHOT</jdt.core.version> + <jdt.core.version>1.9.9</jdt.core.version> <asm.version>9.2</asm.version> <lib.ant.version>1.6.3</lib.ant.version> <lib.ant.xerces.version>2.6.2</lib.ant.xerces.version> @@ -208,6 +208,20 @@ </properties> </profile> <profile> + <id>jdk-18-to-xx</id> + <activation> + <jdk>[18,)</jdk> + </activation> + <properties> + <!-- + 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. + --> + <jvm.arg.addOpens>-Djava.security.manager=allow</jvm.arg.addOpens> + </properties> + </profile> + <profile> <id>release</id> <properties> <maven.javadoc.skip>false</maven.javadoc.skip> diff --git a/run-all-junit-tests/pom.xml b/run-all-junit-tests/pom.xml index 3e2357312..583acfae1 100644 --- a/run-all-junit-tests/pom.xml +++ b/run-all-junit-tests/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.aspectj</groupId> <artifactId>aspectj-parent</artifactId> - <version>1.9.9-SNAPSHOT</version> + <version>1.9.10-SNAPSHOT</version> </parent> <artifactId>run-all-junit-tests</artifactId> diff --git a/runtime/pom.xml b/runtime/pom.xml index 834943106..e66954933 100644 --- a/runtime/pom.xml +++ b/runtime/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.aspectj</groupId> <artifactId>aspectj-parent</artifactId> - <version>1.9.9-SNAPSHOT</version> + <version>1.9.10-SNAPSHOT</version> </parent> <artifactId>runtime</artifactId> diff --git a/taskdefs/pom.xml b/taskdefs/pom.xml index 7185b9b5f..55f5436e0 100644 --- a/taskdefs/pom.xml +++ b/taskdefs/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.aspectj</groupId> <artifactId>aspectj-parent</artifactId> - <version>1.9.9-SNAPSHOT</version> + <version>1.9.10-SNAPSHOT</version> </parent> <artifactId>taskdefs</artifactId> 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-client/pom.xml b/testing-client/pom.xml index 401fff9f9..864dac12c 100644 --- a/testing-client/pom.xml +++ b/testing-client/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.aspectj</groupId> <artifactId>aspectj-parent</artifactId> - <version>1.9.9-SNAPSHOT</version> + <version>1.9.10-SNAPSHOT</version> </parent> <artifactId>testing-client</artifactId> diff --git a/testing-drivers/pom.xml b/testing-drivers/pom.xml index 37052d85f..e22c688a2 100644 --- a/testing-drivers/pom.xml +++ b/testing-drivers/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.aspectj</groupId> <artifactId>aspectj-parent</artifactId> - <version>1.9.9-SNAPSHOT</version> + <version>1.9.10-SNAPSHOT</version> </parent> <artifactId>testing-drivers</artifactId> diff --git a/testing-util/pom.xml b/testing-util/pom.xml index 4324b06df..a596d0c99 100644 --- a/testing-util/pom.xml +++ b/testing-util/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.aspectj</groupId> <artifactId>aspectj-parent</artifactId> - <version>1.9.9-SNAPSHOT</version> + <version>1.9.10-SNAPSHOT</version> </parent> <artifactId>testing-util</artifactId> diff --git a/testing/pom.xml b/testing/pom.xml index 2314f1cd4..ae7fd0d9a 100644 --- a/testing/pom.xml +++ b/testing/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.aspectj</groupId> <artifactId>aspectj-parent</artifactId> - <version>1.9.9-SNAPSHOT</version> + <version>1.9.10-SNAPSHOT</version> </parent> <artifactId>testing</artifactId> diff --git a/testing/src/test/java/org/aspectj/testing/RunSpec.java b/testing/src/test/java/org/aspectj/testing/RunSpec.java index 9e07f8a44..181eb9062 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 @@ -71,7 +71,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/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/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"); diff --git a/tests/bugs198/github_115/A.java b/tests/bugs199/github_115/A.java index 07df21f10..07df21f10 100644 --- a/tests/bugs198/github_115/A.java +++ b/tests/bugs199/github_115/A.java diff --git a/tests/bugs198/github_115/B.java b/tests/bugs199/github_115/B.java index eba199b67..eba199b67 100644 --- a/tests/bugs198/github_115/B.java +++ b/tests/bugs199/github_115/B.java diff --git a/tests/bugs198/github_120/C.java b/tests/bugs199/github_120/C.java index 4af57af24..4af57af24 100644 --- a/tests/bugs198/github_120/C.java +++ b/tests/bugs199/github_120/C.java diff --git a/tests/bugs198/github_120/D.java b/tests/bugs199/github_120/D.java index 2ecdaa574..2ecdaa574 100644 --- a/tests/bugs198/github_120/D.java +++ b/tests/bugs199/github_120/D.java diff --git a/tests/bugs198/github_122/E.java b/tests/bugs199/github_122/E.java index 29c818285..29c818285 100644 --- a/tests/bugs198/github_122/E.java +++ b/tests/bugs199/github_122/E.java diff --git a/tests/bugs198/github_125/Application.java b/tests/bugs199/github_125/Application.java index 7e893fc1a..7e893fc1a 100644 --- a/tests/bugs198/github_125/Application.java +++ b/tests/bugs199/github_125/Application.java diff --git a/tests/bugs198/github_128/Application.java b/tests/bugs199/github_128/Application.java index 9a4a7312f..9a4a7312f 100644 --- a/tests/bugs198/github_128/Application.java +++ b/tests/bugs199/github_128/Application.java diff --git a/tests/bugs198/github_128/MarkerA.java b/tests/bugs199/github_128/MarkerA.java index 89e60978c..89e60978c 100644 --- a/tests/bugs198/github_128/MarkerA.java +++ b/tests/bugs199/github_128/MarkerA.java diff --git a/tests/bugs198/github_128/MarkerB.java b/tests/bugs199/github_128/MarkerB.java index 6f6aa3dd0..6f6aa3dd0 100644 --- a/tests/bugs198/github_128/MarkerB.java +++ b/tests/bugs199/github_128/MarkerB.java diff --git a/tests/bugs198/github_128/annotation_syntax/MarkerAAspect.aj b/tests/bugs199/github_128/annotation_syntax/MarkerAAspect.aj index d090ed9ea..d090ed9ea 100644 --- a/tests/bugs198/github_128/annotation_syntax/MarkerAAspect.aj +++ b/tests/bugs199/github_128/annotation_syntax/MarkerAAspect.aj diff --git a/tests/bugs198/github_128/annotation_syntax/MarkerBAspect.aj b/tests/bugs199/github_128/annotation_syntax/MarkerBAspect.aj index d5548f9da..d5548f9da 100644 --- a/tests/bugs198/github_128/annotation_syntax/MarkerBAspect.aj +++ b/tests/bugs199/github_128/annotation_syntax/MarkerBAspect.aj diff --git a/tests/bugs198/github_128/native_syntax/MarkerAAspect.aj b/tests/bugs199/github_128/native_syntax/MarkerAAspect.aj index 5e2ac5424..5e2ac5424 100644 --- a/tests/bugs198/github_128/native_syntax/MarkerAAspect.aj +++ b/tests/bugs199/github_128/native_syntax/MarkerAAspect.aj diff --git a/tests/bugs198/github_128/native_syntax/MarkerBAspect.aj b/tests/bugs199/github_128/native_syntax/MarkerBAspect.aj index 52e95d1eb..52e95d1eb 100644 --- a/tests/bugs198/github_128/native_syntax/MarkerBAspect.aj +++ b/tests/bugs199/github_128/native_syntax/MarkerBAspect.aj diff --git a/tests/features199/java18/SwitchPatternPreview2Aspect.aj b/tests/features199/java18/SwitchPatternPreview2Aspect.aj new file mode 100644 index 000000000..4170b4d15 --- /dev/null +++ b/tests/features199/java18/SwitchPatternPreview2Aspect.aj @@ -0,0 +1,26 @@ +aspect SwitchPatternPreview2Aspect { + Object around(Integer i): execution(* doSomethingWithInteger(*)) && args(i) { + System.out.println( + 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(i); + } +} + +class Application { + public static void main(String[] args) { + doSomethingWithInteger(-1); + doSomethingWithInteger(0); + doSomethingWithInteger(42); + doSomethingWithInteger(-99); + doSomethingWithInteger(Integer.valueOf(123)); + doSomethingWithInteger(null); + } + + public static Object doSomethingWithInteger(Integer o) { return 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 new file mode 100644 index 000000000..b36b26bf2 --- /dev/null +++ b/tests/features199/java18/SwitchPatternPreview2OK.java @@ -0,0 +1,113 @@ +/** + * 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); + + constantLabelMustAppearBeforePatternInteger(-1); + constantLabelMustAppearBeforePatternInteger(0); + constantLabelMustAppearBeforePatternInteger(42); + constantLabelMustAppearBeforePatternInteger(-99); + constantLabelMustAppearBeforePatternInteger(Integer.valueOf(123)); + constantLabelMustAppearBeforePatternInteger(null); + +// System.out.println(testGenericSealedExhaustive(new B<Integer>())); + } + + /** + * 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 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<T> permits A, B {} + final static class A<X> implements I<String> {} + final static class B<Y> implements I<Y> {} + + static int testGenericSealedExhaustive(I<Integer> i) { + return switch (i) { + // Exhaustive as no A case possible! + case B<Integer> bi -> 42; + }; + } + */ +} diff --git a/tests/pom.xml b/tests/pom.xml index 33801c2f5..21efac3cc 100644 --- a/tests/pom.xml +++ b/tests/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.aspectj</groupId> <artifactId>aspectj-parent</artifactId> - <version>1.9.9-SNAPSHOT</version> + <version>1.9.10-SNAPSHOT</version> </parent> <artifactId>tests</artifactId> 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; 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/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/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 3aefb0760..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,50 +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 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/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..b83448935 --- /dev/null +++ b/tests/src/test/java/org/aspectj/systemtest/ajc199/Bugs199Tests.java @@ -0,0 +1,73 @@ +/******************************************************************************* + * 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 testCompilerCanReopenClosedJARs_gh125() { + try (PropertyEnvironment env = ScopedSystemProperties.newPropertyEnvironment()) { + env.setProperty("org.aspectj.weaver.openarchives", "20"); + runTest("compiler can re-open closed JARs"); + } + } + + 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); + } + + @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..dbe6f733a --- /dev/null +++ b/tests/src/test/java/org/aspectj/systemtest/ajc199/Java18PreviewFeaturesTests.java @@ -0,0 +1,65 @@ +/******************************************************************************* + * 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); + } + + 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("SwitchPatternPreview2OK", Constants.MAJOR_18, Constants.PREVIEW_MINOR_VERSION); + } + + public void testSwitchPatternMatchingPreview2Aspect() { + runTest("switch pattern matching preview 2 aspect"); + checkVersion("SwitchPatternPreview2Aspect", Constants.MAJOR_18, Constants.PREVIEW_MINOR_VERSION); + checkVersion("Application", 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/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 @@ <line text="RecoveryNotSelf.around() call(float services.stockquote.StockQuoteService.getQuote(String))"/> </stdout> </run> - <run class="services.account.StockQuoteServiceTest" ltw="aop-notself.xml"> + <run class="services.account.StockQuoteServiceTest" ltw="aop-notself.xml" usefullltw="true"> <stdout> <line text="RecoveryNotSelf.around() call(float services.stockquote.StockQuoteService.getQuote(String))"/> </stdout> @@ -6184,7 +6184,7 @@ <ajc-test dir="bugs150/pr119657" title="IllegalAccessError with around advice on interface method call using -XterminateAfterCompilation and LTW"> <compile files="services/account/StockQuoteServiceTest.java, services/accountdata/StockAccount.java, services/stockquote/StockQuoteService.java, services/stockquote/StockQuoteServiceImpl.java, services/account/AccountReport.java" options="-1.5"/> <compile files="accounts/recovery/Recovery.aj" options="-1.5 -XterminateAfterCompilation"/> - <run class="services.account.StockQuoteServiceTest" ltw="aop.xml"> + <run class="services.account.StockQuoteServiceTest" ltw="aop.xml" usefullltw="true"> <stdout> <line text="Recovery.around() call(float services.stockquote.StockQuoteService.getQuote(String))"/> </stdout> @@ -6194,7 +6194,7 @@ <ajc-test dir="bugs150/pr119657" title="IllegalAccessError with around advice on interface method call using LTW"> <compile files="services/account/StockQuoteServiceTest.java, services/accountdata/StockAccount.java, services/stockquote/StockQuoteService.java, services/stockquote/StockQuoteServiceImpl.java, services/account/AccountReport.java" options="-1.5"/> <compile files="accounts/recovery/Recovery.aj" options="-1.5"/> - <run class="services.account.StockQuoteServiceTest" ltw="aop.xml"> + <run class="services.account.StockQuoteServiceTest" ltw="aop.xml" usefullltw="true"> <stdout> <line text="Recovery.around() call(float services.stockquote.StockQuoteService.getQuote(String))"/> </stdout> @@ -6204,7 +6204,7 @@ <ajc-test dir="bugs150/pr119657" title="IllegalAccessError with around advice on interface method call not self using LTW"> <compile files="services/account/StockQuoteServiceTest.java, services/accountdata/StockAccount.java, services/stockquote/StockQuoteService.java, services/stockquote/StockQuoteServiceImpl.java, services/account/AccountReport.java" options="-1.5"/> <compile files="accounts/recovery/RecoveryNotSelf.aj" options="-1.4"/> - <run class="services.account.StockQuoteServiceTest" ltw="aop-notself.xml"> + <run class="services.account.StockQuoteServiceTest" ltw="aop-notself.xml" usefullltw="true"> <stdout> <line text="RecoveryNotSelf.around() call(float services.stockquote.StockQuoteService.getQuote(String))"/> </stdout> @@ -6214,7 +6214,7 @@ <ajc-test dir="bugs150/pr119657" title="IllegalAccessError with around advice on interface method call self and not self using LTW"> <compile files="services/account/StockQuoteServiceTest.java, services/accountdata/StockAccount.java, services/stockquote/StockQuoteService.java, services/stockquote/StockQuoteServiceImpl.java, services/account/AccountReport.java" options="-1.5"/> <compile files="accounts/recovery/Recovery.aj, accounts/recovery/RecoveryNotSelf.aj" options="-1.5"/> - <run class="services.account.StockQuoteServiceTest" ltw="aop-selfandnotself.xml"> + <run class="services.account.StockQuoteServiceTest" ltw="aop-selfandnotself.xml" usefullltw="true"> <stdout> <line text="Recovery.around() call(float services.stockquote.StockQuoteService.getQuote(String))"/> <line text="RecoveryNotSelf.around() call(float services.stockquote.StockQuoteService.getQuote(String))"/> @@ -6225,7 +6225,7 @@ <ajc-test dir="bugs150/pr119657" title="IllegalAccessError with around advice on interface method call using LTW and -XnoInline"> <compile files="services/account/StockQuoteServiceTest.java, services/accountdata/StockAccount.java, services/stockquote/StockQuoteService.java, services/stockquote/StockQuoteServiceImpl.java, services/account/AccountReport.java" options="-1.5"/> <compile files="accounts/recovery/Recovery.aj" options="-1.5"/> - <run class="services.account.StockQuoteServiceTest" ltw="aop-noinline.xml"> + <run class="services.account.StockQuoteServiceTest" ltw="aop-noinline.xml" usefullltw="true"> <stdout> <line text="Recovery.around() call(float services.stockquote.StockQuoteService.getQuote(String))"/> </stdout> @@ -6235,7 +6235,7 @@ <ajc-test dir="bugs150/pr121385" title="override protected pointcut in aop.xml concrete aspect"> <compile files="Hello.java" options="-1.5"/> <compile files="World.aj, ConcreteWorld.aj" options="-1.4"/> - <run class="Hello" ltw="aop.xml"> + <run class="Hello" ltw="aop.xml" usefullltw="true"> <stdout> <line text="around start!"/> <line text="Hello"/> 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"/> <run class="ataspectj.DumpTest" ltw="ataspectj/aop-dump.xml"/> </ajc-test> - + <ajc-test dir="java5/ataspectj" title="LTW DumpTest before and after"> <compile files="ataspectj/EmptyAspect.aj" @@ -123,7 +123,7 @@ <compile files="ataspectj/DumpTest.java,ataspectj/DumpTestTheDump.java,ataspectj/TestAroundAspect.aj" options="-1.5"/> - <run class="ataspectj.DumpTest" ltw="ataspectj/aop-dumpclosure.xml"/> + <run class="ataspectj.DumpTest" ltw="ataspectj/aop-dumpclosure.xml" usefullltw="true"/> </ajc-test> <ajc-test dir="java5/ataspectj" title="LTW DumpTest proxy"> @@ -163,7 +163,7 @@ files="ataspectj/ltwlog/Aspect1.java" options="-1.5 -XterminateAfterCompilation" > - </compile> + </compile> <run class="ataspectj.ltwlog.Main" ltw="ataspectj/ltwlog/aop-silent.xml"> <stdout> <line text="execution(Main.target())"/> @@ -182,7 +182,7 @@ files="ataspectj/ltwlog/Aspect1.java" options="-1.5 -XterminateAfterCompilation" > - </compile> + </compile> <run class="ataspectj.ltwlog.Main" ltw="ataspectj/ltwlog/aop-verbose.xml"> <stdout> <line text="execution(Main.target())"/> @@ -207,7 +207,7 @@ files="ataspectj/ltwlog/Aspect1.java" options="-1.5 -XterminateAfterCompilation" > - </compile> + </compile> <run class="ataspectj.ltwlog.Main" ltw="ataspectj/ltwlog/aop-verboseandshow.xml"> <stdout> <line text="execution(Main.target())"/> @@ -233,7 +233,7 @@ files="ataspectj/ltwlog/Aspect1.java" options="-1.5 -XterminateAfterCompilation" > - </compile> + </compile> <run class="ataspectj.ltwlog.Main" ltw="ataspectj/ltwlog/aop-messagehandler.xml"> <stdout> <line text="MessageHolder.MessageHolder()"/> @@ -290,7 +290,7 @@ files="ataspectj/ConcreteAtAspectTest.java,ataspectj/TestHelper.java" options="-1.5 -XterminateAfterCompilation" /> - <run class="ataspectj.ConcreteAtAspectTest" ltw="ataspectj/aop-concreteataspect.xml"/> + <run class="ataspectj.ConcreteAtAspectTest" ltw="ataspectj/aop-concreteataspect.xml" usefullltw="true"/> </ajc-test> <ajc-test dir="java5/ataspectj" title="ConcreteAspect"> @@ -298,7 +298,7 @@ files="ataspectj/ConcreteAspectTest.aj,ataspectj/TestHelper.java" options="-1.5 -Xdev:NoAtAspectJProcessing -XterminateAfterCompilation" /> - <run class="ataspectj.ConcreteAspectTest" ltw="ataspectj/aop-concreteaspect.xml"/> + <run class="ataspectj.ConcreteAspectTest" ltw="ataspectj/aop-concreteaspect.xml" usefullltw="true"/> </ajc-test> <ajc-test dir="java5/ataspectj" title="ConcretePrecedenceAspect"> @@ -306,7 +306,7 @@ files="ataspectj/ConcretePrecedenceAspectTest.java,ataspectj/TestHelper.java" options="-1.5 -Xdev:NoAtAspectJProcessing -XterminateAfterCompilation" /> - <run class="ataspectj.ConcretePrecedenceAspectTest" ltw="ataspectj/aop-concreteprecedenceaspect.xml"/> + <run class="ataspectj.ConcretePrecedenceAspectTest" ltw="ataspectj/aop-concreteprecedenceaspect.xml" usefullltw="true"/> </ajc-test> <ajc-test dir="java5/ataspectj" title="AspectOfWhenAspectNotInInclude"> @@ -346,4 +346,4 @@ </ajc-test> -</suite>
\ No newline at end of file +</suite> 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..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 @@ -215,13 +215,13 @@ <compile files="AbstractSuperAspect.aj" outjar="aspect.jar" options="-1.4"> </compile> - <run class="Main" ltw="aop-defineaspect.xml"> + <run class="Main" ltw="aop-defineaspect.xml" usefullltw="true"> <stdout> <line text="Main.main" /> <line text="Main.test1" /> <line text="Main.test2" /> </stdout> - <stderr> + <stderr ordered="no"> <line text="info AspectJ Weaver Version" /> <line text="info register classloader" /> <line text="info using" /> @@ -229,6 +229,33 @@ <line text="debug weaving 'ConcreteAspect'" /> <line text="debug generating class 'ConcreteAspect'" /> <line text="debug weaving 'Main'" /> + + <!-- In full LTW mode with weaver option '-debug' in aop.xml, the weaver prints this --> + <line text="debug cannot weave 'org.aspectj.lang.Signature'" /> + <line text="debug cannot weave 'org.aspectj.runtime.reflect.Factory'" /> + <line text="debug cannot weave 'org.aspectj.lang.JoinPoint$StaticPart'" /> + <line text="debug cannot weave 'org.aspectj.lang.JoinPoint$EnclosingStaticPart'" /> + <line text="debug cannot weave 'org.aspectj.lang.JoinPoint'" /> + <line text="debug cannot weave 'org.aspectj.lang.reflect.MethodSignature'" /> + <line text="debug cannot weave 'org.aspectj.lang.reflect.CodeSignature'" /> + <line text="debug cannot weave 'org.aspectj.lang.reflect.MemberSignature'" /> + <line text="debug cannot weave 'org.aspectj.lang.reflect.ConstructorSignature'" /> + <line text="debug cannot weave 'org.aspectj.lang.reflect.FieldSignature'" /> + <line text="debug cannot weave 'org.aspectj.lang.reflect.AdviceSignature'" /> + <line text="debug cannot weave 'org.aspectj.lang.reflect.CatchClauseSignature'" /> + <line text="debug cannot weave 'org.aspectj.lang.reflect.LockSignature'" /> + <line text="debug cannot weave 'org.aspectj.lang.reflect.UnlockSignature'" /> + <line text="debug cannot weave 'org.aspectj.lang.reflect.InitializerSignature'" /> + <line text="debug cannot weave 'org.aspectj.lang.reflect.SourceLocation'" /> + <line text="debug cannot weave 'org.aspectj.runtime.reflect.MethodSignatureImpl'" /> + <line text="debug cannot weave 'org.aspectj.runtime.reflect.CodeSignatureImpl'" /> + <line text="debug cannot weave 'org.aspectj.runtime.reflect.MemberSignatureImpl'" /> + <line text="debug cannot weave 'org.aspectj.runtime.reflect.SignatureImpl'" /> + <line text="debug cannot weave 'org.aspectj.runtime.reflect.SignatureImpl$Cache'" /> + <line text="debug cannot weave 'org.aspectj.runtime.reflect.JoinPointImpl$StaticPartImpl'" /> + <line text="debug cannot weave 'org.aspectj.runtime.reflect.SourceLocationImpl'" /> + <line text="debug cannot weave 'org.aspectj.lang.NoAspectBoundException'" /> + <line text="AbstractSuperAspect.before_test1" /> </stderr> </run> @@ -244,7 +271,7 @@ text="this affected type is not exposed to the weaver: TestITDMethod" /> </compile> <run class="TestITDMethod" options="test" - ltw="aop-abstractaspect.xml"> + ltw="aop-abstractaspect.xml" usefullltw="true"> <stdout> <line text="TestITDMethod.main" /> </stdout> 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 @@ <suite> <!-- atDecp begin --> - + <!-- something simple --> <ajc-test dir="bugs151/atDecp/case1" title="atDecp - simple"> <compile files="MainClass.java" options="-1.5 -showWeaveInfo"> @@ -20,7 +20,7 @@ </stderr> </run> </ajc-test> - + <!-- applying parent based on annotation --> <ajc-test dir="bugs151/atDecp/case2" title="atDecp - annotation"> <compile files="MainClass.java" options="-1.5 -showWeaveInfo"> @@ -36,7 +36,7 @@ </stderr> </run> </ajc-test> - + <!-- when interface is binary --> <ajc-test dir="bugs151/atDecp/case3" title="atDecp - binary interface"> <compile files="Mood.java,Moody.java" outjar="moody.jar" options="-1.5"/> @@ -53,7 +53,7 @@ </stderr> </run> </ajc-test> - + <!-- when interface is binary and implementation is not an inner --> <ajc-test dir="bugs151/atDecp/case4" title="atDecp - binary interface - 2"> <compile files="Mood.java,Moody.java" outjar="moody.jar" options="-1.5"/> @@ -70,7 +70,7 @@ </stderr> </run> </ajc-test> - + <!-- atDecp end --> @@ -99,7 +99,7 @@ </stderr> </run> </ajc-test> - + <ajc-test dir="bugs151/pr98901" title="annotations and itds - 2"> <compile files="Failing2.java" options="-1.5"/> <run class="Failing2"> @@ -120,23 +120,23 @@ <compile files="InputAnnotation.java" outjar="foo.jar" options="-1.5"/> <compile files="AffectedType.java" classpath="foo.jar" options="-1.5"/> </ajc-test> - + <ajc-test dir="bugs151/pr132926" pr="132926" title="crashing on annotation type resolving with asm - 3"> <compile files="InputAnnotation2.java" outjar="foo.jar" options="-1.5"/> <compile files="AffectedType.java" classpath="foo.jar" options="-1.5"> <message kind="error" line="9" text="AffectedType is not a valid target for annotation InputAnnotation, this annotation can only be applied to these element types {METHOD}"/> </compile> </ajc-test> - + <ajc-test dir="bugs151/pr133307" title="circular generics"> <compile files="Broken.aj" options="-1.5"/> - </ajc-test> - + </ajc-test> + <ajc-test dir="bugs151/pr123553" title="generic advice parameters"> <compile files="A.java" options="-1.5"/> <run class="A"/> - </ajc-test> - + </ajc-test> + <ajc-test dir="bugs151/pr133298" title="doubly annotating a method with declare"> <compile files="DecA.java" options="-1.5"/> <run class="DecA"> @@ -153,7 +153,7 @@ </stderr> </run> </ajc-test> - + <ajc-test dir="bugs151/pr133298" title="doubly annotating a method with declare - 2"> <compile files="DecA2.java" options="-1.5"/> <run class="DecA2"> @@ -167,19 +167,19 @@ </stderr> </run> </ajc-test> - + <ajc-test dir="bugs151/pr129566" title="arrayindexoutofbounds"> <compile files="SkipList.java" options="-1.5"/> - </ajc-test> - + </ajc-test> + <ajc-test dir="bugs151" title="member types in generic types"> <compile files="pr122458.aj" options="-1.5 -emacssym"/> - </ajc-test> - + </ajc-test> + <ajc-test dir="bugs151/pr127299" title="missing import gives funny message"> <compile files="ModelErrorConversion.aj" options="-1.5"/> </ajc-test> - + <ajc-test dir="bugs151/pr122742" title="@AJ VerifyError with @AfterThrowing and thisJoinPoint argument"> <compile files="AfterThrowingTest.java" options="-1.5"/> <run class="AfterThrowingTest"> @@ -191,32 +191,32 @@ <run class="AfterReturningTest"> </run> </ajc-test> - + <ajc-test dir="bugs151/pr120527" title="incorrect unused interface message"> <compile files="Bugs.aj" options="-warn:unusedPrivate"/> - </ajc-test> - + </ajc-test> + <ajc-test dir="bugs151/pr123901" title="inlinevisitor NPE"> <compile files="A.java,B.java" options="-1.5"> <message kind="error" line="5" text="A cannot be resolved or is not a field"/> </compile> </ajc-test> - + <ajc-test dir="bugs151" title="member types in generic types - 2"> <compile files="pr122458_2.aj" options="-1.5 -emacssym"/> <run class="pr122458_2"/> </ajc-test> - + <ajc-test dir="bugs151/pr123695" title="Internal nullptr exception with complex declare annotation"> <compile files="InjectName.java,Main.java,MarkMyMethods.java,MarkMyMethodsAspect.java,NameAspect.java,Named.java,Read.java,Write.java" options="-1.5"/> </ajc-test> - + <ajc-test dir="bugs151/pr124105" title="hasMember problems with packages"> <compile files="com/test/IOption.java,com/test/IXOption.java,com/test/IYOption.java,com/test/IZOption.java,com/test/MyBrokenXOption.java,com/test/MyXOption.java,com/test/OptionAspect.aj,com/test/OptionType.java" options="-1.5 -XhasMember"> <message kind="error" line="4" text="IOption implementations must provide a constructor which accepts an OptionType"/> </compile> </ajc-test> - + <ajc-test dir="bugs151/pr124803" title="generics and different numbers of type variables"> <compile files="Test.java,TestAspect.java" options="-1.5 -showWeaveInfo"> <message kind="weave" text="Join point 'method-execution(void Test.foo(java.lang.Number))' in Type 'Test' (Test.java:12) advised by after advice from 'TestAspect' (TestAspect.java:4)"/> @@ -227,7 +227,7 @@ </stderr> </run> </ajc-test> - + <ajc-test dir="bugs151/pr124803" title="generics and different numbers of type variables - classes"> <compile files="Test2.java,TestAspect2.java" options="-1.5 -showWeaveInfo"> <message kind="weave" text="Join point 'method-execution(void Test2.foo(java.lang.Number))' in Type 'Test2' (Test2.java:12) advised by after advice from 'TestAspect2' (TestAspect2.java:4)"/> @@ -239,7 +239,7 @@ </stderr> </run> </ajc-test> - + <ajc-test dir="bugs151/pr124808" title="parameterized collection fields matched via pointcut"> <compile files="Test.java,TestAspect.java" options="-1.5"/> <run class="Test"> @@ -248,12 +248,12 @@ </stderr> </run> </ajc-test> - + <ajc-test dir="bugs151" title="calling inherited generic method from around advice"> <compile files="pr124999.aj" options="-1.5"/> <run class="pr124999"/> </ajc-test> - + <ajc-test dir="bugs151/pr124654" title="generic aspects and annotations"> <compile files="GenericAnnotation.java,TestSubAspect.java" options="-1.5"/> <run class="TestSubAspect"> @@ -264,7 +264,7 @@ </stderr> </run> </ajc-test> - + <ajc-test dir="bugs151" title="incorrectly referencing pointcuts"> <compile files="pr122452.aj" options="-1.5"> <message kind="warning" line="2" text="no match for this type name: Point [Xlint:invalidAbsoluteTypeName]"/> @@ -272,18 +272,18 @@ <message kind="error" line="4" text="Syntax error on token "*", "(" expected"/> </compile> </ajc-test> - + <ajc-test dir="bugs151" title="incorrectly referencing pointcuts - 2"> <compile files="pr122452_2.aj" options="-1.5"> <message kind="error" line="2" text="Syntax error on token "*", "(" expected"/> </compile> </ajc-test> - + <ajc-test dir="bugs151/pr125080" title="mixing numbers of type parameters"> <compile files="Test.java" options="-1.5"/> <run class="ConcreteAspect"/> </ajc-test> - + <ajc-test dir="bugs151/pr125080" title="mixing numbers of type parameters - 2"> <compile files="Test2.java" options="-1.5"/> <run class="ConcreteAspect"/> @@ -292,11 +292,11 @@ <ajc-test dir="bugs151/pr125295" title="new IProgramElement methods"> <compile files="pkg/C.java,pkg/A.aj" options="-emacssym"/> </ajc-test> - + <ajc-test dir="bugs151/pr125475" title="define empty pointcut using an annotation"> <compile files="TestEmptyPointcutAtAspect.java" options="-1.5"/> </ajc-test> - + <ajc-test dir="bugs151/pr125475" title="define empty pointcut using an annotation - 2"> <compile files="TestEmptyPointcutAtAspect2.java" options="-1.5 -showWeaveInfo"> <message kind="warning" line="10" text="advice defined in TestEmptyPointcutAtAspect2 has not been applied [Xlint:adviceDidNotMatch]"/> @@ -307,17 +307,17 @@ <compile files="Test.java TestAspect.aj"/> <run class="Test" ltw="aop.xml"/> </ajc-test> - + <ajc-test dir="bugs151/pr128744" title="broken ltw"> <compile files="Hello.java World.java" options="-1.5" /> - <run class="Hello" ltw="aop.xml"> + <run class="Hello" ltw="aop.xml" usefullltw="true"> <stdout> <line text="Hello"/> <line text="World"/> </stdout> </run> </ajc-test> - + <ajc-test dir="bugs151/pr125699" title="inherit advice with this() and thisJoinPoint"> <compile files="Tracing.aj, TestTracing.aj, AtTestTracing.java" options="-1.5"> <message kind="warning" line="13" text="advice defined in Tracing has not been applied [Xlint:adviceDidNotMatch]"/> @@ -345,7 +345,7 @@ <ajc-test dir="bugs151" title="E extends Enum(E) again"> <compile files="Pr126316.aj" options="-1.5"/> - </ajc-test> + </ajc-test> <ajc-test dir="bugs151" title="@AJ without JoinPoint import"> <compile files="pr121616.java" options="-1.5"> @@ -379,7 +379,7 @@ </stdout> </run> </ajc-test> - + <ajc-test dir="bugs151" title="Pointcut interfaces"> <compile files="pr130869.aj" options="-1.5"> <message kind="warning" line="30" text="no directly runnable classes"/> @@ -390,10 +390,10 @@ <compile files="pr131933.aj" options="-1.5"> <message kind="error" line="5" text="can't bind type name 'MyList'"/> </compile> - </ajc-test> + </ajc-test> <!-- New features down here... when they arent big enough to have their own test file --> - + <ajc-test dir="features151/ptw" title="exposing withintype"> <compile files="ExposedType.java" options="-1.5"/> <run class="ExposedType"> @@ -403,8 +403,8 @@ <line text="here I am execution(void ExposedTypeThree.foo()): for class ExposedTypeThree"/> </stderr> </run> - </ajc-test> - + </ajc-test> + <ajc-test dir="features151/swallowedExceptions" title="swallowed exceptions"> <compile files="SwallowedException.java" options="-Xlint:warning"> <message kind="warning" line="11" text="Exception swallowed in catch block"/> @@ -415,4 +415,4 @@ <compile files="SwallowedException.java"> </compile> </ajc-test> -</suite>
\ No newline at end of file +</suite> 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 @@ </run> </ajc-test> - <ajc-test dir="bugs152/pr125480" title="aop.xml aspect inheriting abstract method "> + <ajc-test dir="bugs152/pr125480" title="aop.xml aspect inheriting abstract method"> <compile files="HelloWorld.java"/> <compile files="AbstractMethods.aj, ConcreteMethods.aj" options="-1.5"/> - <run class="HelloWorld" ltw="aop-tracing.xml"> + <run class="HelloWorld" ltw="aop-tracing.xml" usefullltw="true"> <stdout> <line text="advice running"/> <line text="Hello World!"/> @@ -462,7 +462,7 @@ <ajc-test dir="bugs152/pr125480/case2" title="aop.xml aspect inheriting abstract method - code style"> <compile files="HelloWorld.java"/> <compile files="AbstractMethods.aj, ConcreteMethods.aj" options="-1.5"/> - <run class="HelloWorld" ltw="aop-tracing.xml"> + <run class="HelloWorld" ltw="aop-tracing.xml" usefullltw="true"> <stdout> <line text="advice running"/> <line text="Hello World!"/> @@ -600,7 +600,7 @@ <ajc-test dir="bugs152/pr142165" title="broken concretization"> <compile files="C.java" options="-1.5"/> <compile files="A.java" options="-1.5"/> - <run class="C" ltw="aop.xml"> + <run class="C" ltw="aop.xml" usefullltw="true"> <stderr> <line text="warning at Type 'AA' (no debug info available)::0 no match for this type name: SomeType [Xlint:invalidAbsoluteTypeName]"/> <line text="foo running"/> @@ -611,7 +611,7 @@ <ajc-test dir="bugs152/pr142165" title="broken concretization - 2"> <compile files="C.java" options="-1.5"/> <compile files="A.java" options="-1.5"/> - <run class="C" ltw="aop2.xml"> + <run class="C" ltw="aop2.xml" usefullltw="true"> <stderr> <line text="foo running"/> </stderr> @@ -621,7 +621,7 @@ <ajc-test dir="bugs152/pr142165" title="broken concretization - 3"> <compile files="C.java" options="-1.5"/> <compile files="A.java" options="-1.5"/> - <run class="C" ltw="aop3.xml"> + <run class="C" ltw="aop3.xml" usefullltw="true"> <stderr> <line text="advice"/> <line text="foo running"/> 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 @@ <!-- AspectJ v1.5.1 Tests --> <suite> - + <ajc-test dir="features152/synchronization" title="basic"> <compile files="Basic.java" options="-1.5 -showWeaveInfo -Xjoinpoints:synchronization"> </compile> @@ -15,7 +15,7 @@ </stderr> </run> </ajc-test> - + <ajc-test dir="features152/synchronization" title="basic - within"> <compile files="Basic2.java" options="-1.5 -Xjoinpoints:synchronization"> </compile> @@ -36,7 +36,7 @@ </stderr> </run> </ajc-test> - + <ajc-test dir="features152/synchronization" title="basic - within plus args"> <compile files="Basic3.java" options="-1.5 -Xjoinpoints:synchronization"> </compile> @@ -57,7 +57,7 @@ </stderr> </run> </ajc-test> - + <ajc-test dir="features152/synchronization" title="basic - within plus this"> <compile files="Basic4.java" options="-1.5 -Xjoinpoints:synchronization"> </compile> @@ -78,7 +78,7 @@ </stderr> </run> </ajc-test> - + <ajc-test dir="features152/synchronization" title="basic - within plus target"> <compile files="Basic5.java" options="-1.5 -Xjoinpoints:synchronization"> </compile> @@ -110,19 +110,19 @@ </stderr> </run> </ajc-test> - + <ajc-test dir="features152/synchronization" title="parsing - lock"> <compile files="Parsing1.java" options="-1.5 -Xjoinpoints:synchronization"> <message kind="warning" line="5" text="advice defined in Parsing1 has not been applied [Xlint:adviceDidNotMatch]"/> </compile> </ajc-test> - + <ajc-test dir="features152/synchronization" title="parsing - unlock"> <compile files="Parsing2.java" options="-1.5 -Xjoinpoints:synchronization"> <message kind="warning" line="5" text="advice defined in Parsing2 has not been applied [Xlint:adviceDidNotMatch]"/> </compile> </ajc-test> - + <ajc-test dir="features152/synchronization" title="parsing - error - lock"> <compile files="Parsing1.java" options="-1.5"> <message kind="warning" line="5" text="advice defined in Parsing1 has not been applied [Xlint:adviceDidNotMatch]"/> @@ -130,7 +130,7 @@ <message kind="warning" line="5" text="lock() pointcut designator cannot be used without the option -Xjoinpoints:synchronization"/> </compile> </ajc-test> - + <ajc-test dir="features152/synchronization" title="parsing - error - unlock"> <compile files="Parsing2.java" options="-1.5"> <message kind="warning" line="5" text="advice defined in Parsing2 has not been applied [Xlint:adviceDidNotMatch]"/> @@ -138,7 +138,7 @@ <message kind="warning" line="5" text="unlock() pointcut designator cannot be used without the option -Xjoinpoints:synchronization"/> </compile> </ajc-test> - + <ajc-test dir="features152/synchronization" title="parsing and matching - lock and static context"> <compile files="ParsingAndMatching1.java" options="-1.5 -Xjoinpoints:synchronization"/> <run class="ParsingAndMatching1"> @@ -148,7 +148,7 @@ </stderr> </run> </ajc-test> - + <ajc-test dir="features152/synchronization" title="using lock with LTW - missing flag"> <compile files="LockAspect1.java" options="-1.5"> <message kind="warning" line="6" text="lock() pointcut designator cannot be used without the option -Xjoinpoints:synchronization"/> @@ -163,11 +163,11 @@ </stderr> </run> </ajc-test> - + <ajc-test dir="features152/synchronization/transformed" title="transform with LTW"> <compile files="CaptureLock.aj" options="-1.5"/> <compile files="Program.java" options="-1.5"/> - <run class="Program" ltw="aop1.xml"> + <run class="Program" ltw="aop1.xml" usefullltw="true"> <stdout> <line text="Before a lock or unlock"/> <line text="hello from b()"/> @@ -184,7 +184,7 @@ </stdout> </run> </ajc-test> - + <ajc-test dir="features152/synchronization" title="using lock with LTW"> <compile files="LockAspect1.java" options="-1.5 -Xjoinpoints:synchronization"/> <compile files="BasicProgram1.java" options="-1.5 -Xjoinpoints:synchronization"/> @@ -199,7 +199,7 @@ </stderr> </run> </ajc-test> - + <ajc-test dir="features152/synchronization" title="using unlock with LTW"> <compile files="UnlockAspect1.java" options="-1.5 -Xjoinpoints:synchronization"/> <compile files="BasicProgram1.java" options="-1.5 -Xjoinpoints:synchronization"/> @@ -214,7 +214,7 @@ </stderr> </run> </ajc-test> - + <ajc-test dir="features152/synchronization" title="using unlock with LTW - missing flag"> <compile files="UnlockAspect1.java" options="-1.5"> <message kind="warning" line="6" text="unlock() pointcut designator cannot be used without the option -Xjoinpoints:synchronization"/> @@ -238,7 +238,7 @@ </stderr> </run> </ajc-test> - + <ajc-test dir="features152/synchronization" title="parsing and matching - lock and non-static context"> <compile files="ParsingAndMatching3.java" options="-1.5 -Xjoinpoints:synchronization"/> <run class="ParsingAndMatching3"> @@ -258,7 +258,7 @@ </stderr> </run> </ajc-test> - + <ajc-test dir="features152/synchronization" title="a useful program - with lock"> <compile files="Useful2.java" options="-1.5 -showWeaveInfo -Xjoinpoints:synchronization"> <message kind="weave" text="Join point 'method-execution(void Useful2.main(java.lang.String[]))' in Type 'Useful2' (Useful2.java:33) advised by afterReturning advice from 'LockMonitor' (Useful2.java:25)"/> @@ -272,7 +272,7 @@ </stderr> </run> </ajc-test> - + <ajc-test dir="features152/synchronization" title="combining pcds - lock and this"> <compile files="CombiningPCDs1.java" options="-1.5 -Xjoinpoints:synchronization"/> <run class="CombiningPCDs1"> @@ -283,7 +283,7 @@ </stderr> </run> </ajc-test> - + <ajc-test dir="features152/synchronization" title="combining pcds - unlock and this"> <compile files="CombiningPCDs2.java" options="-1.5 -Xjoinpoints:synchronization"/> <run class="CombiningPCDs2"> @@ -294,7 +294,7 @@ </stderr> </run> </ajc-test> - + <ajc-test dir="features152/synchronization" title="thisjoinpoint - monitor entry"> <compile files="ThisJoinPointLock.java" options="-1.5 -Xjoinpoints:synchronization"/> <run class="ThisJoinPointLock"> @@ -305,7 +305,7 @@ </stderr> </run> </ajc-test> - + <ajc-test dir="features152/synchronization" title="thisjoinpoint - monitor exit"> <compile files="ThisJoinPointUnlock.java" options="-1.5 -Xjoinpoints:synchronization"/> <run class="ThisJoinPointUnlock"> @@ -316,7 +316,7 @@ </stderr> </run> </ajc-test> - + <ajc-test dir="features152/synchronization" title="prevent double unlock weaving messages and model contents"> <compile files="ThisJoinPointUnlock.java" options="-1.5 -Xjoinpoints:synchronization -showWeaveInfo -emacssym"> <message kind="weave" text="Join point 'lock(void java.lang.Object.<lock>(java.lang.Object))' in Type 'ThisJoinPointUnlock' (ThisJoinPointUnlock.java:38) advised by before advice from 'TJPAspect' (ThisJoinPointUnlock.java:4)"/> @@ -324,7 +324,7 @@ <message kind="weave" text="Join point 'unlock(void java.lang.Object.<unlock>(java.lang.Object))' in Type 'ThisJoinPointUnlock' (ThisJoinPointUnlock.java:38) advised by before advice from 'TJPAspect' (ThisJoinPointUnlock.java:4)"/> </compile> </ajc-test> - + <ajc-test dir="features152/synchronization" title="before advice - lock"> <compile files="BeforeLock.java" options="-1.5 -Xjoinpoints:synchronization"/> <run class="BeforeLock"> @@ -336,8 +336,8 @@ <line text="non-static method running"/> </stderr> </run> - </ajc-test> - + </ajc-test> + <ajc-test dir="features152/synchronization" title="before advice - unlock"> <compile files="BeforeUnlock.java" options="-1.5 -Xjoinpoints:synchronization"/> <run class="BeforeUnlock"> @@ -349,8 +349,8 @@ <line text="before() unlock: advice running at BeforeUnlock.java:21"/> </stderr> </run> - </ajc-test> - + </ajc-test> + <ajc-test dir="features152/synchronization" title="after advice - lock"> <compile files="AfterLock.java" options="-1.5 -Xjoinpoints:synchronization"/> <run class="AfterLock"> @@ -362,8 +362,8 @@ <line text="non-static method running"/> </stderr> </run> - </ajc-test> - + </ajc-test> + <ajc-test dir="features152/synchronization" title="after advice - unlock"> <compile files="AfterUnlock.java" options="-1.5 -Xjoinpoints:synchronization"/> <run class="AfterUnlock"> @@ -375,8 +375,8 @@ <line text="after() unlock: advice running at AfterUnlock.java:21"/> </stderr> </run> - </ajc-test> - + </ajc-test> + <ajc-test dir="features152/synchronization" title="around advice - lock"> <compile files="AroundLock.java" options="-1.5 -Xjoinpoints:synchronization"> <message kind="warning" line="11" text="Around advice is not supported on the lock and unlock join points (compiler limitation)"/> @@ -395,8 +395,8 @@ <line text="non-static method running"/> </stderr> </run> - </ajc-test> - + </ajc-test> + <ajc-test dir="features152/synchronization" title="around advice - unlock"> <compile files="AroundUnlock.java" options="-1.5 -Xjoinpoints:synchronization"> <message kind="warning" line="5" text="Around advice is not supported on the lock and unlock join points (compiler limitation)"/> @@ -415,22 +415,22 @@ <line text="non-static method running"/> </stderr> </run> - </ajc-test> - + </ajc-test> + <ajc-test dir="features152/synchronization/transformed" title="investigation"> <compile files="Investigation.java"> </compile> </ajc-test> - + <ajc-test dir="features152/synchronization/transformed" title="One"> <compile files="One.java -Xjoinpoints:synchronization"> </compile> <run class="One"/><!-- will check verification ... --> </ajc-test> - + <ajc-test dir="features152/synchronization/transformed" title="Two"> <compile files="Two.java -Xjoinpoints:synchronization"> - <message kind="warning" line="14" text="advice matching the synchronized method shadow 'method-execution(void C.ma())' will be executed outside the lock rather than inside (compiler limitation) [Xlint"/> + <message kind="warning" line="14" text="advice matching the synchronized method shadow 'method-execution(void C.ma())' will be executed outside the lock rather than inside (compiler limitation) [Xlint"/> </compile> <run class="Two"> <stderr> @@ -439,7 +439,7 @@ </stderr> </run> </ajc-test> - + <ajc-test dir="features152/synchronization/transformed" title="Two - xlintoff"> <compile files="Two.java -Xjoinpoints:synchronization -Xlint:ignore"/> <run class="Two"> @@ -449,11 +449,11 @@ </stderr> </run> </ajc-test> - + <ajc-test dir="features152/synchronization/transformed" title="Three"> <compile files="Three.java -Xjoinpoints:synchronization"> - <message kind="warning" line="20" text="advice matching the synchronized method shadow 'method-execution(void C.m3())' will be executed outside the lock rather than inside (compiler limitation) [Xlint"/> - <message kind="warning" line="24" text="advice matching the synchronized method shadow 'method-execution(void C.m32())' will be executed outside the lock rather than inside (compiler limitation) [Xlint"/> + <message kind="warning" line="20" text="advice matching the synchronized method shadow 'method-execution(void C.m3())' will be executed outside the lock rather than inside (compiler limitation) [Xlint"/> + <message kind="warning" line="24" text="advice matching the synchronized method shadow 'method-execution(void C.m32())' will be executed outside the lock rather than inside (compiler limitation) [Xlint"/> </compile> <run class="Three"> <stderr> @@ -468,7 +468,7 @@ </stderr> </run> </ajc-test> - + <ajc-test dir="features152/synchronization/transformed" title="Four"> <compile files="Four.java -Xjoinpoints:synchronization"> <message kind="warning" line="16" text="advice matching the synchronized method shadow 'method-execution(void C.m())' will be executed outside the lock rather than inside (compiler limitation) [Xlint"/> @@ -483,7 +483,7 @@ </stderr> </run> </ajc-test> - + <ajc-test dir="features152/synchronization/transformed" title="Five - Java5"> <compile files="Five.java -1.5 -Xjoinpoints:synchronization"> </compile> @@ -500,7 +500,7 @@ </stderr> </run> </ajc-test> - + <ajc-test dir="features152/synchronization/transformed" title="Six - preJava5"> <compile files="Six.java -Xjoinpoints:synchronization"> </compile> @@ -513,7 +513,7 @@ </stderr> </run> </ajc-test> - + <ajc-test dir="features152/synchronization/transformed" title="lock pcd on transformed non-static method"> <compile files="Seven.java -Xjoinpoints:synchronization"> </compile> @@ -537,7 +537,7 @@ </stderr> </run> </ajc-test> - + <ajc-test dir="features152/synchronization/transformed" title="lock pcd on transformed static method - J5"> <compile files="Nine.java -1.5 -Xjoinpoints:synchronization"> </compile> @@ -561,7 +561,7 @@ </stderr> </run> </ajc-test> - + <ajc-test dir="features152/synchronization/transformed" title="lock pcd on transformed static method - preJ5"> <compile files="Eleven.java -Xjoinpoints:synchronization"> </compile> @@ -585,8 +585,8 @@ </stderr> </run> </ajc-test> - - + + <ajc-test dir="features152/synchronization/transformed" title="transform static method - preJ5"> <compile files="Fifteen.java" options="-Xjoinpoints:synchronization -1.4"> </compile> @@ -598,8 +598,8 @@ </stderr> </run> </ajc-test> - - + + <ajc-test dir="features152/synchronization/transformed" title="transform static method - packages - preJ5"> <compile files="Sixteen.java" options="-Xjoinpoints:synchronization -1.4"> </compile> @@ -611,7 +611,7 @@ </stderr> </run> </ajc-test> - + <ajc-test dir="features152/synchronization" title="obtaining locked object through getArgs"> <compile files="LockingWithTJP.java" options="-Xjoinpoints:synchronization"> </compile> @@ -626,7 +626,7 @@ </stderr> </run> </ajc-test> - + <ajc-test dir="features152/synchronization/transformed" title="other targeters"> <compile files="OtherTargeters.java" options="-Xjoinpoints:synchronization"> <message kind="warning" line="8" text="advice matching the synchronized "/> @@ -638,8 +638,8 @@ </stderr> </run> </ajc-test> - - + + <ajc-test dir="features152/synchronization/transformed" title="joinpoints enabled but no lock"> <compile files="Fourteen.java" options="-Xjoinpoints:synchronization"> <!--message kind="warning" line="8" text="advice matching the synchronized "/--> 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 @@ </compile> <compile files="AbstractSuperAspect.aj" options="-1.4"/> <compile files="TestAdvice.aj" options="-1.4"/> - <run class="HelloWorld" ltw="aop-advice.xml"> + <run class="HelloWorld" ltw="aop-advice.xml" usefullltw="true"> <stdout> <line text="? ConcreteAspectWithAdvice()"/> <line text="? void HelloWorld.main(String[])"/> @@ -773,7 +773,7 @@ <compile files="TestITD.aj"> <message line="3" kind="warning" text="this affected type is not exposed to the weaver: AbstractSuperAspectWithInterface"/> </compile> - <run class="HelloWorld" ltw="aop-itd.xml"> + <run class="HelloWorld" ltw="aop-itd.xml" usefullltw="true"> <stdout> <line text="? void TestITD.interfaceMethod()"/> <line text="? void HelloWorld.main(String[])"/> @@ -789,7 +789,7 @@ <compile files="HelloWorld.java"/> <compile files="AbstractSuperAspect.aj" options="-1.4"/> <compile files="TestAroundClosure.aj" options="-1.4"/> - <run class="HelloWorld" ltw="aop-aroundclosure.xml"> + <run class="HelloWorld" ltw="aop-aroundclosure.xml" usefullltw="true"> <stdout> <line text="> ConcreteAspectWithAroundClosure()"/> <line text="< ConcreteAspectWithAroundClosure()"/> @@ -804,7 +804,7 @@ <ajc-test dir="bugs153/pr149096" title="Weave concrete sub-aspect with cflow"> <compile files="SimpleTracing.aj" outjar="out.jar"/> <compile files="TestMain.aj"/> - <run class="TestMain" ltw="aop-pr149096.xml"/> + <run class="TestMain" ltw="aop-pr149096.xml" usefullltw="true"/> </ajc-test> <ajc-test dir="bugs153/pr158957" title="NPE with LTW, pointcut library and missing aspect dependency" keywords="ltw"> 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 @@ <ajc-test dir="bugs154/pr148381/simple" title="argNames does not work - simple"> <!-- this compile is just to get code.jar into the sandbox, all the code is already precompiled in code.jar --> <compile options="-1.5" files="PerformanceMonitor.java" classpath="code.jar"/> - <run class="test.Main" classpath="code.jar" ltw="META-INF/aop.xml"> + <run class="test.Main" classpath="code.jar" ltw="META-INF/aop.xml" usefullltw="true"> <stdout> <line text="This method was intercepted by the advice: Main.foo()"/> </stdout> @@ -212,7 +212,7 @@ <!-- now loadtime weaving --> <ajc-test dir="bugs154/pr209019/case3" title="various issues with ltw and around advice - 4"> <compile options="-1.5" files="A.java,AbstractDurationMethod.java,Runner.java"/> - <run class="Runner" ltw="aop.xml"> + <run class="Runner" ltw="aop.xml" usefullltw="true"> <stdout> <line text="Proceeded at joinpoint call(Object a.b.A.m3())"/> <line text="Proceeded at joinpoint call(Object a.b.A.m2())"/> 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..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 @@ <ajc-test dir="bugs1612/xmldefs" title="xml defined advice"> <compile files="Hello.java JavaHelper.java"/> - <run class="Hello" ltw="aop.xml"> + <run class="Hello" ltw="aop.xml" usefullltw="true"> <stdout> <line text="Hello"/> <line text="in advice"/> @@ -24,7 +24,7 @@ <ajc-test dir="bugs1612/xmldefs" title="xml defined advice 2"> <compile files="Hello.java JavaHelper.java"/> - <run class="Hello" ltw="aop2.xml"> + <run class="Hello" ltw="aop2.xml" usefullltw="true"> <stdout> <line text="Hello"/> <line text="World"/> @@ -42,7 +42,7 @@ <ajc-test dir="bugs1612/xmldefs" title="xml defined advice 3"> <compile files="Hello.java JavaHelper.java"/> - <run class="Hello" ltw="aop3.xml"> + <run class="Hello" ltw="aop3.xml" usefullltw="true"> <stdout> <line text="Hello"/> <line text="World"/> @@ -60,7 +60,7 @@ <ajc-test dir="bugs1612/xmldefs" title="xml defined advice 4"> <compile files="Hello.java JavaHelper.java"/> - <run class="Hello" ltw="aop4.xml"> + <run class="Hello" ltw="aop4.xml" usefullltw="true"> <stdout> <line text="Hello"/> <line text="World"/> @@ -79,7 +79,7 @@ <ajc-test dir="bugs1612/xmldefs" title="xml defined advice 5"> <compile files="Hello2.java JavaHelper.java"/> - <run class="Hello2" ltw="aop5.xml"> + <run class="Hello2" ltw="aop5.xml" usefullltw="true"> <stdout> <line text="hello"/> <line text="in advice: s=world"/> @@ -91,7 +91,7 @@ <ajc-test dir="bugs1612/xmldefs" title="xml defined advice 6"> <compile files="Hello2.java JavaHelper.java"/> - <run class="Hello2" ltw="aop6.xml"> + <run class="Hello2" ltw="aop6.xml" usefullltw="true"> <stdout> <line text="hello"/> <line text="in advice: s=world"/> @@ -103,7 +103,7 @@ <ajc-test dir="bugs1612/xmldefs" title="xml defined advice 7"> <compile files="Hello2.java JavaHelper.java"/> - <run class="Hello2" ltw="aop7.xml"> + <run class="Hello2" ltw="aop7.xml" usefullltw="true"> <stdout> <line text="hello"/> <line text="in advice4: s=world at execution(int Hello2.say2(String))"/> @@ -115,7 +115,7 @@ <ajc-test dir="bugs1612/xmldefs" title="xml defined advice 8"> <compile files="Hello2.java JavaHelper.java"/> - <run class="Hello2" ltw="aop8.xml"> + <run class="Hello2" ltw="aop8.xml" usefullltw="true"> <stdout> <line text="hello"/> <line text="in advice6: s=world at execution(int Hello2.say2(String))"/> @@ -127,7 +127,7 @@ <ajc-test dir="bugs1612/xmldefs" title="xml defined advice 9"> <compile files="Hello2.java JavaHelper.java"/> - <run class="Hello2" ltw="aop9.xml"> + <run class="Hello2" ltw="aop9.xml" usefullltw="true"> <stdout> <line text="in around advice: s=hello at execution(void Hello2.say1(String))"/> </stdout> @@ -136,7 +136,7 @@ <ajc-test dir="bugs1612/xmldefs" title="xml defined advice 10"> <compile files="Hello2.java JavaHelper.java"/> - <run class="Hello2" ltw="aop10.xml"> + <run class="Hello2" ltw="aop10.xml" usefullltw="true"> <stdout> <line text="hello"/> <line text="in around2 advice: s=world at execution(int Hello2.say2(String))"/> @@ -146,7 +146,7 @@ <ajc-test dir="bugs1612/xmldefs" title="xml defined advice 11"> <compile files="Hello2.java JavaHelper.java"/> - <run class="Hello2" ltw="aop11.xml"> + <run class="Hello2" ltw="aop11.xml" usefullltw="true"> <stdout> <line text="hello"/> <line text="abcde"/> @@ -156,7 +156,7 @@ <ajc-test dir="bugs1612/xmldefs" title="xml defined advice 12"> <compile files="Hello3.java JavaHelper.java"/> - <run class="Hello3" ltw="aop12.xml"> + <run class="Hello3" ltw="aop12.xml" usefullltw="true"> <stdout> <line text="hello"/> <line text="around4 running"/> @@ -168,7 +168,7 @@ <ajc-test dir="bugs1612/xmldefs" title="xml defined advice 13"> <compile files="Hello2.java JavaHelper2.java"/> - <run class="Hello2" ltw="aop13.xml"> + <run class="Hello2" ltw="aop13.xml" usefullltw="true"> <stdout> <line text="in advice"/> <line text="hello"/> 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 @@ <ajc-test dir="bugs162/pr246918" title="ltw perclause"> <compile options="-1.5" files="Code.java Dode.java" outjar="code.jar"/> <compile options="-1.5 -Xlint:ignore" files="Base.java" outjar="aspects.jar"/> - <run class="Code" classpath="aspects.jar,code.jar" ltw="aop1.xml"> + <run class="Code" classpath="aspects.jar,code.jar" ltw="aop1.xml" usefullltw="true"> <stderr> <line text="advice fired class Code"/> <line text="advice fired class Dode"/> @@ -26,7 +26,7 @@ <ajc-test dir="bugs162/pr246918" title="ltw perclause - 2"> <compile options="-1.5" files="Code.java Dode.java" outjar="code.jar"/> <compile options="-1.5 -Xlint:ignore" files="Base.java" outjar="aspects.jar"/> - <run class="Code" classpath="aspects.jar,code.jar" ltw="aop2.xml"> + <run class="Code" classpath="aspects.jar,code.jar" ltw="aop2.xml" usefullltw="true"> <stderr> <line text="advice fired class Dode"/> </stderr> @@ -36,7 +36,7 @@ <ajc-test dir="bugs162/pr246918" title="ltw perclause - 3"> <compile options="-1.5" files="Code.java Dode.java" outjar="code.jar"/> <compile options="-1.5 -Xlint:ignore" files="Base2.java" outjar="aspects.jar"/> - <run class="Code" classpath="aspects.jar,code.jar" ltw="aop3.xml"> + <run class="Code" classpath="aspects.jar,code.jar" ltw="aop3.xml" usefullltw="true"> <stderr> <line text="advice fired class Dode"/> </stderr> 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 @@ <ajc-test dir="bugs164/pr266220" title="generics and aop.xml"> <compile files="Code.java"/> <compile files="Isolator.java" outjar="aspects.jar" options="-1.5"/> - <run class="Code" classpath="aspects.jar" ltw="aop.xml"> + <run class="Code" classpath="aspects.jar" ltw="aop.xml" usefullltw="true"> <stdout> <line text="execution(void Code.main(String[]))"/> <line text="execution(void Code.run())"/> 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 @@ <ajc-test dir="bugs170/xmldefs" title="xml defined dec at method"> <compile files="Hello.java Anno.java" options="-1.5"/> - <run class="Hello" ltw="aop.xml"> + <run class="Hello" ltw="aop.xml" usefullltw="true"> <stdout> <line text="Hello"/> <line text="World"/> @@ -147,7 +147,7 @@ <ajc-test dir="bugs170/xmldefs" title="xml defined dec at method 2"> <compile files="Hello.java Anno2.java" options="-1.5"/> - <run class="Hello" ltw="aop2.xml"> + <run class="Hello" ltw="aop2.xml" usefullltw="true"> <stdout> <line text="Hello"/> <line text="World"/> 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 @@ <ajc-test dir="bugs180/432178" title="percflow ltw"> <compile options="-1.8" files="A.java B.java"/> <compile options="-1.8" files="PerCFlowBug.java"/> - <run class="A" ltw="aop.xml"> + <run class="A" ltw="aop.xml" usefullltw="true"> <stdout> <line text="foo"/> <line text="bar"/> </stdout> </run> </ajc-test> - + <ajc-test dir="bugs180/pr432714" title="stackmapframe"> <compile options="-1.8" files="Code.java"/> <run class="Code"/> </ajc-test> - + <ajc-test dir="bugs180/pr431976" title="thisJoinPoint not initialized"> <compile options="-1.8" files="Code.java"/> </ajc-test> @@ -25,7 +25,7 @@ <ajc-test dir="bugs180/pr431541" title="NullAnnotationMatching exception"> <compile options="-1.8" files="Test.aj"/> </ajc-test> - + <ajc-test dir="bugs180/415957" title="annotations with 1.8 flags"> <compile files="MyAspect.aj MyClass.java Resource.java" options="-1.8 -showWeaveInfo"> <message kind="weave" text="Join point 'method-execution(void MyClass.method())' in Type 'MyClass' (MyClass.java:3) advised by before advice from 'MyAspect' (MyAspect.aj:5)"/> 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 @@ <ajc-test dir="bugs1810/508661" title="various ltw"> <compile options="-1.8" files="CacheMethodResult.java A_yes.java B_no.java Run.java" outjar="classes.jar"/> <compile options="-1.8 -Xlint:ignore" files="CacheMethodResultAspect.java" outjar="aspects.jar"/> - <run class="Run" ltw="aop.xml"> + <run class="Run" ltw="aop.xml" usefullltw="true"> <stdout> <line text="around: void A_yes.m()"/> <line text="A_yes.m()"/> 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 25f5692f2..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,392 +95,9 @@ </run> </ajc-test> - <!-- Javac/ECJ 9+ compiler option, but belated implementation in AJC 1.9.7 --> + <!-- Javac/ECJ 9+ compiler option, but belated implementation in AJC 1.9.8 --> <ajc-test dir="features198/compiler_release" vm="9" title="compile to older JDK release"> <compile files="Buffers.java" options="--release 8"/> </ajc-test> - <ajc-test dir="bugs198/github_115" title="annotation style A"> - <compile files="A.java" options="-1.5"> - <message kind="warning" line="28" text="advice defined in Azpect has not been applied [Xlint:adviceDidNotMatch]"/> - </compile> - <run class="A"> - <stdout> - <line text="Azpect.before"/> - <line text="A.main"/> - </stdout> - </run> - </ajc-test> - - <ajc-test dir="bugs198/github_115" title="annotation style B"> - <compile files="B.java" options="-1.5"/> - <run class="B"> - <stdout> - <line text="Azpect.before"/> - <line text="B.main"/> - </stdout> - </run> - </ajc-test> - - <ajc-test dir="bugs198/github_120" title="annotation style C"> - <compile files="C.java" options="-1.5"/> - <run class="C"> - <stdout> - <line text="check if() pointcut running on C(1)"/> - <line text="Azpect1.beforeAdvice executing"/> - <line text="C.run() executing"/> - </stdout> - </run> - </ajc-test> - - <ajc-test dir="bugs198/github_120" title="annotation style D"> - <compile files="D.java" options="-1.5"/> - <run class="D"> - <stdout> - <line text="advice running"/> - <line text="D.run() executing"/> - </stdout> - </run> - </ajc-test> - - <ajc-test dir="bugs198/github_122" title="annotation style negated if"> - <compile files="E.java" options="-1.5"/> - <run class="E"> - <stdout> - <line text="advice running"/> - <line text="E.run() executing"/> - </stdout> - </run> - </ajc-test> - - <ajc-test dir="bugs198/github_125" title="compiler can re-open closed JARs"> - <!-- - Here the Java test sets system property org.aspectj.weaver.openarchives to 20 in order to provoke - open JAR limit exhaustion - --> - <compile files="Application.java" options="-1.5" /> - <run class="Application"> - <stdout> - <line text="Before advice"/> - <line text="Hello world!"/> - </stdout> - </run> - </ajc-test> - - <ajc-test dir="bugs198/github_128" title="asynchronous proceed for nested around-advice (@AspectJ)"> - <compile files="Application.java MarkerA.java MarkerB.java annotation_syntax/MarkerAAspect.aj annotation_syntax/MarkerBAspect.aj" options="-1.8" /> - <run class="Application" options="1,1"> - <stdout ordered="no"> - <line text=">> Outer intercept"/> - <line text=" >> Outer proceed"/> - <line text=" >> Inner intercept"/> - <line text=" << Inner intercept"/> - <line text=" << Outer proceed"/> - <line text="<< Outer intercept"/> - <line text=" >> Inner proceed"/> - <line text=" Doing something"/> - <line text=" << Inner proceed"/> - </stdout> - </run> - <run class="Application" options="2,1"> - <stdout ordered="no"> - <line text=">> Outer intercept"/> - <line text=" >> Outer proceed"/> - <line text=" >> Inner intercept"/> - <line text=" << Inner intercept"/> - <line text=" << Outer proceed"/> - <line text=" >> Outer proceed"/> - <line text=" >> Inner intercept"/> - <line text=" >> Inner proceed"/> - <line text=" Doing something"/> - <line text=" << Inner proceed"/> - <line text=" << Inner intercept"/> - <line text=" << Outer proceed"/> - <line text=" >> Inner proceed"/> - <line text=" Doing something"/> - <line text=" << Inner proceed"/> - <line text="<< Outer intercept"/> - </stdout> - </run> - <run class="Application" options="1,2"> - <stdout ordered="no"> - <line text=">> Outer intercept"/> - <line text=" >> Outer proceed"/> - <line text=" >> Inner intercept"/> - <line text=" << Inner intercept"/> - <line text=" << Outer proceed"/> - <line text="<< Outer intercept"/> - <line text=" >> Inner proceed"/> - <line text=" Doing something"/> - <line text=" << Inner proceed"/> - <line text=" >> Inner proceed"/> - <line text=" Doing something"/> - <line text=" << Inner proceed"/> - </stdout> - </run> - <run class="Application" options="2,2"> - <stdout ordered="no"> - <line text=">> Outer intercept"/> - <line text=" >> Outer proceed"/> - <line text=" >> Inner intercept"/> - <line text=" << Inner intercept"/> - <line text=" << Outer proceed"/> - <line text=" >> Outer proceed"/> - <line text=" >> Inner intercept"/> - <line text=" >> Inner proceed"/> - <line text=" << Inner intercept"/> - <line text=" Doing something"/> - <line text=" << Inner proceed"/> - <line text=" << Outer proceed"/> - <line text=" >> Inner proceed"/> - <line text=" >> Inner proceed"/> - <line text=" Doing something"/> - <line text=" << Inner proceed"/> - <line text=" >> Inner proceed"/> - <line text=" Doing something"/> - <line text=" << Inner proceed"/> - <line text=" Doing something"/> - <line text=" << Inner proceed"/> - <line text="<< Outer intercept"/> - </stdout> - </run> - </ajc-test> - - <ajc-test dir="bugs198/github_128" title="asynchronous proceed for nested around-advice (@AspectJ, thread pool)"> - <compile files="Application.java MarkerA.java MarkerB.java annotation_syntax/MarkerAAspect.aj annotation_syntax/MarkerBAspect.aj" options="-1.8" /> - <run class="Application" options="1,1,true"> - <stdout ordered="no"> - <line text=">> Outer intercept"/> - <line text=" >> Outer proceed"/> - <line text=" >> Inner intercept"/> - <line text=" << Inner intercept"/> - <line text=" << Outer proceed"/> - <line text="<< Outer intercept"/> - <line text=" >> Inner proceed"/> - <line text=" Doing something"/> - <line text=" << Inner proceed"/> - </stdout> - </run> - <run class="Application" options="2,1,true"> - <stdout ordered="no"> - <line text=">> Outer intercept"/> - <line text=" >> Outer proceed"/> - <line text=" >> Inner intercept"/> - <line text=" << Inner intercept"/> - <line text=" << Outer proceed"/> - <line text=" >> Outer proceed"/> - <line text=" >> Inner intercept"/> - <line text=" >> Inner proceed"/> - <line text=" Doing something"/> - <line text=" << Inner proceed"/> - <line text=" << Inner intercept"/> - <line text=" << Outer proceed"/> - <line text=" >> Inner proceed"/> - <line text=" Doing something"/> - <line text=" << Inner proceed"/> - <line text="<< Outer intercept"/> - </stdout> - </run> - <run class="Application" options="1,2,true"> - <stdout ordered="no"> - <line text=">> Outer intercept"/> - <line text=" >> Outer proceed"/> - <line text=" >> Inner intercept"/> - <line text=" << Inner intercept"/> - <line text=" << Outer proceed"/> - <line text="<< Outer intercept"/> - <line text=" >> Inner proceed"/> - <line text=" Doing something"/> - <line text=" << Inner proceed"/> - <line text=" >> Inner proceed"/> - <line text=" Doing something"/> - <line text=" << Inner proceed"/> - </stdout> - </run> - <run class="Application" options="2,2,true"> - <stdout ordered="no"> - <line text=">> Outer intercept"/> - <line text=" >> Outer proceed"/> - <line text=" >> Inner intercept"/> - <line text=" << Inner intercept"/> - <line text=" << Outer proceed"/> - <line text=" >> Outer proceed"/> - <line text=" >> Inner intercept"/> - <line text=" >> Inner proceed"/> - <line text=" << Inner intercept"/> - <line text=" Doing something"/> - <line text=" << Inner proceed"/> - <line text=" << Outer proceed"/> - <line text=" >> Inner proceed"/> - <line text=" >> Inner proceed"/> - <line text=" Doing something"/> - <line text=" << Inner proceed"/> - <line text=" >> Inner proceed"/> - <line text=" Doing something"/> - <line text=" << Inner proceed"/> - <line text=" Doing something"/> - <line text=" << Inner proceed"/> - <line text="<< Outer intercept"/> - </stdout> - </run> - </ajc-test> - - <ajc-test dir="bugs198/github_128" title="asynchronous proceed for nested around-advice (native)"> - <compile files="Application.java MarkerA.java MarkerB.java native_syntax/MarkerAAspect.aj native_syntax/MarkerBAspect.aj" options="-1.8" /> - <run class="Application" options="1,1"> - <stdout ordered="no"> - <line text=">> Outer intercept"/> - <line text=" >> Outer proceed"/> - <line text=" >> Inner intercept"/> - <line text=" << Inner intercept"/> - <line text=" << Outer proceed"/> - <line text="<< Outer intercept"/> - <line text=" >> Inner proceed"/> - <line text=" Doing something"/> - <line text=" << Inner proceed"/> - </stdout> - </run> - <run class="Application" options="2,1"> - <stdout ordered="no"> - <line text=">> Outer intercept"/> - <line text=" >> Outer proceed"/> - <line text=" >> Inner intercept"/> - <line text=" << Inner intercept"/> - <line text=" << Outer proceed"/> - <line text=" >> Outer proceed"/> - <line text=" >> Inner intercept"/> - <line text=" >> Inner proceed"/> - <line text=" Doing something"/> - <line text=" << Inner proceed"/> - <line text=" << Inner intercept"/> - <line text=" << Outer proceed"/> - <line text=" >> Inner proceed"/> - <line text=" Doing something"/> - <line text=" << Inner proceed"/> - <line text="<< Outer intercept"/> - </stdout> - </run> - <run class="Application" options="1,2"> - <stdout ordered="no"> - <line text=">> Outer intercept"/> - <line text=" >> Outer proceed"/> - <line text=" >> Inner intercept"/> - <line text=" << Inner intercept"/> - <line text=" << Outer proceed"/> - <line text="<< Outer intercept"/> - <line text=" >> Inner proceed"/> - <line text=" Doing something"/> - <line text=" << Inner proceed"/> - <line text=" >> Inner proceed"/> - <line text=" Doing something"/> - <line text=" << Inner proceed"/> - </stdout> - </run> - <run class="Application" options="2,2"> - <stdout ordered="no"> - <line text=">> Outer intercept"/> - <line text=" >> Outer proceed"/> - <line text=" >> Inner intercept"/> - <line text=" << Inner intercept"/> - <line text=" << Outer proceed"/> - <line text=" >> Outer proceed"/> - <line text=" >> Inner intercept"/> - <line text=" >> Inner proceed"/> - <line text=" << Inner intercept"/> - <line text=" Doing something"/> - <line text=" << Inner proceed"/> - <line text=" << Outer proceed"/> - <line text=" >> Inner proceed"/> - <line text=" >> Inner proceed"/> - <line text=" Doing something"/> - <line text=" << Inner proceed"/> - <line text=" >> Inner proceed"/> - <line text=" Doing something"/> - <line text=" << Inner proceed"/> - <line text=" Doing something"/> - <line text=" << Inner proceed"/> - <line text="<< Outer intercept"/> - </stdout> - </run> - </ajc-test> - - <ajc-test dir="bugs198/github_128" title="asynchronous proceed for nested around-advice (native, thread pool)"> - <compile files="Application.java MarkerA.java MarkerB.java native_syntax/MarkerAAspect.aj native_syntax/MarkerBAspect.aj" options="-1.8" /> - <run class="Application" options="1,1,true"> - <stdout ordered="no"> - <line text=">> Outer intercept"/> - <line text=" >> Outer proceed"/> - <line text=" >> Inner intercept"/> - <line text=" << Inner intercept"/> - <line text=" << Outer proceed"/> - <line text="<< Outer intercept"/> - <line text=" >> Inner proceed"/> - <line text=" Doing something"/> - <line text=" << Inner proceed"/> - </stdout> - </run> - <run class="Application" options="2,1,true"> - <stdout ordered="no"> - <line text=">> Outer intercept"/> - <line text=" >> Outer proceed"/> - <line text=" >> Inner intercept"/> - <line text=" << Inner intercept"/> - <line text=" << Outer proceed"/> - <line text=" >> Outer proceed"/> - <line text=" >> Inner intercept"/> - <line text=" >> Inner proceed"/> - <line text=" Doing something"/> - <line text=" << Inner proceed"/> - <line text=" << Inner intercept"/> - <line text=" << Outer proceed"/> - <line text=" >> Inner proceed"/> - <line text=" Doing something"/> - <line text=" << Inner proceed"/> - <line text="<< Outer intercept"/> - </stdout> - </run> - <run class="Application" options="1,2,true"> - <stdout ordered="no"> - <line text=">> Outer intercept"/> - <line text=" >> Outer proceed"/> - <line text=" >> Inner intercept"/> - <line text=" << Inner intercept"/> - <line text=" << Outer proceed"/> - <line text="<< Outer intercept"/> - <line text=" >> Inner proceed"/> - <line text=" Doing something"/> - <line text=" << Inner proceed"/> - <line text=" >> Inner proceed"/> - <line text=" Doing something"/> - <line text=" << Inner proceed"/> - </stdout> - </run> - <run class="Application" options="2,2,true"> - <stdout ordered="no"> - <line text=">> Outer intercept"/> - <line text=" >> Outer proceed"/> - <line text=" >> Inner intercept"/> - <line text=" << Inner intercept"/> - <line text=" << Outer proceed"/> - <line text=" >> Outer proceed"/> - <line text=" >> Inner intercept"/> - <line text=" >> Inner proceed"/> - <line text=" << Inner intercept"/> - <line text=" Doing something"/> - <line text=" << Inner proceed"/> - <line text=" << Outer proceed"/> - <line text=" >> Inner proceed"/> - <line text=" >> Inner proceed"/> - <line text=" Doing something"/> - <line text=" << Inner proceed"/> - <line text=" >> Inner proceed"/> - <line text=" Doing something"/> - <line text=" << Inner proceed"/> - <line text=" Doing something"/> - <line text=" << Inner proceed"/> - <line text="<< Outer intercept"/> - </stdout> - </run> - </ajc-test> - </suite> 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..7baeea086 --- /dev/null +++ b/tests/src/test/resources/org/aspectj/systemtest/ajc199/ajc199.xml @@ -0,0 +1,518 @@ +<!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"[]> + + +<suite> + + <!-- Java 18 final: no new features, only 2nd preview for "JEP 420: Pattern Matching for switch (Second Preview)" --> + <ajc-test dir="features199/java18" vm="18" title="dummy Java 18"> + </ajc-test> + + <!-- Java ?? final, Java 17, 18 preview --> + <ajc-test dir="features198/java17" vm="18" title="switch pattern matching error"> + <compile files="SwitchPatternError.java" options="--enable-preview -18"> + <!-- TODO: Add correct compiler error message, as soon as JDT Core supports it --> + <message kind="error" file="SwitchPatternError.java" text="This case label is dominated by one of the preceding case label"/> + </compile> + </ajc-test> + + <!-- Java ?? final, Java 17, 18 preview --> + <ajc-test dir="features198/java17" vm="18" title="switch pattern matching java"> + <compile files="SwitchPatternOK.java" options="--enable-preview -18" /> + <run class="SwitchPatternOK" vmargs="--enable-preview"> + <stdout> + <line text="null" /> + <line text="int 123" /> + <line text="long 999" /> + <line text="double 12.340000" /> + <line text="String foo" /> + <line text="[123, foo, 999, 12.34]" /> + <line text="Non-circle" /> + <line text="Small circle" /> + <line text="Large circle" /> + <line text="Sealed sub-class A" /> + <line text="Sealed sub-class B" /> + <line text="Sealed sub-record C" /> + </stdout> + </run> + </ajc-test> + + <!-- Java ?? final, Java 17, 18 preview --> + <ajc-test dir="features198/java17" vm="18" title="switch pattern matching aspect"> + <compile files="SwitchPatternAspect.aj" options="--enable-preview -18" /> + <run class="Application" vmargs="--enable-preview"> + <stdout> + <line text="null" /> + <line text="int 123" /> + <line text="long 999" /> + <line text="double 12.340000" /> + <line text="String foo" /> + <line text="[123, foo, 999, 12.34]" /> + <line text="Non-circle" /> + <line text="Small circle" /> + <line text="Large circle" /> + <line text="Sealed sub-class A" /> + <line text="Sealed sub-class B" /> + <line text="Sealed sub-record C" /> + </stdout> + </run> + </ajc-test> + + <!-- Java ?? final, Java 17, 18 preview --> + <ajc-test dir="features199/java18" vm="18" title="switch pattern matching preview 2 error 1"> + <compile files="SwitchPatternPreview2Error1.java" options="--enable-preview -18"> + <!-- TODO: Add correct compiler error message, as soon as JDT Core supports it --> + <message kind="error" file="SwitchPatternPreview2Error1.java" text="This case label is dominated by one of the preceding case label"/> + </compile> + </ajc-test> + + <!-- Java ?? final, Java 17, 18 preview --> + <ajc-test dir="features199/java18" vm="18" title="switch pattern matching preview 2 error 2"> + <compile files="SwitchPatternPreview2Error2.java" options="--enable-preview -18"> + <!-- TODO: Add correct compiler error message, as soon as JDT Core supports it --> + <message kind="error" file="SwitchPatternPreview2Error2.java" text="This case label is dominated by one of the preceding case label"/> + </compile> + </ajc-test> + + <!-- Java ?? final, Java 17, 18 preview --> + <ajc-test dir="features199/java18" vm="18" title="switch pattern matching preview 2 java"> + <compile files="SwitchPatternPreview2OK.java" options="--enable-preview -18" /> + <run class="SwitchPatternPreview2OK" vmargs="--enable-preview"> + <message></message> + <stdout> + <line text="absolute value 1: -1" /> + <line text="other integer: 0" /> + <line text="positive integer: 42" /> + <line text="other integer: -99" /> + <line text="positive integer: 123" /> + <line text="value unavailable: null" /> +<!-- + <line text="null" /> + <line text="int 123" /> + <line text="long 999" /> + <line text="double 12.340000" /> + <line text="String foo" /> + <line text="[123, foo, 999, 12.34]" /> + <line text="Non-circle" /> + <line text="Small circle" /> + <line text="Large circle" /> + <line text="Sealed sub-class A" /> + <line text="Sealed sub-class B" /> + <line text="Sealed sub-record C" /> +--> + </stdout> + </run> + </ajc-test> + + <!-- Java ?? final, Java 17, 18 preview --> + <ajc-test dir="features199/java18" vm="18" title="switch pattern matching preview 2 aspect"> + <compile files="SwitchPatternPreview2Aspect.aj" options="--enable-preview -18" /> + <run class="Application" vmargs="--enable-preview"> + <stdout> + <line text="absolute value 1: -1" /> + <line text="other integer: 0" /> + <line text="positive integer: 42" /> + <line text="other integer: -99" /> + <line text="positive integer: 123" /> + <line text="value unavailable: null" /> +<!-- + <line text="null" /> + <line text="int 123" /> + <line text="long 999" /> + <line text="double 12.340000" /> + <line text="String foo" /> + <line text="[123, foo, 999, 12.34]" /> + <line text="Non-circle" /> + <line text="Small circle" /> + <line text="Large circle" /> + <line text="Sealed sub-class A" /> + <line text="Sealed sub-class B" /> + <line text="Sealed sub-record C" /> +--> + </stdout> + </run> + </ajc-test> + + <ajc-test dir="bugs199/github_115" title="annotation style A"> + <compile files="A.java" options="-1.5"> + <message kind="warning" line="28" text="advice defined in Azpect has not been applied [Xlint:adviceDidNotMatch]"/> + </compile> + <run class="A"> + <stdout> + <line text="Azpect.before"/> + <line text="A.main"/> + </stdout> + </run> + </ajc-test> + + <ajc-test dir="bugs199/github_115" title="annotation style B"> + <compile files="B.java" options="-1.5"/> + <run class="B"> + <stdout> + <line text="Azpect.before"/> + <line text="B.main"/> + </stdout> + </run> + </ajc-test> + + <ajc-test dir="bugs199/github_120" title="annotation style C"> + <compile files="C.java" options="-1.5"/> + <run class="C"> + <stdout> + <line text="check if() pointcut running on C(1)"/> + <line text="Azpect1.beforeAdvice executing"/> + <line text="C.run() executing"/> + </stdout> + </run> + </ajc-test> + + <ajc-test dir="bugs199/github_120" title="annotation style D"> + <compile files="D.java" options="-1.5"/> + <run class="D"> + <stdout> + <line text="advice running"/> + <line text="D.run() executing"/> + </stdout> + </run> + </ajc-test> + + <ajc-test dir="bugs199/github_122" title="annotation style negated if"> + <compile files="E.java" options="-1.5"/> + <run class="E"> + <stdout> + <line text="advice running"/> + <line text="E.run() executing"/> + </stdout> + </run> + </ajc-test> + + <ajc-test dir="bugs199/github_125" title="compiler can re-open closed JARs"> + <!-- + Here the Java test sets system property org.aspectj.weaver.openarchives to 20 in order to provoke + open JAR limit exhaustion + --> + <compile files="Application.java" options="-1.5" /> + <run class="Application"> + <stdout> + <line text="Before advice"/> + <line text="Hello world!"/> + </stdout> + </run> + </ajc-test> + + <ajc-test dir="bugs199/github_128" title="asynchronous proceed for nested around-advice (@AspectJ)"> + <compile files="Application.java MarkerA.java MarkerB.java annotation_syntax/MarkerAAspect.aj annotation_syntax/MarkerBAspect.aj" options="-1.8" /> + <run class="Application" options="1,1"> + <stdout ordered="no"> + <line text=">> Outer intercept"/> + <line text=" >> Outer proceed"/> + <line text=" >> Inner intercept"/> + <line text=" << Inner intercept"/> + <line text=" << Outer proceed"/> + <line text="<< Outer intercept"/> + <line text=" >> Inner proceed"/> + <line text=" Doing something"/> + <line text=" << Inner proceed"/> + </stdout> + </run> + <run class="Application" options="2,1"> + <stdout ordered="no"> + <line text=">> Outer intercept"/> + <line text=" >> Outer proceed"/> + <line text=" >> Inner intercept"/> + <line text=" << Inner intercept"/> + <line text=" << Outer proceed"/> + <line text=" >> Outer proceed"/> + <line text=" >> Inner intercept"/> + <line text=" >> Inner proceed"/> + <line text=" Doing something"/> + <line text=" << Inner proceed"/> + <line text=" << Inner intercept"/> + <line text=" << Outer proceed"/> + <line text=" >> Inner proceed"/> + <line text=" Doing something"/> + <line text=" << Inner proceed"/> + <line text="<< Outer intercept"/> + </stdout> + </run> + <run class="Application" options="1,2"> + <stdout ordered="no"> + <line text=">> Outer intercept"/> + <line text=" >> Outer proceed"/> + <line text=" >> Inner intercept"/> + <line text=" << Inner intercept"/> + <line text=" << Outer proceed"/> + <line text="<< Outer intercept"/> + <line text=" >> Inner proceed"/> + <line text=" Doing something"/> + <line text=" << Inner proceed"/> + <line text=" >> Inner proceed"/> + <line text=" Doing something"/> + <line text=" << Inner proceed"/> + </stdout> + </run> + <run class="Application" options="2,2"> + <stdout ordered="no"> + <line text=">> Outer intercept"/> + <line text=" >> Outer proceed"/> + <line text=" >> Inner intercept"/> + <line text=" << Inner intercept"/> + <line text=" << Outer proceed"/> + <line text=" >> Outer proceed"/> + <line text=" >> Inner intercept"/> + <line text=" >> Inner proceed"/> + <line text=" << Inner intercept"/> + <line text=" Doing something"/> + <line text=" << Inner proceed"/> + <line text=" << Outer proceed"/> + <line text=" >> Inner proceed"/> + <line text=" >> Inner proceed"/> + <line text=" Doing something"/> + <line text=" << Inner proceed"/> + <line text=" >> Inner proceed"/> + <line text=" Doing something"/> + <line text=" << Inner proceed"/> + <line text=" Doing something"/> + <line text=" << Inner proceed"/> + <line text="<< Outer intercept"/> + </stdout> + </run> + </ajc-test> + + <ajc-test dir="bugs199/github_128" title="asynchronous proceed for nested around-advice (@AspectJ, thread pool)"> + <compile files="Application.java MarkerA.java MarkerB.java annotation_syntax/MarkerAAspect.aj annotation_syntax/MarkerBAspect.aj" options="-1.8" /> + <run class="Application" options="1,1,true"> + <stdout ordered="no"> + <line text=">> Outer intercept"/> + <line text=" >> Outer proceed"/> + <line text=" >> Inner intercept"/> + <line text=" << Inner intercept"/> + <line text=" << Outer proceed"/> + <line text="<< Outer intercept"/> + <line text=" >> Inner proceed"/> + <line text=" Doing something"/> + <line text=" << Inner proceed"/> + </stdout> + </run> + <run class="Application" options="2,1,true"> + <stdout ordered="no"> + <line text=">> Outer intercept"/> + <line text=" >> Outer proceed"/> + <line text=" >> Inner intercept"/> + <line text=" << Inner intercept"/> + <line text=" << Outer proceed"/> + <line text=" >> Outer proceed"/> + <line text=" >> Inner intercept"/> + <line text=" >> Inner proceed"/> + <line text=" Doing something"/> + <line text=" << Inner proceed"/> + <line text=" << Inner intercept"/> + <line text=" << Outer proceed"/> + <line text=" >> Inner proceed"/> + <line text=" Doing something"/> + <line text=" << Inner proceed"/> + <line text="<< Outer intercept"/> + </stdout> + </run> + <run class="Application" options="1,2,true"> + <stdout ordered="no"> + <line text=">> Outer intercept"/> + <line text=" >> Outer proceed"/> + <line text=" >> Inner intercept"/> + <line text=" << Inner intercept"/> + <line text=" << Outer proceed"/> + <line text="<< Outer intercept"/> + <line text=" >> Inner proceed"/> + <line text=" Doing something"/> + <line text=" << Inner proceed"/> + <line text=" >> Inner proceed"/> + <line text=" Doing something"/> + <line text=" << Inner proceed"/> + </stdout> + </run> + <run class="Application" options="2,2,true"> + <stdout ordered="no"> + <line text=">> Outer intercept"/> + <line text=" >> Outer proceed"/> + <line text=" >> Inner intercept"/> + <line text=" << Inner intercept"/> + <line text=" << Outer proceed"/> + <line text=" >> Outer proceed"/> + <line text=" >> Inner intercept"/> + <line text=" >> Inner proceed"/> + <line text=" << Inner intercept"/> + <line text=" Doing something"/> + <line text=" << Inner proceed"/> + <line text=" << Outer proceed"/> + <line text=" >> Inner proceed"/> + <line text=" >> Inner proceed"/> + <line text=" Doing something"/> + <line text=" << Inner proceed"/> + <line text=" >> Inner proceed"/> + <line text=" Doing something"/> + <line text=" << Inner proceed"/> + <line text=" Doing something"/> + <line text=" << Inner proceed"/> + <line text="<< Outer intercept"/> + </stdout> + </run> + </ajc-test> + + <ajc-test dir="bugs199/github_128" title="asynchronous proceed for nested around-advice (native)"> + <compile files="Application.java MarkerA.java MarkerB.java native_syntax/MarkerAAspect.aj native_syntax/MarkerBAspect.aj" options="-1.8" /> + <run class="Application" options="1,1"> + <stdout ordered="no"> + <line text=">> Outer intercept"/> + <line text=" >> Outer proceed"/> + <line text=" >> Inner intercept"/> + <line text=" << Inner intercept"/> + <line text=" << Outer proceed"/> + <line text="<< Outer intercept"/> + <line text=" >> Inner proceed"/> + <line text=" Doing something"/> + <line text=" << Inner proceed"/> + </stdout> + </run> + <run class="Application" options="2,1"> + <stdout ordered="no"> + <line text=">> Outer intercept"/> + <line text=" >> Outer proceed"/> + <line text=" >> Inner intercept"/> + <line text=" << Inner intercept"/> + <line text=" << Outer proceed"/> + <line text=" >> Outer proceed"/> + <line text=" >> Inner intercept"/> + <line text=" >> Inner proceed"/> + <line text=" Doing something"/> + <line text=" << Inner proceed"/> + <line text=" << Inner intercept"/> + <line text=" << Outer proceed"/> + <line text=" >> Inner proceed"/> + <line text=" Doing something"/> + <line text=" << Inner proceed"/> + <line text="<< Outer intercept"/> + </stdout> + </run> + <run class="Application" options="1,2"> + <stdout ordered="no"> + <line text=">> Outer intercept"/> + <line text=" >> Outer proceed"/> + <line text=" >> Inner intercept"/> + <line text=" << Inner intercept"/> + <line text=" << Outer proceed"/> + <line text="<< Outer intercept"/> + <line text=" >> Inner proceed"/> + <line text=" Doing something"/> + <line text=" << Inner proceed"/> + <line text=" >> Inner proceed"/> + <line text=" Doing something"/> + <line text=" << Inner proceed"/> + </stdout> + </run> + <run class="Application" options="2,2"> + <stdout ordered="no"> + <line text=">> Outer intercept"/> + <line text=" >> Outer proceed"/> + <line text=" >> Inner intercept"/> + <line text=" << Inner intercept"/> + <line text=" << Outer proceed"/> + <line text=" >> Outer proceed"/> + <line text=" >> Inner intercept"/> + <line text=" >> Inner proceed"/> + <line text=" << Inner intercept"/> + <line text=" Doing something"/> + <line text=" << Inner proceed"/> + <line text=" << Outer proceed"/> + <line text=" >> Inner proceed"/> + <line text=" >> Inner proceed"/> + <line text=" Doing something"/> + <line text=" << Inner proceed"/> + <line text=" >> Inner proceed"/> + <line text=" Doing something"/> + <line text=" << Inner proceed"/> + <line text=" Doing something"/> + <line text=" << Inner proceed"/> + <line text="<< Outer intercept"/> + </stdout> + </run> + </ajc-test> + + <ajc-test dir="bugs199/github_128" title="asynchronous proceed for nested around-advice (native, thread pool)"> + <compile files="Application.java MarkerA.java MarkerB.java native_syntax/MarkerAAspect.aj native_syntax/MarkerBAspect.aj" options="-1.8" /> + <run class="Application" options="1,1,true"> + <stdout ordered="no"> + <line text=">> Outer intercept"/> + <line text=" >> Outer proceed"/> + <line text=" >> Inner intercept"/> + <line text=" << Inner intercept"/> + <line text=" << Outer proceed"/> + <line text="<< Outer intercept"/> + <line text=" >> Inner proceed"/> + <line text=" Doing something"/> + <line text=" << Inner proceed"/> + </stdout> + </run> + <run class="Application" options="2,1,true"> + <stdout ordered="no"> + <line text=">> Outer intercept"/> + <line text=" >> Outer proceed"/> + <line text=" >> Inner intercept"/> + <line text=" << Inner intercept"/> + <line text=" << Outer proceed"/> + <line text=" >> Outer proceed"/> + <line text=" >> Inner intercept"/> + <line text=" >> Inner proceed"/> + <line text=" Doing something"/> + <line text=" << Inner proceed"/> + <line text=" << Inner intercept"/> + <line text=" << Outer proceed"/> + <line text=" >> Inner proceed"/> + <line text=" Doing something"/> + <line text=" << Inner proceed"/> + <line text="<< Outer intercept"/> + </stdout> + </run> + <run class="Application" options="1,2,true"> + <stdout ordered="no"> + <line text=">> Outer intercept"/> + <line text=" >> Outer proceed"/> + <line text=" >> Inner intercept"/> + <line text=" << Inner intercept"/> + <line text=" << Outer proceed"/> + <line text="<< Outer intercept"/> + <line text=" >> Inner proceed"/> + <line text=" Doing something"/> + <line text=" << Inner proceed"/> + <line text=" >> Inner proceed"/> + <line text=" Doing something"/> + <line text=" << Inner proceed"/> + </stdout> + </run> + <run class="Application" options="2,2,true"> + <stdout ordered="no"> + <line text=">> Outer intercept"/> + <line text=" >> Outer proceed"/> + <line text=" >> Inner intercept"/> + <line text=" << Inner intercept"/> + <line text=" << Outer proceed"/> + <line text=" >> Outer proceed"/> + <line text=" >> Inner intercept"/> + <line text=" >> Inner proceed"/> + <line text=" << Inner intercept"/> + <line text=" Doing something"/> + <line text=" << Inner proceed"/> + <line text=" << Outer proceed"/> + <line text=" >> Inner proceed"/> + <line text=" >> Inner proceed"/> + <line text=" Doing something"/> + <line text=" << Inner proceed"/> + <line text=" >> Inner proceed"/> + <line text=" Doing something"/> + <line text=" << Inner proceed"/> + <line text=" Doing something"/> + <line text=" << Inner proceed"/> + <line text="<< Outer intercept"/> + </stdout> + </run> + </ajc-test> + +</suite> 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 @@ +<!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"[]> + +<suite> + + <!-- empty class --> + <ajc-test dir="bugs160/simplejava" title="simple - a"> + <compile files="SimpleA.java" options="-18"/> + </ajc-test> + + <!-- class with one method --> + <ajc-test dir="bugs160/simplejava" title="simple - b"> + <compile files="SimpleB.java" options="-18"/> + <run class="SimpleB"/> + </ajc-test> + + <!-- empty aspect --> + <ajc-test dir="bugs160/simplejava" title="simple - c"> + <compile files="SimpleC.java" options="-18"/> + </ajc-test> + + <!-- simple before --> + <ajc-test dir="bugs160/simplejava" title="simple - d"> + <compile files="SimpleD.java" options="-18"/> + </ajc-test> + + <!-- simple itd field --> + <ajc-test dir="bugs160/simplejava" title="simple - e"> + <compile files="SimpleE.java" options="-18"/> + </ajc-test> + + <!-- aspect with main calling a static method --> + <ajc-test dir="bugs160/simplejava" title="simple - f"> + <compile files="SimpleF.java" options="-18"/> + </ajc-test> + + <!-- pertarget --> + <ajc-test dir="bugs160/simplejava" title="simple - g"> + <compile files="SimpleG.java" options="-18"/> + </ajc-test> + + <!-- generic ctor itds --> + <ajc-test dir="bugs160/simplejava" title="simple - h"> + <compile files="SimpleH.java" options="-18"/> + </ajc-test> + + <!-- overriding generic itd methods --> + <ajc-test dir="bugs160/simplejava" title="simple - i"> + <compile files="SimpleI.java" options="-18"/> + </ajc-test> + + <!-- check class file version is 62.0 (Java 18) --> + <ajc-test dir="bugs160/simplejava" title="simple - j"> + <compile files="SimpleJ.java" options="-18"/> + </ajc-test> + + <!-- check class file version is 62.0 (Java 18) --> + <ajc-test dir="bugs160/simplejava" title="simple - k"> + <compile files="SimpleJ.java" options="-source 18"/> + </ajc-test> + + <!-- check class file version is 49.0 --> + <ajc-test dir="bugs160/simplejava" title="simple - m"> + <compile files="SimpleJ.java" options="-1.5"/> + </ajc-test> + + <ajc-test dir="bugs160/simplejava" title="simple - n"> + <compile files="SimpleN.java" options="-18"/> + </ajc-test> + +</suite> diff --git a/util/pom.xml b/util/pom.xml index e02f6255e..ca3e31e75 100644 --- a/util/pom.xml +++ b/util/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.aspectj</groupId> <artifactId>aspectj-parent</artifactId> - <version>1.9.9-SNAPSHOT</version> + <version>1.9.10-SNAPSHOT</version> </parent> <artifactId>util</artifactId> 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" * diff --git a/weaver/pom.xml b/weaver/pom.xml index 0e03383a0..966f6791a 100644 --- a/weaver/pom.xml +++ b/weaver/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.aspectj</groupId> <artifactId>aspectj-parent</artifactId> - <version>1.9.9-SNAPSHOT</version> + <version>1.9.10-SNAPSHOT</version> </parent> <artifactId>weaver</artifactId> |