aboutsummaryrefslogtreecommitdiffstats
path: root/org.aspectj.ajdt.core/src
Commit message (Collapse)AuthorAgeFilesLines
* Implement source location matching for weave messages in XML testsAlexander Kriegisch2024-04-132-18/+42
| | | | | | | | WIP (work in progress). Closes #218. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Switch to Java 22 + add basic test suiteAlexander Kriegisch2024-03-231-1/+1
| | | | | | | | | | | | 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>
* Remove BCEL files from 'lib' moduleAlexander Kriegisch2024-03-151-2/+0
| | | | | | | | 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>
* Throw exception for minimal AJC runtime version violationAlexander Kriegisch2024-03-151-6/+2
| | | | | | | | | | | | | | | | | | 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>
* AjcTestCase: Improve forked JVM parameter handlingAlexander Kriegisch2024-03-121-5/+8
| | | | | | | - Recognise more "fork-worthy" JVM parameters - Pass on program arguments to program in forked JVM Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Fix typos: '-xmlConfigured', not '-xmlConfig'Alexander Kriegisch2024-02-221-6/+8
| | | | | | Also reformat compiler usage page to adhere to 80-character limit again. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Document AJC option '-xmlConfigured'Alexander Kriegisch2024-02-221-0/+2
| | | | | | | | | | | - 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>
* 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>
* Add 'AspectJ_JDK_Update' hint in various placesAlexander Kriegisch2024-02-191-0/+2
| | | | | | | | | | | | | | | | | | | | 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>
* Bump JDT Core to 1.9.21.1Alexander Kriegisch2024-02-131-1/+1
| | | | | | Eclipse Compiler 8398f6c1210ec3 (13Feb2024) - Java21 Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* AjCompilerOptions: Increment irritant levels to GROUP4Alexander Kriegisch2024-02-121-9/+9
| | | | | | | | Needs eclipse-aspectj/eclipse.jdt.core#ed6050bb. See also eclipse-jdt/eclipse.jdt.core#2006. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Adjust AjASTConverter to JDT Core StringLiteralConcatenation changesAlexander Kriegisch2024-02-121-2/+3
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Replace old by new AspectJ GitHub URLAlexander Kriegisch2024-02-083-3/+3
| | | | | | github.com/eclipse/org.aspectj -> github.com/eclipse-aspectj/aspectj Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Workaround for defining classes during LTWAlexander Kriegisch2024-01-292-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | Overhaul ClassLoaderWeavingAdaptor to use statically initialised Unsafe instances and method handles pointing to their 'defineClass' methods. Those now work universally on JDKs 8-21. In older JDKs, the method used to be in sun.misc.Unsafe, in more recent ones on jdk.internal.misc.Unsafe. It is challenging to fetch instances, especially as reflection protection and module boundaries have been increased in the JDK progressively. But finally, a solution was adapted from Byte Buddy (BB). Kudos to BB author Rafael Winterhalter. The previous solution to use ClassLoader::defineClass and require '--add-opens' is no longer necessary for the first time since it became necessary in AspectJ 1.9.7 with Java 16 support. Add org.ow2.asm:asm-common as a dependency everywhere org.ow2.asm:asm was used before. Maybe that is too many places, but no worse than before. Add missing dependency on loadtime to aspectjweaver. This kept a build like "mvn install -am -pl aspectjweaver" from picking up changed loadtime classes. Fixes #117. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Move docs examples directory two levels upAlexander Kriegisch2024-01-061-1/+1
| | | | | | Now, the location more closely resembles where it is on the website. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Remove references and docs about obsolete toolsAlexander Kriegisch2024-01-061-9/+0
| | | | | | | | | | | | | - AspectJ Browser (ajbrowser) - Forte IDE integration - JBuilder IDE integration - Emacs integration All this information was old and outdated. Ajbrowser was removed from AspectJ a while ago. If the other tools even still exist, any possibly existing AspectJ support is not part of AspectJ itself. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Globally replace HTTP links to eclipse.org by HTTPSAlexander Kriegisch2024-01-062-6/+6
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Add minimal JRE version check to Main.runMainAlexander Kriegisch2023-12-151-21/+35
| | | | | | | | | | | Use new constant Main.MINIMAL_JRE_VERSION (currently = 17) and SourceVersion.latest().ordinal() to check, if the minimal JRE version requirement for AJC is met. If not, then exit with code -1 and error message "The AspectJ compiler needs at least Java runtime 17". Relates to #269. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Bump ECJ to 23b713ce (01Dec2023)Alexander Kriegisch2023-12-021-1/+1
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Adjust to API changes in ECJ 4dc7b558 (01Dec2023)Alexander Kriegisch2023-12-018-17/+17
| | | | | | Mostly StringBuffer -> StringBuilder API changes Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Bump AJC version string to c13b03ceabf0c1Alexander Kriegisch2023-11-271-1/+1
| | | | | | | More exactly: Eclipse Compiler c13b03ceabf0c1 (26Nov2023) - Java21 Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Adjust to latest changes in JDT CoreAlexander Kriegisch2023-11-012-8/+8
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* AjcTestCase: Make sure main methods can be called in Java 21Alexander Kriegisch2023-10-051-2/+5
| | | | | | | | | Since JDK 21, a public main method of a non-public (e.g. default-scoped) class can no longer be invoked without making it accessible first. Because many test sources contain multiple aspects and classes in one file, this is a frequent use case. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* AjLookupEnvironment: readability refactoringAlexander Kriegisch2023-10-011-582/+515
| | | | | | | | | | | | | While trying to understand the code a bit better in order to fix failing builds, I applied some cosmetic refactoring and reformatting. This commit does not change any functionality. Whether the static import of CompilationAndWeavingContext.* is a good thing or not is debatable, but I like the code to be less chatty than it was before, assuming that every developer uses an IDE helping to find out where static methods and constants come from. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* AjLookupEnvironment: add new phase CONNECT_TYPE_HIERARCHY2Alexander Kriegisch2023-10-011-2/+2
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Remove old '.cvsignore' filesAlexander Kriegisch2023-09-271-1/+0
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Bump JDT Core to 1.9.21-SNAPSHOTAlexander Kriegisch2023-09-261-3/+9
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Update compiler.version to latest Java 20 mergeAlexander Kriegisch2023-09-251-1/+1
| | | | | | | | | messages_aspectj.properties: compiler.version = ... d23a141971a37b (27Apr2023) - Java20 Too bad this version string did not make it into 1.9.20 and 1.9.20.1. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Put ASM on classpath for Ajc in testsAlexander Kriegisch2023-08-221-0/+2
| | | | | | | | | | | | | | | This enables compiled source code to use ASM. This way, it is possible to bootstrap tests needing specially prepared class files by 1. compiling an ASM-enabled byte code generator class, 2. running the generator, writing out class files, 3. using the generated class files in subsequent tests. Until now, such classes always had to be checked into the ASM directly or inside JARs. Now, this is no longer necessary. The next commit will be the first example. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* messages_aspectj.properties: update ECJ version stringAlexander Kriegisch2023-06-241-1/+1
| | | | | | | | | This update includes the upstream fix for https://github.com/eclipse-jdt/eclipse.jdt.core/issues/911. Eclipse Compiler b15e5c75653358 (24Mar2023) - Java20 Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* messages_aspectj.properties: update ECJ version stringAlexander Kriegisch2023-06-241-1/+1
| | | | | | Eclipse Compiler 40fa81de93d65b (24Mar2023) - Java20 Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Add null check to AjLookupEnvironment.hasAspectDeclarationsAlexander Kriegisch2023-06-041-0/+2
| | | | | | Fixes #240. 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-221-52/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* No more compiler errors for implicitly static inner aspects of interfacesAlexander Kriegisch2023-01-062-2/+13
| | | | | | | Fixes #162. Contains regression test Bugs1919Tests.testInterfaceInnerAspectImplicitlyStatic. 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>
* Set Java 19 compiler version after JDT Core mergeAlexander Kriegisch2022-10-021-1/+1
| | | | | | | In messages_aspectj.properties, set compiler.version to "Eclipse Compiler 5fd28398cc7aba (21Sep2022) - Java19". Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* First Java 19 version, barely tested.Alexander Kriegisch2022-10-012-5/+7
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Make IStateListener.aboutToCompareClasspaths use typed listsAlexander Kriegisch2022-04-182-2/+2
| | | | | | | | | | | | | | | | Before, the signature was: void aboutToCompareClasspaths( List oldClasspath, List newClasspath); Now it is: void aboutToCompareClasspaths( List<String> oldClasspath, List<String> newClasspath); AJDT will also use the typed version after generics refactoring. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Cleanup redundant null check before instanceofAndrey Turbanov2022-04-175-8/+7
|
* Reduce 'Object' class usageAndrey Turbanov2022-04-158-25/+16
|
* Fix suspicious Map.get callAndrey Turbanov2022-04-151-1/+1
|
* Remove redundant casts after generics updateAndrey Turbanov2022-04-1213-46/+38
|
* Merge pull request #131 from turbanoff/use_generics_ajdt.coreAndy Clement2022-04-1121-59/+66
|\ | | | | Update 'org.aspectj.ajdt.core' code to use generics
| * Update 'org.aspectj.ajdt.core' code to use genericsAndrey Turbanov2022-02-2821-59/+66
| |
* | AjcTestCase: be less verbose when appending to buffer repeatedlyAlexander Kriegisch2022-03-311-71/+39
| | | | | | | | | | | | | | | | Also put 'else (if)' and 'finally' on new lines rather than after the preceding closing curly braces. This helps IDEs when using code folding (show/hide content of code blocks enclosed in curly braces). Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* | Make sure to always print commands when running Java test classesAlexander Kriegisch2022-03-312-8/+10
| | | | | | | | | | | | | | In some cases, the 'java ...' command was not printed, which is especially unhelpful when tests fail. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* | Use upstream method to generate '--add-reads', '--add-exports' infoAlexander Kriegisch2022-03-271-3/+8
| | | | | | | | | | | | | | | | and copy it into our FileSystem instance. In order to be able to access JDT Core's FileSystem.moduleUpdates field, we had to make it public there first. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* | Add test case + experimental fix for AJC option '--add-exports'Alexander Kriegisch2022-03-273-2/+23
| | | | | | | | | | | | | | I am expecting the test case to pass, but other tests to fail. This temporary commit is meant to create feedback from GitHub CI test runs. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>