aboutsummaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* 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-071-3/+5
| | | | | | | | | | | | | | | | | | | | | 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-063-0/+54
| | | | | | | 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>
* 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-043-0/+57
| | | | | | Fixes #20. Needs JDT Core grammar fix. 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>
* Set version to 1.9.20-SNAPSHOTAlexander Kriegisch2022-12-211-1/+1
|
* AspectJ release 1.9.19V1_9_19Alexander Kriegisch2022-12-211-1/+1
|
* Fix #366085 concerning declared annotations with source retentionAlexander Kriegisch2022-12-216-5/+43
| | | | | | | | | | | | | | | 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>
* Add tests for Java 19 record patternsAlexander Kriegisch2022-12-2111-7/+297
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* OutputSpec.matchesThisVm better supports version rangesAlexander Kriegisch2022-10-0511-272/+272
| | | | | | | | | | | | | | | | | | | | vmVersionRanges might be a single version like "9", a list of versions like "1.2,1.3,1.4,1.5", an equivalent range of "1.2-1.5", an open range like "-1.8", "9-" (equivalent to "9+") or a more complex list of ranges like "-1.6,9-11,13-14,17-" or "8,11,16+". Empty ranges like in "", " ", "8,,14", ",5", "6-," will be ignored. I.e., they will not yield a positive match. Bogus ranges like "9-11-14" will be ignored, too. Existing XML test specs using '<line text="..." vm="v,v2,...,vn"/> have been adjusted to use version ranges rather than long lists of consecutive versions. Furthermore, ranges with a trailing '+' like '14+' were replaced by using the new canonical format '14-', even though the parser still correctly recognises '14+'. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Fix tests due to changed JDK 'toString' methods in Java 19Alexander Kriegisch2022-10-033-42/+51
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Add the first few Java 19 testsAlexander Kriegisch2022-10-0312-0/+698
| | | | | | | | | | For now, only the "pattern matching for switch" tests from previews 1 and 2 were adjusted to work in preview 3, because guarded patterns were replaced by 'when' clauses in 'switch' blocks. Therefore, existing test classes did not compile anymore and had to be replaced by syntactically upgraded versions with content merged from preview 1 and 2 classes. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Deactivate Java 18 preview language feature testsAlexander Kriegisch2022-10-032-1/+4
| | | | | | and enable LangUtil to parse Java versions like '19+36-2238'. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Remove Batik path entries from test classpathAlexander Kriegisch2022-10-031-7/+8
| | | | | | | | | | | Firstly, Batik is not needed for running AspectJ tests. Secondly, the fixed Windows path separators led to GitHub CI/CD tests failing under Java 18+ on GitHub. Replacing ';' by 'File.pathSeparator' would have fixed the problem, but removing the paths altogether is the cleaner solution. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Cosmetic fixes in Java 18 tests (e.g. copyright year 2022)Alexander Kriegisch2022-10-036-11/+7
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Set Maven version to 1.9.19-SNAPSHOTAlexander Kriegisch2022-10-021-1/+1
| | | | | | | It makes sense to indicate the Java version in the minor-minor of AspectJ artifacts. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* vuln-fix: Partial Path Traversal VulnerabilityJonathan Leitschuh2022-09-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | This fixes a partial path traversal vulnerability. Replaces `dir.getCanonicalPath().startsWith(parent.getCanonicalPath())`, which is vulnerable to partial path traversal attacks, with the more secure `dir.getCanonicalFile().toPath().startsWith(parent.getCanonicalFile().toPath())`. To demonstrate this vulnerability, consider `"/usr/outnot".startsWith("/usr/out")`. The check is bypassed although `/outnot` is not under the `/out` directory. It's important to understand that the terminating slash may be removed when using various `String` representations of the `File` object. For example, on Linux, `println(new File("/var"))` will print `/var`, but `println(new File("/var", "/")` will print `/var/`; however, `println(new File("/var", "/").getCanonicalPath())` will print `/var`. Weakness: CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') Severity: Medium CVSSS: 6.1 Detection: CodeQL & OpenRewrite (https://public.moderne.io/recipes/org.openrewrite.java.security.PartialPathTraversalVulnerability) Reported-by: Jonathan Leitschuh <Jonathan.Leitschuh@gmail.com> Signed-off-by: Jonathan Leitschuh <Jonathan.Leitschuh@gmail.com> Bug-tracker: https://github.com/JLLeitschuh/security-research/issues/13 Co-authored-by: Moderne <team@moderne.io>
* Make IStateListener.aboutToCompareClasspaths use typed listsAlexander Kriegisch2022-04-182-3/+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>
* Remove AspectJ Browser (ajbrowser) code and documentationAlexander Kriegisch2022-04-023-46/+35
| | | | | | | Closes #148. TODO: Should more AJDE stuff be removed? Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Set version to 1.9.10-SNAPSHOTAlexander Kriegisch2022-03-311-1/+1
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Release AspectJ version 1.9.9.1V1_9_9_1Alexander Kriegisch2022-03-311-1/+1
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* UseJDKExtendedCharsets.java: add "how to fix test" commentAlexander Kriegisch2022-03-311-0/+7
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Revert "Fix more LTW tests"Alexander Kriegisch2022-03-312-30/+3
| | | | This reverts commit 63d5e3e893bd149245465de1610716930998dec8.
* Revert "AtAjLTWTests: 4 test cases switched to 'useFullLTW' mode"Alexander Kriegisch2022-03-312-14/+13
| | | | This reverts commit 5288ef1c1c8be2df85e59740f41622f4cfb9d899.
* Revert "A few dozen more tests need 'useFullLTW' mode"Alexander Kriegisch2022-03-3113-145/+145
| | | | This reverts commit 8c15d83a466843b5dba8ba454329baaca0080cc5.
* POM bug: separate jvm.arg.allowSecurityManager from jvm.arg.addOpensAlexander Kriegisch2022-03-311-1/+4
| | | | | | | | | | | | Before, this was in a single variable, and for JDK 18+, the security manager setting also falsely overwrote the '--add-opens' command. This was the root cause for a few dozen LTW tests to fail on JDK 18, if they were not run in full LTW mode, i.e. in a separate JVM. After this fix, it should be possible to revert the corresponding commits, at least their non-cosmetic parts. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Add some smoke test cases for '--add-reads' and '--add-modules'Alexander Kriegisch2022-03-319-4/+129
| | | | | | | in order to show that the compiler options basically work. The test cases are by no means exhaustive and simply verify that it works at all. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Add test case + experimental fix for AJC option '--add-exports'Alexander Kriegisch2022-03-273-0/+30
| | | | | | | 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>
* Set version to 1.9.10-SNAPSHOTAlexander Kriegisch2022-03-241-1/+1
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Set version to 1.9.9V1_9_9Alexander Kriegisch2022-03-241-1/+1
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Add AllTestsAspectJ199.suite() to AllTests19Alexander Kriegisch2022-03-241-0/+2
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Upgrade to latest JDT Core Java 18 changes, activate J18 preview testsAlexander Kriegisch2022-03-247-73/+170
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Rename testGitHub_125 to testCompilerCanReopenClosedJARs_gh125Alexander Kriegisch2022-03-231-1/+1
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Move GH-128 tests from 1.9.8 to 1.9.9 bugs test suite after mergeAlexander Kriegisch2022-03-2311-333/+333
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Merge branch 'master' into java-18Alexander Kriegisch2022-03-239-0/+493
|\ | | | | | | | | | | # Conflicts: # tests/src/test/java/org/aspectj/systemtest/ajc198/Bugs198Tests.java # tests/src/test/resources/org/aspectj/systemtest/ajc198/ajc198.xml
| * Ignore testAsyncProceedNestedAroundAdviceThreadPool_gh128 for nowAlexander Kriegisch2022-03-231-1/+2
| | | | | | | | | | | | Out of scope for PR #132, future work for issue #141. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
| * Name annotation vs native style aspects uniformly in github_128 testsAlexander Kriegisch2022-03-235-12/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Trying to find the difference between byte code generated by AJC for functionally identical annotation vs native style aspect, I move the aspects into subdirectories in order to be able to name them identically. This way, when decompiling them with javap or Fernflower it is easier to diff them later. Why the decompilation? Because for the thread pool testing scenario native syntax passes while annotation syntax fails. I.e., we need to find the difference. That can be done by reading source code, if you know where to look, or by starting with reverse engineering in order to first understand more and look at the code later. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
| * Expand "asynchronous proceed for nested around-advice" to 4 scenarios:Alexander Kriegisch2022-03-237-14/+343
| | | | | | | | | | | | | | | | | | | | | | 1. @AspectJ syntax, threads created inside advice code 2. @AspectJ syntax, submit runnable to thread pool 3. native syntax, threads created inside advice code 4. native syntax, submit runnable to thread pool Scenarios 1, 3 and 4 are passing, while 2 is failing. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
| * Add test "asynchronous proceed for nested around-advice chain"Alexander Kriegisch2022-03-237-0/+168
| | | | | | | | | | | | Relates to #128. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* | Fix more LTW testsAlexander Kriegisch2022-03-232-3/+30
| | | | | | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* | A few dozen more tests need 'useFullLTW' modeAlexander Kriegisch2022-03-2314-147/+147
| | | | | | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* | AtAjLTWTests: 4 test cases switched to 'useFullLTW' modeAlexander Kriegisch2022-03-232-13/+14
| | | | | | | | | | | | | | | | After the Java 18 JDT Core upgrade, some LTW tests are failing and have to be switched from in-process to full LTW mode due to them now obviously calling some code paths which need '--add-opens'. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* | Prepare code, tests and docs for Java 18Alexander Kriegisch2022-03-2120-125/+647
|/ | | | | | | | | | | | | | | | | | | | - 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>
* Regression test for #125: Bugs198Tests.testGitHub_125Alexander Kriegisch2022-02-234-3/+48
| | | | | | | | | | | | | | | | | | | | | | | | This test fails when run against AspectJ 1.9.8 with JDT Core 1.9.8.RC3. It passes when using the latest JDT Core 1.9.9-SNAPSHOT. It sets system property 'org.aspectj.weaver.openarchives=20', provoking open classpath JAR file exhaustion when compiling a simple class with AJC, i.e. JARs are being forcibly closed and automatically re-opened, as soon as they are needed. Before the JDT Core bugfix, this test causes: java.lang.NullPointerException at ....compiler.batch.ClasspathJmod.getModulesDeclaringPackage With the bugfix incorporated into AspectJ Tools, the problem is gone. Note: New test dependency 'io.github.bmuskalla:scoped-system-properties' helps to test compilation with the temporarily changed global system property in isolation, saving the environment in a thread-local variable and later cleanly restoring the original values again. If we ever switch to parallel test execution, this would otherwise influence other tests and potentially cause weird side effects. Better safe than sorry. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>