aboutsummaryrefslogtreecommitdiffstats
path: root/weaver
Commit message (Collapse)AuthorAgeFilesLines
* BcelObjectType: Add experimental code to set source file name forAlexander Kriegisch2024-04-131-4/+13
| | | | | | | | | | | | | reference Experimental code leading to undesired ripple effects elsewhere, requiring more rework which now I do not feel inclined to invest to perfect source file string representation for post-compile binary classes and aspects. Relates to #218. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Minor code cosmeticsAlexander Kriegisch2024-04-131-1/+1
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Implement source location matching for weave messages in XML testsAlexander Kriegisch2024-04-132-27/+63
| | | | | | | | WIP (work in progress). Closes #218. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Revert WeavingAdaptor generated class map optimisationAlexander Kriegisch2024-04-081-0/+1
| | | | | | | | | | | | | | 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>
* SimpleCache: structural refactoring, better docsAlexander Kriegisch2024-04-081-117/+130
| | | | | | | | - Add some code comments and javadoc for SimpleCache::getAndInitialize - Add TODO to migrate from using ClassLoader::defineClass to the class definition strategy used in ClassLoaderWeavingAdaptor Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Set version to 1.9.23-SNAPSHOTAlexander Kriegisch2024-03-231-1/+1
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Release AspectJ 1.9.22Alexander Kriegisch2024-03-231-1/+1
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Remove BCEL files from 'lib' moduleAlexander Kriegisch2024-03-151-4/+8
| | | | | | | | 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>
* Set version to 1.9.22-SNAPSHOTAlexander Kriegisch2024-03-131-1/+1
|
* Release AspectJ 1.9.21.2V1_9_21_2Alexander Kriegisch2024-03-131-1/+1
|
* Improved fix for #285KimmingLau2024-03-042-45/+67
| | | | | | | | | | | | | 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>
* Improve unwoven class file handling in SimpleCacheAlexander Kriegisch2024-03-021-3/+2
| | | | | | | | | Also update lib/aspectj/aspectjweaver.jar to fix integration tests. Fixes #285. Co-authored-by: Kimming Lau <294001791@qq.com> Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Rephrase docs for WeavingXmlConfig::excludesTypeAlexander Kriegisch2024-02-231-7/+17
| | | | | | and turn into javadoc. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* LangUtil: remove methods like 'is11VMOrGreater', 'is1dot5VMOrGreater'Alexander Kriegisch2024-02-195-8/+8
| | | | | | | | | | 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>
* Globally replace "http:" by "https:" in non-XML filesAlexander Kriegisch2024-02-153-6/+6
| | | | | | | | | Maybe, the XML files and Maven wrapper files will follow. First, let us find out if this breaks the build, maybe some tests are asserting on "http:". But there, the replacement would also have taken place, so probably it just works. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Remove noise from aspectj_1_5_0.dtdAlexander Kriegisch2024-02-151-68/+47
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Set version to 1.9.22-SNAPSHOTAlexander Kriegisch2024-02-141-1/+1
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Release 1.9.21.1V1_9_21_1Alexander Kriegisch2024-02-141-1/+1
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Factor out some anonymous IWeaveRequestor classes to inner classesAlexander Kriegisch2024-02-082-60/+55
| | | | | | Drive-by cosmetics in the context of #279. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Store only weaved class names in the generatedClasses mapUri Simchoni2024-02-081-1/+0
| | | | | | | | | | | | | | | 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.
* Remove WeavingAdaptor.couldWeave()Uri Simchoni2024-02-081-9/+1
| | | | | | | | | | | | WeavingAdaptor.couldWeave() tested two things: whether this specific class (by its name) should be excluded from weaving, and whether the class has generated classes associated with it (in which case we avoid weaving to avoid re-creating those generated classes). However, if the class has generated classes associated, couldWeave() is not called at all because of the new wovenWithGeneratedClass() test, so we have only the name test which is now called directly. Relates to #279.
* Use previous weaving result if classes were generated during weavingUri Simchoni2024-02-081-1/+24
| | | | | | | | | | | | | | | | | | | | | | A parallel-capable class loader might load the same class multiple times in multiple threads, see https://docs.oracle.com/javase/7/docs/technotes/guides/lang/cl-mt.html. In this scenario, the JVM instrumentation mechanism invokes the AspectJ weaver twice on the same class. In simple weaving scenarios, this would just cause weaving logic to run multiple times and produce the same result for each thread, but if the weaver is generating new classes, it is undesirable to generate those classes multiple times. To avoid this, the generatedClasses map in WeavingAdaptor keeps track of classes for which inner classes were generated and avoids re-weaving them. However, before this change, if a class was found in the generated map, the weaver would return the un-woven bytes, which would cause AspectJ not to work for some of the threads. This change returns the woven bytes instead of re-running weaving. Fixes #279.
* Change value of woven class in generatedClasses mapUri Simchoni2024-02-081-1/+1
| | | | | | | | Store the woven class and not a generated (inner) class as value of the woven class name. This has no effect in this commit, because the value is not consulted at all, but will be used later on. 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-072-19/+28
| | | | | | | | | | | | | | | | | | 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-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Set version to 1.9.21.1-SNAPSHOTAlexander Kriegisch2023-12-151-1/+1
| | | | | | | Currently, the situation looks more like a Java 21 maintenance release than directly a Java 22 release. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Set version to 1.9.22-SNAPSHOTAlexander Kriegisch2023-12-111-1/+1
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Release AspectJ 1.9.21V1_9_21Alexander Kriegisch2023-12-111-1/+1
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Simple regression test unit test for #266Alexander Kriegisch2023-12-101-0/+51
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Set exception root cause in ExtensibleURLClassLoader::findClassAndy Russell2023-12-101-1/+1
| | | | Fixes #266.
* Set version to 1.9.21-SNAPSHOT againAlexander Kriegisch2023-12-021-1/+1
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Release candidate 1.9.21.RC1V1_9_21_RC1Alexander Kriegisch2023-12-021-1/+1
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Set version 1.9.21-SNAPSHOTAlexander Kriegisch2023-11-191-1/+1
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Release milestone 1.9.21.M1V1_9_21_M1Alexander Kriegisch2023-11-191-1/+1
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Remove old '.cvsignore' filesAlexander Kriegisch2023-09-271-2/+0
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Set version to 1.9.21-SNAPSHOTAlexander Kriegisch2023-09-041-1/+1
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* AspectJ release 1.9.20.1Alexander Kriegisch2023-09-041-1/+1
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Set version to 1.9.21-SNAPSHOTAlexander Kriegisch2023-08-161-1/+1
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Release 1.9.20V1_9_20Alexander Kriegisch2023-08-161-1/+1
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Improve error message in LazyClassGen.getJavaClassBytesIncludingReweavableAlexander Kriegisch2023-08-063-11/+17
| | | | | | | | | | No longer report "Unable to find ASM classes", if simply an ASM processing error occurred. In that case, report "Error processing class file". Relates to #250. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Fix inline accessor method bug in BcelAccessForInlineMungerAlexander Kriegisch2023-08-061-5/+9
| | | | | | | | | | Make sure to create one ajc$inlineAccessMethod per identically named (overloaded) private aspect method in BcelAccessForInlineMunger.createOrGetInlineAccessorForMethod. Fixes #250. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Use relocated ASM class names in BCException messageAlexander Kriegisch2023-08-041-5/+8
| | | | | | Fixes #251. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* BcelTypeMunger.getRealMemberForITDFromAspect code cosmeticsAlexander Kriegisch2023-06-261-33/+24
| | | | | | Relates to #246. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Correctly identify ITD method signatures in weaverAlexander Kriegisch2023-06-261-7/+1
| | | | | | | | | | by removing faulty condition 'if (isCtorRelated)' from BcelTypeMunger.getRealMemberForITDFromAspect, see comment https://github.com/eclipse-aspectj/aspectj/issues/246#issuecomment-1605999896. Fixes #246. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Fix GitHub #214Alexander Kriegisch2023-01-211-1/+1
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* BcelTypeMunger.mungeMethodDelegate: only use 'synchronized' when necessaryAlexander Kriegisch2023-01-071-3/+25
| | | | | | | | | | | | | | | | | | | | | 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>
* 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>
* Set version to 1.9.20-SNAPSHOTAlexander Kriegisch2022-12-211-1/+1
|
* AspectJ release 1.9.19V1_9_19Alexander Kriegisch2022-12-211-1/+1
|