Repository: ignite
Updated Branches:
  refs/heads/ignite-zk df49a51b5 -> 930a51799


IGNITE-6729: Removed obsolete reflection-based workaround in URLClassLoader 
closing code.

Signed-off-by: Andrey Gura <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/f1a853de
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/f1a853de
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/f1a853de

Branch: refs/heads/ignite-zk
Commit: f1a853ded8e835ce8c98c029cce7d5d17fbd3f52
Parents: cc5fff5
Author: Andrey Kuznetsov <[email protected]>
Authored: Thu Dec 21 18:25:13 2017 +0300
Committer: Andrey Gura <[email protected]>
Committed: Thu Dec 21 18:25:13 2017 +0300

----------------------------------------------------------------------
 .../ignite/internal/util/IgniteUtils.java       | 28 +++-----------------
 1 file changed, 3 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/f1a853de/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java 
b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
index b493545..c6ce969 100755
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
@@ -4068,41 +4068,19 @@ public abstract class IgniteUtils {
 
     /**
      * Closes class loader logging possible checked exception.
-     * Note: this issue for problem <a 
href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5041014";>
-     * http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5041014</a>.
      *
      * @param clsLdr Class loader. If it's {@code null} - it's no-op.
      * @param log Logger to log possible checked exception with (optional).
      */
     public static void close(@Nullable URLClassLoader clsLdr, @Nullable 
IgniteLogger log) {
-        if (clsLdr != null)
+        if (clsLdr != null) {
             try {
-                URLClassPath path = 
SharedSecrets.getJavaNetAccess().getURLClassPath(clsLdr);
-
-                Field ldrFld = path.getClass().getDeclaredField("loaders");
-
-                ldrFld.setAccessible(true);
-
-                Iterable ldrs = (Iterable)ldrFld.get(path);
-
-                for (Object ldr : ldrs)
-                    if (ldr.getClass().getName().endsWith("JarLoader"))
-                        try {
-                            Field jarFld = 
ldr.getClass().getDeclaredField("jar");
-
-                            jarFld.setAccessible(true);
-
-                            ZipFile jar = (ZipFile)jarFld.get(ldr);
-
-                            jar.close();
-                        }
-                        catch (Exception e) {
-                            warn(log, "Failed to close resource: " + 
e.getMessage());
-                        }
+                clsLdr.close();
             }
             catch (Exception e) {
                 warn(log, "Failed to close resource: " + e.getMessage());
             }
+        }
     }
 
     /**

Reply via email to