]> source.dussan.org Git - aspectj.git/log
aspectj.git
7 months agoFix expected weave messages after previous changes
Alexander Kriegisch [Sun, 29 Jan 2023 15:21:47 +0000 (16:21 +0100)]
Fix expected weave messages after previous changes

Remove leading "weaveInfo", add missing "see also:" to weave messages.

Relates to #218.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
7 months agoImplement source location matching for weave messages in XML tests
Alexander Kriegisch [Sun, 29 Jan 2023 13:57:58 +0000 (14:57 +0100)]
Implement source location matching for weave messages in XML tests

WIP (work in progress).

Closes #218.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
7 months agoImprove Ajc165Tests.testFunkyPointcut_pr272233_2
Alexander Kriegisch [Thu, 19 Jan 2023 12:13:15 +0000 (13:13 +0100)]
Improve Ajc165Tests.testFunkyPointcut_pr272233_2

Add more funky pointcuts concerning 'void[]' and pointcuts matching
arrays of generic types. Remove TODO after previously committed bugfix.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
7 months agoFurther streamline BCException
Alexander Kriegisch [Wed, 18 Jan 2023 08:17:43 +0000 (09:17 +0100)]
Further streamline BCException

- Improvement: Also add CompilationAndWeavingContext for constructor
  with causing exception
- Remove home-brew stack trace printing, just call super constructors

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
7 months agoImprove stack trace printing in BCException
Alexander Kriegisch [Wed, 18 Jan 2023 07:44:26 +0000 (08:44 +0100)]
Improve stack trace printing in BCException

- Bugfix: Flush stream.
- Adjust format to more closely resemble JVM format. E.g., do not print
  the causing exception name twice.
- Add TODO, because this whole custom stack trace printing can just go
  away. The JVM format should do just fine. This commit is merely meant
  to document the decision to remove the cruft in the next commit.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
7 months agoMake Ajc165Tests.testFunkyPointcut_pr272233_2 pass
Alexander Kriegisch [Tue, 17 Jan 2023 18:56:27 +0000 (19:56 +0100)]
Make Ajc165Tests.testFunkyPointcut_pr272233_2 pass

The test needs to expect the lately introduced Xlint:arrayCannotBeVoid
warning to be thrown, because one of the pointcuts in
tests/bugs165/pr272233/Iffy2.java contains a 'void[]' return type in a
method signature.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
7 months agoNew Xlint warning 'arrayCannotBeVoid' when resolving 'void[]'
Alexander Kriegisch [Tue, 17 Jan 2023 18:23:26 +0000 (19:23 +0100)]
New Xlint warning 'arrayCannotBeVoid' when resolving 'void[]'

Because void arrays are illegal (and nonsensical), now there is a new
Xlint warning whenever World.resolve resolves a new 'void[]'. Because
in the World class we do not have any source context, no path + line
number are logged. The user only sees something like:

  [warning] arrays cannot have a void type, but found 'void[]' in
  pointcut [Xlint:arrayCannotBeVoid]

Then later, if due to the returned MissingResolvedTypeWithKnownSignature
type a joinpoint does not match, there is an additional

  my/path/MyAspect.aj:42 [warning] advice defined in MyAspect has not
  been applied [Xlint:adviceDidNotMatch]

log line, but not necessarily anywhere near the former one.

On the one hand, this is better than nothing. OTOH, comparing the
situation with no logging message other than Xlint:adviceDidNotMatch in
case of something equally illegal like 'Foo<int>' (primitive generic
type parameter), this is actually more than we have in several other
situations and might even be regarded as superfluous. In case of
multiple 'void[]' cases within a big number of aspects, the same aspect
or even the same pointcut, the user would have no clue where exactly to
search for it. He would just see multiple log messages without source
context.

One option would be to set 'arrayCannotBeVoid=ignore' in
XlintDefault.properties, so the user would have to explicitly activate
it. But IMO, this message should be visible by default.

Another option would be to find out how to defer logging the messages
until later similarly to BcelWeaver.warnOnUnmatchedAdvice and then to
bulk-print them. But in order to achieve that, the information about the
existence of any 'void[]' occurrences would have to be stored in a flag
similar to BcelAdvice.hasMatchedAtLeastOnce, bloating BcelAdvice for
that rare case. Alternatively, each advice pointcut could be
heuristically scanned for the literal substring 'void[]', logging the
Xlint message if it is found anywhere.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
7 months agoUnresolvedType.signatureToName: fix '*' case for generic type '?'
Alexander Kriegisch [Tue, 17 Jan 2023 15:02:03 +0000 (16:02 +0100)]
UnresolvedType.signatureToName: fix '*' case for generic type '?'

In generic type lists, after a '*' in any type parameter list, sometimes
the '*' (which should be converted to '?') itself and always the
subsequent parameters would be missing from the signature:

  - '[Pjava/util/Collection<*>;' yielded
    'java.util.Collection<>[]', but should be
    'java.util.Collection<?>[]'

  - '[Pjava/util/Map<*Pjava/util/List<[Ljava/lang/Integer;>;>;' yielded
    'java.util.Map<?>[]', but should be
    'java.util.Map<?,java.util.List<java.lang.Integer[]>>[]'

