You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by "cshannon (via GitHub)" <gi...@apache.org> on 2023/03/01 23:29:16 UTC

[GitHub] [accumulo] cshannon commented on a diff in pull request #3206: Replace all instances of Guava cache with Caffeine

cshannon commented on code in PR #3206:
URL: https://github.com/apache/accumulo/pull/3206#discussion_r1122419787


##########
core/src/main/java/org/apache/accumulo/core/classloader/URLContextClassLoaderFactory.java:
##########
@@ -63,19 +62,15 @@ public ClassLoader getClassLoader(String context) {
       throw new IllegalArgumentException("Unknown context");
     }
 
-    try {
-      return classloaders.get(context, () -> {
-        LOG.debug("Creating URLClassLoader for context, uris: {}", context);
-        return new URLClassLoader(Arrays.stream(context.split(",")).map(url -> {
-          try {
-            return new URL(url);
-          } catch (MalformedURLException e) {
-            throw new RuntimeException(e);
-          }
-        }).collect(Collectors.toList()).toArray(new URL[] {}), ClassLoader.getSystemClassLoader());
-      });
-    } catch (ExecutionException e) {
-      throw new RuntimeException(e);
-    }
+    return classloaders.get(context, k -> {
+      LOG.debug("Creating URLClassLoader for context, uris: {}", context);
+      return new URLClassLoader(Arrays.stream(context.split(",")).map(url -> {
+        try {
+          return new URL(url);
+        } catch (MalformedURLException e) {
+          throw new RuntimeException(e);
+        }
+      }).collect(Collectors.toList()).toArray(new URL[] {}), ClassLoader.getSystemClassLoader());

Review Comment:
   Good catch, I will go ahead and fix that.



-- 
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: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org