lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From uschind...@apache.org
Subject svn commit: r1582557 - /lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/core/SolrResourceLoader.java
Date Fri, 28 Mar 2014 00:04:38 GMT
Author: uschindler
Date: Fri Mar 28 00:04:37 2014
New Revision: 1582557

URL: http://svn.apache.org/r1582557
Log:
LUCENE-5514: Remove one more Java 6 hack

Modified:
    lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/core/SolrResourceLoader.java

Modified: lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/core/SolrResourceLoader.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/core/SolrResourceLoader.java?rev=1582557&r1=1582556&r2=1582557&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/core/SolrResourceLoader.java
(original)
+++ lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/core/SolrResourceLoader.java
Fri Mar 28 00:04:37 2014
@@ -212,7 +212,7 @@ public class SolrResourceLoader implemen
         }
       }
       ClassLoader oldParent = oldLoader.getParent();
-      closeHack(oldLoader); // best effort
+      IOUtils.closeWhileHandlingException(oldLoader); // best effort
       return URLClassLoader.newInstance(elements, oldParent);
     }
     // are we still here?
@@ -791,19 +791,9 @@ public class SolrResourceLoader implemen
     }
     throw new SolrException( SolrException.ErrorCode.SERVER_ERROR, builder.toString() );
   }
-  
-  /** 
-   * We don't have URLClassLoader.close() until java7, but
-   * we still try to release resources with a Schindler-häck
-   */
-  private static void closeHack(URLClassLoader loader) {
-    if (loader instanceof Closeable) {
-      IOUtils.closeWhileHandlingException((Closeable)loader);
-    }
-  }
 
   @Override
   public void close() throws IOException {
-    closeHack(classLoader);
+    IOUtils.close(classLoader);
   }
 }



Mime
View raw message