This is now fixed.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
7 months agoWildTypePattern: match generic type params correctly for array types
Alexander Kriegisch [Tue, 17 Jan 2023 14:46:18 +0000 (15:46 +0100)]
WildTypePattern: match generic type params correctly for array types

For array reference types, match type parameters on component type, not
on array type itself.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
7 months agoWildTypePattern.toString: do not parenthesesise generic type list
Alexander Kriegisch [Tue, 17 Jan 2023 14:16:32 +0000 (15:16 +0100)]
WildTypePattern.toString: do not parenthesesise generic type list

It is unnecessary to represent a pattern list 'A,B,C' as '(A,B,C)'. Not
only does it look ugly in a type signature like 'org.acme.Foo<(A,B,C)>',
but also is it not valid Java syntax. While the latter might not be
strictly necessary in a String representation, it certainly is
desirable, if such representations are ever used to generate code or
@AspectJ pointcut annotations.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
7 months agoSignaturePattern.TypePatternVisitor: remove redundant visit method
Alexander Kriegisch [Fri, 12 Apr 2024 11:27:47 +0000 (13:27 +0200)]
SignaturePattern.TypePatternVisitor: remove redundant visit method

Method visit(WildAnnotationTypePattern, Object) used to descend into
node.getTypePattern().accept(this, data), which since commit 6585b9ef46
is unnecessary, because WildAnnotationTypePattern::traverse already
traverses its type pattern.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
7 months agoSignaturePattern: minor structural refactoring
Alexander Kriegisch [Fri, 12 Apr 2024 11:18:55 +0000 (13:18 +0200)]
SignaturePattern: minor structural refactoring

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
7 months agoSignaturePattern: Add exception for meta annotations
Alexander Kriegisch [Fri, 12 Apr 2024 11:18:04 +0000 (13:18 +0200)]
SignaturePattern: Add exception for meta annotations

Upon meta annotation usage in signature patterns, lint warnings like the
following were issued during type parameter traversal:

  does not match because annotation @java.lang.annotation.Inherited
  has @Target{ElementType.ANNOTATION_TYPE} [Xlint:unmatchedTargetKind]

To avoid this, we now heuristically check if we are in a meta annotation
situation and, if so, permit it.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
7 months agoLint: minor structural refactoring
Alexander Kriegisch [Fri, 12 Apr 2024 11:12:49 +0000 (13:12 +0200)]
Lint: minor structural refactoring

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
7 months agoFix test after node traversal was improved
Alexander Kriegisch [Mon, 30 Jan 2023 15:32:07 +0000 (16:32 +0100)]
Fix test after node traversal was improved

Due to the latest improvements, an error which was previously not thrown
unexpectedly according to a source code comment in test aspect
ParameterizedTypesInAnnotationPatterns.aj is now thrown for this kind
of pointcut:

  staticinitialization(@(Foo || List<String>) String)

Now the compiler correctly says:

  no static initialization join points for parameterized types,
  use raw type instead

Relates to #221.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
7 months agoUnresolvedType: fix JVM signature conversion
Alexander Kriegisch [Tue, 17 Jan 2023 13:49:54 +0000 (14:49 +0100)]
UnresolvedType: fix JVM signature conversion

Fixes #211. Previously, '?' was not converted to '*' in
UnresolvedType.nameToSignature, but kept as-is. That is why - falsely -
it was necessary to handle the '?' case in UnresolvedType.forSignature
at all, reading this kind of bogus signature and creating a type for it
in TypeFactory.createTypeFromSignature. This, ironically, led to correct
JVM generic type signatures containing '*' not being handled at all.

The conversion should now work correctly both ways.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
7 months agoEnable type parameter traversal in exact type patterns
Alexander Kriegisch [Mon, 30 Jan 2023 11:41:47 +0000 (12:41 +0100)]
Enable type parameter traversal in exact type patterns

Closes #221

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
7 months agoJoinPointImpl minor structural refactoring
Alexander Kriegisch [Wed, 10 Apr 2024 11:22:04 +0000 (13:22 +0200)]
JoinPointImpl minor structural refactoring

No functionality was changed.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
7 months agoJoinPointImpl: Remove thread-locals after usage, where possible
KimmingLau [Wed, 3 Apr 2024 20:20:18 +0000 (04:20 +0800)]
JoinPointImpl: Remove thread-locals after usage, where possible

Avoid potential ThreadLocalMap.Entry accumulation. Entry is a
WeakReference. When JoinPointImpl objects are collected by GC, Entry
instances are still be referenced by ThreadLocalMap, which leads to
memory pressure and potentially more full GCs. So, we proactively remove
ThreadLocal<Integer> arcIndex instances when arcIndex has been
decremented back to -1 per thread. This is not perfect, because not each
thread can be expected to proceed, but it should ameliorate the
situation to some degree.

Fixes #302.

