aboutsummaryrefslogtreecommitdiffstats
path: root/org.aspectj.ajdt.core/src
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* | Fix AjcTaskTest by correctly identifying snapshot versionsAlexander Kriegisch2022-03-241-2/+2
| | | | | | | | | | | | This avoids the corresponding "bad version number found in" warnings. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* | Add JDT Core and bcel-builder to test classpathAlexander Kriegisch2022-03-241-2/+9
| | | | | | | | | | | | | | | | | | | | At present, no tests are failing without those resources, but for good measure, I added them anyway, because then the same path could in the future also be used for stand-alone compilation tests which are not triggered in-process via AJDT interface but, not unlike "full LTW" test execution mode, in a separate JVM. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* | Upgrade to latest JDT Core Java 18 changes, activate J18 preview testsAlexander Kriegisch2022-03-241-1/+1
| | | | | | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* | Make sure that program arguments are passed through in full LTW modeAlexander Kriegisch2022-03-231-14/+17
| | | | | | | | | | | | | | | | This fixes e.g. LTWTests.testDeclareAbstractAspect, which passes on names of ITD methods to the test program, which in turn executes those methods via reflection. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* | Introduce AjcTestCase.DEFAULT_FULL_LTW_CLASSPATH_ENTRIESAlexander Kriegisch2022-03-231-5/+12
| | | | | | | | | | | | | | In 'useFullLTW' mode, aspectjweaver.jar is a Java agent. Therefore, what is contained in there does not need to be on the classpath. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* | AJDT Core: use JUnit 4 from class path instead of 3.8 from lib/junitAlexander Kriegisch2022-03-232-2/+9
| | | | | | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* | Fix broken 'useFullLTW' test modeAlexander Kriegisch2022-03-231-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | It was referring to a no longer existent weaver under aj-build/dist/tools/lib/aspectjweaver.jar, which now has been replaced by the new file lib/aspectj/lib/aspectjweaver.jar. Several tests were broken, not finding the agent. But because those tests make no assertions, nobody ever noticed. Only when I had to change some LTW tests from in-process to full LTW mode (see next commit) due to them now obviously calling some code paths which need '--add-opens', I even noticed the problem. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* | Use static imports for file and path separator constantsAlexander Kriegisch2022-03-232-25/+31
| | | | | | | | | | | | It makes concatenated paths a little more readable. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* | Prepare code, tests and docs for Java 18Alexander Kriegisch2022-03-211-1/+1
|/ | | | | | | | | | | | | | | | | | | | - JDT Core dependency in pom.xml - Constants.java - LangUtil.java - AjcTask.java - messages_aspectj.properties - XMLBasedAjcTestCaseForJava17Only.java - XMLBasedAjcTestCaseForJava18*.java - tests/bugs199 - tests/features199 - JavaVersionCompatibility.md - README-199.html - GitHub CI build Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Cleanup redundant type casts, due to too weak variable type declarationAndrey Turbanov2022-02-262-13/+9
|
* protect against NPE for inheritance and annotation styleAndy Clement2022-01-201-3/+2
|
* Fix annotation style support for if(true) and if(false)Andy Clement2022-01-171-2/+8
| | | | | | | | | | The documentation specifies annotation style pointcuts can use if(false) or if(true) and not require a boolean return value and body for the @Pointcut annotated method but it doesn't work without this change to validation that recognizes the situation. Fixes #115
* Merge pull request #109 from turbanoff/avoid_empty_arrays_allocationAndy Clement2022-01-106-14/+14
|\ | | | | Reduce empty array allocations
| * Reduce empty array allocationsAndrey Turbanov2021-12-186-14/+14
| |
* | Use StringBuilder/StringJoiner for concatenation String's in loopAndrey Turbanov2021-12-181-6/+4
|/
* Merge pull request #103 from turbanoff/redundant_boxingAndy Clement2021-12-132-2/+2
|\ | | | | Cleanup redundant boxing.
| * Cleanup redundant boxing.Andrey Turbanov2021-11-202-2/+2
| | | | | | | | | | Methods Integer.parseInt/Boolean.parseBoolean should be preferred over Integer.valueOf/Boolean.valueOf/ if final result is primitive. They are generally faster and generate less garbage.
* | Replace more usages of StringBuffer with StringBuilderAndrey Turbanov2021-12-055-17/+17
| |
* | Merge pull request #101 from turbanoff/use_StringBuilder_instead_of_StringBufferAndy Clement2021-11-3027-50/+50
|\ \ | | | | | | Replace uses of StringBuffer with StringBuilder.
| * | Replace uses of StringBuffer with StringBuilder.Andrey Turbanov2021-11-2027-50/+50
| |/ | | | | | | StringBuffer is a legacy synchronized class. StringBuilder is a direct replacement to StringBuffer which generally have better performance.
* / According to javadoc File.isDirectory 'true' if and only if the file denoted ↵Andrey Turbanov2021-11-201-2/+2
|/ | | | | | by this abstract pathname exists and is a directory. It means that separate File.exists() check before File.isDirectory() check is redundant.
* Rename DOM AST class TypePattern to AbstractTypePatternAlexander Kriegisch2021-10-0820-60/+59
| | | | | | | | | | | | | | | | | | | | | | Since JDT Core 3.27 (Java 17), there is a name clash, because the new class org.eclipse.jdt.core.dom.TypePattern (JEP 406) gets relocated to org.aspectj.org.eclipse.jdt.core.dom.TypePattern during shading. Fortunately, this made tests like AjASTTest and AjAST5Test fail with rather nasty errors like: java.lang.VerifyError: Bad return type (...) Type 'org/aspectj/org/eclipse/jdt/core/dom/TypePattern' (...) is not assignable to 'org/aspectj/org/eclipse/jdt/core/dom/Pattern' (...) TODO: Update AJDT references to the renamed class in the following classes after refreshing the AspectJ sources: - ExtraPackageReferenceFinder - ExtraTypeReferenceFinder This also means, that for Eclipse 2021-09 (4.21) we need a new AJDT update site, because simply deploying to the 4.19 one would probably lead to problems in the IDE. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Update ECJ version, activate Java 17 preview features testsAlexander Kriegisch2021-10-021-1/+1
| | | | | | | After JDT Core (ECJ) was updated to the final Java 17 feature set, the tests now pass as expected. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* In ITD processing, use setter instead of assigning Scope directlyAlexander Kriegisch2021-09-073-3/+6
| | | | | | | | | | | | Change calls like pre.scope.parent = newParent; to this pattern: // Use setter in order to also update member 'compilationUnitScope' pre.scope.setParent(newParent); This should fix lots of failing tests after updating JDT Core. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Add AJDT support for printing switch expressionsAlexander Kriegisch2021-09-071-7/+32
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* AjBuildConfig: simplify null classpath removal from path listAlexander Kriegisch2021-06-261-7/+2
| | | | | | Use removeIf(Objects::isNull) instead of old-fashioned iterator loop. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Quick fix for AJC '--release' optionAlexander Kriegisch2021-06-262-1/+19
| | | | | | Work in progress, relates to #70 Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Minor code clean-upsAlexander Kriegisch2021-06-262-20/+23
| | | | | | | Add a bit more type safety and accept some minor refactorings suggested by the IDE. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Upgrade license from CPLv1/EPLv1 to EPLv2Alexander Kriegisch2021-06-04211-3079/+3079
| | | | | | | This was required by the Eclipse team as one precondition for the next release. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Replace use of ASM-renamed by original ASMAlexander Kriegisch2021-05-161-4/+4
| | | | | | | | | | | | This involves replacing references in weaver application code as well as a few tests. In order to make AspectJ weaver + tools contain a relocated ASM version, I added a Maven Shade relocation step after Maven Assembly created the uber JARs. Relocation works for both binaries and sources and also encompasses Class::forName calls like in class AsmDetector. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Remove some cruft from test classes Ajc, AjcTestCase, AntSpecAlexander Kriegisch2021-04-162-59/+14
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Remove managing obsolete folder lib/asmAlexander Kriegisch2021-04-161-43/+25
| | | | | | | | The new string AjcTestCase.CLASSPATH_ASM_RENAMED dynamically determines the 'asm-renamed' location from the classpath, system property 'java.class.path'. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>