]> source.dussan.org Git - aspectj.git/log
aspectj.git
11 months agoReactivate some tests on JDK 21 after upstream fix
Alexander Kriegisch [Mon, 27 Nov 2023 04:17:27 +0000 (11:17 +0700)]
Reactivate some tests on JDK 21 after upstream fix

https://github.com/eclipse-jdt/eclipse.jdt.core/issues/1466 has finally
been fixed.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
11 months agoAllTests19 suite: add AllTestsAspectJ1921
Alexander Kriegisch [Mon, 27 Nov 2023 04:15:40 +0000 (11:15 +0700)]
AllTests19 suite: add AllTestsAspectJ1921

Until now, the CI build did not run Java 21 tests, but they look OK
locally. Now, let's find out what GitHub Actions says.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
11 months agoAdd missing file RecordPatternsPreview1ExhaustivenessOK1.java for JDK 21
Alexander Kriegisch [Mon, 27 Nov 2023 04:14:04 +0000 (11:14 +0700)]
Add missing file RecordPatternsPreview1ExhaustivenessOK1.java for JDK 21

This file was missing, which did not trigger an error in CI builds,
because AllTestsAspectJ1921 was not part of the AllTests19 suite before.
The latter will be fixed in the next commit.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
12 months agoAjcTaskTest: Be more lenient with aspectjrt version warning
Alexander Kriegisch [Tue, 21 Nov 2023 00:51:58 +0000 (07:51 +0700)]
AjcTaskTest: Be more lenient with aspectjrt version warning

Filter out a warning which occurs, if the current release does not match
the stored binary in lib/test:

  bad version number found in aspectjrt.jar
  expected 1.9.21.M1 found 1.9.20.1

If e.g. we run tests for a milestone release a.b.5.M1 and afterwards
switch back to a.b.5-SNAPSHOT, we do not want to update lib/test for a
single commit, just to make this test pass. Hence, we ignore this
warning here.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
12 months agoAjcTaskTest: unwrap redundant if statement
Alexander Kriegisch [Tue, 21 Nov 2023 00:48:37 +0000 (07:48 +0700)]
AjcTaskTest: unwrap redundant if statement

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
12 months agoRELEASE.md: Add '--add-opens' info for Nexus Staging 'rc:release'
Alexander Kriegisch [Sun, 19 Nov 2023 06:48:26 +0000 (13:48 +0700)]
RELEASE.md: Add '--add-opens' info for Nexus Staging 'rc:release'

Sonatype has not solved the problems in Nexus Staging Maven Plugin for
years, so it makes sense to document them.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
12 months agoSet version 1.9.21-SNAPSHOT
Alexander Kriegisch [Sun, 19 Nov 2023 06:26:39 +0000 (13:26 +0700)]
Set version 1.9.21-SNAPSHOT

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
12 months agoRelease milestone 1.9.21.M1 V1_9_21_M1
Alexander Kriegisch [Sun, 19 Nov 2023 06:22:14 +0000 (13:22 +0700)]
Release milestone 1.9.21.M1

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
12 months agoEnable some tests after J19 problems were fixed for J21
Alexander Kriegisch [Sun, 5 Nov 2023 03:03:23 +0000 (10:03 +0700)]
Enable some tests after J19 problems were fixed for J21

Two test classes which had redundant default clauses for switch with
record patterns were copied from the java19 to the java21 directory and
the redundant clauses deactivated, i.e. the test now run as originally
intended. For older JDK versions, the old tests still stay active in
order to document the old state of affairs.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
12 months agoSwitch CI build to Temurin JDK 21 final (from EA)
Alexander Kriegisch [Wed, 1 Nov 2023 01:52:44 +0000 (08:52 +0700)]
Switch CI build to Temurin JDK 21 final (from EA)

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
12 months agoAdjust to latest changes in JDT Core
Alexander Kriegisch [Wed, 1 Nov 2023 01:50:17 +0000 (08:50 +0700)]
Adjust to latest changes in JDT Core

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
13 months agoMake all existing tests run on JDK 21
Alexander Kriegisch [Thu, 5 Oct 2023 04:29:04 +0000 (11:29 +0700)]
Make all existing tests run on JDK 21

This mostly affects pattern matching for switch and record patterns.

Two tests which were working before for pattern matching for switch
(preview 4), started to fail, so the corresponding code was commented
out and https://github.com/eclipse-jdt/eclipse.jdt.core/issues/1466
recorded.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
13 months agoMove some 1.9.20.1 bug tests to correct directory
Alexander Kriegisch [Thu, 5 Oct 2023 04:24:28 +0000 (11:24 +0700)]
Move some 1.9.20.1 bug tests to correct directory

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
13 months agoAjcTestCase: Make sure main methods can be called in Java 21
Alexander Kriegisch [Thu, 5 Oct 2023 04:22:13 +0000 (11:22 +0700)]
AjcTestCase: Make sure main methods can be called in Java 21