Co-authored-by: Alexander Kriegisch <Alexander@Kriegisch.name>
Signed-off-by: KimmingLau <294001791@qq.com>
Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
7 months agoAdd IT reproducing JoinPointImpl thread-locals memory leak
Alexander Kriegisch [Wed, 10 Apr 2024 09:03:13 +0000 (11:03 +0200)]
Add IT reproducing JoinPointImpl thread-locals memory leak

Relates to #302.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
7 months agoIDE.md: update M2E connector info for aspectj.dev update site
Alexander Kriegisch [Tue, 9 Apr 2024 13:15:11 +0000 (15:15 +0200)]
IDE.md: update M2E connector info for aspectj.dev update site

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
7 months agoRevert WeavingAdaptor generated class map optimisation
Alexander Kriegisch [Mon, 8 Apr 2024 11:40:01 +0000 (13:40 +0200)]
Revert WeavingAdaptor generated class map optimisation

This was introduced in commit 8a4aa03845 of PR #278 contribution as part
of the #279 fix. The contributor thought that the generated closure
class entries were never used, but in fact AJDT class OSGiWeavingAdaptor
relies on the presence of those entries.

To the best of my present knowledge, it looks as if this change was the
root cause of https://github.com/eclipse-aspectj/ajdt/issues/57.
Therefore, I reverted it, simultaneously refactoring Iterator::remove
usage to delete entries from the map to Collection::removeIf.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
7 months agoSimpleCache: structural refactoring, better docs
Alexander Kriegisch [Mon, 8 Apr 2024 08:17:42 +0000 (10:17 +0200)]
SimpleCache: structural refactoring, better docs

- Add some code comments and javadoc for SimpleCache::getAndInitialize
- Add TODO to migrate from using ClassLoader::defineClass to the class
  definition strategy used in ClassLoaderWeavingAdaptor

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
7 months agoAdd missing asm-commons to aspectjtools
Alexander Kriegisch [Sun, 7 Apr 2024 09:04:03 +0000 (11:04 +0200)]
Add missing asm-commons to aspectjtools

Relates to #117. In commit f986c3d183, the asm-commons dependency became
necessary to pull off the new trick to define classes in arbitrary class
loaders during LTW. The dependency was added to aspectjweaver, but not
to aspectjtools due to an oversight. As aspectjtools is meant to be a
super set of aspectjweaver, add the dependency to the assembly
descriptor.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
7 months agoRaise ClassLoaderWeavingAdaptor::defineClass visibility to protected
Alexander Kriegisch [Thu, 4 Apr 2024 10:51:58 +0000 (12:51 +0200)]
Raise ClassLoaderWeavingAdaptor::defineClass visibility to protected

Relates to https://github.com/eclipse-aspectj/ajdt/issues/57 and it a
precondition for refactoring phase 2 of child class
OSGiWeavingAdaptor::defineClass, which can now directly call the super
methods instead of using reflection.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
7 months agoREADME.md: Fix word order from comment in previous commit
Alexander Kriegisch [Thu, 28 Mar 2024 10:55:50 +0000 (11:55 +0100)]
README.md: Fix word order from comment in previous commit

Relates to #299.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
7 months agoREADME.md: Add hint about project root folder name requirement
Alexander Kriegisch [Thu, 28 Mar 2024 10:26:34 +0000 (11:26 +0100)]
README.md: Add hint about project root folder name requirement

Closes #299.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
8 months agoImplement remaining 'AspectJ_JDK_Update' tasks for 1.9.22
Alexander Kriegisch [Sat, 23 Mar 2024 18:29:28 +0000 (19:29 +0100)]
Implement remaining 'AspectJ_JDK_Update' tasks for 1.9.22

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
8 months agoSet version to 1.9.23-SNAPSHOT
Alexander Kriegisch [Sat, 23 Mar 2024 18:14:42 +0000 (19:14 +0100)]
Set version to 1.9.23-SNAPSHOT

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
8 months agoRelease AspectJ 1.9.22
Alexander Kriegisch [Sat, 23 Mar 2024 18:10:44 +0000 (19:10 +0100)]
Release AspectJ 1.9.22

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
8 months agoBump JDT Core to 1.9.22
Alexander Kriegisch [Sat, 23 Mar 2024 08:35:47 +0000 (09:35 +0100)]
Bump JDT Core to 1.9.22

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
8 months agoAdd 1.9.22 release notes
Alexander Kriegisch [Sat, 23 Mar 2024 08:28:19 +0000 (09:28 +0100)]
Add 1.9.22 release notes

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
8 months agoRemove some TODOs from Java feature tests
Alexander Kriegisch [Sat, 23 Mar 2024 07:51:23 +0000 (08:51 +0100)]
Remove some TODOs from Java feature tests

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
8 months agoSwitch to Java 22 + add basic test suite
Alexander Kriegisch [Fri, 22 Mar 2024 19:53:10 +0000 (20:53 +0100)]
Switch to Java 22 + add basic test suite

The tests from Java 21 were copied to 22. Inactive ones were activated
after their features under test were fixed/implemented. Preview ones
were promotes to final ones for unnamed variables and patterns.

