blackdrag commented on code in PR #2818:
URL: https://github.com/apache/groovy/pull/2818#discussion_r3809452781


##########
src/main/java/groovy/concurrent/AwaitableAdapterRegistry.java:
##########
@@ -132,25 +189,11 @@ public static <T> Iterable<T> toIterable(Object source) {
                         + ". Register an AwaitableAdapter via ServiceLoader or 
AwaitableAdapterRegistry.register().");
     }
 
-    private static ClassValue<AwaitableAdapter> buildAwaitableCache() {
-        /**
-         * Cache of awaitable adapters by source type.
-         */
+    private static ClassValue<SoftReference<AwaitableAdapter>> 
buildAwaitableCache() {
         return new ClassValue<>() {

Review Comment:
   very important here is that the method is static, otherwise there would be a 
reference to the enclosing class instance, which would pin down the classes and 
prevent class loader unloading. I would add this as a comment to ensure a 
future change does not accidentally introduce this trap. But not blocker.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to