aboutsummaryrefslogtreecommitdiffstats
path: root/loadtime/src
Commit message (Collapse)AuthorAgeFilesLines
* Revert WeavingAdaptor generated class map optimisationAlexander Kriegisch2024-04-081-2/+10
| | | | | | | | | | | | | | This was introduced in commit 8a4aa03845 of PR #278 contribution as part of the #279 fix. The contributor thought that the generated closure class entries were never used, but in fact AJDT class OSGiWeavingAdaptor relies on the presence of those entries. To the best of my present knowledge, it looks as if this change was the root cause of https://github.com/eclipse-aspectj/ajdt/issues/57. Therefore, I reverted it, simultaneously refactoring Iterator::remove usage to delete entries from the map to Collection::removeIf. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Raise ClassLoaderWeavingAdaptor::defineClass visibility to protectedAlexander Kriegisch2024-04-041-2/+2
| | | | | | | | | Relates to https://github.com/eclipse-aspectj/ajdt/issues/57 and it a precondition for refactoring phase 2 of child class OSGiWeavingAdaptor::defineClass, which can now directly call the super methods instead of using reflection. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Improved fix for #285KimmingLau2024-03-041-3/+4
| | | | | | | | | | | | | 1. Write SAME_BYTES to cacheMap when woven bytes are null 2. Fix TODO in SimpleCache::getAndInitialize, using Optional to help indicate cache hit for unwoven class 3. Improve test coverage (cache miss, cache hit for unwoven class) Relates to #285. Co-authored-by: Alexander Kriegisch <Alexander@Kriegisch.name> Signed-off-by: KimmingLau <294001791@qq.com> Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Add implementation note and JDK-8325536 link to Aj.preProcessAlexander Kriegisch2024-02-091-0/+5
| | | | | | | | See https://bugs.openjdk.org/browse/JDK-8325536. Relates to #277. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Store only weaved class names in the generatedClasses mapUri Simchoni2024-02-081-15/+2
| | | | | | | | | | | | | | | The generatedClasses map contained both keys of woven classes that had generated classes associated with them, and the keys of the generated classes themselves. It seems like this map is never consulted for the generated class key - the generated class is generated from within the context of woven class loading / retransformation, and thus no transform event is generated for it by the JVM. Because of that, we do not need to guard against re-weaving it. Other uses of generatedClasses map are for full/empty tests, where the woven class key is sufficient. This change simplifies deletion of a class because we do not have to look for its associated generated classes. Relates to #279.
* Add javadoc links to ClassFileTransformer::transformAlexander Kriegisch2024-02-071-0/+2
| | | | | | Relates to #277. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Weaver returns null instead of original bytes for unwoven classesAlexander Kriegisch2024-02-075-17/+30
| | | | | | | | | | | | | | | | | | This change makes sense independently of #277, but also enables using - cp "my.jar;aspectjweaver.jar" -XX:+AllowArchivingWithJavaAgent -javaagent:aspectjweaver.jar while creating a CDS archive. Afterward, the application can be run in its woven state from the CDS archive even without '-javaagent', because the byte code was archived in its woven state ("poor man's AJC"). See https://github.com/eclipse-aspectj/aspectj/issues/277#issuecomment-1931142753 for details. Fixes #277. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Workaround for defining classes during LTWAlexander Kriegisch2024-01-291-145/+228
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Globally fix spelling error "dependancy/dependancies"Alexander Kriegisch2024-01-061-1/+1
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Globally replace HTTP links to eclipse.org by HTTPSAlexander Kriegisch2024-01-061-1/+1
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Do not use String literal as synchronized lockAndrey Turbanov2022-04-151-1/+1
|
* Reduce 'Object' class usageAndrey Turbanov2022-04-151-5/+6
|
* Reduce empty array allocationsAndrey Turbanov2021-12-181-6/+7
|
* Replace uses of StringBuffer with StringBuilder.Andrey Turbanov2021-11-202-3/+3
| | | | StringBuffer is a legacy synchronized class. StringBuilder is a direct replacement to StringBuffer which generally have better performance.
* Upgrade license from CPLv1/EPLv1 to EPLv2Alexander Kriegisch2021-06-0423-133/+133
| | | | | | | This was required by the Eclipse team as one precondition for the next release. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Remove JRockit LTW support, particularly JRockitAgentAlexander Kriegisch2021-04-105-367/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | In two places, the documentation now contains this text: "Since AspectJ 1.9.7, the obsolete Oracle/BEA JRockit agent is no longer part of AspectJ. JRockit JDK never supported Java versions higher than 1.6. Several JRockit JVM features are now part of HotSpot and tools like Mission Control available for OpenJDK and Oracle JDK." The decision to drop JRockit support was made during a discussion between Alexander Kriegisch and Andy Clement: Andy Clement wrote on 26 Mar 2021: > Yes I think so. > > > Alexander Kriegisch wrote on 26 Mar 2021: > >> https://en.wikipedia.org/wiki/JRockit >> >> Can we get rid of that? AspectJ requires Java 8, JRockit never >> supported more than Java 6. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Move lib/ext/jrockit to just lib/jrockitAlexander Kriegisch2021-04-101-1/+1
| | | | | | | | It was the only subdirectory under lib/ext anyway and somehow always irritating and difficult to find when just using a directory browser in the IDE. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Fix JRockitAgentTest.testJrockitRecursionProtection for JVM 9+Alexander Kriegisch2021-03-281-14/+1
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Fix some deprecated Java and JUnit warnings by using newer API callsAlexander Kriegisch2021-03-214-11/+8
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Fix 'ajdoc' tests for Java 15 buildAlexander Kriegisch2021-03-141-3/+3
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Fix misplaced or incorrect javadoc tagsJerry James2020-09-141-1/+1
|
* Fix misplaced or incorrectly nested HTML tagsJerry James2020-09-143-3/+3
|
* Fix incorrect HTML entities in javadoc commentsJerry James2020-09-141-2/+2
|
* debug for test failure under github actionAndy Clement2020-08-162-25/+32
|
* debug for test failure under github actionAndy Clement2020-08-161-0/+2
|
* debug for test failure under github actionAndy Clement2020-08-161-10/+11
|
* Merge branch 'master' into feature/collection-performanceAndy Clement2020-08-153-3/+0
|\
| * Cleanup unused importsLars Grefer2020-08-163-3/+0
| | | | | | | | Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
* | Collection.toArray() call styleLars Grefer2020-08-151-2/+1
|/ | | | | | | There are two styles to convert a collection to an array: either using a pre-sized array (like c.toArray(new String[c.size()])) or using an empty array (like c.toArray(new String[0]). In older Java versions using pre-sized array was recommended, as the reflection call which is necessary to create an array of proper size was quite slow. However since late updates of OpenJDK 6 this call was intrinsified, making the performance of the empty array version the same and sometimes even better, compared to the pre-sized version. Also passing pre-sized array is dangerous for a concurrent or synchronized collection as a data race is possible between the size and toArray call which may result in extra nulls at the end of the array, if the collection was concurrently shrunk during the operation. Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
* Merge branch 'master' of github.com:eclipse/org.aspectj into ↵Lars Grefer2020-08-141-1/+1
|\ | | | | | | remove-old-version-checks
| * Fix JRockitAgentTest for Java 9 and 10Lars Grefer2020-08-131-1/+1
| | | | | | | | Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
* | Remove checks for old Java VersionsLars Grefer2020-08-131-1/+1
|/ | | | Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
* Use the diamond operator where possibleLars Grefer2020-08-134-34/+34
| | | | Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
* 'String.indexOf()' expression is replaceable with 'contains()'Lars Grefer2020-08-083-6/+6
| | | | | | Reports any String.indexOf() expressions which can be replaced with a call to the String.contains() method available in Java 5 and newer. Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
* 'for' loop replaceable with enhanced 'for' loopLars Grefer2020-08-085-127/+117
| | | | | | Reports for loops which iterate over collections or arrays, and can be replaced with an enhanced for loop (i.e. the foreach iteration syntax). Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
* polishAndy Clement2019-11-298-18/+16
|
* fix commentAndy Clement2019-11-281-24/+23
|
* fixes for tests on windowsAndy Clement2019-03-041-2/+3
|
* tidyupAndy Clement2019-02-082-1/+6
|
* Add module tests back in - but streamlinedAndy Clement2019-01-312-37/+46
|
* Merged loadtime5 into loadtimeAndy Clement2019-01-284-0/+182
|
* mavenizing loadtime - wipAndy Clement2019-01-286-62/+23
|
* mavenizing loadtime - wipAndy Clement2019-01-2526-0/+2175
|
* On JDK11 call the defineClass variant with a ProtectionDomain paramAndy Clement2019-01-111-4/+4
| | | | | | | | | | This alters the defineClass used when loadtime weaving and defining 'extra' classes (e.g. closures). This change causes us to call the defineClass() method variant on ClassLoader that takes a protection domain, so it should share the same protection domain as the class for which the extra class was generated. Issue: https://bugs.eclipse.org/bugs/show_bug.cgi?id=542421
* polishV1_9_2Andy Clement2018-10-231-4/+0
|
* polishAndy Clement2018-10-231-2/+0
|
* Exclude delegation loader on JDK11 too (it has been renamed)Andy Clement2018-10-231-10/+3
|
* 1.9.2.RC1 changesV1_9_2_RC1Andy Clement2018-09-292-32/+131
|
* 533038: Clear some generated class entries during class redefinitionAndy Clement2018-04-023-16/+43
|
* switched from diamond operatorAndy Clement2017-10-201-1/+2
|