TODO: Add tests for new Java 22 features and maybe adjust or
amend existing feature tests, if preview or final characteristics have
changed since Java 21.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
8 months agoAdjust 1.6.1 'testRunningBrokenCode_pr102733*' tests ECJ Java 22
Alexander Kriegisch [Fri, 22 Mar 2024 17:25:56 +0000 (18:25 +0100)]
Adjust 1.6.1 'testRunningBrokenCode_pr102733*' tests ECJ Java 22

Initially, these tests made sure that an old AJC bug causing
incompatibility to ECJ when using `-proceedOnError` was fixed and there
were no regressions. See also:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=102733

Now with the Java 22 changes for JEP 463 "Implicitly Declared Classes
and Instance Main Methods (Second Preview)" in JDT Core, source code is
parsed into a significantly different AST structure than before, even
when using compiler targets < 22. See also https://openjdk.org/jeps/463.

One test has been temporarily adjusted to the byte code created by
ECJ/AJC now.

TODO: Revert/adjust after this upstream bug has been
fixed:
https://github.com/eclipse-jdt/eclipse.jdt.core/issues/2205
Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
8 months agoCI build: add Temurin JDK 22
Alexander Kriegisch [Fri, 22 Mar 2024 10:16:56 +0000 (11:16 +0100)]
CI build: add Temurin JDK 22

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
8 months agoBump JDT Core to 1.9.22-SNAPSHOT
Alexander Kriegisch [Wed, 20 Mar 2024 13:52:41 +0000 (14:52 +0100)]
Bump JDT Core to 1.9.22-SNAPSHOT

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
8 months agoUpdate release notes 1.9.7 to 1.9.21
Alexander Kriegisch [Sat, 16 Mar 2024 10:00:29 +0000 (11:00 +0100)]
Update release notes 1.9.7 to 1.9.21

