aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Fix more "Attempt to push null on operand stack" variantsHEADmasterAndrew Clement2025-04-157-8/+54
| | | | | | | | | | | | This change fixes more cases in the *Declaration classes that generate code. Both #336 and #337 are due to the same piece of code not correctly computing the resolved position because of copying it from a source method when it needs recomputing for the method being generated. In particular primitive types and/or double slot types (like long or double) cause the code to miscompute the resolved positions or set the wrong type of expected type on the stack. Fixes #336 Fixes #337
* Move to 1.9.25-SNAPSHOT buildsAndrew Clement2025-04-1328-29/+29
|
* 1.9.24 releaseV1_9_24Andrew Clement2025-04-1028-29/+29
|
* Adapt to 1.9.24 release of AspectJ Eclipse JDT Compiler variantAndrew Clement2025-04-0948-273/+1206
|
* Fixes #323: UnresolvedType#getDimensions uses uncompiled regex, resulting in ↵Andrew Clement2025-03-251-2/+8
| | | | | | | | | | | | | | 97% of memory allocated in Pattern.compile I say 'fixes' but all I did was use a different implementation. I don't have a testcase that gives the memory problem but the new implementation doesn't use Pattern so it can't give the same behaviour. Perhaps Pattern matching is better for some situation I'm unaware of but my microbenchmarks on this approach seem to suggest it is much faster and the tests all seem to pass. Fixes #323
* Fixes #326: ClassCastException: class ParameterizedTypeBinding cannot be ↵Andrew Clement2025-03-2510-1/+123
| | | | | | | | | cast to class SourceTypeBinding Modified EclipseResolvedMember such that if it finds it is dealing with a ParameterizedTypeBinding it resolves it to the base type binding before attempting the cast. Testcode added. Fixes #326
* Fixed #327 - Attempt to push null on operand stackAndrew Clement2025-03-249-9/+137
| | | | | | | | | | | | | | | | | This change adds tests for multiple related scenarios where the code generation was not including correct variable information, leading to these 'push null' problems. The new trackers for stack/variable usage when working with recent versions of Java are more careful in that it is not possible to manipulate stack/variable entries if they have not been previously described to the system. The Xwiki issue here uncovered two but there were a number of routes through the same method that needed testing and fixing (for example the code takes a different path for static vs non-static and private vs non-private). A snapshot build with these changes in seems to pass the Xwiki build process. Fixes #327
* Fix for GH328 - problem with generating supporting code for inline method accessAndrew Clement2025-03-218-10/+76
| | | | | | | | | | | | | | The Eclipse compiler has become more strict and we need to be informing the code generator about variables before we use them otherwise it will not allow them to be manipulated (even though they are there in the bytecode). This fixes ensures sensible names are passed through from the original point where the inline access method is created all the way to the method binding that the generator is inspecting. These can then be used to inform the code generator. This seems preferable to creating simply fake entries on the backend. Fixes #328
* Fix formatting for listAndrew Clement2025-03-131-12/+12
|
* Set versions to AspectJ 1.9.24-SNAPSHOTAndrew Clement2025-03-1328-32/+30
|
* Set pom versions to 1.9.23 for releaseV1_9_23Andrew Clement2025-03-1328-31/+33
|
* Add more correct dateAndrew Clement2025-03-101-1/+1
|
* Add Java 23 to listAndrew Clement2025-03-101-1/+1
|
* Add readme to indexAndrew Clement2025-03-071-0/+1
|
* Readme for 1.9.23Andrew Clement2025-03-072-3/+81
|
* Add Java23 supportAndrew Clement2025-03-07224-3228/+3857
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The huge change with adopting Java23 is that 1.1 > 1.7 Java are now considered unsupported by Eclipse JDT, so the many thousands of tests we have that were specifying java versions lower than 1.8 were all failing with an unsupported version error. All those tests have had their versions bumped to 1.8.

That is why this commit includes so many changes. For example where we were specifying 1.5 - which was the case for many many generics/annotations tests, that is now 1.8. Also, some tests have been deleted because they make no sense now (verifying expected errors on Java 1.4 for example, errors that just can’t happen with minimum Java level 1.8). The biggest impact to tests was when bumping above 1.4 compliance suddenly there were 100s of adviceDidNotMatch messages. Some of these messages were actual indications of bad expectations in the test but many of them were just to-be-expected and were fixed either via an -Xlint:ignore option in the test spec or a SuppressAjWarnings in the test source.

