aboutsummaryrefslogtreecommitdiffstats
path: root/org.aspectj.matcher
Commit message (Collapse)AuthorAgeFilesLines
* Fixes #323: UnresolvedType#getDimensions uses uncompiled regex, resulting in ↵HEADmasterAndrew Clement14 days1-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
* Fix for GH328 - problem with generating supporting code for inline method accessAndrew Clement2025-03-211-3/+12
| | | | | | | | | | | | | | 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
* Set versions to AspectJ 1.9.24-SNAPSHOTAndrew Clement2025-03-131-1/+1
|
* Set pom versions to 1.9.23 for releaseV1_9_23Andrew Clement2025-03-131-1/+1
|
* Add Java23 supportAndrew Clement2025-03-071-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.


* Set version to 1.9.23-SNAPSHOTAlexander Kriegisch2024-05-111-1/+1
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Release AspectJ 1.9.22.1V1_9_22_1Alexander Kriegisch2024-05-111-1/+1
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Minor code cosmeticsAlexander Kriegisch2024-04-131-6/+4
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Further streamline BCExceptionAlexander Kriegisch2024-04-121-40/+6
| | | | | | | | - 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>
* 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>
* 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>
* Set version to 1.9.23-SNAPSHOTAlexander Kriegisch2024-03-231-1/+1
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Release AspectJ 1.9.22Alexander Kriegisch2024-03-231-1/+1
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Remove Apache Commons from 'lib' module, update remaining dependenciesAlexander Kriegisch2024-03-151-1/+1
| | | | | | | | | | | 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>
* Set version to 1.9.22-SNAPSHOTAlexander Kriegisch2024-03-131-1/+1
|
* Release AspectJ 1.9.21.2V1_9_21_2Alexander Kriegisch2024-03-131-1/+1
|
* LangUtil: remove methods like 'is11VMOrGreater', 'is1dot5VMOrGreater'Alexander Kriegisch2024-02-193-3/+3
| | | | | | | | | | 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>
* Globally replace "http:" by "https:" in non-XML filesAlexander Kriegisch2024-02-151-1/+1
| | | | | | | | | 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>
* Replace links to https://www.eclipse.org/aspectj/doc/nextAlexander Kriegisch2024-02-151-4/+4
| | | | | | | 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>
* Set version to 1.9.22-SNAPSHOTAlexander Kriegisch2024-02-141-1/+1
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Release 1.9.21.1V1_9_21_1Alexander Kriegisch2024-02-141-1/+1
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Globally replace HTTP links to eclipse.org by HTTPSAlexander Kriegisch2024-01-061-4/+4
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Set version to 1.9.21.1-SNAPSHOTAlexander Kriegisch2023-12-151-1/+1
| | | | | | | Currently, the situation looks more like a Java 21 maintenance release than directly a Java 22 release. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Set version to 1.9.22-SNAPSHOTAlexander Kriegisch2023-12-111-1/+1
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Release AspectJ 1.9.21V1_9_21Alexander Kriegisch2023-12-111-1/+1
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Set version to 1.9.21-SNAPSHOT againAlexander Kriegisch2023-12-021-1/+1
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Release candidate 1.9.21.RC1V1_9_21_RC1Alexander Kriegisch2023-12-021-1/+1
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Set version 1.9.21-SNAPSHOTAlexander Kriegisch2023-11-191-1/+1
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Release milestone 1.9.21.M1V1_9_21_M1Alexander Kriegisch2023-11-191-1/+1
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Remove old '.cvsignore' filesAlexander Kriegisch2023-09-271-2/+0
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Set version to 1.9.21-SNAPSHOTAlexander Kriegisch2023-09-041-1/+1
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* AspectJ release 1.9.20.1Alexander Kriegisch2023-09-041-1/+1
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* NotTypePattern: Fix matching problem for negated type patternsAlexander Kriegisch2023-08-231-1/+6
| | | | | | | | | | | | | | | 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>
* Fix Spring issue 27761Alexander Kriegisch2023-08-211-1/+1
| | | | | | | | | | 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>
* Set version to 1.9.21-SNAPSHOTAlexander Kriegisch2023-08-161-1/+1
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Release 1.9.20V1_9_20Alexander Kriegisch2023-08-161-1/+1
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Add method ArrayReferenceType.equals to fix failing testsAlexander Kriegisch2023-06-261-0/+8
| | | | | | | | | | | 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>
* Add null checks for Shadow.getResolvedSignature()Alexander Kriegisch2023-06-131-3/+5
| | | | | | Fixes #243. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Add safeguards for And/Or/Not pattern node typesAlexander Kriegisch2023-01-299-15/+30
| | | | | | | | Affects *PointCut, *TypePattern, *AnnotationTypePattern. Relates to #215. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Add traverse methods for declare and pattern typesAlexander Kriegisch2023-01-2911-4/+86
| | | | | | Relates to #215. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Add traverse methods for pointcut typesAlexander Kriegisch2023-01-2916-0/+130
| | | | | | Relates to #215. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>