src/share/classes/com/sun/tools/javac/file/CloseableURLClassLoader.java

Print this page

        

@@ -43,13 +43,13 @@
  *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
  *  you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
-class CloseableURLClassLoader
+public class CloseableURLClassLoader
         extends URLClassLoader implements Closeable {
-    CloseableURLClassLoader(URL[] urls, ClassLoader parent) throws Error {
+    public CloseableURLClassLoader(URL[] urls, ClassLoader parent) throws Error {
         super(urls, parent);
         try {
             getLoaders(); //proactive check that URLClassLoader is as expected
         } catch (Throwable t) {
             throw new Error("cannot create CloseableURLClassLoader", t);

@@ -61,10 +61,11 @@
      * Reflection is used to access the jar files in the URLClassLoader's
      * internal data structures.
      * @throws java.io.IOException if the jar files cannot be found for any
      * reson, or if closing the jar file itself causes an IOException.
      */
+    @Override
     public void close() throws IOException {
         try {
             for (Object l: getLoaders()) {
                 if (l.getClass().getName().equals("sun.misc.URLClassPath$JarLoader")) {
                     Field jarField = l.getClass().getDeclaredField("jar");