Since JDK 21, a public main method of a non-public (e.g. default-scoped)
class can no longer be invoked without making it accessible first.
Because many test sources contain multiple aspects and classes in one
file, this is a frequent use case.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
13 months agoAdd test infrastructure for Java 21 (WIP)
Alexander Kriegisch [Thu, 5 Oct 2023 01:09:24 +0000 (08:09 +0700)]
Add test infrastructure for Java 21 (WIP)

The tests and their XML definitions are still copy & paste and need to
be cleaned up. Separate Java 21 feature tests do not exist yet.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
13 months agoBeautify sanity tests using bytecode level constants
Alexander Kriegisch [Thu, 5 Oct 2023 01:00:47 +0000 (08:00 +0700)]
Beautify sanity tests using bytecode level constants

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
13 months agoBump ASM to 9.6 (new Opcodes.V22 constant for Java 22)
Alexander Kriegisch [Thu, 5 Oct 2023 00:17:06 +0000 (07:17 +0700)]
Bump ASM to 9.6 (new Opcodes.V22 constant for Java 22)

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
13 months agoAntSpec: Improve filter for warning "Archived non-system classes are disabled"
Alexander Kriegisch [Sun, 1 Oct 2023 06:46:30 +0000 (13:46 +0700)]
AntSpec: Improve filter for warning "Archived non-system classes are disabled"

In JDK 21, the prefix has changed once again, no longer being a JVM
specifier like "OpenJDK 64-Bit Server VM" or "Java HotSpot(TM) 64-Bit
Server VM" but rather something like "[0.016s][warning][cds]".

Even worse, before J21, the warning appears on stdErr, but in J21+, it
appears on stdOut.

Fixes LTWTests.testJ14LTWWithXML, which started failing on Java 21.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
13 months agoAjLookupEnvironment: readability refactoring
Alexander Kriegisch [Sun, 1 Oct 2023 05:56:22 +0000 (12:56 +0700)]
AjLookupEnvironment: readability refactoring

While trying to understand the code a bit better in order to fix failing
builds, I applied some cosmetic refactoring and reformatting. This
commit does not change any functionality.

Whether the static import of CompilationAndWeavingContext.* is a good
thing or not is debatable, but I like the code to be less chatty than it
was before, assuming that every developer uses an IDE helping to find
out where static methods and constants come from.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
13 months agoAjLookupEnvironment: add new phase CONNECT_TYPE_HIERARCHY2
Alexander Kriegisch [Thu, 28 Sep 2023 03:51:38 +0000 (10:51 +0700)]
AjLookupEnvironment: add new phase CONNECT_TYPE_HIERARCHY2

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
13 months agoIgnore AspectJ core dumps
Alexander Kriegisch [Wed, 27 Sep 2023 02:13:11 +0000 (09:13 +0700)]
Ignore AspectJ core dumps

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
13 months agoRemove old '.cvsignore' files
Alexander Kriegisch [Wed, 27 Sep 2023 02:10:47 +0000 (09:10 +0700)]
Remove old '.cvsignore' files

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
13 months agoCI build: remove JDK 11 build, switch 21 to 21-ea
Alexander Kriegisch [Wed, 27 Sep 2023 01:49:06 +0000 (08:49 +0700)]
CI build: remove JDK 11 build, switch 21 to 21-ea