Add hint: "As of AspectJ 1.9.21.1, '--add-opens' is no longer necessary.
Please upgrade, if it bothers you too much."

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
8 months agoAsciidoctor: Do not copy target/** to aj-build/dist
Alexander Kriegisch [Sat, 16 Mar 2024 09:22:45 +0000 (10:22 +0100)]
Asciidoctor: Do not copy target/** to aj-build/dist

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
8 months agoAsciidoctor: Create HTML/PDF with TOC level 5
Alexander Kriegisch [Sat, 16 Mar 2024 09:21:34 +0000 (10:21 +0100)]
Asciidoctor: Create HTML/PDF with TOC level 5

The default is 2 in Asciidoctor. A higher TOC level enables developers
and users to post more precise deep-links into docs. In PDF versions, it
is also easier now to navigate from the TOC to a specific subchapter.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
8 months agoRemove lib/jdtcore-aj
Alexander Kriegisch [Fri, 15 Mar 2024 17:16:02 +0000 (18:16 +0100)]
Remove lib/jdtcore-aj

If any of the old Ant builds, e.g. tests/profiling/build.xml, which
have never been mavenised, need JDT Core, they should be converted to
Maven builds and refer to it as a regular dependency. As is, the Ant
builds would not run anyway, because other dependency locations have
changed as well.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
8 months agoRemove lib/jarjar
Alexander Kriegisch [Fri, 15 Mar 2024 13:12:54 +0000 (14:12 +0100)]
Remove lib/jarjar

The jarjar library seems to be unused.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
8 months agoRemove lib/regexp
Alexander Kriegisch [Fri, 15 Mar 2024 12:54:08 +0000 (13:54 +0100)]
Remove lib/regexp

The library seems to be unused.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
8 months agoRemove bcel-builder/verifier-src
Alexander Kriegisch [Fri, 15 Mar 2024 12:41:59 +0000 (13:41 +0100)]
Remove bcel-builder/verifier-src

It looks as if the source code is never built and never used either.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
8 months agoReactivate test in AtAjAnnotationGenTests
Alexander Kriegisch [Fri, 15 Mar 2024 13:00:48 +0000 (14:00 +0100)]
Reactivate test in AtAjAnnotationGenTests

In AtAjAnnotationGenTests.testRuntimePointcutsReferencingCompiledPointcuts,
the classpath issues mentioned in the comments do not seem to exist
anymore, with or without the removed lib/bcel/bcel.jar.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
8 months agoRemove BCEL files from 'lib' module
Alexander Kriegisch [Fri, 15 Mar 2024 12:39:04 +0000 (13:39 +0100)]
Remove BCEL files from 'lib' module

Both bcel.jar and bcel-verifier.jar seem to be obsolete.

Possible next step: Remove bcel-builder/verifier-src.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
8 months agoRemove Apache Commons from 'lib' module, update remaining dependencies
Alexander Kriegisch [Fri, 15 Mar 2024 11:17:48 +0000 (12:17 +0100)]
Remove Apache Commons from 'lib' module, update remaining dependencies

Of beanutils, collections, digester and logging actually only digester
and logging are directly used in AspectJ code. Therefore, remove the
unused ones and upgrade the remaining libraries' versions to ones which
also have source JARs on Maven Central. This makes downloading sources
from GitHub and packaging separate commons.jar and commons-src.zip
artifacts superfluous. Hence, we can get rid of them completely.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
8 months agoThrow exception for minimal AJC runtime version violation
Alexander Kriegisch [Fri, 15 Mar 2024 08:20:21 +0000 (09:20 +0100)]
Throw exception for minimal AJC runtime version violation

When running AJC, throw an AbortException(MINIMAL_JRE_VERSION) instead
of just logging an error, if the minimal JRE version requirement is
violated. Otherwise, in-process compilation would not fail due to the
skipped System.exit(-1) that was used before. In-process compilation is,
for example, relevant for AspectJ Maven Plugin, but also for non-forked
executions of Plexus AspectJ via Maven Compiler.

I am not 100% sure that AbortException is the appropriate exception
type, because it was designed for an aborted compilation process and
here compilation has not even started yet, but it seems to work fine.

Relates to #269.
Fixes #292.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
8 months agoAdd links for AspectJ 1.9.21.2
Alexander Kriegisch [Wed, 13 Mar 2024 09:17:17 +0000 (10:17 +0100)]
Add links for AspectJ 1.9.21.2

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
8 months agoSet version to 1.9.22-SNAPSHOT
Alexander Kriegisch [Wed, 13 Mar 2024 08:51:34 +0000 (09:51 +0100)]
Set version to 1.9.22-SNAPSHOT

8 months agoRelease AspectJ 1.9.21.2 V1_9_21_2
Alexander Kriegisch [Wed, 13 Mar 2024 08:48:26 +0000 (09:48 +0100)]
Release AspectJ 1.9.21.2

8 months agoAdd release notes for AspectJ 1.9.21.2
Alexander Kriegisch [Wed, 13 Mar 2024 08:20:55 +0000 (09:20 +0100)]
Add release notes for AspectJ 1.9.21.2

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
8 months agoAvoid ThreadLocal memory leak in JoinPointImpl
Alexander Kriegisch [Sat, 2 Mar 2024 10:52:31 +0000 (11:52 +0100)]
Avoid ThreadLocal memory leak in JoinPointImpl

according to https://rules.sonarsource.com/java/tag/leak/RSPEC-5164/.
Now, there no longer is a thread-local stack of AroundClosure instances,
but rather a list of them, which can only grow but never shrink.
Instead, we now have a thread-local (integer) list index, for every
thread being initialised with pointing to the last element. I.e., every
thread can unwind by decrementing the index while proceeding,
independently of other threads.

A positive side effect is that this approach also works for long-lived
threads from thread pools, used by executor services. Hence, test
Bugs199Tests.testAsyncProceedNestedAroundAdviceThreadPool_gh128, which
was previously commented out, has been activated and passes, see #141.

I am not sure if this brings @AspectJ style, non-inlined, nested around
advice execution functionally on par with native ones, but at least for
current scenarios it seems to work.

Fixes #288, #141.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
8 months agoAdd regression tests for inheritable thread-local memory leak
Alexander Kriegisch [Wed, 6 Mar 2024 14:27:50 +0000 (15:27 +0100)]
Add regression tests for inheritable thread-local memory leak

Leak was introduced in commit 3c80a36527, fixing #128, but introducing
#288 instead, which was the lesser of two evils, but still bad for some
users unwilling to use native AspectJ syntax for their aspects, avoiding
the problem.

Relates to #288.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
8 months agoAjcTestCase: Improve forked JVM parameter handling
Alexander Kriegisch [Wed, 6 Mar 2024 15:48:29 +0000 (16:48 +0100)]
AjcTestCase: Improve forked JVM parameter handling

- Recognise more "fork-worthy" JVM parameters
- Pass on program arguments to program in forked JVM

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
8 months agoImproved fix for #285
KimmingLau [Wed, 28 Feb 2024 03:50:59 +0000 (11:50 +0800)]
Improved fix for #285

1. Write SAME_BYTES to cacheMap when woven bytes are null
2. Fix TODO in SimpleCache::getAndInitialize, using Optional to help
   indicate cache hit for unwoven class
3. Improve test coverage (cache miss, cache hit for unwoven class)

Relates to #285.

Co-authored-by: Alexander Kriegisch <Alexander@Kriegisch.name>
Signed-off-by: KimmingLau <294001791@qq.com>
Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
8 months agoImprove unwoven class file handling in SimpleCache
Alexander Kriegisch [Sat, 2 Mar 2024 08:44:03 +0000 (09:44 +0100)]
Improve unwoven class file handling in SimpleCache

Also update lib/aspectj/aspectjweaver.jar to fix integration tests.

Fixes #285.

Co-authored-by: Kimming Lau <294001791@qq.com>
Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
8 months agoAdd Bugs1921Tests::testGitHub_285
Alexander Kriegisch [Sat, 2 Mar 2024 08:08:48 +0000 (09:08 +0100)]
Add Bugs1921Tests::testGitHub_285

This is an additional reproducer for regression bug #285.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
8 months agoFix: AllTestsAspectJ171 runs correct NewFeatures suite
Alexander Kriegisch [Sat, 2 Mar 2024 09:01:49 +0000 (10:01 +0100)]
Fix: AllTestsAspectJ171 runs correct NewFeatures suite

While fixing #285, I noticed that *.ajc171.NewFeatures was never
executed as part of the AspectJ test suite, because since 2012 falsely
*.ajc1610.NewFeatures was imported and executed a second time instead.
In addition to an outdated AspetJ weaver library in 'lib', this was one
more factor why the regression bug was never spotted.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
8 months agoBump AspectJ libraries in 'lib' subfolders to 1.9.21.1
Alexander Kriegisch [Sat, 2 Mar 2024 07:57:44 +0000 (08:57 +0100)]
Bump AspectJ libraries in 'lib' subfolders to 1.9.21.1

This reproduces regression bug #285 when running
org.aspectj.systemtest.ajc171.NewFeatures::testSharedCache.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
8 months agoFurther improve '-xmlConfigured' docs
Alexander Kriegisch [Sat, 24 Feb 2024 01:30:25 +0000 (08:30 +0700)]
Further improve '-xmlConfigured' docs

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
8 months agoAdd link to JDK-8326483 for "generated by javadoc (n)" issue
Alexander Kriegisch [Sat, 24 Feb 2024 01:06:48 +0000 (08:06 +0700)]
Add link to JDK-8326483 for "generated by javadoc (n)" issue

https://bugs.openjdk.org/browse/JDK-8326483
Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
9 months agoRephrase docs for WeavingXmlConfig::excludesType
Alexander Kriegisch [Fri, 23 Feb 2024 10:43:47 +0000 (17:43 +0700)]
Rephrase docs for WeavingXmlConfig::excludesType

and turn into javadoc.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
9 months agoFix typos: '-xmlConfigured', not '-xmlConfig'
Alexander Kriegisch [Thu, 22 Feb 2024 03:42:17 +0000 (10:42 +0700)]
Fix typos: '-xmlConfigured', not '-xmlConfig'

Also reformat compiler usage page to adhere to 80-character limit again.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
9 months agoajc.adoc: Fix typo ('-xmlConfigured', not '-xmlConfig')
Alexander Kriegisch [Thu, 22 Feb 2024 03:40:59 +0000 (10:40 +0700)]
ajc.adoc: Fix typo ('-xmlConfigured', not '-xmlConfig')

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
9 months agoajc.adoc: Cosmetic improvements
Alexander Kriegisch [Thu, 22 Feb 2024 03:24:56 +0000 (10:24 +0700)]
ajc.adoc: Cosmetic improvements

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
9 months agoajc.adoc: Update '-source', '-target', '-<version>'
Alexander Kriegisch [Thu, 22 Feb 2024 03:24:39 +0000 (10:24 +0700)]
ajc.adoc: Update '-source', '-target', '-<version>'

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
9 months agoDocument AJC option '-xmlConfigured'
Alexander Kriegisch [Thu, 22 Feb 2024 03:20:45 +0000 (10:20 +0700)]
Document AJC option '-xmlConfigured'

- Add short description to AJC usage message via
  messages_aspectj.properties
- Add longer description to ajc.adoc in the AspectJ Development
  Environment Guide

Closes https://bugs.eclipse.org/bugs/show_bug.cgi?id=455014.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
9 months agoAdd Ajc164Tests::testMultipleXMLFiles
Alexander Kriegisch [Wed, 21 Feb 2024 03:35:44 +0000 (10:35 +0700)]
Add Ajc164Tests::testMultipleXMLFiles

While researching how and what to document for AJJ option
'-xmlConfigured', I needed to find out what happens in case of multiple
XML config files. Result: They are merged. the new test case for the old
1.6.4 release verifies and documents that. It can also serve as an
example for reference in case of user questions.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
9 months agoExtend documentation for Antrun execution to fix javadocs
Alexander Kriegisch [Wed, 21 Feb 2024 02:16:19 +0000 (09:16 +0700)]
Extend documentation for Antrun execution to fix javadocs

Also update the internal review ID of the OpenJDK bug I created, because
previously I had created a feature request, which has remained
unanswered. But actually, I think it is rather a regression bug, having
found out that before JDK 16 the behaviour was exactly how the feature
request describes it.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
9 months agoNew abstract class JavaVersionSpecificXMLBasedAjcTestCase
Alexander Kriegisch [Mon, 19 Feb 2024 15:01:05 +0000 (22:01 +0700)]
New abstract class JavaVersionSpecificXMLBasedAjcTestCase

Replaces now obsolete base classes
  - XMLBasedAjcTestCaseForJava[n]OrLater,
  - XMLBasedAjcTestCaseForJava[n]Only.

The new class is parametrised with minimum and maximum Java version and
hence can replace all the other classes. This does not only apply the
DRY principle, but also makes adding tests for new Java versions less
tedious.

By chance, I also noticed missing sanity tests for Java 12, which I
added as a little drive-by benefit.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
9 months agoReformat and slightly refactor AjcTaskTest
Alexander Kriegisch [Mon, 19 Feb 2024 08:59:16 +0000 (15:59 +0700)]
Reformat and slightly refactor AjcTaskTest

I was looking at this test for another reason and thought, it might be a
good idea to make it a little bit more compact and re-indent it.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
9 months agoAjcTask: make version number arrays more generic
Alexander Kriegisch [Mon, 19 Feb 2024 07:03:31 +0000 (14:03 +0700)]
AjcTask: make version number arrays more generic

SOURCE_INPUTS, TARGET_INPUTS, COMPLIANCE_INPUTS are now populated in a
'for' loop in a static initialiser block. I.e., adding support for a new
Java version is now as simple as incrementing field JAVA_VERSION_MAX. In
case ECJ raises the minimum supporter compiler source/target version,
field JAVA_VERSION_MIN needs to be incremented. But that should happen
less frequently.

This was done to make the 'AspectJ_JDK_Update' tasks as easy and as
little error-prone as possible.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
9 months agoRemove most MINOR_*, MINOR_* BCEL class file versions
Alexander Kriegisch [Mon, 19 Feb 2024 06:19:49 +0000 (13:19 +0700)]
Remove most MINOR_*, MINOR_* BCEL class file versions

in favour of Constants.ClassFileVersion.of(int, int). The few ones
retained are used from production code, the vast majority of removed
ones only from test code.

This gets rid of yet another 'AspectJ_JDK_Update' tag. One less place to
check and update with each newly supported Java version. :-)

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
9 months agoLangUtil: remove methods like 'is11VMOrGreater', 'is1dot5VMOrGreater'
Alexander Kriegisch [Mon, 19 Feb 2024 03:22:10 +0000 (10:22 +0700)]
LangUtil: remove methods like 'is11VMOrGreater', 'is1dot5VMOrGreater'

Replace them by a uniform method 'isVMGreaterOrEqual(double)', also
overloaded for int.

This gets rid of one 'AspectJ_JDK_Update' tag. One less place to check
and update with each newly supported Java version. :-)

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
9 months agoAdd 'AspectJ_JDK_Update' hint in various places
Alexander Kriegisch [Mon, 19 Feb 2024 02:41:18 +0000 (09:41 +0700)]
Add 'AspectJ_JDK_Update' hint in various places

The hint is meant to help AspectJ developers identify the places where
there are to-dos for releases supporting new Java versions. This is work
in progress, new tags can be added wherever necessary in the future. But
for now, the most important places should be covered:

 - AJC version string
 - Test infrastructure (test suites, classes and XML files)
 - BCEL class file version MAJOR_*, MINOR_* constants
 - AjcTask constants for compiler source, target, release
 - LangUtil::is*VMOrGreater methods
 - ASM and JDT Core dependency versions
 - CI workflow file
 - Release notes

The to-do to check the tagged places is also mentioned in RELEASE.md.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
9 months agoSuppress Maven download messages in CI build
Alexander Kriegisch [Mon, 19 Feb 2024 01:06:04 +0000 (08:06 +0700)]
Suppress Maven download messages in CI build

by SLF4J system property, see
https://blogs.itemis.com/en/in-a-nutshell-removing-artifact-messages-from-maven-log-output

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
9 months agoRephrase "check the diffs before committing" section
Alexander Kriegisch [Sat, 17 Feb 2024 05:50:55 +0000 (12:50 +0700)]
Rephrase "check the diffs before committing" section

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
9 months agoRun Antrun post-javadoc task depending on Javadoc execution
Alexander Kriegisch [Sat, 17 Feb 2024 04:55:26 +0000 (11:55 +0700)]
Run Antrun post-javadoc task depending on Javadoc execution

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
9 months agoUpdate RELEASE.md
Alexander Kriegisch [Sat, 17 Feb 2024 04:41:00 +0000 (11:41 +0700)]
Update RELEASE.md

- Remove obsolete section "Deploying the AspectJ installer to
  aspectj.dev", because we are publishing releases on GitHub, attaching
  installers to them.

- Add section "Publish documentation on website".

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
9 months agoMinor POM cosmetics
Alexander Kriegisch [Sat, 17 Feb 2024 04:38:17 +0000 (11:38 +0700)]
Minor POM cosmetics

One less warning in IntelliJ due to the entirely optional groupId for
that plugin, but IntelliJ still complains.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
9 months agoUse Antrun plugin to eliminate javadoc version number in HTML
Alexander Kriegisch [Sat, 17 Feb 2024 04:37:08 +0000 (11:37 +0700)]
Use Antrun plugin to eliminate javadoc version number in HTML

This is the one issue that cannot be solved regarding reproducible
builds by setting javadoc options, because that header comment is
hard-coded into the JDK with no option to avoid it. I just created an
OpenJDK issue (internal review ID 9076583, not published yet) for it,
but that does not help us today.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
9 months agoMaven Javadoc: Add options for reproducible build artifacts
Alexander Kriegisch [Sat, 17 Feb 2024 04:33:23 +0000 (11:33 +0700)]
Maven Javadoc: Add options for reproducible build artifacts

and smaller diffs when committing changes to the website,avoiding
timestamps, changing current copyright years, artifact versions.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
9 months agoBump Maven Javadoc to 3.6.3
Alexander Kriegisch [Sat, 17 Feb 2024 04:28:24 +0000 (11:28 +0700)]
Bump Maven Javadoc to 3.6.3

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
9 months agoSuppress "unresolved Maven property" warning in IntelliJ for 'maven.gpg
Alexander Kriegisch [Sat, 17 Feb 2024 04:26:08 +0000 (11:26 +0700)]
Suppress "unresolved Maven property" warning in IntelliJ for 'maven.gpg
.skip'

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
9 months agoReproducible builds: set project.build.outputTimestamp
Alexander Kriegisch [Sat, 17 Feb 2024 04:24:26 +0000 (11:24 +0700)]
Reproducible builds: set project.build.outputTimestamp

See https://maven.apache.org/guides/mini/guide-reproducible-builds.html.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
9 months agoRemove obsolete stuff from module 'build' and lib/build
Alexander Kriegisch [Fri, 16 Feb 2024 04:08:32 +0000 (11:08 +0700)]
Remove obsolete stuff from module 'build' and lib/build

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
9 months agoAdd decade 2020-2029 to copyright years in Checklics
Alexander Kriegisch [Fri, 16 Feb 2024 03:58:20 +0000 (10:58 +0700)]
Add decade 2020-2029 to copyright years in Checklics

FWIW, I just wanted to know if the tests in module 'build' would still
pass. They did not find copyrights for more recent years, so I added
them here.

But I am still unsure, if we need these tests at all. Obviously, they
were not running during CI builds, i.e. they seem to be non-essential.
But chances are, they were forgotten to be added to the suite.

BTW, running the tests in module 'build' with '-Drun.build.tests=true'
is failing, too, because some old JDK classes looked up there no longer
exist in more recent JDKs.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
9 months agoAvoid "Last updated [timestamp]" footer on each docs page
Alexander Kriegisch [Thu, 15 Feb 2024 12:34:26 +0000 (19:34 +0700)]
Avoid "Last updated [timestamp]" footer on each docs page

Set Asciidoctor option 'nofooter' to avoid the annoying timestamps. It
makes updating the website difficult, because always there are "changes"
in each file. Diffing real changes in generated files for the website
before committing becomes difficult. Furthermore, the user does not have
any immediate benefit for most documents, as they change infrequently or
never (e.g. old release notes).

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
9 months agoMention release 1.9.21.1 in overview pages
Alexander Kriegisch [Thu, 15 Feb 2024 11:43:02 +0000 (18:43 +0700)]
Mention release 1.9.21.1 in overview pages

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
9 months agoAdd missing release notes for 1.8.12, 1.8.13, 1.8.14
Alexander Kriegisch [Thu, 15 Feb 2024 11:38:48 +0000 (18:38 +0700)]
Add missing release notes for 1.8.12, 1.8.13, 1.8.14

I found those in HTML only on the Eclipse web server, but not in the Git
repository. So, I manually converted them to ADOC.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
9 months agoAdd Git .mailmap file
Alexander Kriegisch [Thu, 15 Feb 2024 06:42:36 +0000 (13:42 +0700)]
Add Git .mailmap file

Mapping file for Git committers, mapping e-mail addresses to names for
'git shortlog -sne'. See https://git-scm.com/docs/gitmailmap.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
9 months agoGlobally replace "http:" by "https:" in non-XML files
Alexander Kriegisch [Thu, 15 Feb 2024 02:36:18 +0000 (09:36 +0700)]
Globally replace "http:" by "https:" in non-XML files

Maybe, the XML files and Maven wrapper files will follow. First, let us
find out if this breaks the build, maybe some tests are asserting on
"http:". But there, the replacement would also have taken place, so
probably it just works.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
9 months agoRemove noise from aspectj_1_5_0.dtd
Alexander Kriegisch [Thu, 15 Feb 2024 02:21:45 +0000 (09:21 +0700)]
Remove noise from aspectj_1_5_0.dtd

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
9 months agojoinpointsignatures.adoc: minor formatting cosmetics
Alexander Kriegisch [Thu, 15 Feb 2024 02:00:06 +0000 (09:00 +0700)]
joinpointsignatures.adoc: minor formatting cosmetics

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
9 months agoReplace links to https://www.eclipse.org/aspectj/doc/next
Alexander Kriegisch [Thu, 15 Feb 2024 01:59:28 +0000 (08:59 +0700)]
Replace links to https://www.eclipse.org/aspectj/doc/next

This part of the website is outdated and will be deleted. Instead, link
to ADOCs right in the GitHub repository.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
9 months agoFix some docs links
Alexander Kriegisch [Wed, 14 Feb 2024 04:27:59 +0000 (11:27 +0700)]
Fix some docs links

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
9 months agoSet version to 1.9.22-SNAPSHOT
Alexander Kriegisch [Wed, 14 Feb 2024 02:27:32 +0000 (09:27 +0700)]
Set version to 1.9.22-SNAPSHOT

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
9 months agoRelease 1.9.21.1 V1_9_21_1
Alexander Kriegisch [Wed, 14 Feb 2024 02:24:11 +0000 (09:24 +0700)]
Release 1.9.21.1

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
9 months agoRelease notes for 1.9.21.1
Alexander Kriegisch [Wed, 14 Feb 2024 02:07:09 +0000 (09:07 +0700)]
Release notes for 1.9.21.1

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