]> source.dussan.org Git - javassist.git/commitdiff
Merge branch 'master' into cm/bug/classpath-close
authorChristian Melchior <christian@ilios.dk>
Sun, 12 Nov 2017 14:37:15 +0000 (15:37 +0100)
committerChristian Melchior <christian@ilios.dk>
Sun, 12 Nov 2017 14:37:15 +0000 (15:37 +0100)
# Conflicts:
# pom.xml
# src/main/javassist/ByteArrayClassPath.java
# src/main/javassist/ClassClassPath.java
# src/main/javassist/ClassPoolTail.java
# src/main/javassist/LoaderClassPath.java
# src/main/javassist/URLClassPath.java

1  2 
pom.xml
src/main/javassist/ByteArrayClassPath.java
src/main/javassist/ClassClassPath.java
src/main/javassist/ClassPath.java
src/main/javassist/ClassPoolTail.java
src/main/javassist/LoaderClassPath.java
src/main/javassist/URLClassPath.java
src/test/javassist/JvstTest.java

diff --cc pom.xml
index 6259547a8ce4f204ce7bf8f71424475efd31d5e4,da4222830f7976f27f2eccc66913c8bd3145c5d0..f8b7af497710e1921e73322f0cb179308e3996cf
+++ b/pom.xml
            <includes>
              <include>javassist/JvstTest.java</include>
            </includes>
 -        <forkMode>once</forkMode>
 +          <additionalClasspathElements>
 +            <additionalClasspathElement>resources</additionalClasspathElement>
 +          </additionalClasspathElements>
 +            <forkMode>once</forkMode>
-           <workingDirectory>runtest</workingDirectory>
+       <workingDirectory>${project.build.directory}/runtest</workingDirectory>
          </configuration>
        </plugin>
        <plugin>
index 00397470932e6fc3bc783642570c98de1299baad,f370453ae4e37188199eee145180b9691bcb1968..b93bc8926f437fadcaf7bf9484ee78f3c2c587a6
@@@ -62,6 -63,13 +63,7 @@@ public class ByteArrayClassPath impleme
          this.classfile = classfile;
      }
  
 -    /**
 -     * Closes this class path.
 -     */
 -    @Override
 -    public void close() {}
 -
+     @Override
      public String toString() {
          return "byte[]:" + classname;
      }
index e1c44f08462d5a6d9eced93dd5a1efa5f44599f7,ccc42fa4e19d482f64ffca75e934cfaa0d4424ea..0c2201fa2f54a2d30d63a5c5edf18fa0b961a2f2
@@@ -91,6 -91,14 +91,7 @@@ public class ClassClassPath implements 
          return thisClass.getResource(filename);
      }
  
 -    /**
 -     * Does nothing.
 -     */
 -    @Override
 -    public void close() {
 -    }
 -
+     @Override
      public String toString() {
          return thisClass.getName() + ".class";
      }
Simple merge
index 8e03873c254cb0977a7c6fda162b1b981203e0bf,c28003eadb0a7da2f64d302e4a790b9e5514ec88..ebbfff990f17d286215b74f4d40095c018ba9a2d
@@@ -75,6 -74,10 +77,7 @@@ final class DirClassPath implements Cla
          return null;
      }
  
 -    @Override
 -    public void close() {}
 -
+     @Override
      public String toString() {
          return directory;
      }
@@@ -173,9 -177,19 +179,10 @@@ final class JarClassPath implements Cla
          return null;            // not found
      }
  
 -    public void close() {
 -        try {
 -            jarfile.close();
 -            jarfile = null;
 -        }
 -        catch (IOException e) {}
 -    }
 -
+     @Override
      @Override
      public String toString() {
 -        return jarfile == null ? "<null>" : jarfile.toString();
 +        return jarfileURL == null ? "<null>" : jarfileURL.toString();
      }
  }
  
index 299fdb859997a0aefc4e89adff236b11422da5be,d13e2a7fa59e2e760b9170d92ef89f4a646b0a79..6807dfa3b72e77287bad7a1d47ca6d32924ddb50
@@@ -84,14 -81,21 +81,13 @@@ public class LoaderClassPath implement
       *
       * @return null if the class file could not be found. 
       */
+     @Override
      public URL find(String classname) {
          String cname = classname.replace('.', '/') + ".class";
-         ClassLoader cl = (ClassLoader)clref.get();
+         ClassLoader cl = clref.get();
          if (cl == null)
              return null;        // not found
-         else {
-             URL url = cl.getResource(cname);
-             return url;
-         }
+         URL url = cl.getResource(cname);
+         return url;
      }
 -
 -    /**
 -     * Closes this class path.
 -     */
 -    @Override
 -    public void close() {
 -        clref = null;
 -    }
  }
Simple merge
Simple merge