Background: JDT Core dependencies now contain hundreds of Java 17 class
files, i.e. Ajc now requires Java 17+ runtime environment. :-(
For more details, see:
https://github.com/eclipse-aspectj/aspectj/issues/260#issuecomment-1736540176

Adoptium Java 21 release is not available yet, so we need to run on EA.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
13 months agoBump JDT Core to 1.9.21-SNAPSHOT
Alexander Kriegisch [Tue, 26 Sep 2023 06:45:32 +0000 (13:45 +0700)]
Bump JDT Core to 1.9.21-SNAPSHOT

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
13 months agoUpgrade CI build to JDK 21
Alexander Kriegisch [Tue, 26 Sep 2023 06:43:00 +0000 (13:43 +0700)]
Upgrade CI build to JDK 21

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
13 months agoUpdate compiler.version to latest Java 20 merge
Alexander Kriegisch [Mon, 25 Sep 2023 02:14:56 +0000 (09:14 +0700)]
Update compiler.version to latest Java 20 merge

messages_aspectj.properties:
compiler.version = ... d23a141971a37b (27Apr2023) - Java20

Too bad this version string did not make it into 1.9.20 and 1.9.20.1.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
14 months agoSet version to 1.9.21-SNAPSHOT
Alexander Kriegisch [Mon, 4 Sep 2023 04:51:58 +0000 (11:51 +0700)]
Set version to 1.9.21-SNAPSHOT

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
14 months agoUpdate AspectJ libraries in 'lib' subfolders V1_9_20_1
Alexander Kriegisch [Mon, 4 Sep 2023 04:06:28 +0000 (11:06 +0700)]
Update AspectJ libraries in 'lib' subfolders

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
14 months agoAspectJ release 1.9.20.1
Alexander Kriegisch [Mon, 4 Sep 2023 03:33:19 +0000 (10:33 +0700)]
AspectJ release 1.9.20.1

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
14 months agoUpdate 1.9.20 release notes for 1.9.20.1
Alexander Kriegisch [Mon, 4 Sep 2023 03:22:50 +0000 (10:22 +0700)]
Update 1.9.20 release notes for 1.9.20.1

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
15 months agoajc162.xml: Fix test failing after previous bugfix
Alexander Kriegisch [Wed, 23 Aug 2023 03:13:02 +0000 (10:13 +0700)]
ajc162.xml: Fix test failing after previous bugfix

A change made to ajc162.xml in commit 43cb1e2f has been reverted
and improved after the recent negated type pattern fix. Relates to #257.

The pointcut 'call(!void *.*(..)) && this(src) && target(dst)' actually
does match method call 'payloadClass.getPayload()' within the
around-advice in GenericClassInAdvice itself.

Improvement: Activate '-showWeaveInfo' and verify weaving message.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
15 months agoNotTypePattern: Fix matching problem for negated type patterns
Alexander Kriegisch [Wed, 23 Aug 2023 02:33:21 +0000 (09:33 +0700)]
NotTypePattern: Fix matching problem for negated type patterns

The implementation for boolean matchesArray(UnresolvedType type) was
buggy.

'!String' should match anything but String, no matter if it is
an array or not, e.g. int, void, int[], String[], String[][].

'!String[]' should match anything but String[], no matter if it is
an array or not, e.g. int, void, int[], String, String[][].

Fixes #257.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
15 months agoAdd regression test for #257
Alexander Kriegisch [Wed, 23 Aug 2023 02:23:38 +0000 (09:23 +0700)]
Add regression test for #257

Relates to #257.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
15 months agoImprove bridge method test, bootstrapping ASM usage
Alexander Kriegisch [Tue, 22 Aug 2023 00:54:19 +0000 (07:54 +0700)]
Improve bridge method test, bootstrapping ASM usage

Instead of using a pre-generated JAR, the source code generating the
class with reordered methods (bridge method first) is now compiled
directly before usage. This is possible, because in the previous commit
ASM was put on the Ajc classpath for tests.

Relates to #256.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
15 months agoPut ASM on classpath for Ajc in tests
Alexander Kriegisch [Tue, 22 Aug 2023 00:49:36 +0000 (07:49 +0700)]
Put ASM on classpath for Ajc in tests

This enables compiled source code to use ASM. This way, it is possible
to bootstrap tests needing specially prepared class files by
  1. compiling an ASM-enabled byte code generator class,
  2. running the generator, writing out class files,
  3. using the generated class files in subsequent tests.

Until now, such classes always had to be checked into the ASM directly
or inside JARs. Now, this is no longer necessary.

The next commit will be the first example.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
15 months agoFix Spring issue 27761
Alexander Kriegisch [Mon, 21 Aug 2023 10:37:56 +0000 (17:37 +0700)]
Fix Spring issue 27761

Fixes spring-projects/spring-framework#27761.
Fixes #256.

Bridge methods are now ignored in favour of their overriding namesakes
during method matching.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
15 months agoRegression test for Spring issue 27761
Alexander Kriegisch [Mon, 21 Aug 2023 10:18:27 +0000 (17:18 +0700)]
Regression test for Spring issue 27761

Relates to spring-projects/spring-framework#27761.

The test needs an ASM-generated class file with reordered methods in
order to reproduce the issue in plain AspectJ. The test fails now, but
should pass after the fix.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
15 months agoRELEASE.md: add info about creating docs for installer
Alexander Kriegisch [Wed, 16 Aug 2023 06:58:49 +0000 (13:58 +0700)]
RELEASE.md: add info about creating docs for installer

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
15 months agoSet version to 1.9.21-SNAPSHOT
Alexander Kriegisch [Wed, 16 Aug 2023 06:58:13 +0000 (13:58 +0700)]
Set version to 1.9.21-SNAPSHOT

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
15 months agoRelease 1.9.20 V1_9_20
Alexander Kriegisch [Wed, 16 Aug 2023 06:37:26 +0000 (13:37 +0700)]
Release 1.9.20

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
15 months agoAdd more info and set release date in 1.9.20 release notes
Alexander Kriegisch [Wed, 16 Aug 2023 04:17:59 +0000 (11:17 +0700)]
Add more info and set release date in 1.9.20 release notes

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
15 months agoBump JDT Core to 1.9.20
Alexander Kriegisch [Wed, 16 Aug 2023 04:14:49 +0000 (11:14 +0700)]
Bump JDT Core to 1.9.20

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
15 months agoAdd 1.9.20 release notes and update version compatibility matrix
Alexander Kriegisch [Wed, 16 Aug 2023 03:36:33 +0000 (10:36 +0700)]
Add 1.9.20 release notes and update version compatibility matrix

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
15 months agoMove 1.9.20 bug regression tests to the correct spots
Alexander Kriegisch [Tue, 15 Aug 2023 01:58:14 +0000 (08:58 +0700)]
Move 1.9.20 bug regression tests to the correct spots

Originally, I had intended to release a minor 1.9.19.1 release to fix
some bugs. But then, Java 20 support was implemented and merged, so the
next release will be 1.9.20. Therefore, I moved some bug regression
tests to the 1.9.20 suite.

Relates to #254.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
15 months agoFix tests using Javac via Ant using source/target < 1.8
Alexander Kriegisch [Sun, 6 Aug 2023 01:50:46 +0000 (08:50 +0700)]
Fix tests using Javac via Ant using source/target < 1.8

Since JDK 20, targets older than 1.8 are no longer supported by Javac.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
15 months agoImprove error message in LazyClassGen.getJavaClassBytesIncludingReweavable
Alexander Kriegisch [Sun, 6 Aug 2023 02:12:38 +0000 (09:12 +0700)]
Improve error message in LazyClassGen.getJavaClassBytesIncludingReweavable

No longer report "Unable to find ASM classes", if simply an ASM
processing error occurred. In that case, report "Error processing
class file".

Relates to #250.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
15 months agoFix inline accessor method bug in BcelAccessForInlineMunger
Alexander Kriegisch [Sat, 5 Aug 2023 05:15:37 +0000 (12:15 +0700)]
Fix inline accessor method bug in BcelAccessForInlineMunger

Make sure to create one ajc$inlineAccessMethod per identically named
(overloaded) private aspect method in
BcelAccessForInlineMunger.createOrGetInlineAccessorForMethod.

Fixes #250.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
15 months agoAdd regression test for #250
Alexander Kriegisch [Sat, 5 Aug 2023 04:34:59 +0000 (11:34 +0700)]
Add regression test for #250

Reproduces #250.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
15 months agoUse relocated ASM class names in BCException message
Alexander Kriegisch [Fri, 4 Aug 2023 02:31:31 +0000 (09:31 +0700)]
Use relocated ASM class names in BCException message

Fixes #251.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
16 months agoAdd method ArrayReferenceType.equals to fix failing tests
Alexander Kriegisch [Mon, 26 Jun 2023 06:11:38 +0000 (08:11 +0200)]
Add method ArrayReferenceType.equals to fix failing tests

This also fixes a bug. Previously, ResolvedType.equals was used for
equality check, and in there is a '==' comparison, which does not work
for two different ArrayReferenceType instances, even if the component
type is the same.

Relates to #246.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
16 months agoBcelTypeMunger.getRealMemberForITDFromAspect code cosmetics
Alexander Kriegisch [Sun, 25 Jun 2023 10:22:34 +0000 (12:22 +0200)]
BcelTypeMunger.getRealMemberForITDFromAspect code cosmetics

Relates to #246.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
16 months agoCorrectly identify ITD method signatures in weaver
Alexander Kriegisch [Sun, 25 Jun 2023 10:17:48 +0000 (12:17 +0200)]
Correctly identify ITD method signatures in weaver

by removing faulty condition 'if (isCtorRelated)' from
BcelTypeMunger.getRealMemberForITDFromAspect, see comment
https://github.com/eclipse-aspectj/aspectj/issues/246#issuecomment-1605999896.

Fixes #246.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
16 months agoAdd failing test reproducing #246
Alexander Kriegisch [Sat, 24 Jun 2023 06:15:24 +0000 (08:15 +0200)]
Add failing test reproducing #246

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
16 months agoAdjust expected error message in switch pattern tests after upstream typo fix
Alexander Kriegisch [Fri, 31 Mar 2023 07:26:45 +0000 (09:26 +0200)]
Adjust expected error message in switch pattern tests after upstream typo fix

See:
https://github.com/eclipse-jdt/eclipse.jdt.core/issues/919
https://github.com/eclipse-jdt/eclipse.jdt.core/commit/b681dfb5
Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
16 months agoImprove SystemPropertiesTest
Alexander Kriegisch [Thu, 30 Mar 2023 10:03:59 +0000 (12:03 +0200)]
Improve SystemPropertiesTest

- Fix quotation error in console output
- Throw RuntimeException instead of Error. Maybe this helps to avoid
  the prominent error message listing in the GitHub build log, which
  always looks like something bad happened, even though it is simply an
  expected error.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
16 months agoSwitch CI build to coactions/setup-xvfb
Alexander Kriegisch [Thu, 30 Mar 2023 09:09:02 +0000 (11:09 +0200)]
Switch CI build to coactions/setup-xvfb

GabrielBB/xvfb-action is no longer maintained and points to
coactions/setup-xvfb. The switch should eliminate this warning in CI
builds:

Node.js 12 actions are deprecated. Please update the following actions
to use Node.js 16: GabrielBB/xvfb-action@v1.6. For more information see:
https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
16 months agoAdd AllTestsAspectJ1920 to AllTests19 suite
Alexander Kriegisch [Thu, 30 Mar 2023 07:59:18 +0000 (09:59 +0200)]
Add AllTestsAspectJ1920 to AllTests19 suite

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
16 months agoeclipse-jdt/eclipse.jdt.core#919 has been fixed
Alexander Kriegisch [Thu, 30 Mar 2023 07:13:05 +0000 (09:13 +0200)]
eclipse-jdt/eclipse.jdt.core#919 has been fixed

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
16 months agoBuild on JDK 11, 17, 20 (remove 19)
Alexander Kriegisch [Thu, 30 Mar 2023 07:12:00 +0000 (09:12 +0200)]
Build on JDK 11, 17, 20 (remove 19)

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
16 months agoFix tests using Javac using source/target 1.7
Alexander Kriegisch [Wed, 29 Mar 2023 14:14:00 +0000 (16:14 +0200)]
Fix tests using Javac using source/target 1.7

Javac 20+ no longer supports 1.7.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
16 months agoFix javadoc generation broken on JDK 20
Alexander Kriegisch [Wed, 29 Mar 2023 10:49:22 +0000 (12:49 +0200)]
Fix javadoc generation broken on JDK 20

Firstly, Javadoc 20 cannot handle source level 1.7 anymore, so I bumped
it to 11, which hopefully will be around for another while. It also
matches the ajc minimum of Java 11, i.e. ajdoc and ajc are synchronised
in this regard now.

Secondly, as of JDK 20, the javadoc tool renders HTML pages with section
headers specific to the JVM default locale. The workaround is to set the
locale to English before calling javadoc.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
16 months agoImprove Java 9+ version matching in ClassPath.getClassPath
Alexander Kriegisch [Wed, 29 Mar 2023 06:38:57 +0000 (08:38 +0200)]
Improve Java 9+ version matching in ClassPath.getClassPath

On the short term, this fixes the failing weaver tests on JDK 20. On the
long term, the improved matching heuristics should make it unnecessary
to update the regex again.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
16 months agoAdd basic tests for Java 20, deactivate Java 19 preview tests
Alexander Kriegisch [Tue, 28 Mar 2023 14:29:12 +0000 (16:29 +0200)]
Add basic tests for Java 20, deactivate Java 19 preview tests

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
16 months agomessages_aspectj.properties: update ECJ version string
Alexander Kriegisch [Mon, 27 Mar 2023 11:41:40 +0000 (13:41 +0200)]
messages_aspectj.properties: update ECJ version string

This update includes the upstream fix for
https://github.com/eclipse-jdt/eclipse.jdt.core/issues/911.

Eclipse Compiler b15e5c75653358 (24Mar2023) - Java20

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
16 months agoTemporarily build both Java 19 and 20 on GitHub
Alexander Kriegisch [Mon, 27 Mar 2023 08:29:06 +0000 (10:29 +0200)]
Temporarily build both Java 19 and 20 on GitHub

Let's find out if the tests still pass
  - on Java 19, except for J19 preview features,
  - on Java 20, also except for J19 with changed syntax.

TODO: After having added Java 20 preview feature tests, remove J19
build.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
16 months agoBump jdt.core.version to 1.9.20-SNAPSHOT
Alexander Kriegisch [Mon, 27 Mar 2023 08:27:14 +0000 (10:27 +0200)]
Bump jdt.core.version to 1.9.20-SNAPSHOT

Let's find out if the tests still pass
  - on Java 19, except for J19 preview features,
  - on Java 20, also except for J19 with changed syntax.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
16 months agomessages_aspectj.properties: update ECJ version string
Alexander Kriegisch [Mon, 27 Mar 2023 07:43:58 +0000 (09:43 +0200)]
messages_aspectj.properties: update ECJ version string

Eclipse Compiler 40fa81de93d65b (24Mar2023) - Java20

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
16 months agoUse ASM 9.5 for Java 20 support
Alexander Kriegisch [Mon, 27 Mar 2023 07:29:33 +0000 (09:29 +0200)]
Use ASM 9.5 for Java 20 support

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
17 months agoAdd null checks for Shadow.getResolvedSignature()
Alexander Kriegisch [Tue, 13 Jun 2023 07:21:52 +0000 (09:21 +0200)]
Add null checks for Shadow.getResolvedSignature()

Fixes #243.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
17 months agoFix XML config for Bugs1919Tests.test_GitHub_214
Alexander Kriegisch [Sun, 4 Jun 2023 10:52:54 +0000 (12:52 +0200)]
Fix XML config for Bugs1919Tests.test_GitHub_214

The test started breaking on GitHub, but ran fine locally, which implied
some kind of classpath ordering issue. As it turned out, for XML tests
all JARs found in the sandbox directory are added to the classpath
automatically. So if we do not want them on the classpath, we need to
delete or rename them before running.

In this case, however, it was enough to make sure the classpath order is
correct, so that the duplicate 'Application' class is found in the woven
version, not in the unwoven one by chance. We therefore need to use the
correct syntax,
  1. separating classpath entries by comma, not space,
  2. prepending '$sandbox/' to the JAR name.

Now the test reliably does what it should have done from the start: run
the woven code. Until now, the output assertions were adjusted to the
weird result of no aspect logs being present on the console, which was
wrong right from the start.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
17 months agoAdd null check to AjLookupEnvironment.hasAspectDeclarations
Alexander Kriegisch [Sun, 4 Jun 2023 07:37:47 +0000 (09:37 +0200)]
Add null check to AjLookupEnvironment.hasAspectDeclarations

Fixes #240.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
20 months agoIDE.md: change 2022-12 AJDT M2E connector link to upstream update site
Alexander Kriegisch [Sat, 11 Mar 2023 12:23:54 +0000 (13:23 +0100)]
IDE.md: change 2022-12 AJDT M2E connector link to upstream update site

20 months agoAdded MIll to the Build tools section
Tobias Roeser [Fri, 20 May 2022 07:31:25 +0000 (09:31 +0200)]
Added MIll to the Build tools section

I'm the author of mill-aspectj and Mill maintainer, so i might be biased. ;-)

We use Mill with the mill-aspectj plugin in commercial projects, so I'm rather confident in it's reliability.

20 months agoJavaVersionCompatibility.md: add Java 19
Alexander Kriegisch [Wed, 1 Mar 2023 16:21:52 +0000 (17:21 +0100)]
JavaVersionCompatibility.md: add Java 19

20 months agoIDE.md: add link to m2e AJDT connector for Eclipse 2022-12
Alexander Kriegisch [Wed, 1 Mar 2023 07:33:36 +0000 (08:33 +0100)]
IDE.md: add link to m2e AJDT connector for Eclipse 2022-12

The link points to aspectj.dev for now, because Mika Vesti has not
merged my PR and published a new version on repo.t5.fi yet.

20 months agoIDE.md: Add new AJDT update site for 2022-12 (4.26)
Alexander Kriegisch [Tue, 28 Feb 2023 11:01:04 +0000 (12:01 +0100)]
IDE.md: Add new AJDT update site for 2022-12 (4.26)

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
20 months agoDepend on JDT Core 1.9.20.M1
Alexander Kriegisch [Tue, 28 Feb 2023 07:10:46 +0000 (08:10 +0100)]
Depend on JDT Core 1.9.20.M1

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
20 months agoHandleProviderDelimiter: rename JEM_MODULAR_CLASSFILE to MODULAR_CLASSFILE
Alexander Kriegisch [Tue, 28 Feb 2023 07:09:48 +0000 (08:09 +0100)]
HandleProviderDelimiter: rename JEM_MODULAR_CLASSFILE to MODULAR_CLASSFILE

The other constants do not have the JEM_ prefix from JavaElement either.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
20 months agoSync HandleProviderDelimiter with JDT Core & AJDT
Alexander Kriegisch [Sat, 25 Feb 2023 22:11:05 +0000 (23:11 +0100)]
Sync HandleProviderDelimiter with JDT Core & AJDT

New constants:
  JEM_MODULAR_CLASSFILE - '\'' (single quote)
  ANNOTATION - '}'
  LAMBDA_EXPRESSION - ')'
  LAMBDA_METHOD - '&'
  STRING - '"'
  MODULE - '`'
  DELIMITER_ESCAPE - '='

Updated AspectJ constants due to JDT Core using constants previously
used by AspectJ:

  ADVICE - '&' to '§'
  ASPECT_TYPE - '\'' to '>'
  ITD_METHOD - ')' to '°'
  DECLARE - '`' to '´'
  POINTCUT - '"' to '©'

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
21 months agoAdd safeguards for And/Or/Not pattern node types
Alexander Kriegisch [Sun, 29 Jan 2023 16:14:05 +0000 (17:14 +0100)]
Add safeguards for And/Or/Not pattern node types

Affects *PointCut, *TypePattern, *AnnotationTypePattern.

Relates to #215.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
21 months agoAdd traverse methods for declare and pattern types
Alexander Kriegisch [Sun, 29 Jan 2023 16:05:59 +0000 (17:05 +0100)]
Add traverse methods for declare and pattern types

Relates to #215.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
21 months agoAdd traverse methods for pointcut types
Alexander Kriegisch [Sun, 29 Jan 2023 12:18:10 +0000 (13:18 +0100)]
Add traverse methods for pointcut types

Relates to #215.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
21 months agoFurther improve indentation of compilation results on the console gh-217
Alexander Kriegisch [Tue, 24 Jan 2023 16:17:41 +0000 (17:17 +0100)]
Further improve indentation of compilation results on the console

In CompilationResult.toString, no longer indent like this:

  [warning 1] warning at
              after() : execution(FooBar Blah.*()) {
                                  ^^^^^^
              xxx FooBar [Xlint:invalidAbsoluteTypeName]

Instead, always just indent by 2 spaces, saving screen real estate:

  [warning 1] warning at
    after() : execution(FooBar Blah.*()) {
                        ^^^^^^
    xxx FooBar [Xlint:invalidAbsoluteTypeName]

Also further streamline/simplify the code a bit.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
21 months agoFix indentation of compilation results on the console
Alexander Kriegisch [Sun, 22 Jan 2023 20:52:24 +0000 (21:52 +0100)]
Fix indentation of compilation results on the console

Whenever warnings or errors were printed via CompilationResult.toString,
indirectly also using MessageUtil.renderMessage(IMessage, boolean),
messages containing context info such as code snippets with carets
marking erroneous tokens - see also the previous commit - prefixes like
"[warning 1] warning at " were printed right in front of the code
snippets. I.e., the carets marking erroneous tokens in the second line
were not indented like the first line with the code snippet, leading to
(simplified) output like:

  [warning 1] warning at after() : execution(FooBar Blah.*()) {
                      ^^^^^^
  xxx FooBar [Xlint:invalidAbsoluteTypeName]

This was fixed to now correctly indent lines 2 to n according to line 1,
yielding the correct output:

  [warning 1] warning at
              after() : execution(FooBar Blah.*()) {
                                  ^^^^^^
              xxx FooBar [Xlint:invalidAbsoluteTypeName]

Especially with longer, more complex context lines, this helps to
identify the erroneous section. BTW, for one-line messages, everything
of course looks like before.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
21 months agoBugfix: caret error marks in compiler output too short
Alexander Kriegisch [Sun, 22 Jan 2023 11:22:37 +0000 (12:22 +0100)]
Bugfix: caret error marks in compiler output too short

This very old bug in EclipseAdapterUtils calculated the '^' caret error
marks incorrectly. The marks were too short like this:

  void m() { return vax[3]; }
             ^^^^^^^^^^^

Where the correct result would look like this:

  void m() { return vax[3]; }
             ^^^^^^^^^^^^^^

This was due to the rather complicated way in which first surrounding
context code - here the leading 'void m() { ' and trailing  ' }' - was
first added and then possible leading white space was cut off again from
the left. It is difficult to explain, the code is a nightmare, trying to
work with char arrays, counting indexes, repeatedly using
System.arraycopy and using lots of counters and offsets. I would have
liked to simplify the code, converting char[] buffers to Strings, but
decided to keep the basic structure for now, not sure what kind of
memory or performance considerations led to this design.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
22 months agoFix GitHub #214
Alexander Kriegisch [Sat, 21 Jan 2023 10:26:05 +0000 (11:26 +0100)]
Fix GitHub #214

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
22 months agoAdd regression test reproducing GitHub #214
Alexander Kriegisch [Sat, 21 Jan 2023 10:25:49 +0000 (11:25 +0100)]
Add regression test reproducing GitHub #214

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
22 months agoComment on newly pointcut parsing found problem in test class
Alexander Kriegisch [Sun, 15 Jan 2023 13:18:32 +0000 (14:18 +0100)]
Comment on newly pointcut parsing found problem in test class

A pointcut like

  execution(*..Collection<?>[] *(..))

leads to an AJ core dump, which is something I noticed while fixing a
test in the previous commit. I am going to create a new issue for it and
link to this commit later.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
22 months agoFix failing tests after previous commit
Alexander Kriegisch [Sun, 15 Jan 2023 13:16:04 +0000 (14:16 +0100)]
Fix failing tests after previous commit

After the changes, the weaver's behaviour is now slightly different, but
not actually buggy. Actually, in one case there is now a weaver warning
for a non-matching pointcut which should have been there before, but was
not. I.e., things have improved and the tests are even a bit better now.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
22 months agoRemove old, erroneously committed binaries from tests/bugs193/543657
Alexander Kriegisch [Sun, 15 Jan 2023 12:22:49 +0000 (13:22 +0100)]
Remove old, erroneously committed binaries from tests/bugs193/543657

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
22 months agoFix PointcutRewriterTest, add LogicalPointcutStructure test helper class
Alexander Kriegisch [Sun, 15 Jan 2023 00:25:11 +0000 (01:25 +0100)]
Fix PointcutRewriterTest, add LogicalPointcutStructure test helper class

After WildTypePattern.hashCode was fixed in the previous commit,
PointcutRewriterTest started failing, because in many places it was
falsely relying on a specific order of hash codes, which cannot be
guaranteed, especially since more instance fields are part of the hash
code now in accordance with 'equals'.

The new test helper class LogicalPointcutStructure is able to recognise
chained '&&' and '||' pointcuts of the same logical nesting level,
un-nesting them from the actual pointcut structure and making them
comparable, disregarding their order. I.e., something like
  ((A && B) && C) && D
is actually recognised to logically be
  A && B && C && D
and equivalent to e.g. either of
  D && B && A && C
  A && B && D && C
  C && A && D && B

This helps to compare rewritten pointcuts, as long as their logical
structure has not been altered.

Relates to #24.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
22 months agoWildTypePattern: fix hashCode and toString methods
Alexander Kriegisch [Sun, 15 Jan 2023 00:16:24 +0000 (01:16 +0100)]
WildTypePattern: fix hashCode and toString methods

Especially 'hashCode' did not correspond to 'equals', disregarding
several fields, array dimension information being only one of them. This
led to parts of pointcuts being ignored, because they were regarded as
duplicates. Example:

execution(Foo* *(..)) && !execution(Foo*[] *(..))

Here, the negated pattern was falsely regarded as equal to the first
pattern, leading to an "A && !A" situation, i.e. no match at all.

Furthermore, 'toString' did not print array strings, i.e. instead of
"Foo*[][]" something like "Foo*" was printed. This false information was
also present in annotations generated by the weaver.

FuzzilyMatchingAspect was adjusted to actually match exactly once, as
expected, for the "Foo*" return types, i.e. exclusions for the array
return types have been added.

Relates to #24.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
22 months agoImprove array matching for all TypePattern subclasses
Alexander Kriegisch [Sun, 15 Jan 2023 00:05:47 +0000 (01:05 +0100)]
Improve array matching for all TypePattern subclasses

Relates to #24.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
22 months agoHandle one- and multi-dimensional array return types correctly
Alexander Kriegisch [Mon, 9 Jan 2023 17:03:50 +0000 (18:03 +0100)]
Handle one- and multi-dimensional array return types correctly

Fixes https://github.com/eclipse/org.aspectj/issues/24, both the array
return type matching as such as well as matching dimensionality patterns
correctly. E.g., 'Foo*[]' is not the same as 'Foo*[][]'. This also works
correctly in combination with asterisks, even for primitive types, i.e.
'in*[][]' correctly matches a 2-dimensional array of 'int'.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
22 months agoSimplify if-else in WildTypePattern.matchesExactlyByName
Alexander Kriegisch [Mon, 9 Jan 2023 16:59:20 +0000 (17:59 +0100)]
Simplify if-else in WildTypePattern.matchesExactlyByName

A simple boolean condition is enough.

Loosely relates to https://github.com/eclipse/org.aspectj/issues/24, but
actually it is just drive-by cosmetics.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
22 months agoFix WildTypePattern.isArray
Alexander Kriegisch [Mon, 9 Jan 2023 16:56:15 +0000 (17:56 +0100)]
Fix WildTypePattern.isArray

The method falsely determined that a one-dimensional array was not an
array due to a one-off bug.

Relates to https://github.com/eclipse/org.aspectj/issues/24.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
22 months agoExpand regression tests for GitHub bug #24
Alexander Kriegisch [Mon, 9 Jan 2023 16:53:30 +0000 (17:53 +0100)]
Expand regression tests for GitHub bug #24

More test cases were added for
  - multi-dimensional arrays,
  - primitive type arrays.

Relates to https://github.com/eclipse/org.aspectj/issues/24.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
22 months agoAdd regression tests for GitHub bug #24
Alexander Kriegisch [Sun, 8 Jan 2023 10:00:46 +0000 (11:00 +0100)]
Add regression tests for GitHub bug #24

Relates to https://github.com/eclipse/org.aspectj/issues/24.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
22 months agoRefactor, comment and reactivate Ajc183Tests.testAnnoStyleDecp_442425
Alexander Kriegisch [Sat, 7 Jan 2023 13:23:26 +0000 (14:23 +0100)]
Refactor, comment and reactivate Ajc183Tests.testAnnoStyleDecp_442425

This test was always inactive and did not add any value other than
during development. No it runs, passes and documents the status quo of
  - what was fixed (regression for AJC 1.8.2 core dump fixed in 1.8.3),
  - the current limitations of @DeclareParents and @DeclareMixin
    regarding generic interfaces.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
22 months agoRemove some old, accidentally committed class files from tests
Alexander Kriegisch [Sat, 7 Jan 2023 13:05:22 +0000 (14:05 +0100)]
Remove some old, accidentally committed class files from tests

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>