One or two tests actually revealed real bugs that just didn’t surface with lower level java versions specified. A bare minimum of real Java 23 tests have been added just to get this sanity tested and committed. More would ideally be added. Other notable changes due to Eclipse JDT changes: org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/*.java Changes in here because there are now more validations on the code generator methods we were calling. Now you can’t start manipulating variables without having declared them as proper local variables, so those extra calls to define them have been added.
 org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom With needing to bump up the java versions, these classes had to be brought up to date with AST.JLS20 rather than only supporting versions 2/3. This was mostly copying patterns for the Eclipse classes.


* Update documentation links in README.mdAlexander Kriegisch2025-01-211-4/+7
| | | | | | Some links should point to eclipse.dev/aspectj/doc/latest/ rather than link to GitHub pages. Closes #321.
* Set version to 1.9.23-SNAPSHOTAlexander Kriegisch2024-05-1128-28/+28
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Release AspectJ 1.9.22.1V1_9_22_1Alexander Kriegisch2024-05-1132-28/+28
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Add 1.9.22.1 release notesAlexander Kriegisch2024-05-113-2/+38
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* ClasspathManagerTestCase cosmeticsAlexander Kriegisch2024-04-261-132/+132
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Improve ClassPathManager performance, caching unfound entriesRic Harris2024-04-261-12/+21
| | | | | | | Fixes #306 and adds a few small optimisations. Co-authored-by: Alexander Kriegisch <Alexander@Kriegisch.name> Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Add ClasspathManagerTestCase::testUnfoundClassPerformanceAlexander Kriegisch2024-04-261-1/+28
| | | | | | | Performance regression test for #306, failing before the enhancement and passing afterward. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* IDE.md: Remove old repo.t5.fi M2E update sites, add two more aspectj.devAlexander Kriegisch2024-04-171-5/+4
| | | | | | | | | ones after Miika Vesti provided copies of the old plugin versions. Thanks, Miika. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Use aspect file/line matching for weave messages in some testsAlexander Kriegisch2024-04-132-12/+12
| | | | | | | | | | | | | | | Instead of creating dedicated ITs for #218, just use the new matching capabilities like this for good measure: <message kind="weave" aspectFile="MyAspect.java" aspectLine="8" .../> Tests affected: - Ajc165Tests::testFunkyPointcut_pr272233_2 - Bugs1920Tests::test_GitHub_214 Relates to #218. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* BcelObjectType: Add experimental code to set source file name forAlexander Kriegisch2024-04-131-4/+13
| | | | | | | | | | | | | reference Experimental code leading to undesired ripple effects elsewhere, requiring more rework which now I do not feel inclined to invest to perfect source file string representation for post-compile binary classes and aspects. Relates to #218. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Minor code cosmeticsAlexander Kriegisch2024-04-134-9/+7
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Fix expected weave messages after previous changesAlexander Kriegisch2024-04-136-130/+142
| | | | | | | | Remove leading "weaveInfo", add missing "see also:" to weave messages. Relates to #218. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Implement source location matching for weave messages in XML testsAlexander Kriegisch2024-04-138-63/+166
| | | | | | | | WIP (work in progress). Closes #218. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Improve Ajc165Tests.testFunkyPointcut_pr272233_2Alexander Kriegisch2024-04-122-40/+62
| | | | | | | 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>
* Further streamline BCExceptionAlexander Kriegisch2024-04-122-40/+16
| | | | | | | | - 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>
* Improve stack trace printing in BCExceptionAlexander Kriegisch2024-04-121-7/+10
| | | | | | | | | | | - 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>
* Make Ajc165Tests.testFunkyPointcut_pr272233_2 passAlexander Kriegisch2024-04-121-0/+1
| | | | | | | | | 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>
* New Xlint warning 'arrayCannotBeVoid' when resolving 'void[]'Alexander Kriegisch2024-04-124-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* UnresolvedType.signatureToName: fix '*' case for generic type '?'Alexander Kriegisch2024-04-121-1/+1
| | | | | | | | | | | | | | | | | | 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>
* WildTypePattern: match generic type params correctly for array typesAlexander Kriegisch2024-04-121-1/+8
| | | | | | | For array reference types, match type parameters on component type, not on array type itself. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* WildTypePattern.toString: do not parenthesesise generic type listAlexander Kriegisch2024-04-121-1/+1
| | | | | | | | | | | 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>
* SignaturePattern.TypePatternVisitor: remove redundant visit methodAlexander Kriegisch2024-04-121-6/+0
| | | | | | | | | 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>
* SignaturePattern: minor structural refactoringAlexander Kriegisch2024-04-121-37/+37
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* SignaturePattern: Add exception for meta annotationsAlexander Kriegisch2024-04-121-19/+19
| | | | | | | | | | | | | 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>
* Lint: minor structural refactoringAlexander Kriegisch2024-04-121-56/+36
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Fix test after node traversal was improvedAlexander Kriegisch2024-04-123-4/+5
| | | | | | | | | | | | | | | | | | 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>
* UnresolvedType: fix JVM signature conversionAlexander Kriegisch2024-04-122-3/+3
| | | | | | | | | | | | | 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>
* Enable type parameter traversal in exact type patternsAlexander Kriegisch2024-04-129-19/+49
| | | | | | Closes #221 Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* JoinPointImpl minor structural refactoringAlexander Kriegisch2024-04-101-89/+79
| | | | | | No functionality was changed. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* JoinPointImpl: Remove thread-locals after usage, where possibleKimmingLau2024-04-101-1/+5
| | | | | | | | | | | | | | | | | 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>
* Add IT reproducing JoinPointImpl thread-locals memory leakAlexander Kriegisch2024-04-106-2/+146
| | | | | | Relates to #302. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* IDE.md: update M2E connector info for aspectj.dev update siteAlexander Kriegisch2024-04-091-5/+21
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Revert WeavingAdaptor generated class map optimisationAlexander Kriegisch2024-04-082-2/+11
| | | | | | | | | | | | | | 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>
* SimpleCache: structural refactoring, better docsAlexander Kriegisch2024-04-081-117/+130
| | | | | | | | - 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>