]> source.dussan.org Git - aspectj.git/commitdiff
Remove WeavingAdaptor.couldWeave()
authorUri Simchoni <urisimchoni@gmail.com>
Mon, 5 Feb 2024 06:29:32 +0000 (08:29 +0200)
committerAlexander Kriegisch <Alexander@Kriegisch.name>
Thu, 8 Feb 2024 05:17:55 +0000 (12:17 +0700)
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.

weaver/src/main/java/org/aspectj/weaver/tools/WeavingAdaptor.java

index 551ef45e6499ffb0356abf4802152a6314a1527e..966143fc1156982286db8c7cd526bfdca30b47be 100644 (file)
@@ -369,7 +369,7 @@ public class WeavingAdaptor implements IMessageContext {
 
                        try {
                                delegateForCurrentClass = null;
-                               if (couldWeave(name, bytes)) {
+                               if (shouldWeaveName(name)) {
                                        if (accept(name, bytes)) {
 
                                                // Determine if we have the weaved class cached
@@ -448,14 +448,6 @@ public class WeavingAdaptor implements IMessageContext {
                }
        }
 
-       /**
-        * @param name
-        * @return true if even valid to weave: either with an accept check or to munge it for @AspectJ aspectof support
-        */
-       private boolean couldWeave(String name, byte[] bytes) {
-               return !generatedClasses.containsKey(name) && shouldWeaveName(name);
-       }
-
        /**
         * Return the bytes from a (parallel?) weaving process that generated an inner class, e.g. to support Around closures.
         * This is done instead of weaving again, as weaving would generate another inner class.