fail-fast: false | fail-fast: false | ||||
matrix: | matrix: | ||||
# Check for available Temurin releases on https://adoptium.net/releases.html | # Check for available Temurin releases on https://adoptium.net/releases.html | ||||
java: [ 11, 17, 18 ] | |||||
java: [ 11, 17, 19 ] | |||||
runs-on: ubuntu-latest | runs-on: ubuntu-latest | ||||
<parent> | <parent> | ||||
<groupId>org.aspectj</groupId> | <groupId>org.aspectj</groupId> | ||||
<artifactId>aspectj-parent</artifactId> | <artifactId>aspectj-parent</artifactId> | ||||
<version>1.9.10-SNAPSHOT</version> | |||||
<version>1.9.19-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>ajde.core</artifactId> | <artifactId>ajde.core</artifactId> |
<parent> | <parent> | ||||
<groupId>org.aspectj</groupId> | <groupId>org.aspectj</groupId> | ||||
<artifactId>aspectj-parent</artifactId> | <artifactId>aspectj-parent</artifactId> | ||||
<version>1.9.10-SNAPSHOT</version> | |||||
<version>1.9.19-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>ajde</artifactId> | <artifactId>ajde</artifactId> |
<parent> | <parent> | ||||
<groupId>org.aspectj</groupId> | <groupId>org.aspectj</groupId> | ||||
<artifactId>aspectj-parent</artifactId> | <artifactId>aspectj-parent</artifactId> | ||||
<version>1.9.10-SNAPSHOT</version> | |||||
<version>1.9.19-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>ajdoc</artifactId> | <artifactId>ajdoc</artifactId> |
<parent> | <parent> | ||||
<groupId>org.aspectj</groupId> | <groupId>org.aspectj</groupId> | ||||
<artifactId>aspectj-parent</artifactId> | <artifactId>aspectj-parent</artifactId> | ||||
<version>1.9.10-SNAPSHOT</version> | |||||
<version>1.9.19-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>asm</artifactId> | <artifactId>asm</artifactId> |
<parent> | <parent> | ||||
<groupId>org.aspectj</groupId> | <groupId>org.aspectj</groupId> | ||||
<artifactId>aspectj-parent</artifactId> | <artifactId>aspectj-parent</artifactId> | ||||
<version>1.9.10-SNAPSHOT</version> | |||||
<version>1.9.19-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>aspectjmatcher</artifactId> | <artifactId>aspectjmatcher</artifactId> |
<parent> | <parent> | ||||
<groupId>org.aspectj</groupId> | <groupId>org.aspectj</groupId> | ||||
<artifactId>aspectj-parent</artifactId> | <artifactId>aspectj-parent</artifactId> | ||||
<version>1.9.10-SNAPSHOT</version> | |||||
<version>1.9.19-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>aspectjrt</artifactId> | <artifactId>aspectjrt</artifactId> |
<parent> | <parent> | ||||
<groupId>org.aspectj</groupId> | <groupId>org.aspectj</groupId> | ||||
<artifactId>aspectj-parent</artifactId> | <artifactId>aspectj-parent</artifactId> | ||||
<version>1.9.10-SNAPSHOT</version> | |||||
<version>1.9.19-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>aspectjtools</artifactId> | <artifactId>aspectjtools</artifactId> |
<parent> | <parent> | ||||
<groupId>org.aspectj</groupId> | <groupId>org.aspectj</groupId> | ||||
<artifactId>aspectj-parent</artifactId> | <artifactId>aspectj-parent</artifactId> | ||||
<version>1.9.10-SNAPSHOT</version> | |||||
<version>1.9.19-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>aspectjweaver</artifactId> | <artifactId>aspectjweaver</artifactId> |
<parent> | <parent> | ||||
<groupId>org.aspectj</groupId> | <groupId>org.aspectj</groupId> | ||||
<artifactId>aspectj-parent</artifactId> | <artifactId>aspectj-parent</artifactId> | ||||
<version>1.9.10-SNAPSHOT</version> | |||||
<version>1.9.19-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>bcel-builder</artifactId> | <artifactId>bcel-builder</artifactId> |
short MINOR_17 = 0; | short MINOR_17 = 0; | ||||
short MAJOR_18 = 62; | short MAJOR_18 = 62; | ||||
short MINOR_18 = 0; | short MINOR_18 = 0; | ||||
// short MAJOR_19 = 63; | |||||
// short MINOR_19 = 0; | |||||
short MAJOR_19 = 63; | |||||
short MINOR_19 = 0; | |||||
// short MAJOR_20 = 64; | |||||
// short MINOR_20 = 0; | |||||
int PREVIEW_MINOR_VERSION = 65535; | int PREVIEW_MINOR_VERSION = 65535; | ||||
<parent> | <parent> | ||||
<groupId>org.aspectj</groupId> | <groupId>org.aspectj</groupId> | ||||
<artifactId>aspectj-parent</artifactId> | <artifactId>aspectj-parent</artifactId> | ||||
<version>1.9.10-SNAPSHOT</version> | |||||
<version>1.9.19-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>bridge</artifactId> | <artifactId>bridge</artifactId> |
<parent> | <parent> | ||||
<groupId>org.aspectj</groupId> | <groupId>org.aspectj</groupId> | ||||
<artifactId>aspectj-parent</artifactId> | <artifactId>aspectj-parent</artifactId> | ||||
<version>1.9.10-SNAPSHOT</version> | |||||
<version>1.9.19-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>build</artifactId> | <artifactId>build</artifactId> |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> | |||||
<html> | |||||
<head> | |||||
<title>AspectJ 1.9.19 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.19</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.19 can be found here: | |||||
<ul> | |||||
<li><a href="https://github.com/eclipse/org.aspectj/issues?q=is%3Aissue+is%3Aclosed++milestone%3A1.9.19">GitHub 1.9.19</a></li> | |||||
<li><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.19">Bugzilla 1.9.19</a></li> | |||||
</ul> | |||||
</p> | |||||
<h2>New features</h2> | |||||
<p> | |||||
AspectJ 1.9.19 supports <a href="https://openjdk.java.net/projects/jdk/19/">Java 19</a> and its final, preview and | |||||
incubator features, such as: | |||||
</p> | |||||
<ul> | |||||
<li>Record patterns (preview)</li> | |||||
<li>Virtual threads (preview)</li> | |||||
<li>Pattern matching for <tt>switch</tt> (preview 3)</li> | |||||
<li>Structured concurrency (incubator)</li> | |||||
</ul> | |||||
Please note that the upstream Eclipse Java Compiler (ECJ) which the AspectJ Compiler (AJC) is a fork of still has some | |||||
open issues concerning Java 19 preview feature support, see the list in | |||||
<a href="https://github.com/eclipse/org.aspectj/issues/184#issuecomment-1272254940">this comment</a>. AJC therefore | |||||
inherits the same problems for the specific cases described in the linked issues. | |||||
<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/features199/java18"> | |||||
Pattern matching for switch (preview 3), record patterns (preview 1) | |||||
</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> | |||||
<li> | |||||
Please note that presently there is no specific sample code for virtual threads and structured concurrency in the | |||||
AspectJ code base, because these are just new APIs, no Java language features. You can find sample code for these | |||||
concurrency features elsewhere, e.g. in the corresponding JEPs. In AspectJ, they should just work transparently | |||||
like any other Java API. | |||||
</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.19 on DD-MMM-2022 | |||||
</p> | |||||
</body> | |||||
</html> |
<tr> <td>README's | <tr> <td>README's | ||||
</td> | </td> | ||||
<td>Changes and porting guide for AspectJ | <td>Changes and porting guide for AspectJ | ||||
<a href="README-1919.html">1.9.19</a>, | |||||
<a href="README-199.html">1.9.9 and 1.9.9.1</a>, | |||||
<a href="README-198.html">1.9.8</a>, | <a href="README-198.html">1.9.8</a>, | ||||
<a href="README-197.html">1.9.7</a>, | <a href="README-197.html">1.9.7</a>, | ||||
<a href="README-196.html">1.9.6</a>, | <a href="README-196.html">1.9.6</a>, |
<parent> | <parent> | ||||
<groupId>org.aspectj</groupId> | <groupId>org.aspectj</groupId> | ||||
<artifactId>aspectj-parent</artifactId> | <artifactId>aspectj-parent</artifactId> | ||||
<version>1.9.10-SNAPSHOT</version> | |||||
<version>1.9.19-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>docs</artifactId> | <artifactId>docs</artifactId> |
<parent> | <parent> | ||||
<groupId>org.aspectj</groupId> | <groupId>org.aspectj</groupId> | ||||
<artifactId>aspectj-parent</artifactId> | <artifactId>aspectj-parent</artifactId> | ||||
<version>1.9.10-SNAPSHOT</version> | |||||
<version>1.9.19-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>installer</artifactId> | <artifactId>installer</artifactId> |
<parent> | <parent> | ||||
<groupId>org.aspectj</groupId> | <groupId>org.aspectj</groupId> | ||||
<artifactId>aspectj-parent</artifactId> | <artifactId>aspectj-parent</artifactId> | ||||
<version>1.9.10-SNAPSHOT</version> | |||||
<version>1.9.19-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>lib</artifactId> | <artifactId>lib</artifactId> |
<parent> | <parent> | ||||
<groupId>org.aspectj</groupId> | <groupId>org.aspectj</groupId> | ||||
<artifactId>aspectj-parent</artifactId> | <artifactId>aspectj-parent</artifactId> | ||||
<version>1.9.10-SNAPSHOT</version> | |||||
<version>1.9.19-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>loadtime</artifactId> | <artifactId>loadtime</artifactId> |
<parent> | <parent> | ||||
<groupId>org.aspectj</groupId> | <groupId>org.aspectj</groupId> | ||||
<artifactId>aspectj-parent</artifactId> | <artifactId>aspectj-parent</artifactId> | ||||
<version>1.9.10-SNAPSHOT</version> | |||||
<version>1.9.19-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>org.aspectj.ajdt.core</artifactId> | <artifactId>org.aspectj.ajdt.core</artifactId> |
package org.aspectj.ajdt.internal.core.builder; | package org.aspectj.ajdt.internal.core.builder; | ||||
import org.aspectj.bridge.IProgressListener; | import org.aspectj.bridge.IProgressListener; | ||||
import org.eclipse.core.resources.IProject; | |||||
import org.eclipse.core.runtime.IProgressMonitor; | import org.eclipse.core.runtime.IProgressMonitor; | ||||
import org.aspectj.org.eclipse.jdt.internal.core.builder.BuildNotifier; | import org.aspectj.org.eclipse.jdt.internal.core.builder.BuildNotifier; | ||||
import java.util.function.BooleanSupplier; | |||||
/** | /** | ||||
* @author colyer | * @author colyer | ||||
* | * | ||||
* @param monitor | * @param monitor | ||||
* @param project | * @param project | ||||
*/ | */ | ||||
public AjBuildNotifier(IProgressMonitor monitor, IProject project) { | |||||
super(monitor, project); | |||||
public AjBuildNotifier(IProgressMonitor monitor, int buildKind, BooleanSupplier interruptSupplier) { | |||||
super(monitor, buildKind, interruptSupplier); | |||||
} | } | ||||
/* (non-Javadoc) | /* (non-Javadoc) |
import java.util.Locale; | import java.util.Locale; | ||||
import java.util.Map; | import java.util.Map; | ||||
import java.util.Properties; | import java.util.Properties; | ||||
import java.util.function.BooleanSupplier; | |||||
import org.aspectj.ajdt.core.AspectJCore; | import org.aspectj.ajdt.core.AspectJCore; | ||||
import org.aspectj.ajdt.internal.compiler.CompilerAdapter; | import org.aspectj.ajdt.internal.compiler.CompilerAdapter; | ||||
* @see org.eclipse.jdt.internal.core.builder.JavaBuilder#createBuildNotifier(org.eclipse.core.runtime.IProgressMonitor, | * @see org.eclipse.jdt.internal.core.builder.JavaBuilder#createBuildNotifier(org.eclipse.core.runtime.IProgressMonitor, | ||||
* org.eclipse.core.resources.IProject) | * org.eclipse.core.resources.IProject) | ||||
*/ | */ | ||||
protected BuildNotifier createBuildNotifier(IProgressMonitor monitor, IProject currentProject) { | |||||
return new AjBuildNotifier(monitor, currentProject); | |||||
protected BuildNotifier createBuildNotifier(IProgressMonitor monitor, int buildKind, BooleanSupplier interruptSupplier) { | |||||
return new AjBuildNotifier(monitor, buildKind, interruptSupplier); | |||||
} | } | ||||
private void initWorldAndWeaver(AjCompilerOptions options) { | private void initWorldAndWeaver(AjCompilerOptions options) { |
compiler.name = AspectJ Compiler | compiler.name = AspectJ Compiler | ||||
compiler.version = Eclipse Compiler d3a80f1f9b2f8a (21Mar2022) - Java18 | |||||
compiler.version = Eclipse Compiler 19f448f47c9e3e (15Dec2022) - Java19 | |||||
compiler.copyright = | compiler.copyright = | ||||
misc.version = {0} {1} - {2} {3} | misc.version = {0} {1} - {2} {3} |
<parent> | <parent> | ||||
<groupId>org.aspectj</groupId> | <groupId>org.aspectj</groupId> | ||||
<artifactId>aspectj-parent</artifactId> | <artifactId>aspectj-parent</artifactId> | ||||
<version>1.9.10-SNAPSHOT</version> | |||||
<version>1.9.19-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>org.aspectj.matcher</artifactId> | <artifactId>org.aspectj.matcher</artifactId> |
<groupId>org.aspectj</groupId> | <groupId>org.aspectj</groupId> | ||||
<artifactId>aspectj-parent</artifactId> | <artifactId>aspectj-parent</artifactId> | ||||
<version>1.9.10-SNAPSHOT</version> | |||||
<version>1.9.19-SNAPSHOT</version> | |||||
<packaging>pom</packaging> | <packaging>pom</packaging> | ||||
<name>AspectJ Parent Project</name> | <name>AspectJ Parent Project</name> | ||||
<maven.javadoc.skip>true</maven.javadoc.skip> | <maven.javadoc.skip>true</maven.javadoc.skip> | ||||
<!-- Dependency versions --> | <!-- Dependency versions --> | ||||
<jdt.core.version>1.9.9.1</jdt.core.version> | |||||
<asm.version>9.2</asm.version> | |||||
<jdt.core.version>1.9.19-SNAPSHOT</jdt.core.version> | |||||
<asm.version>9.4</asm.version> | |||||
<lib.ant.version>1.6.3</lib.ant.version> | <lib.ant.version>1.6.3</lib.ant.version> | ||||
<lib.ant.xerces.version>2.6.2</lib.ant.xerces.version> | <lib.ant.xerces.version>2.6.2</lib.ant.xerces.version> | ||||
<lib.regexp.version>1.2</lib.regexp.version> | <lib.regexp.version>1.2</lib.regexp.version> |
<parent> | <parent> | ||||
<groupId>org.aspectj</groupId> | <groupId>org.aspectj</groupId> | ||||
<artifactId>aspectj-parent</artifactId> | <artifactId>aspectj-parent</artifactId> | ||||
<version>1.9.10-SNAPSHOT</version> | |||||
<version>1.9.19-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>run-all-junit-tests</artifactId> | <artifactId>run-all-junit-tests</artifactId> |
<parent> | <parent> | ||||
<groupId>org.aspectj</groupId> | <groupId>org.aspectj</groupId> | ||||
<artifactId>aspectj-parent</artifactId> | <artifactId>aspectj-parent</artifactId> | ||||
<version>1.9.10-SNAPSHOT</version> | |||||
<version>1.9.19-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>runtime</artifactId> | <artifactId>runtime</artifactId> |
<parent> | <parent> | ||||
<groupId>org.aspectj</groupId> | <groupId>org.aspectj</groupId> | ||||
<artifactId>aspectj-parent</artifactId> | <artifactId>aspectj-parent</artifactId> | ||||
<version>1.9.10-SNAPSHOT</version> | |||||
<version>1.9.19-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>taskdefs</artifactId> | <artifactId>taskdefs</artifactId> |
static final String[] TARGET_INPUTS = new String[] { | 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", | "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" | |||||
"10", "11", "12", "13", "14", "15", "16", "17", "18", "19" | |||||
}; | }; | ||||
static final String[] SOURCE_INPUTS = new String[] { | static final String[] SOURCE_INPUTS = new String[] { | ||||
"1.3", "1.4", "1.5", "1.6", "1.7", "1.8", "1.9", "9", | "1.3", "1.4", "1.5", "1.6", "1.7", "1.8", "1.9", "9", | ||||
"10", "11", "12", "13", "14", "15", "16", "17", "18" | |||||
"10", "11", "12", "13", "14", "15", "16", "17", "18", "19" | |||||
}; | }; | ||||
static final String[] COMPLIANCE_INPUTS = new String[] { | static final String[] COMPLIANCE_INPUTS = new String[] { | ||||
"-1.3", "-1.4", "-1.5", "-1.6", "-1.7", "-1.8", "-1.9", "-9", | "-1.3", "-1.4", "-1.5", "-1.6", "-1.7", "-1.8", "-1.9", "-9", | ||||
"-10", "-11", "-12", "-13", "-14", "-15", "-16", "-17", "-18" | |||||
"-10", "-11", "-12", "-13", "-14", "-15", "-16", "-17", "-18", "-19" | |||||
}; | }; | ||||
private static final ICommandEditor COMMAND_EDITOR; | private static final ICommandEditor COMMAND_EDITOR; |
<parent> | <parent> | ||||
<groupId>org.aspectj</groupId> | <groupId>org.aspectj</groupId> | ||||
<artifactId>aspectj-parent</artifactId> | <artifactId>aspectj-parent</artifactId> | ||||
<version>1.9.10-SNAPSHOT</version> | |||||
<version>1.9.19-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>testing-client</artifactId> | <artifactId>testing-client</artifactId> |
<parent> | <parent> | ||||
<groupId>org.aspectj</groupId> | <groupId>org.aspectj</groupId> | ||||
<artifactId>aspectj-parent</artifactId> | <artifactId>aspectj-parent</artifactId> | ||||
<version>1.9.10-SNAPSHOT</version> | |||||
<version>1.9.19-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>testing-drivers</artifactId> | <artifactId>testing-drivers</artifactId> |
<parent> | <parent> | ||||
<groupId>org.aspectj</groupId> | <groupId>org.aspectj</groupId> | ||||
<artifactId>aspectj-parent</artifactId> | <artifactId>aspectj-parent</artifactId> | ||||
<version>1.9.10-SNAPSHOT</version> | |||||
<version>1.9.19-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>testing-util</artifactId> | <artifactId>testing-util</artifactId> |
<parent> | <parent> | ||||
<groupId>org.aspectj</groupId> | <groupId>org.aspectj</groupId> | ||||
<artifactId>aspectj-parent</artifactId> | <artifactId>aspectj-parent</artifactId> | ||||
<version>1.9.10-SNAPSHOT</version> | |||||
<version>1.9.19-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>testing</artifactId> | <artifactId>testing</artifactId> |
import org.aspectj.tools.ajc.AjcTestCase; | import org.aspectj.tools.ajc.AjcTestCase; | ||||
import org.aspectj.util.LangUtil; | import org.aspectj.util.LangUtil; | ||||
import static java.lang.Double.parseDouble; | |||||
public class OutputSpec { | public class OutputSpec { | ||||
private List<String> expectedOutputLines = new ArrayList<>(); | private List<String> expectedOutputLines = new ArrayList<>(); | ||||
} | } | ||||
/** | /** | ||||
* For a test output line that has specified a vm version, check if it matches the vm we are running on. | |||||
* vm might be "1.2,1.3,1.4,1.5" or simply "9" or it may be a version with a '+' suffix indicating that | |||||
* level or later, e.g. "9+" should be ok on Java 10 | |||||
* @return true if the current vm version matches the spec | |||||
* For a test output line that has specified list of JVM version ranges, determine whether the JVM we are running on | |||||
* matches at least one of those ranges. | |||||
* | |||||
* @param vmVersionRanges might be a single version like "9", a list of versions like "1.2,1.3,1.4,1.5", an equivalent | |||||
* range of "1.2-1.5", an open range like "-1.8", "9-" (equivalent to "9+") or a more complex list of ranges | |||||
* like "-1.6,9-11,13-14,17-" or "8,11,16+". Empty ranges like in "", " ", "8,,14", ",5", "6-," will be | |||||
* ignored. I.e., they will not yield a positive match. Bogus ranges like "9-11-14" will be ignored, too. | |||||
* | |||||
* @return true if the current vmVersionRanges version matches the spec | |||||
*/ | */ | ||||
private boolean matchesThisVm(String vm) { | |||||
// vm might be 1.2, 1.3, 1.4, 1.5 or 1.9 possibly with a '+' in there | |||||
// For now assume + is attached to there only being one version, like "9+" | |||||
// System.out.println("Checking "+vm+" for "+LangUtil.getVmVersionString()); | |||||
String v = LangUtil.getVmVersionString(); | |||||
if (v.endsWith(".0")) { | |||||
v = v.substring(0,v.length()-2); | |||||
} | |||||
if (vm.contains(v)) { | |||||
return true; | |||||
} | |||||
if (vm.endsWith("+")) { | |||||
double vmVersion = LangUtil.getVmVersion(); | |||||
double vmSpecified = Double.parseDouble(vm.substring(0,vm.length()-1)); | |||||
return vmVersion >= vmSpecified; | |||||
} | |||||
return false; | |||||
private boolean matchesThisVm(String vmVersionRanges) { | |||||
double currentVmVersion = LangUtil.getVmVersion(); | |||||
return Arrays.stream(vmVersionRanges.split(",")) | |||||
.map(String::trim) | |||||
.filter(range -> !range.isEmpty()) | |||||
.map(range -> range | |||||
.replaceFirst("^([0-9.]+)$", "$1-$1") // single version 'n' to range 'n-n' | |||||
.replaceFirst("^-", "0-") // left open range '-n' to '0-n' | |||||
.replaceFirst("[+-]$", "-99999") // right open range 'n-' or 'n+' to 'n-99999' | |||||
.split("-") // range 'n-m' to array ['n', 'm'] | |||||
) | |||||
.filter(range -> range.length == 2) | |||||
.map(range -> new double[] { parseDouble(range[0]), parseDouble(range[1]) }) | |||||
//.filter(range -> { System.out.println(range[0] + " - " +range[1]); return true; }) | |||||
.anyMatch(range -> range[0] <= currentVmVersion && range[1] >= currentVmVersion); | |||||
} | } | ||||
public void matchAgainst(String output) { | public void matchAgainst(String output) { |
/* ******************************************************************* | /* ******************************************************************* | ||||
* Copyright (c) 2021 Contributors | |||||
* Copyright (c) 2022 Contributors | |||||
* All rights reserved. | * All rights reserved. | ||||
* This program and the accompanying materials are made available | * This program and the accompanying materials are made available | ||||
* under the terms of the Eclipse Public License v 2.0 | * under the terms of the Eclipse Public License v 2.0 | ||||
@Override | @Override | ||||
public void setUp() throws Exception { | public void setUp() throws Exception { | ||||
// Activate this block after upgrading to JDT Core Java 19 | // Activate this block after upgrading to JDT Core Java 19 | ||||
/* | |||||
throw new IllegalStateException( | throw new IllegalStateException( | ||||
"These tests need a Java 18 level AspectJ compiler " + | "These tests need a Java 18 level AspectJ compiler " + | ||||
"(e.g. because they use version-specific preview features). " + | "(e.g. because they use version-specific preview features). " + | ||||
"This compiler does not support preview features of a previous version anymore." | "This compiler does not support preview features of a previous version anymore." | ||||
); | ); | ||||
*/ | |||||
// Activate this block before upgrading to JDT Core Java 19 | // Activate this block before upgrading to JDT Core Java 19 | ||||
/* | |||||
if (!LangUtil.is18VMOrGreater() || LangUtil.is19VMOrGreater()) { | if (!LangUtil.is18VMOrGreater() || LangUtil.is19VMOrGreater()) { | ||||
throw new IllegalStateException( | throw new IllegalStateException( | ||||
"These tests should be run on Java 18 only " + | "These tests should be run on Java 18 only " + | ||||
); | ); | ||||
} | } | ||||
super.setUp(); | super.setUp(); | ||||
*/ | |||||
} | } | ||||
} | } |
/* ******************************************************************* | /* ******************************************************************* | ||||
* Copyright (c) 2021 Contributors | |||||
* Copyright (c) 2022 Contributors | |||||
* All rights reserved. | * All rights reserved. | ||||
* This program and the accompanying materials are made available | * This program and the accompanying materials are made available | ||||
* under the terms of the Eclipse Public License v 2.0 | * under the terms of the Eclipse Public License v 2.0 |
/* ******************************************************************* | |||||
* Copyright (c) 2022 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 XMLBasedAjcTestCaseForJava19Only extends XMLBasedAjcTestCase { | |||||
@Override | |||||
public void setUp() throws Exception { | |||||
// Activate this block after upgrading to JDT Core Java 20 | |||||
/* | |||||
throw new IllegalStateException( | |||||
"These tests need a Java 19 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 20 | |||||
if (!LangUtil.is19VMOrGreater() || LangUtil.is20VMOrGreater()) { | |||||
throw new IllegalStateException( | |||||
"These tests should be run on Java 19 only " + | |||||
"(e.g. because they use version-specific preview features)" | |||||
); | |||||
} | |||||
super.setUp(); | |||||
} | |||||
} |
/* ******************************************************************* | |||||
* Copyright (c) 2022 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 XMLBasedAjcTestCaseForJava19OrLater extends XMLBasedAjcTestCase { | |||||
@Override | |||||
public void setUp() throws Exception { | |||||
if (!LangUtil.is19VMOrGreater()) | |||||
throw new IllegalStateException("These tests should be run on Java 19 or later"); | |||||
super.setUp(); | |||||
} | |||||
} |
public aspect RecordPatternsPreview1Aspect { | |||||
public static void main(String[] args) { | |||||
doSomething(new Point(2, 7)); | |||||
doSomething(new Rectangle( | |||||
new ColoredPoint(new Point(1, 6), Color.RED), | |||||
new ColoredPoint(new Point(4, 6), Color.BLUE) | |||||
)); | |||||
} | |||||
public static void doSomething(Object object) { | |||||
System.out.println("Doing something with " + object); | |||||
} | |||||
before(Object object): execution(* doSomething(*)) && args(object) { | |||||
if (object instanceof Point p) { | |||||
int x = p.x(); | |||||
int y = p.y(); | |||||
System.out.println(x + y); | |||||
} | |||||
if (object instanceof Point(int x, int y)) | |||||
System.out.println(x * y); | |||||
if (object instanceof Rectangle(ColoredPoint ul, ColoredPoint lr)) | |||||
System.out.println("Upper-left color: " + ul.c()); | |||||
if (object instanceof Rectangle(ColoredPoint(Point p, Color c), ColoredPoint lr)) | |||||
System.out.println("Upper-left color: " + c); | |||||
if (object instanceof Rectangle(ColoredPoint(Point(var x, var y), var c), var lr)) | |||||
System.out.println("Upper-left x coordinate: " + x); | |||||
} | |||||
} | |||||
record Point(int x,int y){} | |||||
enum Color { RED, GREEN, BLUE } | |||||
record ColoredPoint(Point p, Color c) {} | |||||
record Rectangle(ColoredPoint upperLeft, ColoredPoint lowerRight) {} |
/** | |||||
* This was not working as expected in ECJ after the initial Java 19 merge the JDT Core main line, | |||||
* see https://github.com/eclipse-jdt/eclipse.jdt.core/issues/450. | |||||
*/ | |||||
public class RecordPatternsPreview1Error { | |||||
public static void main(String[] args) { | |||||
erroneousTest1(new Box<>("A")); | |||||
erroneousTest2(new Box<>("B")); | |||||
} | |||||
static void erroneousTest1(Box<Object> bo) { | |||||
if (bo instanceof Box(var s)) { // Javac error: raw deconstruction patterns are not allowed | |||||
System.out.println("I'm a box"); | |||||
} | |||||
} | |||||
static void erroneousTest2(Box b) { | |||||
if (b instanceof Box(var t)) { // Javac error: raw deconstruction patterns are not allowed | |||||
System.out.println("I'm a box"); | |||||
} | |||||
} | |||||
} | |||||
record Box<T>(T t) {} |
public aspect RecordPatternsPreview1ExhaustivenessAspect { | |||||
static Pair<I> p2 = new Pair<>(new C(), new D()); | |||||
public static void main(String[] args) { | |||||
doSomething(p2); | |||||
} | |||||
public static void doSomething(Pair pair) { | |||||
System.out.println(pair.toString().replaceAll("@[0-9a-f]+", "@000")); | |||||
} | |||||
before(Pair pair) : execution(* doSomething(Pair)) && args(pair) { | |||||
switch (pair) { | |||||
case Pair<I>(I i, C c) -> System.out.println("x"); | |||||
case Pair<I>(I i, D d) -> System.out.println("y"); | |||||
// TODO: Remove redundant default clause when https://github.com/eclipse-jdt/eclipse.jdt.core/issues/455 | |||||
// has been fixed. But even with the default clause, it generates wrong byte code and throws runtime error: | |||||
// NoSuchMethodError: 'I Pair.x()' | |||||
default -> System.out.println("z"); | |||||
} | |||||
switch (pair) { | |||||
case Pair<I>(C c, I i) -> System.out.println("a"); | |||||
case Pair<I>(D d, C c) -> System.out.println("b"); | |||||
case Pair<I>(D d1, D d2) -> System.out.println("c"); | |||||
// TODO: remove redundant default clause when https://github.com/eclipse-jdt/eclipse.jdt.core/issues/455 | |||||
// has been fixed. But even with the default clause, it generates wrong byte code and throws runtime error: | |||||
// NoSuchMethodError: 'I Pair.x()' | |||||
default -> System.out.println("d"); | |||||
} | |||||
} | |||||
} | |||||
sealed interface I permits C, D { } | |||||
final class C implements I { } | |||||
final class D implements I { } | |||||
record Pair<T>(T x, T y) { } |
public class RecordPatternsPreview1ExhaustivenessError { | |||||
static Pair<I> p2 = new Pair<>(new C(), new D()); | |||||
public static void main(String[] args) { | |||||
exhaustiveSwitch(); | |||||
} | |||||
static void exhaustiveSwitch() { | |||||
switch (p2) { | |||||
case Pair<I>(C fst, D snd) -> System.out.println("a"); | |||||
case Pair<I>(D fst, C snd) -> System.out.println("b"); | |||||
case Pair<I>(I fst, C snd) -> System.out.println("c"); | |||||
} | |||||
} | |||||
} | |||||
class A { } | |||||
class B extends A { } | |||||
sealed interface I permits C, D { } | |||||
final class C implements I { } | |||||
final class D implements I { } | |||||
record Pair<T>(T x, T y) { } |
public class RecordPatternsPreview1ExhaustivenessOK1 { | |||||
static Pair<A> p1 = new Pair<>(new A(), new B()); | |||||
static Pair<I> p2 = new Pair<>(new C(), new D()); | |||||
public static void main(String[] args) { | |||||
exhaustiveSwitch(); | |||||
} | |||||
static void exhaustiveSwitch() { | |||||
switch (p2) { | |||||
case Pair<I>(I i, C c) -> System.out.println("x"); | |||||
case Pair<I>(I i, D d) -> System.out.println("y"); | |||||
} | |||||
switch (p2) { | |||||
case Pair<I>(C c, I i) -> System.out.println("a"); | |||||
case Pair<I>(D d, C c) -> System.out.println("b"); | |||||
case Pair<I>(D d1, D d2) -> System.out.println("c"); | |||||
} | |||||
} | |||||
} | |||||
class A { } | |||||
class B extends A { } | |||||
sealed interface I permits C, D { } | |||||
final class C implements I { } | |||||
final class D implements I { } | |||||
record Pair<T>(T x, T y) { } |
public class RecordPatternsPreview1ExhaustivenessOK2 { | |||||
public static void main(String[] args) { | |||||
Person person = new Person("Bob", 12); | |||||
switch (person) { | |||||
case Person(var name, var age) -> System.out.println(name + " " + age); | |||||
} | |||||
} | |||||
} | |||||
record Person(String name, int age) { } |
public class RecordPatternsPreview1OK { | |||||
static void printGenericBoxString1(Box<Object> objectBox) { | |||||
if (objectBox instanceof Box<Object>(String s)) { | |||||
System.out.println(s); | |||||
} | |||||
} | |||||
static void printGenericBoxString2(Box<String> stringBox) { | |||||
if (stringBox instanceof Box<String>(var s)) { | |||||
System.out.println(s); | |||||
} | |||||
} | |||||
} | |||||
record Box<T>(T t) {} |
import java.util.List; | |||||
import java.util.Locale; | |||||
aspect SwitchPatternPreview3Aspect { | |||||
Object around(Object o) : execution(* doSomethingWithObject(*)) && args(o) { | |||||
System.out.println(switch (o) { | |||||
case null -> "null"; | |||||
case Integer i -> String.format("int %d", i); | |||||
case Long l -> String.format("long %d", l); | |||||
case Double d -> String.format(Locale.ENGLISH, "double %f", d); | |||||
case String s -> String.format("String %s", s); | |||||
default -> o.toString(); | |||||
}); | |||||
return proceed(o); | |||||
} | |||||
before(Shape s) : execution(* doSomethingWithShape(*)) && args(s) { | |||||
System.out.println(switch (s) { | |||||
case Circle c when (c.calculateArea() > 100) -> "Large circle"; | |||||
case Circle c -> "Small circle"; | |||||
default -> "Non-circle"; | |||||
}); | |||||
} | |||||
after(S s) : execution(* doSomethingWithSealedClass(*)) && args(s) { | |||||
System.out.println(switch (s) { | |||||
case A a -> "Sealed sub-class A"; | |||||
case B b -> "Sealed sub-class B"; | |||||
case C c -> "Sealed sub-record C"; | |||||
}); | |||||
} | |||||
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 when value > 0 -> "positive integer: " + i; | |||||
default -> "other integer: " + i; | |||||
} | |||||
); | |||||
return proceed(i); | |||||
} | |||||
} | |||||
class Shape {} | |||||
class Rectangle extends Shape {} | |||||
class Circle extends Shape { | |||||
private final double radius; | |||||
public Circle(double radius) { this.radius = radius; } | |||||
double calculateArea() { return Math.PI * radius * radius; } | |||||
} | |||||
sealed interface S permits A, B, C {} | |||||
final class A implements S {} | |||||
final class B implements S {} | |||||
record C(int i) implements S {} // Implicitly final | |||||
class Application { | |||||
public static void main(String[] args) { | |||||
doSomethingWithObject(null); | |||||
doSomethingWithObject(123); | |||||
doSomethingWithObject(999L); | |||||
doSomethingWithObject(12.34); | |||||
doSomethingWithObject("foo"); | |||||
doSomethingWithObject(List.of(123, "foo", 999L, 12.34)); | |||||
doSomethingWithShape(new Rectangle()); | |||||
doSomethingWithShape(new Circle(5)); | |||||
doSomethingWithShape(new Circle(6)); | |||||
doSomethingWithSealedClass(new A()); | |||||
doSomethingWithSealedClass(new B()); | |||||
doSomethingWithSealedClass(new C(5)); | |||||
doSomethingWithInteger(-1); | |||||
doSomethingWithInteger(0); | |||||
doSomethingWithInteger(42); | |||||
doSomethingWithInteger(-99); | |||||
doSomethingWithInteger(Integer.valueOf(123)); | |||||
doSomethingWithInteger(null); | |||||
} | |||||
public static Object doSomethingWithObject(Object o) { return o; } | |||||
public static void doSomethingWithSealedClass(S s) {} | |||||
public static void doSomethingWithShape(Shape s) {} | |||||
public static Object doSomethingWithInteger(Integer o) { return o; } | |||||
} |
/** | |||||
* Inspired by examples in https://openjdk.java.net/jeps/420 | |||||
*/ | |||||
public class SwitchPatternPreview3Error1 { | |||||
static void constantLabelsMustAppearBeforePatterns1(Integer i) { | |||||
switch (i) { | |||||
case null -> System.out.println("value unavailable: " + i); | |||||
case Integer value when 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); | |||||
} | |||||
} | |||||
} |
/** | |||||
* Inspired by examples in https://openjdk.java.net/jeps/420 | |||||
*/ | |||||
public class SwitchPatternPreview3Error2 { | |||||
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 when (value == 1 || value == -1) -> System.out.println("absolute value 1: " + o); | |||||
case Integer value when value > 0 -> System.out.println("positive integer: " + o); | |||||
case String value when value.startsWith("hello") -> System.out.println("greeting: " + o); | |||||
default -> System.out.println("other type: " + o); | |||||
} | |||||
} | |||||
} |
import java.util.List; | |||||
import java.util.Locale; | |||||
/** | |||||
* Inspired by examples in https://openjdk.org/jeps/427 | |||||
*/ | |||||
public class SwitchPatternPreview3OK { | |||||
public static void main(String[] args) { | |||||
System.out.println(formatterPatternSwitch(null)); | |||||
System.out.println(formatterPatternSwitch(123)); | |||||
System.out.println(formatterPatternSwitch(999L)); | |||||
System.out.println(formatterPatternSwitch(12.34)); | |||||
System.out.println(formatterPatternSwitch("foo")); | |||||
System.out.println(formatterPatternSwitch(List.of(123, "foo", 999L, 12.34))); | |||||
System.out.println(testCircle(new Rectangle())); | |||||
System.out.println(testCircle(new Circle(5))); | |||||
System.out.println(testCircle(new Circle(6))); | |||||
System.out.println(testSealedCoverage(new A())); | |||||
System.out.println(testSealedCoverage(new B())); | |||||
System.out.println(testSealedCoverage(new C(5))); | |||||
// 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>())); | |||||
} | |||||
static String formatterPatternSwitch(Object o) { | |||||
return switch (o) { | |||||
case null -> "null"; | |||||
case Integer i -> String.format("int %d", i); | |||||
case Long l -> String.format("long %d", l); | |||||
case Double d -> String.format(Locale.ENGLISH, "double %f", d); | |||||
case String s -> String.format("String %s", s); | |||||
default -> o.toString(); | |||||
}; | |||||
} | |||||
static class Shape {} | |||||
static class Rectangle extends Shape {} | |||||
static class Circle extends Shape { | |||||
private final double radius; | |||||
public Circle(double radius) { this.radius = radius; } | |||||
double calculateArea() { return Math.PI * radius * radius; } | |||||
} | |||||
static String testCircle(Shape s) { | |||||
return switch (s) { | |||||
case Circle c when (c.calculateArea() > 100) -> "Large circle"; | |||||
case Circle c -> "Small circle"; | |||||
default -> "Non-circle"; | |||||
}; | |||||
} | |||||
sealed interface S permits A, B, C {} | |||||
final static class A implements S {} | |||||
final static class B implements S {} | |||||
static record C(int i) implements S {} // Implicitly final | |||||
static String testSealedCoverage(S s) { | |||||
return switch (s) { | |||||
case A a -> "Sealed sub-class A"; | |||||
case B b -> "Sealed sub-class B"; | |||||
case C c -> "Sealed sub-record C"; | |||||
}; | |||||
} | |||||
/** | |||||
* 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 when 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 when 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 when 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 when 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 when value > 0 -> System.out.println("positive integer: " + i); | |||||
} | |||||
} | |||||
/** | |||||
* According to an example from JEP 420, this should work with preview 2 (Java 18), and it does with Javac, | |||||
* but not with ECJ for Java 18 and 19. | |||||
* | |||||
* See: | |||||
* https://openjdk.java.net/jeps/420#2--Exhaustiveness-of-switch-expressions-and-statements | |||||
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=579360 | |||||
* https://github.com/eclipse-jdt/eclipse.jdt.core/issues/587 | |||||
* | |||||
* TODO: reactivate when implemented or move to preview 4 with Java 20. | |||||
*/ | |||||
/* | |||||
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; | |||||
}; | |||||
} | |||||
*/ | |||||
} |
} | } | ||||
/** | /** | ||||
* According to an example from JEP 420, this should work, and it does with Javac, but not with ECJ. | |||||
* According to an example from JEP 420, this should work with preview 2 (Java 18), and it does with Javac, | |||||
* but not with ECJ for Java 18 and 19. | |||||
* | * | ||||
* See: | * See: | ||||
* https://openjdk.java.net/jeps/420#2--Exhaustiveness-of-switch-expressions-and-statements | * https://openjdk.java.net/jeps/420#2--Exhaustiveness-of-switch-expressions-and-statements | ||||
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=579360 | * 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. | |||||
* https://github.com/eclipse-jdt/eclipse.jdt.core/issues/587 | |||||
*/ | */ | ||||
/* | /* | ||||
sealed interface I<T> permits A, B {} | sealed interface I<T> permits A, B {} |
<parent> | <parent> | ||||
<groupId>org.aspectj</groupId> | <groupId>org.aspectj</groupId> | ||||
<artifactId>aspectj-parent</artifactId> | <artifactId>aspectj-parent</artifactId> | ||||
<version>1.9.10-SNAPSHOT</version> | |||||
<version>1.9.19-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>tests</artifactId> | <artifactId>tests</artifactId> |
import org.aspectj.systemtest.ajc190.AllTestsAspectJ190; | import org.aspectj.systemtest.ajc190.AllTestsAspectJ190; | ||||
import org.aspectj.systemtest.ajc191.AllTestsAspectJ191; | import org.aspectj.systemtest.ajc191.AllTestsAspectJ191; | ||||
import org.aspectj.systemtest.ajc1919.AllTestsAspectJ1919; | |||||
import org.aspectj.systemtest.ajc192.AllTestsAspectJ192; | import org.aspectj.systemtest.ajc192.AllTestsAspectJ192; | ||||
import org.aspectj.systemtest.ajc193.AllTestsAspectJ193; | import org.aspectj.systemtest.ajc193.AllTestsAspectJ193; | ||||
import org.aspectj.systemtest.ajc195.AllTestsAspectJ195; | import org.aspectj.systemtest.ajc195.AllTestsAspectJ195; | ||||
suite.addTest(AllTestsAspectJ197.suite()); | suite.addTest(AllTestsAspectJ197.suite()); | ||||
suite.addTest(AllTestsAspectJ198.suite()); | suite.addTest(AllTestsAspectJ198.suite()); | ||||
suite.addTest(AllTestsAspectJ199.suite()); | suite.addTest(AllTestsAspectJ199.suite()); | ||||
suite.addTest(AllTestsAspectJ1919.suite()); | |||||
suite.addTest(AllTests18.suite()); | suite.addTest(AllTests18.suite()); | ||||
// $JUnit-END$ | // $JUnit-END$ | ||||
return suite; | return suite; |
/******************************************************************************* | |||||
* Copyright (c) 2022 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.ajc1919; | |||||
import junit.framework.Test; | |||||
import org.aspectj.testing.XMLBasedAjcTestCase; | |||||
import org.aspectj.testing.XMLBasedAjcTestCaseForJava19OrLater; | |||||
/** | |||||
* @author Alexander Kriegisch | |||||
*/ | |||||
public class Ajc1919TestsJava extends XMLBasedAjcTestCaseForJava19OrLater { | |||||
public void testDummyJava19() { | |||||
//runTest("dummy Java 19"); | |||||
} | |||||
public static Test suite() { | |||||
return XMLBasedAjcTestCase.loadSuite(Ajc1919TestsJava.class); | |||||
} | |||||
@Override | |||||
protected java.net.URL getSpecFile() { | |||||
return getClassResource("ajc1919.xml"); | |||||
} | |||||
} |
/******************************************************************************* | |||||
* Copyright (c) 2022 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.ajc1919; | |||||
import junit.framework.Test; | |||||
import junit.framework.TestSuite; | |||||
import org.aspectj.util.LangUtil; | |||||
/** | |||||
* @author Alexander Kriegisch | |||||
*/ | |||||
public class AllTestsAspectJ1919 { | |||||
public static Test suite() { | |||||
TestSuite suite = new TestSuite("AspectJ 1.9.19 tests"); | |||||
suite.addTest(Bugs1919Tests.suite()); | |||||
if (LangUtil.is19VMOrGreater()) { | |||||
suite.addTest(SanityTestsJava19.suite()); | |||||
suite.addTest(Ajc1919TestsJava.suite()); | |||||
} | |||||
// Do not run tests using a previous compiler's preview features anymore. They would all fail. | |||||
// TODO: Comment out the following block when upgrading JDT Core to Java 20 | |||||
if (LangUtil.is19VMOrGreater() && !LangUtil.is20VMOrGreater()) { | |||||
suite.addTest(Java19PreviewFeaturesTests.suite()); | |||||
} | |||||
return suite; | |||||
} | |||||
} |
/******************************************************************************* | |||||
* Copyright (c) 2022 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.ajc1919; | |||||
import junit.framework.Test; | |||||
import org.aspectj.testing.XMLBasedAjcTestCase; | |||||
/** | |||||
* @author Alexander Kriegisch | |||||
*/ | |||||
public class Bugs1919Tests extends XMLBasedAjcTestCase { | |||||
public void testDummyBug() { | |||||
//runTest("dummy Java 19 bug"); | |||||
} | |||||
public static Test suite() { | |||||
return XMLBasedAjcTestCase.loadSuite(Bugs1919Tests.class); | |||||
} | |||||
@Override | |||||
protected java.net.URL getSpecFile() { | |||||
return getClassResource("ajc1919.xml"); | |||||
} | |||||
} |
/******************************************************************************* | |||||
* Copyright (c) 2022 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.ajc1919; | |||||
import junit.framework.Test; | |||||
import org.aspectj.apache.bcel.Constants; | |||||
import org.aspectj.testing.XMLBasedAjcTestCase; | |||||
import org.aspectj.testing.XMLBasedAjcTestCaseForJava19Only; | |||||
/** | |||||
* @author Alexander Kriegisch | |||||
*/ | |||||
public class Java19PreviewFeaturesTests extends XMLBasedAjcTestCaseForJava19Only { | |||||
public void testSwitchPatternMatchingPreview3Java() { | |||||
runTest("switch pattern matching preview 3 java"); | |||||
checkVersion("SwitchPatternPreview3OK", Constants.MAJOR_19, Constants.PREVIEW_MINOR_VERSION); | |||||
} | |||||
public void testSwitchPatternMatchingPreview3Aspect() { | |||||
runTest("switch pattern matching preview 3 aspect"); | |||||
checkVersion("SwitchPatternPreview3Aspect", Constants.MAJOR_19, Constants.PREVIEW_MINOR_VERSION); | |||||
checkVersion("Application", Constants.MAJOR_19, Constants.PREVIEW_MINOR_VERSION); | |||||
checkVersion("Shape", Constants.MAJOR_19, Constants.PREVIEW_MINOR_VERSION); | |||||
checkVersion("S", Constants.MAJOR_19, Constants.PREVIEW_MINOR_VERSION); | |||||
} | |||||
public void testSwitchPatternMatchingCaseLabelDominatedByPrecedingError() { | |||||
runTest("switch pattern matching error"); | |||||
} | |||||
public void testSwitchPatternMatchingPreview3Error1() { | |||||
runTest("switch pattern matching preview 3 error 1"); | |||||
} | |||||
public void testSwitchPatternMatchingPreview3Error2() { | |||||
runTest("switch pattern matching preview 3 error 2"); | |||||
} | |||||
public void testRecordPatternsPreview1OK() { | |||||
// See https://github.com/eclipse-jdt/eclipse.jdt.core/issues/450 | |||||
runTest("record patterns"); | |||||
} | |||||
public void testRecordPatternsPreview1Error() { | |||||
// See https://github.com/eclipse-jdt/eclipse.jdt.core/issues/450 | |||||
runTest("record patterns error"); | |||||
} | |||||
public void testRecordPatternsPreview1ExhaustivenessOK1() { | |||||
// Falsely throws 'An enhanced switch statement should be exhaustive; a default label expected' twice, | |||||
// see https://github.com/eclipse-jdt/eclipse.jdt.core/issues/455 | |||||
// TODO: activate when fixed | |||||
System.out.println("TODO: activate when https://github.com/eclipse-jdt/eclipse.jdt.core/issues/455 has been fixed"); | |||||
//runTest("record patterns exhaustiveness 1"); | |||||
} | |||||
public void testRecordPatternsPreview1Aspect() { | |||||
runTest("record patterns aspect"); | |||||
} | |||||
public void testRecordPatternsPreview1ExhaustivenessAspect() { | |||||
// TODO: Remove redundant default clauses in RecordPatternsPreview1Aspect when | |||||
// https://github.com/eclipse-jdt/eclipse.jdt.core/issues/455 has been fixed. Furthermore, activate '<run />' | |||||
// action for XML test case in order to not just compile but also run the code. | |||||
System.out.println("TODO: fully activate when https://github.com/eclipse-jdt/eclipse.jdt.core/issues/455 has been fixed"); | |||||
runTest("record patterns exhaustiveness aspect"); | |||||
} | |||||
public void testRecordPatternsPreview1ExhaustivenessError() { | |||||
// See https://github.com/eclipse-jdt/eclipse.jdt.core/issues/455 | |||||
runTest("record patterns exhaustiveness error"); | |||||
} | |||||
public void testRecordPatternsPreview1ExhaustivenessOK2() { | |||||
// Falsely throws 'An enhanced switch statement should be exhaustive; a default label expected', | |||||
// see https://github.com/eclipse-jdt/eclipse.jdt.core/issues/398 | |||||
// TODO: activate when fixed | |||||
System.out.println("TODO: activate when https://github.com/eclipse-jdt/eclipse.jdt.core/issues/398 has been fixed"); | |||||
//runTest("record patterns exhaustiveness 2"); | |||||
} | |||||
public static Test suite() { | |||||
return XMLBasedAjcTestCase.loadSuite(Java19PreviewFeaturesTests.class); | |||||
} | |||||
@Override | |||||
protected java.net.URL getSpecFile() { | |||||
return getClassResource("ajc1919.xml"); | |||||
} | |||||
} |
/******************************************************************************* | |||||
* Copyright (c) 2022 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.ajc1919; | |||||
import junit.framework.Test; | |||||
import org.aspectj.testing.XMLBasedAjcTestCase; | |||||
import org.aspectj.testing.XMLBasedAjcTestCaseForJava19OrLater; | |||||
/* | |||||
* 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 -19 option | |||||
* to check code generation and modification with that version specified. | |||||
* | |||||
* @author Alexander Kriegisch | |||||
*/ | |||||
public class SanityTestsJava19 extends XMLBasedAjcTestCaseForJava19OrLater { | |||||
public static final int bytecode_version_for_JDK_level = 63; | |||||
// 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(SanityTestsJava19.class); | |||||
} | |||||
@Override | |||||
protected java.net.URL getSpecFile() { | |||||
return getClassResource("sanity-tests-19.xml"); | |||||
} | |||||
} |
// Do not run tests using a previous compiler's preview features anymore. They would all fail. | // Do not run tests using a previous compiler's preview features anymore. They would all fail. | ||||
/* | /* | ||||
if (LangUtil.is14VMOrGreater() && !LangUtil.is15VMOrGreater()) { | if (LangUtil.is14VMOrGreater() && !LangUtil.is15VMOrGreater()) { | ||||
suite.addTest(Ajc196PreviewFeaturesTests.suite()); | |||||
suite.addTest(Java14PreviewFeaturesTests.suite()); | |||||
} | } | ||||
*/ | */ | ||||
return suite; | return suite; |
/******************************************************************************* | /******************************************************************************* | ||||
* Copyright (c) 2021 Contributors | |||||
* Copyright (c) 2022 Contributors | |||||
* All rights reserved. This program and the accompanying materials | * All rights reserved. This program and the accompanying materials | ||||
* are made available under the terms of the Eclipse Public License v 2.0 | * are made available under the terms of the Eclipse Public License v 2.0 | ||||
* which accompanies this distribution, and is available at | * which accompanies this distribution, and is available at | ||||
public class Ajc199TestsJava extends XMLBasedAjcTestCaseForJava18OrLater { | public class Ajc199TestsJava extends XMLBasedAjcTestCaseForJava18OrLater { | ||||
public void testDummyJava18() { | public void testDummyJava18() { | ||||
runTest("dummy Java 18"); | |||||
//runTest("dummy Java 18"); | |||||
} | } | ||||
public static Test suite() { | public static Test suite() { |
/******************************************************************************* | /******************************************************************************* | ||||
* Copyright (c) 2021 Contributors | |||||
* Copyright (c) 2022 Contributors | |||||
* All rights reserved. This program and the accompanying materials | * All rights reserved. This program and the accompanying materials | ||||
* are made available under the terms of the Eclipse Public License v 2.0 | * are made available under the terms of the Eclipse Public License v 2.0 | ||||
* which accompanies this distribution, and is available at | * which accompanies this distribution, and is available at | ||||
suite.addTest(SanityTestsJava18.suite()); | suite.addTest(SanityTestsJava18.suite()); | ||||
suite.addTest(Ajc199TestsJava.suite()); | suite.addTest(Ajc199TestsJava.suite()); | ||||
} | } | ||||
// Do not run tests using a previous compiler's preview features anymore. They would all fail. | |||||
/* | |||||
if (LangUtil.is18VMOrGreater() && !LangUtil.is19VMOrGreater()) { | if (LangUtil.is18VMOrGreater() && !LangUtil.is19VMOrGreater()) { | ||||
suite.addTest(Java18PreviewFeaturesTests.suite()); | suite.addTest(Java18PreviewFeaturesTests.suite()); | ||||
} | } | ||||
*/ | |||||
return suite; | return suite; | ||||
} | } | ||||
} | } |
/******************************************************************************* | /******************************************************************************* | ||||
* Copyright (c) 2021 Contributors | |||||
* Copyright (c) 2022 Contributors | |||||
* All rights reserved. This program and the accompanying materials | * All rights reserved. This program and the accompanying materials | ||||
* are made available under the terms of the Eclipse Public License v 2.0 | * are made available under the terms of the Eclipse Public License v 2.0 | ||||
* which accompanies this distribution, and is available at | * which accompanies this distribution, and is available at |
/******************************************************************************* | /******************************************************************************* | ||||
* Copyright (c) 2021 Contributors | |||||
* Copyright (c) 2022 Contributors | |||||
* All rights reserved. This program and the accompanying materials | * All rights reserved. This program and the accompanying materials | ||||
* are made available under the terms of the Eclipse Public License v 2.0 | * are made available under the terms of the Eclipse Public License v 2.0 | ||||
* which accompanies this distribution, and is available at | * which accompanies this distribution, and is available at |
/******************************************************************************* | /******************************************************************************* | ||||
* Copyright (c) 2021 Contributors | |||||
* Copyright (c) 2022 Contributors | |||||
* All rights reserved. This program and the accompanying materials | * All rights reserved. This program and the accompanying materials | ||||
* are made available under the terms of the Eclipse Public License v 2.0 | * are made available under the terms of the Eclipse Public License v 2.0 | ||||
* which accompanies this distribution, and is available at | * which accompanies this distribution, and is available at | ||||
/* | /* | ||||
* Some very trivial tests that help verify things are OK. | * 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 | |||||
* These are a copy of the earlier Sanity Tests created for 1.6 but these supply the -18 option | |||||
* to check code generation and modification with that version specified. | * to check code generation and modification with that version specified. | ||||
* | * | ||||
* @author Alexander Kriegisch | * @author Alexander Kriegisch |
for (File dir: allOutputPaths) { | for (File dir: allOutputPaths) { | ||||
sb.append(File.pathSeparator + dir.getAbsolutePath()); | sb.append(File.pathSeparator + dir.getAbsolutePath()); | ||||
} | } | ||||
String cp = sb.toString() + File.pathSeparator + new File(AjdeInteractionTestbed.testdataSrcDir) + File.pathSeparator | |||||
+ System.getProperty("sun.boot.class.path") + File.pathSeparator + "../runtime/target/classes" + File.pathSeparator | |||||
+ this.classPath + File.pathSeparator + System.getProperty("aspectjrt.path") + File.pathSeparator | |||||
+ "../lib/junit/junit.jar" + "c:/batik/batik-1.6/lib/batik-util.jar;" | |||||
+ "c:/batik/batik-1.6/lib/batik-awt-util.jar;" + "c:/batik/batik-1.6/lib/batik-dom.jar;" | |||||
+ "c:/batik/batik-1.6/lib/batik-svggen.jar;" + File.pathSeparator + ".." + File.separator + "lib" + File.separator | |||||
+ "test" + File.separator + "aspectjrt.jar"; | |||||
String cp = sb + File.pathSeparator | |||||
+ new File(AjdeInteractionTestbed.testdataSrcDir) + File.pathSeparator | |||||
+ System.getProperty("sun.boot.class.path") + File.pathSeparator | |||||
+ "../runtime/target/classes" + File.pathSeparator | |||||
+ this.classPath + File.pathSeparator | |||||
+ System.getProperty("aspectjrt.path") + File.pathSeparator | |||||
+ "../lib/junit/junit.jar" + File.pathSeparator | |||||
+ ".." + File.separator + "lib" + File.separator + "test" + File.separator + "aspectjrt.jar"; | |||||
verifyClasspath(cp); | verifyClasspath(cp); | ||||
if (LangUtil.is9VMOrGreater()) { | if (LangUtil.is9VMOrGreater()) { | ||||
cp = LangUtil.getJrtFsFilePath() + File.pathSeparator + cp; | cp = LangUtil.getJrtFsFilePath() + File.pathSeparator + cp; |
<line text="@target(Classified) at call(Class java.lang.Object.getClass())"/> | <line text="@target(Classified) at call(Class java.lang.Object.getClass())"/> | ||||
<line text="1 @Foo()"/> | <line text="1 @Foo()"/> | ||||
<line text="1 @Foo()"/> | <line text="1 @Foo()"/> | ||||
<line text="1 @Classified(classification=TOP-SECRET)" vm="1.2,1.3,1.4,1.5,1.6,1.7,1.8"/> | |||||
<line text="1 @Classified(classification="TOP-SECRET")" vm="9+"/> | |||||
<line text="1 @Classified(classification=TOP-SECRET)" vm="-1.8"/> | |||||
<line text="1 @Classified(classification="TOP-SECRET")" vm="9-"/> | |||||
<line text="This information is TOP-SECRET"/> | <line text="This information is TOP-SECRET"/> | ||||
<line text="Entering critical join point with priority 3"/> | <line text="Entering critical join point with priority 3"/> | ||||
<line text="Entering critical join point with reflectively obtained priority 3"/> | <line text="Entering critical join point with reflectively obtained priority 3"/> | ||||
<run class="GenericAspectRuntimePointcuts"> | <run class="GenericAspectRuntimePointcuts"> | ||||
<stdout> | <stdout> | ||||
<line text="target-ok an X execution(void X.foo())"/> | <line text="target-ok an X execution(void X.foo())"/> | ||||
<line text="@this-ok @MyAnnotation(value=my-value) execution(void X.foo())" vm="1.5,1.6,1.7,1.8"/> | |||||
<line text="@this-ok @MyAnnotation(value="my-value") execution(void X.foo())" vm="9,10,11,12,13"/> | |||||
<line text="@this-ok @MyAnnotation("my-value") execution(void X.foo())" vm="14+"/> | |||||
<line text="@target-ok @MyAnnotation(value=my-value) execution(void X.foo())" vm="1.5,1.6,1.7,1.8"/> | |||||
<line text="@target-ok @MyAnnotation(value="my-value") execution(void X.foo())" vm="9,10,11,12,13"/> | |||||
<line text="@target-ok @MyAnnotation("my-value") execution(void X.foo())" vm="14+"/> | |||||
<line text="@within-ok @MyAnnotation(value=my-value) execution(void X.foo())" vm="1.5,1.6,1.7,1.8"/> | |||||
<line text="@within-ok @MyAnnotation(value="my-value") execution(void X.foo())" vm="9,10,11,12,13"/> | |||||
<line text="@within-ok @MyAnnotation("my-value") execution(void X.foo())" vm="14+"/> | |||||
<line text="@this-ok @MyAnnotation(value=my-value) execution(void X.foo())" vm="1.5-1.8"/> | |||||
<line text="@this-ok @MyAnnotation(value="my-value") execution(void X.foo())" vm="9-13"/> | |||||
<line text="@this-ok @MyAnnotation("my-value") execution(void X.foo())" vm="14-"/> | |||||
<line text="@target-ok @MyAnnotation(value=my-value) execution(void X.foo())" vm="1.5-1.8"/> | |||||
<line text="@target-ok @MyAnnotation(value="my-value") execution(void X.foo())" vm="9-13"/> | |||||
<line text="@target-ok @MyAnnotation("my-value") execution(void X.foo())" vm="14-"/> | |||||
<line text="@within-ok @MyAnnotation(value=my-value) execution(void X.foo())" vm="1.5-1.8"/> | |||||
<line text="@within-ok @MyAnnotation(value="my-value") execution(void X.foo())" vm="9-13"/> | |||||
<line text="@within-ok @MyAnnotation("my-value") execution(void X.foo())" vm="14-"/> | |||||
<line text="cflow-ok an X a Y set(Y X.y)"/> | <line text="cflow-ok an X a Y set(Y X.y)"/> | ||||
<line text="@annotation-ok-sub @MyAnnotation(value=bar) execution(void X.bar())" vm="1.5,1.6,1.7,1.8"/> | |||||
<line text="@annotation-ok-sub @MyAnnotation(value="bar") execution(void X.bar())" vm="9,10,11,12,13"/> | |||||
<line text="@annotation-ok-sub @MyAnnotation("bar") execution(void X.bar())" vm="14+"/> | |||||
<line text="@annotation-ok @MyAnnotation(value=bar) execution(void X.bar())" vm="1.5,1.6,1.7,1.8"/> | |||||
<line text="@annotation-ok @MyAnnotation(value="bar") execution(void X.bar())" vm="9,10,11,12,13"/> | |||||
<line text="@annotation-ok @MyAnnotation("bar") execution(void X.bar())" vm="14+"/> | |||||
<line text="@annotation-ok-sub @MyAnnotation(value=bar) execution(void X.bar())" vm="1.5-1.8"/> | |||||
<line text="@annotation-ok-sub @MyAnnotation(value="bar") execution(void X.bar())" vm="9-13"/> | |||||
<line text="@annotation-ok-sub @MyAnnotation("bar") execution(void X.bar())" vm="14-"/> | |||||
<line text="@annotation-ok @MyAnnotation(value=bar) execution(void X.bar())" vm="1.5-1.8"/> | |||||
<line text="@annotation-ok @MyAnnotation(value="bar") execution(void X.bar())" vm="9-13"/> | |||||
<line text="@annotation-ok @MyAnnotation("bar") execution(void X.bar())" vm="14-"/> | |||||
<line text="target-ok an X execution(void X.bar())"/> | <line text="target-ok an X execution(void X.bar())"/> | ||||
<line text="@this-ok @MyAnnotation(value=my-value) execution(void X.bar())" vm="1.5,1.6,1.7,1.8"/> | |||||
<line text="@this-ok @MyAnnotation(value="my-value") execution(void X.bar())" vm="9,10,11,12,13"/> | |||||
<line text="@this-ok @MyAnnotation("my-value") execution(void X.bar())" vm="14+"/> | |||||
<line text="@target-ok @MyAnnotation(value=my-value) execution(void X.bar())" vm="1.5,1.6,1.7,1.8"/> | |||||
<line text="@target-ok @MyAnnotation(value="my-value") execution(void X.bar())" vm="9,10,11,12,13"/> | |||||
<line text="@target-ok @MyAnnotation("my-value") execution(void X.bar())" vm="14+"/> | |||||
<line text="@within-ok @MyAnnotation(value=my-value) execution(void X.bar())" vm="1.5,1.6,1.7,1.8"/> | |||||
<line text="@within-ok @MyAnnotation(value="my-value") execution(void X.bar())" vm="9,10,11,12,13"/> | |||||
<line text="@within-ok @MyAnnotation("my-value") execution(void X.bar())" vm="14+"/> | |||||
<line text="@args-ok @MyAnnotation(value=my-value) execution(void Y.foo(X))" vm="1.5,1.6,1.7,1.8"/> | |||||
<line text="@args-ok @MyAnnotation(value="my-value") execution(void Y.foo(X))" vm="9,10,11,12,13"/> | |||||
<line text="@args-ok @MyAnnotation("my-value") execution(void Y.foo(X))" vm="14+"/> | |||||
<line text="@this-ok @MyAnnotation(value=my-value) execution(void X.bar())" vm="1.5-1.8"/> | |||||
<line text="@this-ok @MyAnnotation(value="my-value") execution(void X.bar())" vm="9-13"/> | |||||
<line text="@this-ok @MyAnnotation("my-value") execution(void X.bar())" vm="14-"/> | |||||
<line text="@target-ok @MyAnnotation(value=my-value) execution(void X.bar())" vm="1.5-1.8"/> | |||||
<line text="@target-ok @MyAnnotation(value="my-value") execution(void X.bar())" vm="9-13"/> | |||||
<line text="@target-ok @MyAnnotation("my-value") execution(void X.bar())" vm="14-"/> | |||||
<line text="@within-ok @MyAnnotation(value=my-value) execution(void X.bar())" vm="1.5-1.8"/> | |||||
<line text="@within-ok @MyAnnotation(value="my-value") execution(void X.bar())" vm="9-13"/> | |||||
<line text="@within-ok @MyAnnotation("my-value") execution(void X.bar())" vm="14-"/> | |||||
<line text="@args-ok @MyAnnotation(value=my-value) execution(void Y.foo(X))" vm="1.5-1.8"/> | |||||
<line text="@args-ok @MyAnnotation(value="my-value") execution(void Y.foo(X))" vm="9-13"/> | |||||
<line text="@args-ok @MyAnnotation("my-value") execution(void Y.foo(X))" vm="14-"/> | |||||
<line text="args-ok an X execution(void Y.foo(X))"/> | <line text="args-ok an X execution(void Y.foo(X))"/> | ||||
<line text="this-ok a Y execution(void Y.foo(X))"/> | <line text="this-ok a Y execution(void Y.foo(X))"/> | ||||
<line text="@this-ok @MyAnnotation(value=on Y) execution(void Y.foo(X))" vm="1.5,1.6,1.7,1.8"/> | |||||
<line text="@this-ok @MyAnnotation(value="on Y") execution(void Y.foo(X))" vm="9,10,11,12,13"/> | |||||
<line text="@this-ok @MyAnnotation("on Y") execution(void Y.foo(X))" vm="14+"/> | |||||
<line text="@target-ok @MyAnnotation(value=on Y) execution(void Y.foo(X))" vm="1.5,1.6,1.7,1.8"/> | |||||
<line text="@target-ok @MyAnnotation(value="on Y") execution(void Y.foo(X))" vm="9,10,11,12,13"/> | |||||
<line text="@target-ok @MyAnnotation("on Y") execution(void Y.foo(X))" vm="14+"/> | |||||
<line text="@within-ok @MyAnnotation(value=on Y) execution(void Y.foo(X))" vm="1.5,1.6,1.7,1.8"/> | |||||
<line text="@within-ok @MyAnnotation(value="on Y") execution(void Y.foo(X))" vm="9,10,11,12,13"/> | |||||
<line text="@within-ok @MyAnnotation("on Y") execution(void Y.foo(X))" vm="14+"/> | |||||
<line text="@annotation-ok-sub @MyAnnotation(value=my-value) execution(X Y.bar())" vm="1.5,1.6,1.7,1.8"/> | |||||
<line text="@annotation-ok-sub @MyAnnotation(value="my-value") execution(X Y.bar())" vm="9,10,11,12,13"/> | |||||
<line text="@annotation-ok-sub @MyAnnotation("my-value") execution(X Y.bar())" vm="14+"/> | |||||
<line text="@annotation-ok @MyAnnotation(value=my-value) execution(X Y.bar())" vm="1.5,1.6,1.7,1.8"/> | |||||
<line text="@annotation-ok @MyAnnotation(value="my-value") execution(X Y.bar())" vm="9,10,11,12,13"/> | |||||
<line text="@annotation-ok @MyAnnotation("my-value") execution(X Y.bar())" vm="14+"/> | |||||
<line text="@this-ok @MyAnnotation(value=on Y) execution(void Y.foo(X))" vm="1.5-1.8"/> | |||||
<line text="@this-ok @MyAnnotation(value="on Y") execution(void Y.foo(X))" vm="9-13"/> | |||||
<line text="@this-ok @MyAnnotation("on Y") execution(void Y.foo(X))" vm="14-"/> | |||||
<line text="@target-ok @MyAnnotation(value=on Y) execution(void Y.foo(X))" vm="1.5-1.8"/> | |||||
<line text="@target-ok @MyAnnotation(value="on Y") execution(void Y.foo(X))" vm="9-13"/> | |||||
<line text="@target-ok @MyAnnotation("on Y") execution(void Y.foo(X))" vm="14-"/> | |||||
<line text="@within-ok @MyAnnotation(value=on Y) execution(void Y.foo(X))" vm="1.5-1.8"/> | |||||
<line text="@within-ok @MyAnnotation(value="on Y") execution(void Y.foo(X))" vm="9-13"/> | |||||
<line text="@within-ok @MyAnnotation("on Y") execution(void Y.foo(X))" vm="14-"/> | |||||
<line text="@annotation-ok-sub @MyAnnotation(value=my-value) execution(X Y.bar())" vm="1.5-1.8"/> | |||||
<line text="@annotation-ok-sub @MyAnnotation(value="my-value") execution(X Y.bar())" vm="9-13"/> | |||||
<line text="@annotation-ok-sub @MyAnnotation("my-value") execution(X Y.bar())" vm="14-"/> | |||||
<line text="@annotation-ok @MyAnnotation(value=my-value) execution(X Y.bar())" vm="1.5-1.8"/> | |||||
<line text="@annotation-ok @MyAnnotation(value="my-value") execution(X Y.bar())" vm="9-13"/> | |||||
<line text="@annotation-ok @MyAnnotation("my-value") execution(X Y.bar())" vm="14-"/> | |||||
<line text="this-ok a Y execution(X Y.bar())"/> | <line text="this-ok a Y execution(X Y.bar())"/> | ||||
<line text="@this-ok @MyAnnotation(value=on Y) execution(X Y.bar())" vm="1.5,1.6,1.7,1.8"/> | |||||
<line text="@this-ok @MyAnnotation(value="on Y") execution(X Y.bar())" vm="9,10,11,12,13"/> | |||||
<line text="@this-ok @MyAnnotation("on Y") execution(X Y.bar())" vm="14+"/> | |||||
<line text="@target-ok @MyAnnotation(value=on Y) execution(X Y.bar())" vm="1.5,1.6,1.7,1.8"/> | |||||
<line text="@target-ok @MyAnnotation(value="on Y") execution(X Y.bar())" vm="9,10,11,12,13"/> | |||||
<line text="@target-ok @MyAnnotation("on Y") execution(X Y.bar())" vm="14+"/> | |||||
<line text="@within-ok @MyAnnotation(value=on Y) execution(X Y.bar())" vm="1.5,1.6,1.7,1.8"/> | |||||
<line text="@within-ok @MyAnnotation(value="on Y") execution(X Y.bar())" vm="9,10,11,12,13"/> | |||||
<line text="@within-ok @MyAnnotation("on Y") execution(X Y.bar())" vm="14+"/> | |||||
<line text="@withincode-ok @MyAnnotation(value=my-value) get(X Y.x)" vm="1.5,1.6,1.7,1.8"/> | |||||
<line text="@withincode-ok @MyAnnotation(value="my-value") get(X Y.x)" vm="9,10,11,12,13"/> | |||||
<line text="@withincode-ok @MyAnnotation("my-value") get(X Y.x)" vm="14+"/> | |||||
<line text="@this-ok @MyAnnotation(value=on Y) execution(X Y.bar())" vm="1.5-1.8"/> | |||||
<line text="@this-ok @MyAnnotation(value="on Y") execution(X Y.bar())" vm="9-13"/> | |||||
<line text="@this-ok @MyAnnotation("on Y") execution(X Y.bar())" vm="14-"/> | |||||
<line text="@target-ok @MyAnnotation(value=on Y) execution(X Y.bar())" vm="1.5-1.8"/> | |||||
<line text="@target-ok @MyAnnotation(value="on Y") execution(X Y.bar())" vm="9-13"/> | |||||
<line text="@target-ok @MyAnnotation("on Y") execution(X Y.bar())" vm="14-"/> | |||||
<line text="@within-ok @MyAnnotation(value=on Y) execution(X Y.bar())" vm="1.5-1.8"/> | |||||
<line text="@within-ok @MyAnnotation(value="on Y") execution(X Y.bar())" vm="9-13"/> | |||||
<line text="@within-ok @MyAnnotation("on Y") execution(X Y.bar())" vm="14-"/> | |||||
<line text="@withincode-ok @MyAnnotation(value=my-value) get(X Y.x)" vm="1.5-1.8"/> | |||||
<line text="@withincode-ok @MyAnnotation(value="my-value") get(X Y.x)" vm="9-13"/> | |||||
<line text="@withincode-ok @MyAnnotation("my-value") get(X Y.x)" vm="14-"/> | |||||
</stdout> | </stdout> | ||||
</run> | </run> | ||||
</ajc-test> | </ajc-test> |
<suite> | <suite> | ||||
<!-- atDecp begin --> | <!-- atDecp begin --> | ||||
<!-- something simple --> | <!-- something simple --> | ||||
<ajc-test dir="bugs151/atDecp/case1" title="atDecp - simple"> | <ajc-test dir="bugs151/atDecp/case1" title="atDecp - simple"> | ||||
<compile files="MainClass.java" options="-1.5 -showWeaveInfo"> | <compile files="MainClass.java" options="-1.5 -showWeaveInfo"> | ||||
</stderr> | </stderr> | ||||
</run> | </run> | ||||
</ajc-test> | </ajc-test> | ||||
<!-- applying parent based on annotation --> | <!-- applying parent based on annotation --> | ||||
<ajc-test dir="bugs151/atDecp/case2" title="atDecp - annotation"> | <ajc-test dir="bugs151/atDecp/case2" title="atDecp - annotation"> | ||||
<compile files="MainClass.java" options="-1.5 -showWeaveInfo"> | <compile files="MainClass.java" options="-1.5 -showWeaveInfo"> | ||||
</stderr> | </stderr> | ||||
</run> | </run> | ||||
</ajc-test> | </ajc-test> | ||||
<!-- when interface is binary --> | <!-- when interface is binary --> | ||||
<ajc-test dir="bugs151/atDecp/case3" title="atDecp - binary interface"> | <ajc-test dir="bugs151/atDecp/case3" title="atDecp - binary interface"> | ||||
<compile files="Mood.java,Moody.java" outjar="moody.jar" options="-1.5"/> | <compile files="Mood.java,Moody.java" outjar="moody.jar" options="-1.5"/> | ||||
</stderr> | </stderr> | ||||
</run> | </run> | ||||
</ajc-test> | </ajc-test> | ||||
<!-- when interface is binary and implementation is not an inner --> | <!-- when interface is binary and implementation is not an inner --> | ||||
<ajc-test dir="bugs151/atDecp/case4" title="atDecp - binary interface - 2"> | <ajc-test dir="bugs151/atDecp/case4" title="atDecp - binary interface - 2"> | ||||
<compile files="Mood.java,Moody.java" outjar="moody.jar" options="-1.5"/> | <compile files="Mood.java,Moody.java" outjar="moody.jar" options="-1.5"/> | ||||
</stderr> | </stderr> | ||||
</run> | </run> | ||||
</ajc-test> | </ajc-test> | ||||
<!-- atDecp end --> | <!-- atDecp end --> | ||||
<compile files="Failing.java" options="-1.5"/> | <compile files="Failing.java" options="-1.5"/> | ||||
<run class="Failing"> | <run class="Failing"> | ||||
<stderr> | <stderr> | ||||
<line text="On TestInterface:@TestAnnotation(value=true)" vm="1.5,1.6,1.7,1.8,9,10,11,12,13"/> | |||||
<line text="On TestInterface:@TestAnnotation(true)" vm="14+"/> | |||||
<line text="On Failing:@TestAnnotation(value=true)" vm="1.5,1.6,1.7,1.8,9,10,11,12,13"/> | |||||
<line text="On Failing:@TestAnnotation(true)" vm="14+"/> | |||||
<line text="On TestInterface:@TestAnnotation(value=true)" vm="1.5-13"/> | |||||
<line text="On TestInterface:@TestAnnotation(true)" vm="14-"/> | |||||
<line text="On Failing:@TestAnnotation(value=true)" vm="1.5-13"/> | |||||
<line text="On Failing:@TestAnnotation(true)" vm="14-"/> | |||||
</stderr> | </stderr> | ||||
</run> | </run> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="bugs151/pr98901" title="annotations and itds - 2"> | <ajc-test dir="bugs151/pr98901" title="annotations and itds - 2"> | ||||
<compile files="Failing2.java" options="-1.5"/> | <compile files="Failing2.java" options="-1.5"/> | ||||
<run class="Failing2"> | <run class="Failing2"> | ||||
<stderr> | <stderr> | ||||
<line text="On TestInterface:@TestAnnotation(value=true)" vm="1.5,1.6,1.7,1.8,9,10,11,12,13"/> | |||||
<line text="On TestInterface:@TestAnnotation(true)" vm="14+"/> | |||||
<line text="On Failing2:@TestAnnotation(value=true)" vm="1.5,1.6,1.7,1.8,9,10,11,12,13"/> | |||||
<line text="On Failing2:@TestAnnotation(true)" vm="14+"/> | |||||
<line text="On TestInterface:@TestAnnotation(value=true)" vm="1.5-13"/> | |||||
<line text="On TestInterface:@TestAnnotation(true)" vm="14-"/> | |||||
<line text="On Failing2:@TestAnnotation(value=true)" vm="1.5-13"/> | |||||
<line text="On Failing2:@TestAnnotation(true)" vm="14-"/> | |||||
</stderr> | </stderr> | ||||
</run> | </run> | ||||
</ajc-test> | </ajc-test> | ||||
<compile files="InputAnnotation.java" outjar="foo.jar" options="-1.5"/> | <compile files="InputAnnotation.java" outjar="foo.jar" options="-1.5"/> | ||||
<compile files="AffectedType.java" classpath="foo.jar" options="-1.5"/> | <compile files="AffectedType.java" classpath="foo.jar" options="-1.5"/> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="bugs151/pr132926" pr="132926" title="crashing on annotation type resolving with asm - 3"> | <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="InputAnnotation2.java" outjar="foo.jar" options="-1.5"/> | ||||
<compile files="AffectedType.java" classpath="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}"/> | <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> | </compile> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="bugs151/pr133307" title="circular generics"> | <ajc-test dir="bugs151/pr133307" title="circular generics"> | ||||
<compile files="Broken.aj" options="-1.5"/> | <compile files="Broken.aj" options="-1.5"/> | ||||
</ajc-test> | |||||
</ajc-test> | |||||
<ajc-test dir="bugs151/pr123553" title="generic advice parameters"> | <ajc-test dir="bugs151/pr123553" title="generic advice parameters"> | ||||
<compile files="A.java" options="-1.5"/> | <compile files="A.java" options="-1.5"/> | ||||
<run class="A"/> | <run class="A"/> | ||||
</ajc-test> | |||||
</ajc-test> | |||||
<ajc-test dir="bugs151/pr133298" title="doubly annotating a method with declare"> | <ajc-test dir="bugs151/pr133298" title="doubly annotating a method with declare"> | ||||
<compile files="DecA.java" options="-1.5"/> | <compile files="DecA.java" options="-1.5"/> | ||||
<run class="DecA"> | <run class="DecA"> | ||||
</stderr> | </stderr> | ||||
</run> | </run> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="bugs151/pr133298" title="doubly annotating a method with declare - 2"> | <ajc-test dir="bugs151/pr133298" title="doubly annotating a method with declare - 2"> | ||||
<compile files="DecA2.java" options="-1.5"/> | <compile files="DecA2.java" options="-1.5"/> | ||||
<run class="DecA2"> | <run class="DecA2"> | ||||
</stderr> | </stderr> | ||||
</run> | </run> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="bugs151/pr129566" title="arrayindexoutofbounds"> | <ajc-test dir="bugs151/pr129566" title="arrayindexoutofbounds"> | ||||
<compile files="SkipList.java" options="-1.5"/> | <compile files="SkipList.java" options="-1.5"/> | ||||
</ajc-test> | |||||
</ajc-test> | |||||
<ajc-test dir="bugs151" title="member types in generic types"> | <ajc-test dir="bugs151" title="member types in generic types"> | ||||
<compile files="pr122458.aj" options="-1.5 -emacssym"/> | <compile files="pr122458.aj" options="-1.5 -emacssym"/> | ||||
</ajc-test> | |||||
</ajc-test> | |||||
<ajc-test dir="bugs151/pr127299" title="missing import gives funny message"> | <ajc-test dir="bugs151/pr127299" title="missing import gives funny message"> | ||||
<compile files="ModelErrorConversion.aj" options="-1.5"/> | <compile files="ModelErrorConversion.aj" options="-1.5"/> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="bugs151/pr122742" title="@AJ VerifyError with @AfterThrowing and thisJoinPoint argument"> | <ajc-test dir="bugs151/pr122742" title="@AJ VerifyError with @AfterThrowing and thisJoinPoint argument"> | ||||
<compile files="AfterThrowingTest.java" options="-1.5"/> | <compile files="AfterThrowingTest.java" options="-1.5"/> | ||||
<run class="AfterThrowingTest"> | <run class="AfterThrowingTest"> | ||||
<run class="AfterReturningTest"> | <run class="AfterReturningTest"> | ||||
</run> | </run> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="bugs151/pr120527" title="incorrect unused interface message"> | <ajc-test dir="bugs151/pr120527" title="incorrect unused interface message"> | ||||
<compile files="Bugs.aj" options="-warn:unusedPrivate"/> | <compile files="Bugs.aj" options="-warn:unusedPrivate"/> | ||||
</ajc-test> | |||||
</ajc-test> | |||||
<ajc-test dir="bugs151/pr123901" title="inlinevisitor NPE"> | <ajc-test dir="bugs151/pr123901" title="inlinevisitor NPE"> | ||||
<compile files="A.java,B.java" options="-1.5"> | <compile files="A.java,B.java" options="-1.5"> | ||||
<message kind="error" line="5" text="A cannot be resolved or is not a field"/> | <message kind="error" line="5" text="A cannot be resolved or is not a field"/> | ||||
</compile> | </compile> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="bugs151" title="member types in generic types - 2"> | <ajc-test dir="bugs151" title="member types in generic types - 2"> | ||||
<compile files="pr122458_2.aj" options="-1.5 -emacssym"/> | <compile files="pr122458_2.aj" options="-1.5 -emacssym"/> | ||||
<run class="pr122458_2"/> | <run class="pr122458_2"/> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="bugs151/pr123695" title="Internal nullptr exception with complex declare annotation"> | <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"/> | <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> | ||||
<ajc-test dir="bugs151/pr124105" title="hasMember problems with packages"> | <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"> | <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"/> | <message kind="error" line="4" text="IOption implementations must provide a constructor which accepts an OptionType"/> | ||||
</compile> | </compile> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="bugs151/pr124803" title="generics and different numbers of type variables"> | <ajc-test dir="bugs151/pr124803" title="generics and different numbers of type variables"> | ||||
<compile files="Test.java,TestAspect.java" options="-1.5 -showWeaveInfo"> | <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)"/> | <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)"/> | ||||
</stderr> | </stderr> | ||||
</run> | </run> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="bugs151/pr124803" title="generics and different numbers of type variables - classes"> | <ajc-test dir="bugs151/pr124803" title="generics and different numbers of type variables - classes"> | ||||
<compile files="Test2.java,TestAspect2.java" options="-1.5 -showWeaveInfo"> | <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)"/> | <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)"/> | ||||
</stderr> | </stderr> | ||||
</run> | </run> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="bugs151/pr124808" title="parameterized collection fields matched via pointcut"> | <ajc-test dir="bugs151/pr124808" title="parameterized collection fields matched via pointcut"> | ||||
<compile files="Test.java,TestAspect.java" options="-1.5"/> | <compile files="Test.java,TestAspect.java" options="-1.5"/> | ||||
<run class="Test"> | <run class="Test"> | ||||
</stderr> | </stderr> | ||||
</run> | </run> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="bugs151" title="calling inherited generic method from around advice"> | <ajc-test dir="bugs151" title="calling inherited generic method from around advice"> | ||||
<compile files="pr124999.aj" options="-1.5"/> | <compile files="pr124999.aj" options="-1.5"/> | ||||
<run class="pr124999"/> | <run class="pr124999"/> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="bugs151/pr124654" title="generic aspects and annotations"> | <ajc-test dir="bugs151/pr124654" title="generic aspects and annotations"> | ||||
<compile files="GenericAnnotation.java,TestSubAspect.java" options="-1.5"/> | <compile files="GenericAnnotation.java,TestSubAspect.java" options="-1.5"/> | ||||
<run class="TestSubAspect"> | <run class="TestSubAspect"> | ||||
</stderr> | </stderr> | ||||
</run> | </run> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="bugs151" title="incorrectly referencing pointcuts"> | <ajc-test dir="bugs151" title="incorrectly referencing pointcuts"> | ||||
<compile files="pr122452.aj" options="-1.5"> | <compile files="pr122452.aj" options="-1.5"> | ||||
<message kind="warning" line="2" text="no match for this type name: Point [Xlint:invalidAbsoluteTypeName]"/> | <message kind="warning" line="2" text="no match for this type name: Point [Xlint:invalidAbsoluteTypeName]"/> | ||||
<message kind="error" line="4" text="Syntax error on token "*", "(" expected"/> | <message kind="error" line="4" text="Syntax error on token "*", "(" expected"/> | ||||
</compile> | </compile> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="bugs151" title="incorrectly referencing pointcuts - 2"> | <ajc-test dir="bugs151" title="incorrectly referencing pointcuts - 2"> | ||||
<compile files="pr122452_2.aj" options="-1.5"> | <compile files="pr122452_2.aj" options="-1.5"> | ||||
<message kind="error" line="2" text="Syntax error on token "*", "(" expected"/> | <message kind="error" line="2" text="Syntax error on token "*", "(" expected"/> | ||||
</compile> | </compile> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="bugs151/pr125080" title="mixing numbers of type parameters"> | <ajc-test dir="bugs151/pr125080" title="mixing numbers of type parameters"> | ||||
<compile files="Test.java" options="-1.5"/> | <compile files="Test.java" options="-1.5"/> | ||||
<run class="ConcreteAspect"/> | <run class="ConcreteAspect"/> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="bugs151/pr125080" title="mixing numbers of type parameters - 2"> | <ajc-test dir="bugs151/pr125080" title="mixing numbers of type parameters - 2"> | ||||
<compile files="Test2.java" options="-1.5"/> | <compile files="Test2.java" options="-1.5"/> | ||||
<run class="ConcreteAspect"/> | <run class="ConcreteAspect"/> | ||||
<ajc-test dir="bugs151/pr125295" title="new IProgramElement methods"> | <ajc-test dir="bugs151/pr125295" title="new IProgramElement methods"> | ||||
<compile files="pkg/C.java,pkg/A.aj" options="-emacssym"/> | <compile files="pkg/C.java,pkg/A.aj" options="-emacssym"/> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="bugs151/pr125475" title="define empty pointcut using an annotation"> | <ajc-test dir="bugs151/pr125475" title="define empty pointcut using an annotation"> | ||||
<compile files="TestEmptyPointcutAtAspect.java" options="-1.5"/> | <compile files="TestEmptyPointcutAtAspect.java" options="-1.5"/> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="bugs151/pr125475" title="define empty pointcut using an annotation - 2"> | <ajc-test dir="bugs151/pr125475" title="define empty pointcut using an annotation - 2"> | ||||
<compile files="TestEmptyPointcutAtAspect2.java" options="-1.5 -showWeaveInfo"> | <compile files="TestEmptyPointcutAtAspect2.java" options="-1.5 -showWeaveInfo"> | ||||
<message kind="warning" line="10" text="advice defined in TestEmptyPointcutAtAspect2 has not been applied [Xlint:adviceDidNotMatch]"/> | <message kind="warning" line="10" text="advice defined in TestEmptyPointcutAtAspect2 has not been applied [Xlint:adviceDidNotMatch]"/> | ||||
<compile files="Test.java TestAspect.aj"/> | <compile files="Test.java TestAspect.aj"/> | ||||
<run class="Test" ltw="aop.xml"/> | <run class="Test" ltw="aop.xml"/> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="bugs151/pr128744" title="broken ltw"> | <ajc-test dir="bugs151/pr128744" title="broken ltw"> | ||||
<compile files="Hello.java World.java" options="-1.5" /> | <compile files="Hello.java World.java" options="-1.5" /> | ||||
<run class="Hello" ltw="aop.xml"> | <run class="Hello" ltw="aop.xml"> | ||||
</stdout> | </stdout> | ||||
</run> | </run> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="bugs151/pr125699" title="inherit advice with this() and thisJoinPoint"> | <ajc-test dir="bugs151/pr125699" title="inherit advice with this() and thisJoinPoint"> | ||||
<compile files="Tracing.aj, TestTracing.aj, AtTestTracing.java" options="-1.5"> | <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]"/> | <message kind="warning" line="13" text="advice defined in Tracing has not been applied [Xlint:adviceDidNotMatch]"/> | ||||
<ajc-test dir="bugs151" title="E extends Enum(E) again"> | <ajc-test dir="bugs151" title="E extends Enum(E) again"> | ||||
<compile files="Pr126316.aj" options="-1.5"/> | <compile files="Pr126316.aj" options="-1.5"/> | ||||
</ajc-test> | |||||
</ajc-test> | |||||
<ajc-test dir="bugs151" title="@AJ without JoinPoint import"> | <ajc-test dir="bugs151" title="@AJ without JoinPoint import"> | ||||
<compile files="pr121616.java" options="-1.5"> | <compile files="pr121616.java" options="-1.5"> | ||||
</stdout> | </stdout> | ||||
</run> | </run> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="bugs151" title="Pointcut interfaces"> | <ajc-test dir="bugs151" title="Pointcut interfaces"> | ||||
<compile files="pr130869.aj" options="-1.5"> | <compile files="pr130869.aj" options="-1.5"> | ||||
<message kind="warning" line="30" text="no directly runnable classes"/> | <message kind="warning" line="30" text="no directly runnable classes"/> | ||||
<compile files="pr131933.aj" options="-1.5"> | <compile files="pr131933.aj" options="-1.5"> | ||||
<message kind="error" line="5" text="can't bind type name 'MyList'"/> | <message kind="error" line="5" text="can't bind type name 'MyList'"/> | ||||
</compile> | </compile> | ||||
</ajc-test> | |||||
</ajc-test> | |||||
<!-- New features down here... when they arent big enough to have their own test file --> | <!-- New features down here... when they arent big enough to have their own test file --> | ||||
<ajc-test dir="features151/ptw" title="exposing withintype"> | <ajc-test dir="features151/ptw" title="exposing withintype"> | ||||
<compile files="ExposedType.java" options="-1.5"/> | <compile files="ExposedType.java" options="-1.5"/> | ||||
<run class="ExposedType"> | <run class="ExposedType"> | ||||
<line text="here I am execution(void ExposedTypeThree.foo()): for class ExposedTypeThree"/> | <line text="here I am execution(void ExposedTypeThree.foo()): for class ExposedTypeThree"/> | ||||
</stderr> | </stderr> | ||||
</run> | </run> | ||||
</ajc-test> | |||||
</ajc-test> | |||||
<ajc-test dir="features151/swallowedExceptions" title="swallowed exceptions"> | <ajc-test dir="features151/swallowedExceptions" title="swallowed exceptions"> | ||||
<compile files="SwallowedException.java" options="-Xlint:warning"> | <compile files="SwallowedException.java" options="-Xlint:warning"> | ||||
<message kind="warning" line="11" text="Exception swallowed in catch block"/> | <message kind="warning" line="11" text="Exception swallowed in catch block"/> | ||||
<compile files="SwallowedException.java"> | <compile files="SwallowedException.java"> | ||||
</compile> | </compile> | ||||
</ajc-test> | </ajc-test> | ||||
</suite> | |||||
</suite> |
</compile> | </compile> | ||||
<run class="c.d.DistantResource"> | <run class="c.d.DistantResource"> | ||||
<stdout> | <stdout> | ||||
<line text="Annotation is @a.b.SimpleAnnotation(classname=oranges)" vm="1.2,1.3,1.4,1.5,1.6,1.7,1.8"/> | |||||
<line text="Annotation is @a.b.SimpleAnnotation(classname="oranges")" vm="9+"/> | |||||
<line text="Annotation is @a.b.SimpleAnnotation(classname=oranges)" vm="-1.8"/> | |||||
<line text="Annotation is @a.b.SimpleAnnotation(classname="oranges")" vm="9-"/> | |||||
</stdout> | </stdout> | ||||
</run> | </run> | ||||
</ajc-test> | </ajc-test> | ||||
</compile> | </compile> | ||||
<run class="c.d.DistantResource"> | <run class="c.d.DistantResource"> | ||||
<stdout> | <stdout> | ||||
<line text="Annotation is @a.b.SimpleAnnotation(classname=oranges)" vm="1.2,1.3,1.4,1.5,1.6,1.7,1.8"/> | |||||
<line text="Annotation is @a.b.SimpleAnnotation(classname="oranges")" vm="9+"/> | |||||
<line text="Annotation is @a.b.SimpleAnnotation(classname=oranges)" vm="-1.8"/> | |||||
<line text="Annotation is @a.b.SimpleAnnotation(classname="oranges")" vm="9-"/> | |||||
</stdout> | </stdout> | ||||
</run> | </run> | ||||
</ajc-test> | </ajc-test> | ||||
</compile> | </compile> | ||||
<run class="c.d.DistantResource"> | <run class="c.d.DistantResource"> | ||||
<stdout> | <stdout> | ||||
<line text="Annotation is @e.f.SimpleAnnotation2(classname=oranges)" vm="1.2,1.3,1.4,1.5,1.6,1.7,1.8"/> | |||||
<line text="Annotation is @e.f.SimpleAnnotation2(classname="oranges")" vm="9+"/> | |||||
<line text="Annotation is @e.f.SimpleAnnotation2(classname=oranges)" vm="-1.8"/> | |||||
<line text="Annotation is @e.f.SimpleAnnotation2(classname="oranges")" vm="9-"/> | |||||
</stdout> | </stdout> | ||||
</run> | </run> | ||||
</ajc-test> | </ajc-test> | ||||
</compile> | </compile> | ||||
<run class="c.d.DistantResource"> | <run class="c.d.DistantResource"> | ||||
<stdout> | <stdout> | ||||
<line text="Annotation is @e.f.SimpleAnnotation2(classname=oranges)" vm="1.2,1.3,1.4,1.5,1.6,1.7,1.8"/> | |||||
<line text="Annotation is @e.f.SimpleAnnotation2(classname="oranges")" vm="9+"/> | |||||
<line text="Annotation is @e.f.SimpleAnnotation2(classname=oranges)" vm="-1.8"/> | |||||
<line text="Annotation is @e.f.SimpleAnnotation2(classname="oranges")" vm="9-"/> | |||||
</stdout> | </stdout> | ||||
</run> | </run> | ||||
</ajc-test> | </ajc-test> | ||||
</compile> | </compile> | ||||
<run class="c.d.DistantResource"> | <run class="c.d.DistantResource"> | ||||
<stdout> | <stdout> | ||||
<line text="Annotation is @e.f.SimpleAnnotation2(classname=oranges)" vm="1.2,1.3,1.4,1.5,1.6,1.7,1.8"/> | |||||
<line text="Annotation is @e.f.SimpleAnnotation2(classname="oranges")" vm="9+"/> | |||||
<line text="Annotation is @e.f.SimpleAnnotation2(classname=oranges)" vm="-1.8"/> | |||||
<line text="Annotation is @e.f.SimpleAnnotation2(classname="oranges")" vm="9-"/> | |||||
</stdout> | </stdout> | ||||
</run> | </run> | ||||
</ajc-test> | </ajc-test> | ||||
</compile> | </compile> | ||||
<run class="c.d.DistantResource"> | <run class="c.d.DistantResource"> | ||||
<stdout> | <stdout> | ||||
<line text="Annotation is @e.f.SimpleAnnotation2(classname=oranges)" vm="1.2,1.3,1.4,1.5,1.6,1.7,1.8"/> | |||||
<line text="Annotation is @e.f.SimpleAnnotation2(classname="oranges")" vm="9+"/> | |||||
<line text="Annotation is @e.f.SimpleAnnotation2(classname=oranges)" vm="-1.8"/> | |||||
<line text="Annotation is @e.f.SimpleAnnotation2(classname="oranges")" vm="9-"/> | |||||
</stdout> | </stdout> | ||||
</run> | </run> | ||||
</ajc-test> | </ajc-test> |
</stdout> | </stdout> | ||||
</run> | </run> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="features1611/declareMinus" title="adding and removing"> | <ajc-test dir="features1611/declareMinus" title="adding and removing"> | ||||
<compile files="OnOff.java" options="-1.5 -showWeaveInfo"> | <compile files="OnOff.java" options="-1.5 -showWeaveInfo"> | ||||
<message kind="weave" text="'public int field2' of type 'OnOff' (OnOff.java) is annotated with @Anno field annotation from 'Foo' (OnOff.java:12)"/> | <message kind="weave" text="'public int field2' of type 'OnOff' (OnOff.java) is annotated with @Anno field annotation from 'Foo' (OnOff.java:12)"/> | ||||
</stdout> | </stdout> | ||||
</run> | </run> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="features1611/declareMinus" title="adding and removing - 2"> | <ajc-test dir="features1611/declareMinus" title="adding and removing - 2"> | ||||
<compile files="OnOff2.java" options="-1.5 -showWeaveInfo"> | <compile files="OnOff2.java" options="-1.5 -showWeaveInfo"> | ||||
<message kind="weave" text="'public int field2' of type 'OnOff2' (OnOff2.java) is annotated with @Anno field annotation from 'Foo' (OnOff2.java:8)"/> | <message kind="weave" text="'public int field2' of type 'OnOff2' (OnOff2.java) is annotated with @Anno field annotation from 'Foo' (OnOff2.java:8)"/> | ||||
</stdout> | </stdout> | ||||
</run> | </run> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="features1611/declareMinus" title="declare minus - 1"> | <ajc-test dir="features1611/declareMinus" title="declare minus - 1"> | ||||
<compile files="Code.java" options="-1.5"/> | <compile files="Code.java" options="-1.5"/> | ||||
<run class="Code"> <stdout> | <run class="Code"> <stdout> | ||||
<line text="no annotation"/> | <line text="no annotation"/> | ||||
</stdout></run> | </stdout></run> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="features1611/declareMinus" title="declare minus - itd"> | <ajc-test dir="features1611/declareMinus" title="declare minus - itd"> | ||||
<compile files="Code2.java" options="-1.5"/> | <compile files="Code2.java" options="-1.5"/> | ||||
<run class="Code2"> | <run class="Code2"> | ||||
<line text="no annotation"/> | <line text="no annotation"/> | ||||
</stdout></run> | </stdout></run> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="features1611/declareMinus" title="declare minus - 2 annos"> | <ajc-test dir="features1611/declareMinus" title="declare minus - 2 annos"> | ||||
<compile files="Code3.java" options="-1.5"/> | <compile files="Code3.java" options="-1.5"/> | ||||
<run class="Code3"> | <run class="Code3"> | ||||
<line text="has AnnoB"/> | <line text="has AnnoB"/> | ||||
</stdout></run> | </stdout></run> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="features1611/declareMinus" title="declare minus - multifiles"> | <ajc-test dir="features1611/declareMinus" title="declare minus - multifiles"> | ||||
<compile files="aspectjtest/AnnotationA.java aspectjtest/AnnotationB.java aspectjtest/ExampleItd.aj aspectjtest/HelloTest.java aspectjtest/MyEntity.java" options="-1.5"/> | <compile files="aspectjtest/AnnotationA.java aspectjtest/AnnotationB.java aspectjtest/ExampleItd.aj aspectjtest/HelloTest.java aspectjtest/MyEntity.java" options="-1.5"/> | ||||
<run class="aspectjtest.HelloTest"> | <run class="aspectjtest.HelloTest"> | ||||
<line text="interface aspectjtest.AnnotationB"/> | <line text="interface aspectjtest.AnnotationB"/> | ||||
</stdout></run> | </stdout></run> | ||||
</ajc-test> | </ajc-test> | ||||
<!-- different ordering --> | <!-- different ordering --> | ||||
<ajc-test dir="features1611/declareMinus" title="declare minus - multifiles - 2"> | <ajc-test dir="features1611/declareMinus" title="declare minus - multifiles - 2"> | ||||
<compile files="aspectjtest/MyEntity.java aspectjtest/AnnotationA.java aspectjtest/AnnotationB.java aspectjtest/ExampleItd.aj aspectjtest/HelloTest.java" options="-1.5"/> | <compile files="aspectjtest/MyEntity.java aspectjtest/AnnotationA.java aspectjtest/AnnotationB.java aspectjtest/ExampleItd.aj aspectjtest/HelloTest.java" options="-1.5"/> | ||||
<line text="interface aspectjtest.AnnotationB"/> | <line text="interface aspectjtest.AnnotationB"/> | ||||
</stdout></run> | </stdout></run> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="features1611/declareMinus" title="declare minus - with values"> | <ajc-test dir="features1611/declareMinus" title="declare minus - with values"> | ||||
<compile files="WithValues.java" options="-1.5"/> | <compile files="WithValues.java" options="-1.5"/> | ||||
<run class="WithValues"> | <run class="WithValues"> | ||||
<stdout> | <stdout> | ||||
<line text="i does not have Anno"/> | <line text="i does not have Anno"/> | ||||
<line text="j has Banno:@Banno(hoo=abc)" vm="1.2,1.3,1.4,1.5,1.6,1.7,1.8"/> | |||||
<line text="j has Banno:@Banno(hoo="abc")" vm="9+"/> | |||||
<line text="j has Banno:@Banno(hoo=abc)" vm="-1.8"/> | |||||
<line text="j has Banno:@Banno(hoo="abc")" vm="9-"/> | |||||
<line text="j does not have Anno"/> | <line text="j does not have Anno"/> | ||||
</stdout></run> | </stdout></run> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="features1611/declareMinus" title="declare minus - unsupported"> | <ajc-test dir="features1611/declareMinus" title="declare minus - unsupported"> | ||||
<compile files="Unsupported.java" options="-1.5"> | <compile files="Unsupported.java" options="-1.5"> | ||||
<message kind="error" line="19" text="Annotation removal only supported for declare @field (compiler limitation)"/> | <message kind="error" line="19" text="Annotation removal only supported for declare @field (compiler limitation)"/> | ||||
<message kind="error" line="21" text="Annotation removal does not allow values to be specified for the annotation (compiler limitation)"/> | <message kind="error" line="21" text="Annotation removal does not allow values to be specified for the annotation (compiler limitation)"/> | ||||
</compile> | </compile> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="features1611/declareMinus" title="binary weaving"> | <ajc-test dir="features1611/declareMinus" title="binary weaving"> | ||||
<compile files="aspectjtest/AnnotationA.java aspectjtest/AnnotationB.java aspectjtest/MyEntity.java aspectjtest/HelloTest.java" outjar="code.jar" options="-1.5"/> | <compile files="aspectjtest/AnnotationA.java aspectjtest/AnnotationB.java aspectjtest/MyEntity.java aspectjtest/HelloTest.java" outjar="code.jar" options="-1.5"/> | ||||
<compile files="aspectjtest/ExampleItd.aj" inpath="code.jar" options="-1.5 -showWeaveInfo"> | <compile files="aspectjtest/ExampleItd.aj" inpath="code.jar" options="-1.5 -showWeaveInfo"> | ||||
<line text="interface aspectjtest.AnnotationB"/> | <line text="interface aspectjtest.AnnotationB"/> | ||||
</stdout></run> | </stdout></run> | ||||
</ajc-test> | </ajc-test> | ||||
</suite> | </suite> |
<run class="AspectWithConstant"> | <run class="AspectWithConstant"> | ||||
<stdout> | <stdout> | ||||
<line text="MAX=9"/> | <line text="MAX=9"/> | ||||
<line text="@AspectWithConstant$Loggable()"/> | |||||
<line text="@AspectWithConstant$Loggable()" vm="-18"/> | |||||
<line text="@AspectWithConstant.Loggable()" vm="19-"/> | |||||
</stdout></run> | </stdout></run> | ||||
</ajc-test> | </ajc-test> | ||||
<compile files="AnnoBinding2.java" options="-1.5"/> | <compile files="AnnoBinding2.java" options="-1.5"/> | ||||
<run class="AnnoBinding2"> | <run class="AnnoBinding2"> | ||||
<stdout> | <stdout> | ||||
<line text="get(int AnnoBinding2.field1) @Marker(message=foo)" vm="1.2,1.3,1.4,1.5,1.6,1.7,1.8"/> | |||||
<line text="get(int AnnoBinding2.field1) @Marker(message="foo")" vm="9+"/> | |||||
<line text="get(int AnnoBinding2.field2) @Marker(message=bar)" vm="1.2,1.3,1.4,1.5,1.6,1.7,1.8"/> | |||||
<line text="get(int AnnoBinding2.field2) @Marker(message="bar")" vm="9+"/> | |||||
<line text="get(int AnnoBinding2.field1) @Marker(message=foo)" vm="-1.8"/> | |||||
<line text="get(int AnnoBinding2.field1) @Marker(message="foo")" vm="9-"/> | |||||
<line text="get(int AnnoBinding2.field2) @Marker(message=bar)" vm="-1.8"/> | |||||
<line text="get(int AnnoBinding2.field2) @Marker(message="bar")" vm="9-"/> | |||||
<line text="2 ajc$anno$NNN fields"/> | <line text="2 ajc$anno$NNN fields"/> | ||||
</stdout> | </stdout> | ||||
</run> | </run> |
<!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"[]> | <!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"[]> | ||||
<suite> | <suite> | ||||
<ajc-test dir="features169/itdInnerTypes/separate" title="separate compilation"> | <ajc-test dir="features169/itdInnerTypes/separate" title="separate compilation"> | ||||
<compile files="Basic.java" options="-1.5"/> | <compile files="Basic.java" options="-1.5"/> | ||||
<compile files="Basic2.java"/> | <compile files="Basic2.java"/> | ||||
</stdout> | </stdout> | ||||
</run> | </run> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="features169/itdInnerTypes/separate2" title="separate compilation - 2"> | <ajc-test dir="features169/itdInnerTypes/separate2" title="separate compilation - 2"> | ||||
<compile files="Basic.java" options="-1.5"/> | <compile files="Basic.java" options="-1.5"/> | ||||
<compile files="Basic2.java"/> | <compile files="Basic2.java"/> | ||||
<message kind="error" text="target type already declares a "/> | <message kind="error" text="target type already declares a "/> | ||||
</compile> | </compile> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="features169/itdInnerTypes" title="construction4"> | <ajc-test dir="features169/itdInnerTypes" title="construction4"> | ||||
<compile files="Construction4.java" options="-1.5"/> | <compile files="Construction4.java" options="-1.5"/> | ||||
<run class="Construction4"> | <run class="Construction4"> | ||||
</stdout> | </stdout> | ||||
</run> | </run> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="features169/itdInnerTypes" title="construction3"> | <ajc-test dir="features169/itdInnerTypes" title="construction3"> | ||||
<compile files="Construction3.java" options="-1.5"/> | <compile files="Construction3.java" options="-1.5"/> | ||||
<run class="Construction3"> | <run class="Construction3"> | ||||
</stdout> | </stdout> | ||||
</run> | </run> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="features169/itdInnerTypes/ten" title="construction2"> | <ajc-test dir="features169/itdInnerTypes/ten" title="construction2"> | ||||
<compile files="Construction.java Aspect1.java Aspect2.java" options="-1.5"/> | <compile files="Construction.java Aspect1.java Aspect2.java" options="-1.5"/> | ||||
<run class="Construction"> | <run class="Construction"> | ||||
</stdout> | </stdout> | ||||
</run> | </run> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="features169/itdInnerTypes" title="construction"> | <ajc-test dir="features169/itdInnerTypes" title="construction"> | ||||
<compile files="Construction.java" options="-1.5"/> | <compile files="Construction.java" options="-1.5"/> | ||||
<run class="Construction"> | <run class="Construction"> | ||||
</stdout> | </stdout> | ||||
</run> | </run> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="features169/itdInnerTypes/nine" title="vote - itd mixture 2"> | <ajc-test dir="features169/itdInnerTypes/nine" title="vote - itd mixture 2"> | ||||
<compile files="Underscorer.aj Vote.java Runner.java RelatedType.java" options="-1.5"/> | <compile files="Underscorer.aj Vote.java Runner.java RelatedType.java" options="-1.5"/> | ||||
<run class="a.b.c.Runner"> | <run class="a.b.c.Runner"> | ||||
<stdout> | <stdout> | ||||
<line text="wibble"/> | <line text="wibble"/> | ||||
<line text="@a.b.c.RelatedType(value=class a.b.c.Vote$_$choice)" vm="1.2,1.3,1.4,1.5,1.6,1.7,1.8"/> | |||||
<line text="@a.b.c.RelatedType(value=a.b.c.Vote$_$choice.class)" vm="9,10,11,12,13"/> | |||||
<line text="@a.b.c.RelatedType(a.b.c.Vote$_$choice.class)" vm="14+"/> | |||||
<line text="@a.b.c.RelatedType(value=class a.b.c.Vote$_$choice)" vm="-1.8"/> | |||||
<line text="@a.b.c.RelatedType(value=a.b.c.Vote$_$choice.class)" vm="9-13"/> | |||||
<line text="@a.b.c.RelatedType(a.b.c.Vote$_$choice.class)" vm="14-18"/> | |||||
<line text="@a.b.c.RelatedType(a.b.c.Vote._.choice.class)" vm="19-"/> | |||||
</stdout> | </stdout> | ||||
</run> | </run> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="features169/itdInnerTypes/eight" title="vote - itd mixture"> | <ajc-test dir="features169/itdInnerTypes/eight" title="vote - itd mixture"> | ||||
<compile files="Underscorer.aj Vote.java Runner.java RelatedType.java" options="-1.5"/> | <compile files="Underscorer.aj Vote.java Runner.java RelatedType.java" options="-1.5"/> | ||||
<run class="a.b.c.Runner"> | <run class="a.b.c.Runner"> | ||||
<stdout> | <stdout> | ||||
<line text="wibble"/> | <line text="wibble"/> | ||||
<line text="@a.b.c.RelatedType(value=class a.b.c.Vote$_$choice)" vm="1.2,1.3,1.4,1.5,1.6,1.7,1.8"/> | |||||
<line text="@a.b.c.RelatedType(value=a.b.c.Vote$_$choice.class)" vm="9,10,11,12,13"/> | |||||
<line text="@a.b.c.RelatedType(a.b.c.Vote$_$choice.class)" vm="14+"/> | |||||
<line text="@a.b.c.RelatedType(value=class a.b.c.Vote$_$choice)" vm="-1.8"/> | |||||
<line text="@a.b.c.RelatedType(value=a.b.c.Vote$_$choice.class)" vm="9-13"/> | |||||
<line text="@a.b.c.RelatedType(a.b.c.Vote$_$choice.class)" vm="14-18"/> | |||||
<line text="@a.b.c.RelatedType(a.b.c.Vote._.choice.class)" vm="19-"/> | |||||
</stdout> | </stdout> | ||||
</run> | </run> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="features169/itdInnerTypes/seven" title="vote - method reference"> | <ajc-test dir="features169/itdInnerTypes/seven" title="vote - method reference"> | ||||
<compile files="Underscorer.aj Vote.java Runner.java RelatedType.java" options="-1.5"/> | <compile files="Underscorer.aj Vote.java Runner.java RelatedType.java" options="-1.5"/> | ||||
<run class="a.b.c.Runner"> | <run class="a.b.c.Runner"> | ||||
<stdout> | <stdout> | ||||
<line text="wibble"/> | <line text="wibble"/> | ||||
<line text="@a.b.c.RelatedType(value=class a.b.c.Vote$_$choice)" vm="1.2,1.3,1.4,1.5,1.6,1.7,1.8"/> | |||||
<line text="@a.b.c.RelatedType(value=a.b.c.Vote$_$choice.class)" vm="9,10,11,12,13"/> | |||||
<line text="@a.b.c.RelatedType(a.b.c.Vote$_$choice.class)" vm="14+"/> | |||||
<line text="@a.b.c.RelatedType(value=class a.b.c.Vote$_$choice)" vm="-1.8"/> | |||||
<line text="@a.b.c.RelatedType(value=a.b.c.Vote$_$choice.class)" vm="9-13"/> | |||||
<line text="@a.b.c.RelatedType(a.b.c.Vote$_$choice.class)" vm="14-18"/> | |||||
<line text="@a.b.c.RelatedType(a.b.c.Vote._.choice.class)" vm="19-"/> | |||||
</stdout> | </stdout> | ||||
</run> | </run> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="features169/itdInnerTypes/six" title="vote - field reference"> | <ajc-test dir="features169/itdInnerTypes/six" title="vote - field reference"> | ||||
<compile files="Vote.java Vote_Amender.aj Runner.java RelatedType.java" options="-1.5"/> | <compile files="Vote.java Vote_Amender.aj Runner.java RelatedType.java" options="-1.5"/> | ||||
<run class="a.b.c.Runner"> | <run class="a.b.c.Runner"> | ||||
<stdout> | <stdout> | ||||
<line text="wibble"/> | <line text="wibble"/> | ||||
<line text="@a.b.c.RelatedType(value=class a.b.c.Vote$_$choice)" vm="1.2,1.3,1.4,1.5,1.6,1.7,1.8"/> | |||||
<line text="@a.b.c.RelatedType(value=a.b.c.Vote$_$choice.class)" vm="9,10,11,12,13"/> | |||||
<line text="@a.b.c.RelatedType(a.b.c.Vote$_$choice.class)" vm="14+"/> | |||||
<line text="@a.b.c.RelatedType(value=class a.b.c.Vote$_$choice)" vm="-1.8"/> | |||||
<line text="@a.b.c.RelatedType(value=a.b.c.Vote$_$choice.class)" vm="9-13"/> | |||||
<line text="@a.b.c.RelatedType(a.b.c.Vote$_$choice.class)" vm="14-18"/> | |||||
<line text="@a.b.c.RelatedType(a.b.c.Vote._.choice.class)" vm="19-"/> | |||||
</stdout> | </stdout> | ||||
</run> | </run> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="features169/itdInnerTypes/five" title="vote - inner inner"> | <ajc-test dir="features169/itdInnerTypes/five" title="vote - inner inner"> | ||||
<compile files="Vote.java Vote_Amender.aj Runner.java RelatedType.java" options="-1.5"/> | <compile files="Vote.java Vote_Amender.aj Runner.java RelatedType.java" options="-1.5"/> | ||||
<run class="a.b.c.Runner"> | <run class="a.b.c.Runner"> | ||||
<stdout> | <stdout> | ||||
<line text="wibble"/> | <line text="wibble"/> | ||||
<line text="@a.b.c.RelatedType(value=class a.b.c.Vote$_$choice)" vm="1.2,1.3,1.4,1.5,1.6,1.7,1.8"/> | |||||
<line text="@a.b.c.RelatedType(value=a.b.c.Vote$_$choice.class)" vm="9,10,11,12,13"/> | |||||
<line text="@a.b.c.RelatedType(a.b.c.Vote$_$choice.class)" vm="14+"/> | |||||
<line text="@a.b.c.RelatedType(value=class a.b.c.Vote$_$choice)" vm="-1.8"/> | |||||
<line text="@a.b.c.RelatedType(value=a.b.c.Vote$_$choice.class)" vm="9-13"/> | |||||
<line text="@a.b.c.RelatedType(a.b.c.Vote$_$choice.class)" vm="14-18"/> | |||||
<line text="@a.b.c.RelatedType(a.b.c.Vote._.choice.class)" vm="19-"/> | |||||
</stdout> | </stdout> | ||||
</run> | </run> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="features169/itdInnerTypes/four" title="vote - reference via annotation - two"> | <ajc-test dir="features169/itdInnerTypes/four" title="vote - reference via annotation - two"> | ||||
<compile files="Vote.java Vote_Amender.aj Runner.java RelatedType.java" options="-1.5"/> | <compile files="Vote.java Vote_Amender.aj Runner.java RelatedType.java" options="-1.5"/> | ||||
<run class="a.b.c.Runner"> | <run class="a.b.c.Runner"> | ||||
<stdout> | <stdout> | ||||
<line text="wibble"/> | <line text="wibble"/> | ||||
<line text="@a.b.c.RelatedType(value=class a.b.c.Vote$_$choice)" vm="1.2,1.3,1.4,1.5,1.6,1.7,1.8"/> | |||||
<line text="@a.b.c.RelatedType(value=a.b.c.Vote$_$choice.class)" vm="9,10,11,12,13"/> | |||||
<line text="@a.b.c.RelatedType(a.b.c.Vote$_$choice.class)" vm="14+"/> | |||||
<line text="@a.b.c.RelatedType(value=class a.b.c.Vote$_$choice)" vm="-1.8"/> | |||||
<line text="@a.b.c.RelatedType(value=a.b.c.Vote$_$choice.class)" vm="9-13"/> | |||||
<line text="@a.b.c.RelatedType(a.b.c.Vote$_$choice.class)" vm="14-18"/> | |||||
<line text="@a.b.c.RelatedType(a.b.c.Vote._.choice.class)" vm="19-"/> | |||||
</stdout> | </stdout> | ||||
</run> | </run> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="features169/itdInnerTypes/three" title="vote - reference via annotation"> | <ajc-test dir="features169/itdInnerTypes/three" title="vote - reference via annotation"> | ||||
<compile files="Vote.java Vote_Amender.aj Runner.java RelatedType.java" options="-1.5"/> | <compile files="Vote.java Vote_Amender.aj Runner.java RelatedType.java" options="-1.5"/> | ||||
<run class="a.b.c.Runner"> | <run class="a.b.c.Runner"> | ||||
<stdout> | <stdout> | ||||
<line text="wibble"/> | <line text="wibble"/> | ||||
<line text="@a.b.c.RelatedType(value=class a.b.c.Vote$_)" vm="1.2,1.3,1.4,1.5,1.6,1.7,1.8"/> | |||||
<line text="@a.b.c.RelatedType(value=a.b.c.Vote$_.class)" vm="9,10,11,12,13"/> | |||||
<line text="@a.b.c.RelatedType(a.b.c.Vote$_.class)" vm="14+"/> | |||||
<line text="@a.b.c.RelatedType(value=class a.b.c.Vote$_)" vm="-1.8"/> | |||||
<line text="@a.b.c.RelatedType(value=a.b.c.Vote$_.class)" vm="9-13"/> | |||||
<line text="@a.b.c.RelatedType(a.b.c.Vote$_.class)" vm="14-18"/> | |||||
<line text="@a.b.c.RelatedType(a.b.c.Vote._.class)" vm="19-"/> | |||||
</stdout> | </stdout> | ||||
</run> | </run> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="features169/itdInnerTypes/two" title="vote - construction"> | <ajc-test dir="features169/itdInnerTypes/two" title="vote - construction"> | ||||
<compile files="Vote.java Vote_Amender.aj Runner.java" options="-1.5"/> | <compile files="Vote.java Vote_Amender.aj Runner.java" options="-1.5"/> | ||||
<run class="a.b.c.Runner"> | <run class="a.b.c.Runner"> | ||||
</stdout> | </stdout> | ||||
</run> | </run> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="features169/itdInnerTypes/one" title="vote - basic"> | <ajc-test dir="features169/itdInnerTypes/one" title="vote - basic"> | ||||
<compile files="Vote.java Vote_Amender.aj Runner.java" options="-1.5"/> | <compile files="Vote.java Vote_Amender.aj Runner.java" options="-1.5"/> | ||||
<run class="a.b.c.Runner"/> | <run class="a.b.c.Runner"/> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="features169/itdInnerTypes" title="choice - generics 1"> | <ajc-test dir="features169/itdInnerTypes" title="choice - generics 1"> | ||||
<compile files="ChoiceGenerics1.java" options="-1.5"/> | <compile files="ChoiceGenerics1.java" options="-1.5"/> | ||||
</ajc-test> | </ajc-test> | ||||
<message kind="error" text="Type mismatch: cannot convert from String to Integer"/> | <message kind="error" text="Type mismatch: cannot convert from String to Integer"/> | ||||
</compile> | </compile> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="features169/itdInnerTypes" title="choice"> | <ajc-test dir="features169/itdInnerTypes" title="choice"> | ||||
<compile files="Choice.java" options="-1.5"/> | <compile files="Choice.java" options="-1.5"/> | ||||
<run class="Choice"> | <run class="Choice"> | ||||
<line text="null"/> | <line text="null"/> | ||||
</stdout></run> | </stdout></run> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="features169/itdInnerTypes" title="choice - weaveinfo"> | <ajc-test dir="features169/itdInnerTypes" title="choice - weaveinfo"> | ||||
<compile files="Choice.java" options="-1.5 -showWeaveInfo"> | <compile files="Choice.java" options="-1.5 -showWeaveInfo"> | ||||
<message kind="weave" text="Type 'Choice' (Choice.java) has intertyped member class from 'X' (Choice.java)"/> | <message kind="weave" text="Type 'Choice' (Choice.java) has intertyped member class from 'X' (Choice.java)"/> | ||||
</compile> | </compile> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="features169/itdInnerTypes" title="choice - model"> | <ajc-test dir="features169/itdInnerTypes" title="choice - model"> | ||||
<compile files="Choice.java" options="-1.5 -emacssym"/> | <compile files="Choice.java" options="-1.5 -emacssym"/> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="features169/itdInnerTypes" title="choice2"> | <ajc-test dir="features169/itdInnerTypes" title="choice2"> | ||||
<compile files="Choice2.java" options="-1.5"/> | <compile files="Choice2.java" options="-1.5"/> | ||||
<run class="Choice2"> | <run class="Choice2"> | ||||
<line text="null"/> | <line text="null"/> | ||||
</stdout></run> | </stdout></run> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="features169/itdInnerTypes" title="field access"> | <ajc-test dir="features169/itdInnerTypes" title="field access"> | ||||
<compile files="FieldAccess.java" options="-1.5"/> | <compile files="FieldAccess.java" options="-1.5"/> | ||||
<run class="FieldAccess"> | <run class="FieldAccess"> | ||||
<line text="42"/> | <line text="42"/> | ||||
</stdout></run> | </stdout></run> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="features169/itdInnerTypes" title="method access"> | <ajc-test dir="features169/itdInnerTypes" title="method access"> | ||||
<compile files="MethodCall.java" options="-1.5"/> | <compile files="MethodCall.java" options="-1.5"/> | ||||
<run class="MethodCall"> | <run class="MethodCall"> | ||||
<line text="42"/> | <line text="42"/> | ||||
</stdout></run> | </stdout></run> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="features169/itdInnerTypes" title="only static"> | <ajc-test dir="features169/itdInnerTypes" title="only static"> | ||||
<compile files="OnlyStatic.java" options="-1.5"> | <compile files="OnlyStatic.java" options="-1.5"> | ||||
<message kind="error" line="5" text="Intertype declared member types can only be static (compiler limitation)"/> | <message kind="error" line="5" text="Intertype declared member types can only be static (compiler limitation)"/> | ||||
</compile> | </compile> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="features169/itdInnerTypes" title="on interface"> | <ajc-test dir="features169/itdInnerTypes" title="on interface"> | ||||
<compile files="OnInterface.java" options="-1.5"> | <compile files="OnInterface.java" options="-1.5"> | ||||
<message kind="error" line="5" text="Cannot declare new member type on 'OnInterface'. New member types can only be specified on classes (compiler limitation)"/> | <message kind="error" line="5" text="Cannot declare new member type on 'OnInterface'. New member types can only be specified on classes (compiler limitation)"/> | ||||
</compile> | </compile> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="features169/itdInnerTypes" title="on enum"> | <ajc-test dir="features169/itdInnerTypes" title="on enum"> | ||||
<compile files="OnEnum.java" options="-1.5"> | <compile files="OnEnum.java" options="-1.5"> | ||||
<message kind="error" line="6" text="Cannot declare new member type on 'EEE'. New member types can only be specified on classes (compiler limitation)"/> | <message kind="error" line="6" text="Cannot declare new member type on 'EEE'. New member types can only be specified on classes (compiler limitation)"/> | ||||
</compile> | </compile> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="features169/itdInnerTypes" title="on annotation"> | <ajc-test dir="features169/itdInnerTypes" title="on annotation"> | ||||
<compile files="OnAnnotation.java" options="-1.5"> | <compile files="OnAnnotation.java" options="-1.5"> | ||||
<message kind="error" line="8" text="Cannot declare new member type on 'Anno'. New member types can only be specified on classes (compiler limitation)"/> | <message kind="error" line="8" text="Cannot declare new member type on 'Anno'. New member types can only be specified on classes (compiler limitation)"/> | ||||
</compile> | </compile> | ||||
</ajc-test> | </ajc-test> | ||||
<!-- | |||||
<!-- | |||||
<ajc-test dir="features169/itdInnerTypes" title="simplest 3"> | <ajc-test dir="features169/itdInnerTypes" title="simplest 3"> | ||||
<compile files="Simplest3.java" options="-1.5"/> | <compile files="Simplest3.java" options="-1.5"/> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="features169/itdInnerTypes" title="simplest 2"> | <ajc-test dir="features169/itdInnerTypes" title="simplest 2"> | ||||
<compile files="Simplest2.java" options="-1.5"/> | <compile files="Simplest2.java" options="-1.5"/> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="features169/itdInnerTypes" title="simplest"> | <ajc-test dir="features169/itdInnerTypes" title="simplest"> | ||||
<compile files="Simplest.java" options="-1.5"/> | <compile files="Simplest.java" options="-1.5"/> | ||||
</ajc-test> | </ajc-test> | ||||
--> | --> | ||||
</suite> | |||||
</suite> |
<line text="Annotations on field1? true"/> | <line text="Annotations on field1? true"/> | ||||
<line text="Annotation count is 4"/> | <line text="Annotation count is 4"/> | ||||
<line text="@AnnoBoolean(value=true, zzz=false)"/> | <line text="@AnnoBoolean(value=true, zzz=false)"/> | ||||
<line text="@AnnoClass(value=class java.lang.Integer, ccc=class java.lang.String)" vm="1.2,1.3,1.4,1.5,1.6,1.7,1.8"/> | |||||
<line text="@AnnoClass(value=java.lang.Integer.class, ccc=java.lang.String.class)" vm="9+"/> | |||||
<line text="@AnnoLong(value=999L, jjj=111L)" vm="14+"/> | |||||
<line text="@AnnoLong(value=999, jjj=111)" vm="1.2,1.3,1.4,1.5,1.6,1.6,1.8,9,10,11,12,13"/> | |||||
<line text="@AnnoString(value=set from xml, sss=xyz)" vm="1.2,1.3,1.4,1.5,1.6,1.7,1.8"/> | |||||
<line text="@AnnoString(value="set from xml", sss="xyz")" vm="9+"/> | |||||
<line text="@AnnoClass(value=class java.lang.Integer, ccc=class java.lang.String)" vm="-1.8"/> | |||||
<line text="@AnnoClass(value=java.lang.Integer.class, ccc=java.lang.String.class)" vm="9-"/> | |||||
<line text="@AnnoLong(value=999L, jjj=111L)" vm="14-"/> | |||||
<line text="@AnnoLong(value=999, jjj=111)" vm="-13"/> | |||||
<line text="@AnnoString(value=set from xml, sss=xyz)" vm="-1.8"/> | |||||
<line text="@AnnoString(value="set from xml", sss="xyz")" vm="9-"/> | |||||
<line text="Annotations on field2? true"/> | <line text="Annotations on field2? true"/> | ||||
<line text="Annotation count is 1"/> | <line text="Annotation count is 1"/> | ||||
<line text="@AnnoClass(value=class java.lang.String, ccc=class java.lang.String)" vm="1.2,1.3,1.4,1.5,1.6,1.7,1.8"/> | |||||
<line text="@AnnoClass(value=java.lang.String.class, ccc=java.lang.String.class)" vm="9+"/> | |||||
<line text="@AnnoClass(value=class java.lang.String, ccc=class java.lang.String)" vm="-1.8"/> | |||||
<line text="@AnnoClass(value=java.lang.String.class, ccc=java.lang.String.class)" vm="9-"/> | |||||
</stdout> | </stdout> | ||||
</run> | </run> | ||||
</ajc-test> | </ajc-test> | ||||
<stdout> | <stdout> | ||||
<line text="Annotations on field1? true"/> | <line text="Annotations on field1? true"/> | ||||
<line text="Annotation count is 4"/> | <line text="Annotation count is 4"/> | ||||
<line text="@AnnoChar(value=z, ccc=a)" vm="1.2,1.3,1.4,1.5,1.6,1.7,1.8"/> | |||||
<line text="@AnnoChar(value='z', ccc='a')" vm="9+"/> | |||||
<line text="@AnnoChar(value=z, ccc=a)" vm="-1.8"/> | |||||
<line text="@AnnoChar(value='z', ccc='a')" vm="9-"/> | |||||
<line text="@AnnoDouble(value=99.0,ddd=3.0)"/> | <line text="@AnnoDouble(value=99.0,ddd=3.0)"/> | ||||
<line text="@AnnoFloat(value=6.0, fff=4.0)" vm="1.2,1.3,1.4,1.5,1.6,1.7,1.8"/> | |||||
<line text="@AnnoFloat(value=6.0f, fff=4.0f)" vm="9+"/> | |||||
<line text="@AnnoFloat(value=6.0, fff=4.0)" vm="-1.8"/> | |||||
<line text="@AnnoFloat(value=6.0f, fff=4.0f)" vm="9-"/> | |||||
<line text="@AnnoShort(value=8, sss=3)"/> | <line text="@AnnoShort(value=8, sss=3)"/> | ||||
<line text="Annotations on field2? true"/> | <line text="Annotations on field2? true"/> | ||||
<line text="Annotation count is 2"/> | <line text="Annotation count is 2"/> | ||||
<line text="@AnnoByte(value=88, bbb=66)" vm="1.2,1.3,1.4,1.5,1.6,1.7,1.8,9,10,11,12,13"/> | |||||
<line text="@AnnoByte(value=(byte)0x58, bbb=(byte)0x42)" vm="14+"/> | |||||
<line text="@AnnoByte(value=88, bbb=66)" vm="-13"/> | |||||
<line text="@AnnoByte(value=(byte)0x58, bbb=(byte)0x42)" vm="14-"/> | |||||
<line text="@AnnoInt(iii=111, value=99)"/> | <line text="@AnnoInt(iii=111, value=99)"/> | ||||
</stdout> | </stdout> | ||||
</run> | </run> | ||||
<stdout> | <stdout> | ||||
<line text="Annotations on field1? true"/> | <line text="Annotations on field1? true"/> | ||||
<line text="Annotation count is 1"/> | <line text="Annotation count is 1"/> | ||||
<line text="@Annot(a=a, fred=false, value=abc)" vm="1.2,1.3,1.4,1.5,1.6,1.7,1.8"/> | |||||
<line text="@Annot(a='a', fred=false, value="abc")" vm="9+"/> | |||||
<line text="@Annot(a=a, fred=false, value=abc)" vm="-1.8"/> | |||||
<line text="@Annot(a='a', fred=false, value="abc")" vm="9-"/> | |||||
</stdout> | </stdout> | ||||
</run> | </run> | ||||
</ajc-test> | </ajc-test> | ||||
<stdout> | <stdout> | ||||
<line text="Annotations on field1? true"/> | <line text="Annotations on field1? true"/> | ||||
<line text="Annotation count is 1"/> | <line text="Annotation count is 1"/> | ||||
<line text="@Annot(a=a, fred=false, value=abc)" vm="1.4,1.5,1.6,1.7,1.8"/> | |||||
<line text="@Annot(a='a', fred=false, value="abc")" vm="9+"/> | |||||
<line text="@Annot(a=a, fred=false, value=abc)" vm="1.4-1.8"/> | |||||
<line text="@Annot(a='a', fred=false, value="abc")" vm="9-"/> | |||||
</stdout> | </stdout> | ||||
</run> | </run> | ||||
</ajc-test> | </ajc-test> |
<ajc-test dir="bugs173/pr407739" title="add remove annos"> | <ajc-test dir="bugs173/pr407739" title="add remove annos"> | ||||
<compile files="MyAnnotation.java Hello.java Aspect.java" options="-1.5 -showWeaveInfo"> | <compile files="MyAnnotation.java Hello.java Aspect.java" options="-1.5 -showWeaveInfo"> | ||||
<message kind="weave" text="'private String dummy [RuntimeVisibleAnnotations]' of type 'Hello' (Hello.java) has had @MyAnnotation field annotation removed by 'Aspect' (Aspect.java:3)"/> | <message kind="weave" text="'private String dummy [RuntimeVisibleAnnotations]' of type 'Hello' (Hello.java) has had @MyAnnotation field annotation removed by 'Aspect' (Aspect.java:3)"/> | ||||
<message kind="weave" text="'private String dummy [RuntimeVisibleAnnotations]' of type 'Hello' (Hello.java) is annotated with @MyAnnotation(dummy2 = "korte") field annotation from 'Aspect' (Aspect.java:4)"/> | |||||
<message kind="weave" text="'private String dummy [RuntimeVisibleAnnotations]' of type 'Hello' (Hello.java) is annotated with @MyAnnotation(dummy2 = "korte") field annotation from 'Aspect' (Aspect.java:4)"/> | |||||
</compile> | </compile> | ||||
<run class="Hello"> | <run class="Hello"> | ||||
<stdout> | <stdout> | ||||
<line text="@MyAnnotation(dummy1=, dummy2=korte)" vm="1.2,1.3,1.4,1.5,1.6,1.7,1.8"/> | |||||
<line text="@MyAnnotation(dummy1="", dummy2="korte")" vm="9+"/> | |||||
<line text="@MyAnnotation(dummy1=, dummy2=korte)" vm="-1.8"/> | |||||
<line text="@MyAnnotation(dummy1="", dummy2="korte")" vm="9-"/> | |||||
</stdout> | </stdout> | ||||
</run> | </run> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="bugs173/pr408014" title="inner interface mixin"> | <ajc-test dir="bugs173/pr408014" title="inner interface mixin"> | ||||
<compile files="IdentifiableMixin.java" options="-1.5 -showWeaveInfo"> | |||||
<compile files="IdentifiableMixin.java" options="-1.5 -showWeaveInfo"> | |||||
</compile> | </compile> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="bugs173/pr407966" title="ordering"> | <ajc-test dir="bugs173/pr407966" title="ordering"> | ||||
<compile files="Aspect.aj Use.java Def.java" options="-1.5 -showWeaveInfo"> | <compile files="Aspect.aj Use.java Def.java" options="-1.5 -showWeaveInfo"> | ||||
</compile> | </compile> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="bugs173/pr407494" title="inner names"> | <ajc-test dir="bugs173/pr407494" title="inner names"> | ||||
<compile files="A.java" options="-1.5 -showWeaveInfo"> | |||||
<compile files="A.java" options="-1.5 -showWeaveInfo"> | |||||
<message kind="weave" text="Join point 'staticinitialization(void a.b.c.A$B.<clinit>())' in Type 'a.b.c.A$B' (A.java:4) advised by before advice from 'a.b.c.X' (A.java:13)"/> | <message kind="weave" text="Join point 'staticinitialization(void a.b.c.A$B.<clinit>())' in Type 'a.b.c.A$B' (A.java:4) advised by before advice from 'a.b.c.X' (A.java:13)"/> | ||||
<message kind="weave" text="Join point 'staticinitialization(void a.b.c.A.<clinit>())' in Type 'a.b.c.A' (A.java:3) advised by before advice from 'a.b.c.X' (A.java:13)"/> | <message kind="weave" text="Join point 'staticinitialization(void a.b.c.A.<clinit>())' in Type 'a.b.c.A' (A.java:3) advised by before advice from 'a.b.c.X' (A.java:13)"/> | ||||
<message kind="weave" text="Join point 'staticinitialization(void a.b.c.A$$C.<clinit>())' in Type 'a.b.c.A$$C' (A.java:6) advised by before advice from 'a.b.c.X' (A.java:13)"/> | <message kind="weave" text="Join point 'staticinitialization(void a.b.c.A$$C.<clinit>())' in Type 'a.b.c.A$$C' (A.java:6) advised by before advice from 'a.b.c.X' (A.java:13)"/> | ||||
</compile> | </compile> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="bugs173/pr407494" title="inner names 2"> | <ajc-test dir="bugs173/pr407494" title="inner names 2"> | ||||
<compile files="A2.java" options="-1.5 -showWeaveInfo"> | |||||
<compile files="A2.java" options="-1.5 -showWeaveInfo"> | |||||
<message kind="weave" text="Join point 'staticinitialization(void a.b.c.A$$B$$C.<clinit>())' in Type 'a.b.c.A$$B$$C' (A2.java:10) advised by before advice from 'a.b.c.X' (A2.java:14)"/> | <message kind="weave" text="Join point 'staticinitialization(void a.b.c.A$$B$$C.<clinit>())' in Type 'a.b.c.A$$B$$C' (A2.java:10) advised by before advice from 'a.b.c.X' (A2.java:14)"/> | ||||
</compile> | </compile> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="bugs173/pr405016/one" title="class anno value 1"> | <ajc-test dir="bugs173/pr405016/one" title="class anno value 1"> | ||||
<compile files="Gimme.java Thingy.java" options="-1.5 -showWeaveInfo"> | <compile files="Gimme.java Thingy.java" options="-1.5 -showWeaveInfo"> | ||||
<message kind="weave" text="Extending interface set for type 'Thingy' (Thingy.java) to include 'java.io.Serializable' (Thingy.java)"/> | <message kind="weave" text="Extending interface set for type 'Thingy' (Thingy.java) to include 'java.io.Serializable' (Thingy.java)"/> | ||||
</stdout> | </stdout> | ||||
</run> | </run> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="bugs173/pr405016" title="class anno value"> | <ajc-test dir="bugs173/pr405016" title="class anno value"> | ||||
<compile files="Gimme.java Thingy.java" options="-1.5 -showWeaveInfo"> | <compile files="Gimme.java Thingy.java" options="-1.5 -showWeaveInfo"> | ||||
<message kind="weave" text="Extending interface set for type 'Thingy' (Thingy.java) to include 'java.io.Serializable' (Thingy.java)"/> | <message kind="weave" text="Extending interface set for type 'Thingy' (Thingy.java) to include 'java.io.Serializable' (Thingy.java)"/> | ||||
</stdout> | </stdout> | ||||
</run> | </run> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="bugs173/pr404601" title="abstract method error"> | <ajc-test dir="bugs173/pr404601" title="abstract method error"> | ||||
<compile files="user/IUser.java user/Test.java user/UserTrait.java user/Youser.java" options="-1.5"> | <compile files="user/IUser.java user/Test.java user/UserTrait.java user/Youser.java" options="-1.5"> | ||||
<message kind="error" text="private intertype declaration 'void UserTrait$I.testSetUsername(java.lang.String)' clashes with public member 'void Youser.testSetUsername(java.lang.String)'"/> | <message kind="error" text="private intertype declaration 'void UserTrait$I.testSetUsername(java.lang.String)' clashes with public member 'void Youser.testSetUsername(java.lang.String)'"/> | ||||
<message kind="weave" text="Type 'Intface' (Code.java) has intertyped method from 'A' (Code.java:'void Intface.getName()')"/> | <message kind="weave" text="Type 'Intface' (Code.java) has intertyped method from 'A' (Code.java:'void Intface.getName()')"/> | ||||
</compile> | </compile> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="bugs173/lyor/2" title="declare anno on itd 2"> | <ajc-test dir="bugs173/lyor/2" title="declare anno on itd 2"> | ||||
<compile files="A1.java" outjar="aspects1.jar" options="-1.5 -Xlint:ignore"/> | <compile files="A1.java" outjar="aspects1.jar" options="-1.5 -Xlint:ignore"/> | ||||
<compile files="Intface.java A2.java" aspectpath="aspects1.jar" outjar="aspects2.jar" options="-1.5"/> | <compile files="Intface.java A2.java" aspectpath="aspects1.jar" outjar="aspects2.jar" options="-1.5"/> | ||||
<compile files="Code.java" aspectpath="aspects1.jar;aspects2.jar" options="-1.5"/> | <compile files="Code.java" aspectpath="aspects1.jar;aspects2.jar" options="-1.5"/> | ||||
<!-- | |||||
<!-- | |||||
<message kind="weave" text="'public void Intface.getName()' (A2.java) is annotated with @Foo method annotation from 'A1' (A1.java:7)"/> | <message kind="weave" text="'public void Intface.getName()' (A2.java) is annotated with @Foo method annotation from 'A1' (A1.java:7)"/> | ||||
<message kind="weave" text="Type 'C' (Code.java) has intertyped method from 'A2' (A2.java:'void Intface.getName()')"/> | <message kind="weave" text="Type 'C' (Code.java) has intertyped method from 'A2' (A2.java:'void Intface.getName()')"/> | ||||
<message kind="weave" text="Type 'Intface' (Code.java) has intertyped method from 'A2' (A2.java:'void Intface.getName()')"/> | <message kind="weave" text="Type 'Intface' (Code.java) has intertyped method from 'A2' (A2.java:'void Intface.getName()')"/> |
</stdout> | </stdout> | ||||
</run> | </run> | ||||
</ajc-test> | </ajc-test> | ||||
<!-- declared with throws exception --> | <!-- declared with throws exception --> | ||||
<ajc-test dir="bugs174/pr418129" title="annotated itd 2"> | <ajc-test dir="bugs174/pr418129" title="annotated itd 2"> | ||||
<compile files="Target2.java" options="-1.5 -showWeaveInfo"> | <compile files="Target2.java" options="-1.5 -showWeaveInfo"> | ||||
</stdout> | </stdout> | ||||
</run> | </run> | ||||
</ajc-test> | </ajc-test> | ||||
<!-- already annotated with another annotation --> | <!-- already annotated with another annotation --> | ||||
<ajc-test dir="bugs174/pr418129" title="annotated itd 3"> | <ajc-test dir="bugs174/pr418129" title="annotated itd 3"> | ||||
<compile files="Target3.java" options="-1.5 -showWeaveInfo"> | <compile files="Target3.java" options="-1.5 -showWeaveInfo"> | ||||
</stdout> | </stdout> | ||||
</run> | </run> | ||||
</ajc-test> | </ajc-test> | ||||
<!-- already annotated with the same annotation --> | <!-- already annotated with the same annotation --> | ||||
<ajc-test dir="bugs174/pr418129" title="annotated itd 4"> | <ajc-test dir="bugs174/pr418129" title="annotated itd 4"> | ||||
<compile files="Target4.java" options="-1.5 -showWeaveInfo"> | <compile files="Target4.java" options="-1.5 -showWeaveInfo"> | ||||
<message kind="weave" text="Type 'Behavior' (Target4.java) has intertyped method from 'Trait' (Target4.java:'java.lang.String Behavior.hello()')"/> | <message kind="weave" text="Type 'Behavior' (Target4.java) has intertyped method from 'Trait' (Target4.java:'java.lang.String Behavior.hello()')"/> | ||||
<message kind="weave" text="Type 'Target4' (Target4.java) has intertyped method from 'Trait' (Target4.java:'java.lang.String Behavior.hello()')"/> | <message kind="weave" text="Type 'Target4' (Target4.java) has intertyped method from 'Trait' (Target4.java:'java.lang.String Behavior.hello()')"/> | ||||
<!-- warning turned off as it gets confusing - when the itd on the interface is hit by a deca --> | <!-- warning turned off as it gets confusing - when the itd on the interface is hit by a deca --> | ||||
<!-- | |||||
<!-- | |||||
<message kind="warning" text="java.lang.String Target4.hello() - already has an annotation of type Tagged, cannot add a second instance [Xlint:elementAlreadyAnnotated]"/> | <message kind="warning" text="java.lang.String Target4.hello() - already has an annotation of type Tagged, cannot add a second instance [Xlint:elementAlreadyAnnotated]"/> | ||||
--> | --> | ||||
</compile> | </compile> | ||||
<run class="Target4"> | <run class="Target4"> | ||||
<stdout> | <stdout> | ||||
<line text="1"/> | <line text="1"/> | ||||
<line text="@Tagged(value=31)" vm="1.5,1.6,1.7,1.8,9,10,11,12,13"/> | |||||
<line text="@Tagged(31)" vm="14+"/> | |||||
<line text="@Tagged(value=31)" vm="1.5-13"/> | |||||
<line text="@Tagged(31)" vm="14-"/> | |||||
</stdout> | </stdout> | ||||
</run> | </run> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="bugs174/pr413378" title="super itd ctor"> | <ajc-test dir="bugs174/pr413378" title="super itd ctor"> | ||||
<compile files="Code.java" options="-1.5 -showWeaveInfo"> | <compile files="Code.java" options="-1.5 -showWeaveInfo"> | ||||
<message kind="weave" text="Type 'Child' (Code.java) has intertyped constructor from 'MyTest' (Code.java:'void Child.<init>(java.lang.String, int)')"/> | <message kind="weave" text="Type 'Child' (Code.java) has intertyped constructor from 'MyTest' (Code.java:'void Child.<init>(java.lang.String, int)')"/> | ||||
</stdout> | </stdout> | ||||
</run> | </run> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="bugs174/pr368046" title="classloader exclusion - 1"> | <ajc-test dir="bugs174/pr368046" title="classloader exclusion - 1"> | ||||
<compile files="Azpect.java" outjar="foo.jar" options="-1.4"/> | <compile files="Azpect.java" outjar="foo.jar" options="-1.4"/> | ||||
<compile files="Code.java" classpath="$sandbox/foo.jar"/> | <compile files="Code.java" classpath="$sandbox/foo.jar"/> | ||||
</stderr> | </stderr> | ||||
</run> | </run> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="bugs174/pr368046" title="classloader exclusion - 2"> | <ajc-test dir="bugs174/pr368046" title="classloader exclusion - 2"> | ||||
<compile files="Azpect.java" outjar="foo.jar" options="-1.4"/> | <compile files="Azpect.java" outjar="foo.jar" options="-1.4"/> | ||||
<compile files="Code.java" classpath="$sandbox/foo.jar"/> | <compile files="Code.java" classpath="$sandbox/foo.jar"/> | ||||
</stderr> | </stderr> | ||||
</run> | </run> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="bugs174/pr368046" title="classloader exclusion - 3"> | <ajc-test dir="bugs174/pr368046" title="classloader exclusion - 3"> | ||||
<compile files="Azpect.java" outjar="foo.jar" options="-1.4"/> | <compile files="Azpect.java" outjar="foo.jar" options="-1.4"/> | ||||
<compile files="Code.java" classpath="$sandbox/foo.jar"/> | <compile files="Code.java" classpath="$sandbox/foo.jar"/> | ||||
</stderr> | </stderr> | ||||
</run> | </run> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="bugs174/pr368046" title="classloader exclusion - 4"> | <ajc-test dir="bugs174/pr368046" title="classloader exclusion - 4"> | ||||
<compile files="Azpect.java" outjar="foo.jar" options="-1.4"/> | <compile files="Azpect.java" outjar="foo.jar" options="-1.4"/> | ||||
<compile files="Code.java" classpath="$sandbox/foo.jar"/> | <compile files="Code.java" classpath="$sandbox/foo.jar"/> | ||||
</stderr> | </stderr> | ||||
</run> | </run> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="bugs174/pr368046" title="classloader exclusion - 5"> | <ajc-test dir="bugs174/pr368046" title="classloader exclusion - 5"> | ||||
<compile files="Azpect.java" outjar="foo.jar" options="-1.4"/> | <compile files="Azpect.java" outjar="foo.jar" options="-1.4"/> | ||||
<compile files="Code.java" classpath="$sandbox/foo.jar"/> | <compile files="Code.java" classpath="$sandbox/foo.jar"/> |
<run class="AspectWithConstant"> | <run class="AspectWithConstant"> | ||||
<stdout> | <stdout> | ||||
<line text="MAXS=hello"/> | <line text="MAXS=hello"/> | ||||
<line text="@AspectWithConstant$Loggable()"/> | |||||
<line text="@AspectWithConstant$Loggable()" vm="-18"/> | |||||
<line text="@AspectWithConstant.Loggable()" vm="19-"/> | |||||
</stdout></run> | </stdout></run> | ||||
</ajc-test> | </ajc-test> | ||||
<ajc-test dir="bugs188/484941" title="annotation discovery npe"> | <ajc-test dir="bugs188/484941" title="annotation discovery npe"> | ||||
<compile files="Test2.java" options="-1.8 -XnoInline"/> | <compile files="Test2.java" options="-1.8 -XnoInline"/> | ||||
</ajc-test> | </ajc-test> |
<line text="@target(Classified) at call(Class java.lang.Object.getClass())"/> | <line text="@target(Classified) at call(Class java.lang.Object.getClass())"/> | ||||
<line text="1 @Foo()"/> | <line text="1 @Foo()"/> | ||||
<line text="1 @Foo()"/> | <line text="1 @Foo()"/> | ||||
<line text="1 @Classified(classification=TOP-SECRET)" vm="1.2,1.3,1.4,1.5,1.6,1.7,1.8"/> | |||||
<line text="1 @Classified(classification="TOP-SECRET")" vm="9+"/> | |||||
<line text="1 @Classified(classification=TOP-SECRET)" vm="-1.8"/> | |||||
<line text="1 @Classified(classification="TOP-SECRET")" vm="9-"/> | |||||
<line text="This information is TOP-SECRET"/> | <line text="This information is TOP-SECRET"/> | ||||
<line text="Entering critical join point with priority 3"/> | <line text="Entering critical join point with priority 3"/> | ||||
<line text="Entering critical join point with reflectively obtained priority 3"/> | <line text="Entering critical join point with reflectively obtained priority 3"/> | ||||
<run class="GenericAspectRuntimePointcuts"> | <run class="GenericAspectRuntimePointcuts"> | ||||
<stdout> | <stdout> | ||||
<line text="target-ok an X execution(void X.foo())"/> | <line text="target-ok an X execution(void X.foo())"/> | ||||
<line text="@this-ok @MyAnnotation(value=my-value) execution(void X.foo())" vm="1.5,1.6,1.7,1.8"/> | |||||
<line text="@this-ok @MyAnnotation(value="my-value") execution(void X.foo())" vm="9,10,11,12,13"/> | |||||
<line text="@this-ok @MyAnnotation("my-value") execution(void X.foo())" vm="14+"/> | |||||
<line text="@target-ok @MyAnnotation(value=my-value) execution(void X.foo())" vm="1.5,1.6,1.7,1.8"/> | |||||
<line text="@target-ok @MyAnnotation(value="my-value") execution(void X.foo())" vm="9,10,11,12,13"/> | |||||
<line text="@target-ok @MyAnnotation("my-value") execution(void X.foo())" vm="14+"/> | |||||
<line text="@within-ok @MyAnnotation(value=my-value) execution(void X.foo())" vm="1.5,1.6,1.7,1.8"/> | |||||
<line text="@within-ok @MyAnnotation(value="my-value") execution(void X.foo())" vm="9,10,11,12,13"/> | |||||
<line text="@within-ok @MyAnnotation("my-value") execution(void X.foo())" vm="14+"/> | |||||
<line text="@this-ok @MyAnnotation(value=my-value) execution(void X.foo())" vm="1.5-1.8"/> | |||||
<line text="@this-ok @MyAnnotation(value="my-value") execution(void X.foo())" vm="9-13"/> | |||||
<line text="@this-ok @MyAnnotation("my-value") execution(void X.foo())" vm="14-"/> | |||||
<line text="@target-ok @MyAnnotation(value=my-value) execution(void X.foo())" vm="1.5-1.8"/> | |||||
<line text="@target-ok @MyAnnotation(value="my-value") execution(void X.foo())" vm="9-13"/> | |||||
<line text="@target-ok @MyAnnotation("my-value") execution(void X.foo())" vm="14-"/> | |||||
<line text="@within-ok @MyAnnotation(value=my-value) execution(void X.foo())" vm="1.5-1.8"/> | |||||
<line text="@within-ok @MyAnnotation(value="my-value") execution(void X.foo())" vm="9-13"/> | |||||
<line text="@within-ok @MyAnnotation("my-value") execution(void X.foo())" vm="14-"/> | |||||
<line text="cflow-ok an X a Y set(Y X.y)"/> | <line text="cflow-ok an X a Y set(Y X.y)"/> | ||||
<line text="@annotation-ok-sub @MyAnnotation(value=bar) execution(void X.bar())" vm="1.5,1.6,1.7,1.8"/> | |||||
<line text="@annotation-ok-sub @MyAnnotation(value="bar") execution(void X.bar())" vm="9,10,11,12,13"/> | |||||
<line text="@annotation-ok-sub @MyAnnotation("bar") execution(void X.bar())" vm="14+"/> | |||||
<line text="@annotation-ok @MyAnnotation(value=bar) execution(void X.bar())" vm="1.5,1.6,1.7,1.8"/> | |||||
<line text="@annotation-ok @MyAnnotation(value="bar") execution(void X.bar())" vm="9,10,11,12,13"/> | |||||
<line text="@annotation-ok @MyAnnotation("bar") execution(void X.bar())" vm="14+"/> | |||||
<line text="@annotation-ok-sub @MyAnnotation(value=bar) execution(void X.bar())" vm="1.5-1.8"/> | |||||
<line text="@annotation-ok-sub @MyAnnotation(value="bar") execution(void X.bar())" vm="9-13"/> | |||||
<line text="@annotation-ok-sub @MyAnnotation("bar") execution(void X.bar())" vm="14-"/> | |||||
<line text="@annotation-ok @MyAnnotation(value=bar) execution(void X.bar())" vm="1.5-1.8"/> | |||||
<line text="@annotation-ok @MyAnnotation(value="bar") execution(void X.bar())" vm="9-13"/> | |||||
<line text="@annotation-ok @MyAnnotation("bar") execution(void X.bar())" vm="14-"/> | |||||
<line text="target-ok an X execution(void X.bar())"/> | <line text="target-ok an X execution(void X.bar())"/> | ||||
<line text="@this-ok @MyAnnotation(value=my-value) execution(void X.bar())" vm="1.5,1.6,1.7,1.8"/> | |||||
<line text="@this-ok @MyAnnotation(value="my-value") execution(void X.bar())" vm="9,10,11,12,13"/> | |||||
<line text="@this-ok @MyAnnotation("my-value") execution(void X.bar())" vm="14+"/> | |||||
<line text="@target-ok @MyAnnotation(value=my-value) execution(void X.bar())" vm="1.5,1.6,1.7,1.8"/> | |||||
<line text="@target-ok @MyAnnotation(value="my-value") execution(void X.bar())" vm="9,10,11,12,13"/> | |||||
<line text="@target-ok @MyAnnotation("my-value") execution(void X.bar())" vm="14+"/> | |||||
<line text="@within-ok @MyAnnotation(value=my-value) execution(void X.bar())" vm="1.5,1.6,1.7,1.8"/> | |||||
<line text="@within-ok @MyAnnotation(value="my-value") execution(void X.bar())" vm="9,10,11,12,13"/> | |||||
<line text="@within-ok @MyAnnotation("my-value") execution(void X.bar())" vm="14+"/> | |||||
<line text="@args-ok @MyAnnotation(value=my-value) execution(void Y.foo(X))" vm="1.5,1.6,1.7,1.8"/> | |||||
<line text="@args-ok @MyAnnotation(value="my-value") execution(void Y.foo(X))" vm="9,10,11,12,13"/> | |||||
<line text="@args-ok @MyAnnotation("my-value") execution(void Y.foo(X))" vm="14+"/> | |||||
<line text="@this-ok @MyAnnotation(value=my-value) execution(void X.bar())" vm="1.5-1.8"/> | |||||
<line text="@this-ok @MyAnnotation(value="my-value") execution(void X.bar())" vm="9-13"/> | |||||
<line text="@this-ok @MyAnnotation("my-value") execution(void X.bar())" vm="14-"/> | |||||
<line text="@target-ok @MyAnnotation(value=my-value) execution(void X.bar())" vm="1.5-1.8"/> | |||||
<line text="@target-ok @MyAnnotation(value="my-value") execution(void X.bar())" vm="9-13"/> | |||||
<line text="@target-ok @MyAnnotation("my-value") execution(void X.bar())" vm="14-"/> | |||||
<line text="@within-ok @MyAnnotation(value=my-value) execution(void X.bar())" vm="1.5-1.8"/> | |||||
<line text="@within-ok @MyAnnotation(value="my-value") execution(void X.bar())" vm="9-13"/> | |||||
<line text="@within-ok @MyAnnotation("my-value") execution(void X.bar())" vm="14-"/> | |||||
<line text="@args-ok @MyAnnotation(value=my-value) execution(void Y.foo(X))" vm="1.5-1.8"/> | |||||
<line text="@args-ok @MyAnnotation(value="my-value") execution(void Y.foo(X))" vm="9-13"/> | |||||
<line text="@args-ok @MyAnnotation("my-value") execution(void Y.foo(X))" vm="14-"/> | |||||
<line text="args-ok an X execution(void Y.foo(X))"/> | <line text="args-ok an X execution(void Y.foo(X))"/> | ||||
<line text="this-ok a Y execution(void Y.foo(X))"/> | <line text="this-ok a Y execution(void Y.foo(X))"/> | ||||
<line text="@this-ok @MyAnnotation(value=on Y) execution(void Y.foo(X))" vm="1.5,1.6,1.7,1.8"/> | |||||
<line text="@this-ok @MyAnnotation(value="on Y") execution(void Y.foo(X))" vm="9,10,11,12,13"/> | |||||
<line text="@this-ok @MyAnnotation("on Y") execution(void Y.foo(X))" vm="14+"/> | |||||
<line text="@target-ok @MyAnnotation(value=on Y) execution(void Y.foo(X))" vm="1.5,1.6,1.7,1.8"/> | |||||
<line text="@target-ok @MyAnnotation(value="on Y") execution(void Y.foo(X))" vm="9,10,11,12,13"/> | |||||
<line text="@target-ok @MyAnnotation("on Y") execution(void Y.foo(X))" vm="14+"/> | |||||
<line text="@within-ok @MyAnnotation(value=on Y) execution(void Y.foo(X))" vm="1.5,1.6,1.7,1.8"/> | |||||
<line text="@within-ok @MyAnnotation(value="on Y") execution(void Y.foo(X))" vm="9,10,11,12,13"/> | |||||
<line text="@within-ok @MyAnnotation("on Y") execution(void Y.foo(X))" vm="14+"/> | |||||
<line text="@annotation-ok-sub @MyAnnotation(value=my-value) execution(X Y.bar())" vm="1.5,1.6,1.7,1.8"/> | |||||
<line text="@annotation-ok-sub @MyAnnotation(value="my-value") execution(X Y.bar())" vm="9,10,11,12,13"/> | |||||
<line text="@annotation-ok-sub @MyAnnotation("my-value") execution(X Y.bar())" vm="14+"/> | |||||
<line text="@annotation-ok @MyAnnotation(value=my-value) execution(X Y.bar())" vm="1.5,1.6,1.7,1.8"/> | |||||
<line text="@annotation-ok @MyAnnotation(value="my-value") execution(X Y.bar())" vm="9,10,11,12,13"/> | |||||
<line text="@annotation-ok @MyAnnotation("my-value") execution(X Y.bar())" vm="14+"/> | |||||
<line text="@this-ok @MyAnnotation(value=on Y) execution(void Y.foo(X))" vm="1.5-1.8"/> | |||||
<line text="@this-ok @MyAnnotation(value="on Y") execution(void Y.foo(X))" vm="9-13"/> | |||||
<line text="@this-ok @MyAnnotation("on Y") execution(void Y.foo(X))" vm="14-"/> | |||||
<line text="@target-ok @MyAnnotation(value=on Y) execution(void Y.foo(X))" vm="1.5-1.8"/> | |||||
<line text="@target-ok @MyAnnotation(value="on Y") execution(void Y.foo(X))" vm="9-13"/> | |||||
<line text="@target-ok @MyAnnotation("on Y") execution(void Y.foo(X))" vm="14-"/> | |||||
<line text="@within-ok @MyAnnotation(value=on Y) execution(void Y.foo(X))" vm="1.5-1.8"/> | |||||
<line text="@within-ok @MyAnnotation(value="on Y") execution(void Y.foo(X))" vm="9-13"/> | |||||
<line text="@within-ok @MyAnnotation("on Y") execution(void Y.foo(X))" vm="14-"/> | |||||
<line text="@annotation-ok-sub @MyAnnotation(value=my-value) execution(X Y.bar())" vm="1.5-1.8"/> | |||||
<line text="@annotation-ok-sub @MyAnnotation(value="my-value") execution(X Y.bar())" vm="9-13"/> | |||||
<line text="@annotation-ok-sub @MyAnnotation("my-value") execution(X Y.bar())" vm="14-"/> | |||||
<line text="@annotation-ok @MyAnnotation(value=my-value) execution(X Y.bar())" vm="1.5-1.8"/> | |||||
<line text="@annotation-ok @MyAnnotation(value="my-value") execution(X Y.bar())" vm="9-13"/> | |||||
<line text="@annotation-ok @MyAnnotation("my-value") execution(X Y.bar())" vm="14-"/> | |||||
<line text="this-ok a Y execution(X Y.bar())"/> | <line text="this-ok a Y execution(X Y.bar())"/> | ||||
<line text="@this-ok @MyAnnotation(value=on Y) execution(X Y.bar())" vm="1.5,1.6,1.7,1.8"/> | |||||
<line text="@this-ok @MyAnnotation(value="on Y") execution(X Y.bar())" vm="9,10,11,12,13"/> | |||||
<line text="@this-ok @MyAnnotation("on Y") execution(X Y.bar())" vm="14+"/> | |||||
<line text="@target-ok @MyAnnotation(value=on Y) execution(X Y.bar())" vm="1.5,1.6,1.7,1.8"/> | |||||
<line text="@target-ok @MyAnnotation(value="on Y") execution(X Y.bar())" vm="9,10,11,12,13"/> | |||||
<line text="@target-ok @MyAnnotation("on Y") execution(X Y.bar())" vm="14+"/> | |||||
<line text="@within-ok @MyAnnotation(value=on Y) execution(X Y.bar())" vm="1.5,1.6,1.7,1.8"/> | |||||
<line text="@within-ok @MyAnnotation(value="on Y") execution(X Y.bar())" vm="9,10,11,12,13"/> | |||||
<line text="@within-ok @MyAnnotation("on Y") execution(X Y.bar())" vm="14+"/> | |||||
<line text="@withincode-ok @MyAnnotation(value=my-value) get(X Y.x)" vm="1.5,1.6,1.7,1.8"/> | |||||
<line text="@withincode-ok @MyAnnotation(value="my-value") get(X Y.x)" vm="9,10,11,12,13"/> | |||||
<line text="@withincode-ok @MyAnnotation("my-value") get(X Y.x)" vm="14+"/> | |||||
<line text="@this-ok @MyAnnotation(value=on Y) execution(X Y.bar())" vm="1.5-1.8"/> | |||||
<line text="@this-ok @MyAnnotation(value="on Y") execution(X Y.bar())" vm="9-13"/> | |||||
<line text="@this-ok @MyAnnotation("on Y") execution(X Y.bar())" vm="14-"/> | |||||
<line text="@target-ok @MyAnnotation(value=on Y) execution(X Y.bar())" vm="1.5-1.8"/> | |||||
<line text="@target-ok @MyAnnotation(value="on Y") execution(X Y.bar())" vm="9-13"/> | |||||
<line text="@target-ok @MyAnnotation("on Y") execution(X Y.bar())" vm="14-"/> | |||||
<line text="@within-ok @MyAnnotation(value=on Y) execution(X Y.bar())" vm="1.5-1.8"/> | |||||
<line text="@within-ok @MyAnnotation(value="on Y") execution(X Y.bar())" vm="9-13"/> | |||||
<line text="@within-ok @MyAnnotation("on Y") execution(X Y.bar())" vm="14-"/> | |||||
<line text="@withincode-ok @MyAnnotation(value=my-value) get(X Y.x)" vm="1.5-1.8"/> | |||||
<line text="@withincode-ok @MyAnnotation(value="my-value") get(X Y.x)" vm="9-13"/> | |||||
<line text="@withincode-ok @MyAnnotation("my-value") get(X Y.x)" vm="14-"/> | |||||
</stdout> | </stdout> | ||||
</run> | </run> | ||||
</ajc-test> | </ajc-test> |
<!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"[]> | |||||
<!-- | |||||
Java 19: no new final language features, only preview/incubator ones: | |||||
- "JEP 427: Pattern Matching for switch (Third Preview)" (syntax change, introducing 'when') | |||||
- "JEP 405: Record Patterns (Preview)" | |||||
- "JEP 425: Virtual Threads (Preview)" (API only) | |||||
- "JEP 428: Structured Concurrency (Incubator)" (API only) | |||||
--> | |||||
<suite> | |||||
<!-- Java ?? final, Java 17, 18, 19 preview --> | |||||
<ajc-test dir="features1919/java19" vm="19" title="switch pattern matching preview 3 java"> | |||||
<compile files="SwitchPatternPreview3OK.java" options="--enable-preview -19" /> | |||||
<run class="SwitchPatternPreview3OK" vmargs="--enable-preview"> | |||||
<message></message> | |||||
<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" /> | |||||
<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" /> | |||||
</stdout> | |||||
</run> | |||||
</ajc-test> | |||||
<!-- Java ?? final, Java 17, 18, 19 preview --> | |||||
<ajc-test dir="features1919/java19" vm="19" title="switch pattern matching preview 3 aspect"> | |||||
<compile files="SwitchPatternPreview3Aspect.aj" options="--enable-preview -19" /> | |||||
<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" /> | |||||
<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" /> | |||||
</stdout> | |||||
</run> | |||||
</ajc-test> | |||||
<!-- Java ?? final, Java 17, 18, 19 preview --> | |||||
<ajc-test dir="features198/java17" vm="19" title="switch pattern matching error"> | |||||
<compile files="SwitchPatternError.java" options="--enable-preview -19"> | |||||
<!-- 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, 19 preview --> | |||||
<ajc-test dir="features1919/java19" vm="19" title="switch pattern matching preview 3 error 1"> | |||||
<compile files="SwitchPatternPreview3Error1.java" options="--enable-preview -19"> | |||||
<!-- TODO: Add correct compiler error message, as soon as JDT Core supports it --> | |||||
<message kind="error" file="SwitchPatternPreview3Error1.java" text="This case label is dominated by one of the preceding case label"/> | |||||
</compile> | |||||
</ajc-test> | |||||
<!-- Java ?? final, Java 17, 18, 19 preview --> | |||||
<ajc-test dir="features1919/java19" vm="19" title="switch pattern matching preview 3 error 2"> | |||||
<compile files="SwitchPatternPreview3Error2.java" options="--enable-preview -19"> | |||||
<!-- TODO: Add correct compiler error message, as soon as JDT Core supports it --> | |||||
<message kind="error" file="SwitchPatternPreview3Error2.java" text="This case label is dominated by one of the preceding case label"/> | |||||
</compile> | |||||
</ajc-test> | |||||
<!-- Java ?? final, Java 19 preview --> | |||||
<ajc-test dir="features1919/java19" vm="19" title="record patterns"> | |||||
<compile files="RecordPatternsPreview1OK.java" options="--enable-preview -19"/> | |||||
</ajc-test> | |||||
<!-- Java ?? final, Java 19 preview --> | |||||
<ajc-test dir="features1919/java19" vm="19" title="record patterns error"> | |||||
<compile files="RecordPatternsPreview1Error.java" options="--enable-preview -19"> | |||||
<message kind="error" file="RecordPatternsPreview1Error.java" text="Raw types are not allowed in record patterns"/> | |||||
<message kind="error" file="RecordPatternsPreview1Error.java" text="Raw types are not allowed in record patterns"/> | |||||
</compile> | |||||
</ajc-test> | |||||
<!-- Java ?? final, Java 19 preview --> | |||||
<ajc-test dir="features1919/java19" vm="19" title="record patterns exhaustiveness 1"> | |||||
<compile files="RecordPatternsPreview1ExhaustivenessOK1.java" options="--enable-preview -19"/> | |||||
<run class="RecordPatternsPreview1ExhaustivenessOK1" vmargs="--enable-preview"> | |||||
<stdout> | |||||
<line text="y"/> | |||||
<line text="a"/> | |||||
</stdout> | |||||
</run> | |||||
</ajc-test> | |||||
<!-- Java ?? final, Java 19 preview --> | |||||
<ajc-test dir="features1919/java19" vm="19" title="record patterns exhaustiveness aspect"> | |||||
<compile files="RecordPatternsPreview1ExhaustivenessAspect.aj" options="--enable-preview -19"/> | |||||
<!-- | |||||
TODO: Remove redundant default clause when https://github.com/eclipse-jdt/eclipse.jdt.core/issues/455 | |||||
has been fixed. But even with the default clause, it generates wrong byte code and throws runtime error: | |||||
NoSuchMethodError: 'I Pair.x()' | |||||
--> | |||||
<!--run class="RecordPatternsPreview1ExhaustivenessAspect" vmargs="-XXX-enable-preview"> | |||||
<stdout> | |||||
<line text="y"/> | |||||
<line text="a"/> | |||||
<line text="Pair[x=C@000, y=D@000]"/> | |||||
</stdout> | |||||
</run--> | |||||
</ajc-test> | |||||
<!-- Java ?? final, Java 19 preview --> | |||||
<ajc-test dir="features1919/java19" vm="19" title="record patterns aspect"> | |||||
<compile files="RecordPatternsPreview1Aspect.aj" options="--enable-preview -19"/> | |||||
<run class="RecordPatternsPreview1Aspect" vmargs="--enable-preview"> | |||||
<stdout> | |||||
<line text="9"/> | |||||
<line text="14"/> | |||||
<line text="Doing something with Point[x=2, y=7]"/> | |||||
<line text="Upper-left color: RED"/> | |||||
<line text="Upper-left color: RED"/> | |||||
<line text="Upper-left x coordinate: 1"/> | |||||
<line text="Doing something with Rectangle[upperLeft=ColoredPoint[p=Point[x=1, y=6], c=RED], lowerRight=ColoredPoint[p=Point[x=4, y=6], c=BLUE]]"/> | |||||
</stdout> | |||||
</run> | |||||
</ajc-test> | |||||
<!-- Java ?? final, Java 19 preview --> | |||||
<ajc-test dir="features1919/java19" vm="19" title="record patterns exhaustiveness error"> | |||||
<compile files="RecordPatternsPreview1ExhaustivenessError.java" options="--enable-preview -19"> | |||||
<message kind="error" file="RecordPatternsPreview1ExhaustivenessError.java" text="An enhanced switch statement should be exhaustive; a default label expected"/> | |||||
</compile> | |||||
</ajc-test> | |||||
<!-- Java ?? final, Java 19 preview --> | |||||
<ajc-test dir="features1919/java19" vm="19" title="record patterns exhaustiveness 2"> | |||||
<compile files="RecordPatternsPreview1ExhaustivenessOK2.java" options="--enable-preview -19"/> | |||||
<run class="RecordPatternsPreview1ExhaustivenessOK2" vmargs="--enable-preview"> | |||||
<stdout> | |||||
<line text="Bob 12"/> | |||||
</stdout> | |||||
</run> | |||||
</ajc-test> | |||||
<!-- Currently, there are no bugfixes with tests in this AspectJ vesion --> | |||||
<ajc-test dir="bugs1919/github_99999" vm="19" title="dummy Java 19"> | |||||
</ajc-test> | |||||
</suite> |
<!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"[]> | |||||
<suite> | |||||
<!-- empty class --> | |||||
<ajc-test dir="bugs160/simplejava" title="simple - a"> | |||||
<compile files="SimpleA.java" options="-19"/> | |||||
</ajc-test> | |||||
<!-- class with one method --> | |||||
<ajc-test dir="bugs160/simplejava" title="simple - b"> | |||||
<compile files="SimpleB.java" options="-19"/> | |||||
<run class="SimpleB"/> | |||||
</ajc-test> | |||||
<!-- empty aspect --> | |||||
<ajc-test dir="bugs160/simplejava" title="simple - c"> | |||||
<compile files="SimpleC.java" options="-19"/> | |||||
</ajc-test> | |||||
<!-- simple before --> | |||||
<ajc-test dir="bugs160/simplejava" title="simple - d"> | |||||
<compile files="SimpleD.java" options="-19"/> | |||||
</ajc-test> | |||||
<!-- simple itd field --> | |||||
<ajc-test dir="bugs160/simplejava" title="simple - e"> | |||||
<compile files="SimpleE.java" options="-19"/> | |||||
</ajc-test> | |||||
<!-- aspect with main calling a static method --> | |||||
<ajc-test dir="bugs160/simplejava" title="simple - f"> | |||||
<compile files="SimpleF.java" options="-19"/> | |||||
</ajc-test> | |||||
<!-- pertarget --> | |||||
<ajc-test dir="bugs160/simplejava" title="simple - g"> | |||||
<compile files="SimpleG.java" options="-19"/> | |||||
</ajc-test> | |||||
<!-- generic ctor itds --> | |||||
<ajc-test dir="bugs160/simplejava" title="simple - h"> | |||||
<compile files="SimpleH.java" options="-19"/> | |||||
</ajc-test> | |||||
<!-- overriding generic itd methods --> | |||||
<ajc-test dir="bugs160/simplejava" title="simple - i"> | |||||
<compile files="SimpleI.java" options="-19"/> | |||||
</ajc-test> | |||||
<!-- check class file version is 63.0 (Java 19) --> | |||||
<ajc-test dir="bugs160/simplejava" title="simple - j"> | |||||
<compile files="SimpleJ.java" options="-19"/> | |||||
</ajc-test> | |||||
<!-- check class file version is 63.0 (Java 19) --> | |||||
<ajc-test dir="bugs160/simplejava" title="simple - k"> | |||||
<compile files="SimpleJ.java" options="-source 19"/> | |||||
</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="-19"/> | |||||
</ajc-test> | |||||
</suite> |
<suite> | <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 --> | <!-- Java ?? final, Java 17, 18 preview --> | ||||
<ajc-test dir="features198/java17" vm="18" title="switch pattern matching error"> | <ajc-test dir="features198/java17" vm="18" title="switch pattern matching error"> | ||||
<compile files="SwitchPatternError.java" options="--enable-preview -18"> | <compile files="SwitchPatternError.java" options="--enable-preview -18"> |
<parent> | <parent> | ||||
<groupId>org.aspectj</groupId> | <groupId>org.aspectj</groupId> | ||||
<artifactId>aspectj-parent</artifactId> | <artifactId>aspectj-parent</artifactId> | ||||
<version>1.9.10-SNAPSHOT</version> | |||||
<version>1.9.19-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>util</artifactId> | <artifactId>util</artifactId> |
static { | static { | ||||
// http://www.oracle.com/technetwork/java/javase/versioning-naming-139433.html | // http://www.oracle.com/technetwork/java/javase/versioning-naming-139433.html | ||||
// http://openjdk.java.net/jeps/223 "New Version-String Scheme" | // http://openjdk.java.net/jeps/223 "New Version-String Scheme" | ||||
// TODO: Use java.lang.Runtime class (since Java 9, now AspectJ needs Java 11+ due to JDT Core anyway) | |||||
final String JAVA_VERSION_NOT_FOUND = "System properties appear damaged, cannot find: java.version/java.runtime.version/java.vm.version"; | |||||
try { | try { | ||||
String vm = System.getProperty("java.version"); // JLS 20.18.7 | String vm = System.getProperty("java.version"); // JLS 20.18.7 | ||||
if (vm == null) { | if (vm == null) { | ||||
vm = System.getProperty("java.vm.version"); | vm = System.getProperty("java.vm.version"); | ||||
} | } | ||||
if (vm == null) { | if (vm == null) { | ||||
new RuntimeException( | |||||
"System properties appear damaged, cannot find: java.version/java.runtime.version/java.vm.version") | |||||
.printStackTrace(System.err); | |||||
new RuntimeException(JAVA_VERSION_NOT_FOUND).printStackTrace(System.err); | |||||
vmVersion = 1.5; | vmVersion = 1.5; | ||||
} else { | } else { | ||||
// Version: [1-9][0-9]*((\.0)*\.[1-9][0-9]*)* | |||||
// Care about the first set of digits and second set if first digit is 1 | // Care about the first set of digits and second set if first digit is 1 | ||||
try { | try { | ||||
List<Integer> numbers = getFirstNumbers(vm); | |||||
List<Integer> numbers = getJavaMajorMinor(vm); | |||||
if (numbers.get(0) == 1) { | if (numbers.get(0) == 1) { | ||||
// Old school for 1.0 > 1.8 | // Old school for 1.0 > 1.8 | ||||
vmVersion = numbers.get(0)+(numbers.get(1)/10d); | vmVersion = numbers.get(0)+(numbers.get(1)/10d); | ||||
} | } | ||||
} | } | ||||
} catch (Throwable t) { | } catch (Throwable t) { | ||||
new RuntimeException( | |||||
"System properties appear damaged, cannot find: java.version/java.runtime.version/java.vm.version", t) | |||||
.printStackTrace(System.err); | |||||
new RuntimeException(JAVA_VERSION_NOT_FOUND, t).printStackTrace(System.err); | |||||
vmVersion = 1.5; | vmVersion = 1.5; | ||||
} | } | ||||
} | } | ||||
private static List<Integer> getFirstNumbers(String vm) { | |||||
private static List<Integer> getJavaMajorMinor(String vm) { | |||||
List<Integer> result = new ArrayList<>(); | List<Integer> result = new ArrayList<>(); | ||||
StringTokenizer st = new StringTokenizer(vm,".-_"); | |||||
// Can be something like '1.5', '11.0.16.1', '19+36-2238' | |||||
StringTokenizer st = new StringTokenizer(vm.replaceFirst("[+].*", ""), ".-_"); | |||||
try { | try { | ||||
result.add(Integer.parseInt(st.nextToken())); | result.add(Integer.parseInt(st.nextToken())); | ||||
result.add(Integer.parseInt(st.nextToken())); | result.add(Integer.parseInt(st.nextToken())); | ||||
// NoSuchElementException if no more tokens | // NoSuchElementException if no more tokens | ||||
// NumberFormatException if not a number | // NumberFormatException if not a number | ||||
} | } | ||||
// Always add a default minor, just in case a caller expects it | |||||
if (result.size() == 1) | |||||
result.add(0); | |||||
return result; | return result; | ||||
} | } | ||||
return 19 <= vmVersion; | return 19 <= vmVersion; | ||||
} | } | ||||
public static boolean is20VMOrGreater() { | |||||
return 20 <= vmVersion; | |||||
} | |||||
/** | /** | ||||
* Shorthand for "if null, throw IllegalArgumentException" | * Shorthand for "if null, throw IllegalArgumentException" | ||||
* | * |
<parent> | <parent> | ||||
<groupId>org.aspectj</groupId> | <groupId>org.aspectj</groupId> | ||||
<artifactId>aspectj-parent</artifactId> | <artifactId>aspectj-parent</artifactId> | ||||
<version>1.9.10-SNAPSHOT</version> | |||||
<version>1.9.19-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>weaver</artifactId> | <artifactId>weaver</artifactId> |