aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Added MIll to the Build tools sectionTobias Roeser2023-03-031-0/+6
| | | | | 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.
* JavaVersionCompatibility.md: add Java 19Alexander Kriegisch2023-03-011-0/+1
|
* IDE.md: add link to m2e AJDT connector for Eclipse 2022-12Alexander Kriegisch2023-03-011-0/+1
| | | | 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.
* IDE.md: Add new AJDT update site for 2022-12 (4.26)Alexander Kriegisch2023-02-281-0/+1
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Depend on JDT Core 1.9.20.M1Alexander Kriegisch2023-02-281-1/+1
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* HandleProviderDelimiter: rename JEM_MODULAR_CLASSFILE to MODULAR_CLASSFILEAlexander Kriegisch2023-02-281-1/+1
| | | | | | The other constants do not have the JEM_ prefix from JavaElement either. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Sync HandleProviderDelimiter with JDT Core & AJDTAlexander Kriegisch2023-02-2631-289/+311
| | | | | | | | | | | | | | | | | | | | | | 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>
* 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>
* Further improve indentation of compilation results on the consolegh-217Alexander Kriegisch2023-01-241-33/+21
| | | | | | | | | | | | | | | | | | | | 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>
* Fix indentation of compilation results on the consoleAlexander Kriegisch2023-01-222-55/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Bugfix: caret error marks in compiler output too shortAlexander Kriegisch2023-01-221-53/+70
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Fix GitHub #214Alexander Kriegisch2023-01-211-1/+1
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Add regression test reproducing GitHub #214Alexander Kriegisch2023-01-217-0/+68
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Comment on newly pointcut parsing found problem in test classAlexander Kriegisch2023-01-152-0/+27
| | | | | | | | | | | | 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>
* Fix failing tests after previous commitAlexander Kriegisch2023-01-154-23/+35
| | | | | | | | | 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>
* Remove old, erroneously committed binaries from tests/bugs193/543657Alexander Kriegisch2023-01-159-0/+0
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Fix PointcutRewriterTest, add LogicalPointcutStructure test helper classAlexander Kriegisch2023-01-152-169/+360
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* WildTypePattern: fix hashCode and toString methodsAlexander Kriegisch2023-01-152-10/+31
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* Improve array matching for all TypePattern subclassesAlexander Kriegisch2023-01-1513-19/+62
| | | | | | Relates to #24. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Handle one- and multi-dimensional array return types correctlyAlexander Kriegisch2023-01-155-6/+33
| | | | | | | | | | 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>
* Simplify if-else in WildTypePattern.matchesExactlyByNameAlexander Kriegisch2023-01-151-5/+1
| | | | | | | | | 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>
* Fix WildTypePattern.isArrayAlexander Kriegisch2023-01-151-1/+1
| | | | | | | | | 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>
* Expand regression tests for GitHub bug #24Alexander Kriegisch2023-01-154-13/+112
| | | | | | | | | | 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>
* Add regression tests for GitHub bug #24Alexander Kriegisch2023-01-155-0/+142
| | | | | | Relates to https://github.com/eclipse/org.aspectj/issues/24. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Refactor, comment and reactivate Ajc183Tests.testAnnoStyleDecp_442425Alexander Kriegisch2023-01-077-67/+74
| | | | | | | | | | 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>
* Remove some old, accidentally committed class files from testsAlexander Kriegisch2023-01-079-0/+0
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* BcelTypeMunger.mungeMethodDelegate: only use 'synchronized' when necessaryAlexander Kriegisch2023-01-072-6/+30
| | | | | | | | | | | | | | | | | | | | | Relates to #198. Now, we create a delegate method body which basically looks as follows: public void methodOne() { if (this.ajc$instance$MyAspect$MyMixin == null) { synchronized(this) { if (this.ajc$instance$MyAspect$MyMixin == null) { this.ajc$instance$MyAspect$MyMixin = MyAspect.aspectOf().createImplementation(this); } } } this.ajc$instance$MyAspect$MyMixin.methodOne(); } The idea for the outer null check is from @aclement, see https://github.com/eclipse/org.aspectj/pull/205#issuecomment-1371556080. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* No more compiler errors for implicitly static inner aspects of interfacesAlexander Kriegisch2023-01-065-2/+67
| | | | | | | Fixes #162. Contains regression test Bugs1919Tests.testInterfaceInnerAspectImplicitlyStatic. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Test cosmeticsAlexander Kriegisch2023-01-062-3/+3
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* GitHub CI build: upgrade GabrielBB/xvfb-action to 1.6Alexander Kriegisch2023-01-041-1/+1
| | | | | | | | | | | | CI builds started showing warnings as follows: Node.js 12 actions are deprecated. For more information see: https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/. Please update the following actions to use Node.js 16: GabrielBB/xvfb-action@v1 Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Improve BcelTypeMunger.mungeMethodDelegate to avoid race conditionAlexander Kriegisch2023-01-041-2/+31
| | | | | | | Fixes #198, i.e. test DeclareMixinTests.testCaseEConcurrent from the previous commit now passes. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Add test reproducing problem from #198Alexander Kriegisch2023-01-043-25/+133
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Fix parenthesised AJ keyword compiler problemAlexander Kriegisch2023-01-044-1/+58
| | | | | | Fixes #20. Needs JDT Core grammar fix. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Fix TABLESWITCH weaver issue with Integer.MAX_VALUEAlexander Kriegisch2022-12-301-2/+2
| | | | | | Fixes #190. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Regression test for #190Alexander Kriegisch2022-12-303-0/+36
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Fix indentation in ajc1919.xml (cosmetics)Alexander Kriegisch2022-12-301-8/+8
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Improve code and documentation for #366085 fixAlexander Kriegisch2022-12-281-39/+52
| | | | | | | | | | | This commit is a follow-up for 65f1ec72. The SOURCE retention case is documented now and considered in a few more call sites. The previously already similar code structures in - DeclareAnnotation.ensureAnnotationDiscovered, - DeclareAnnotation.getAnnotationType have both been streamlined and still remain logically in sync. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* IDE.md: update AJDT version infoAlexander Kriegisch2022-12-221-2/+2
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Set version to 1.9.20-SNAPSHOTAlexander Kriegisch2022-12-2128-28/+28
|
* AspectJ release 1.9.19V1_9_19Alexander Kriegisch2022-12-2128-28/+28
|
* BCEL: use MAX_CP_ENTRIES from internal class, not from JREAlexander Kriegisch2022-12-211-5/+4
| | | | | | | | | | | | Instead of importing com.sun.org.apache.bcel.internal.Const, use use org.aspectj.apache.bcel.Constants. The former class is from the internal JRE module 'java.xml' which is not exposed by default. Actually, no existing test failed because of it, but javadoc generation for the AspectJ weaver. Relates to #192. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Bump JDT Core to release 1.9.19Alexander Kriegisch2022-12-211-1/+1
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Update release notes for 1.9.19 (Java 19)Alexander Kriegisch2022-12-211-31/+26
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Fix #366085 concerning declared annotations with source retentionAlexander Kriegisch2022-12-218-7/+55
| | | | | | | | | | | | | | | See https://bugs.eclipse.org/bugs/show_bug.cgi?id=366085. See https://stackoverflow.com/q/74618269/1082681. The issue described in the Bugzilla issue is about 'declare @type', but similar issues also existed for 'declare @field', 'declare @method', 'declare @constructor'. This fix is rather superficial and leaves things to be desired, because it is rather hacky and simply ignores errors source retention annotation declarations during weaving. A better fix would drop the corresponding declarations while parsing and also issue compiler warnings in each case. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Merge pull request #187 from eclipse/java-19Alexander Kriegisch2022-12-2181-395/+1638
|\ | | | | Java 19 support
| * Add release notes for 1.9.19 (Java 19)Alexander Kriegisch2022-12-212-0/+165
| | | | | | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
| * Add tests for Java 19 record patternsAlexander Kriegisch2022-12-2111-7/+297
| | | | | | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
| * Bump ECJ version in messages_aspectj.propertiesAlexander Kriegisch2022-12-201-1/+1
| | | | | | | | | | | | Eclipse Compiler 19f448f47c9e3e (15Dec2022) - Java19 Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>