diff options
author | Christian Melchior <christian@ilios.dk> | 2017-11-12 15:37:15 +0100 |
---|---|---|
committer | Christian Melchior <christian@ilios.dk> | 2017-11-12 15:37:15 +0100 |
commit | 215a61f3a0a1d2794df51611218068ab09a90d56 (patch) | |
tree | 7309f91e448e346a26d7f339fbd84464402d9406 /src/main/javassist/ByteArrayClassPath.java | |
parent | f4769c7ad702fa529a790106ea5c318a7af5c7b7 (diff) | |
parent | e1f0bba5de4dc03a9debfab333683f07cfbcb594 (diff) | |
download | javassist-215a61f3a0a1d2794df51611218068ab09a90d56.tar.gz javassist-215a61f3a0a1d2794df51611218068ab09a90d56.zip |
Merge branch 'master' into cm/bug/classpath-close
# 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
Diffstat (limited to 'src/main/javassist/ByteArrayClassPath.java')
-rw-r--r-- | src/main/javassist/ByteArrayClassPath.java | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/main/javassist/ByteArrayClassPath.java b/src/main/javassist/ByteArrayClassPath.java index 00397470..b93bc892 100644 --- a/src/main/javassist/ByteArrayClassPath.java +++ b/src/main/javassist/ByteArrayClassPath.java @@ -16,9 +16,10 @@ package javassist; -import java.io.*; -import java.net.URL; +import java.io.ByteArrayInputStream; +import java.io.InputStream; import java.net.MalformedURLException; +import java.net.URL; /** * A <code>ByteArrayClassPath</code> contains bytes that is served as @@ -37,7 +38,7 @@ import java.net.MalformedURLException; * * <p>The <code>ClassPool</code> object <code>cp</code> uses the created * <code>ByteArrayClassPath</code> object as the source of the class file. - * + * * <p>A <code>ByteArrayClassPath</code> must be instantiated for every * class. It contains only a single class file. * @@ -62,6 +63,7 @@ public class ByteArrayClassPath implements ClassPath { this.classfile = classfile; } + @Override public String toString() { return "byte[]:" + classname; } @@ -69,16 +71,17 @@ public class ByteArrayClassPath implements ClassPath { /** * Opens the class file. */ + @Override public InputStream openClassfile(String classname) { if(this.classname.equals(classname)) return new ByteArrayInputStream(classfile); - else - return null; + return null; } /** * Obtains the URL. */ + @Override public URL find(String classname) { if(this.classname.equals(classname)) { String cname = classname.replace('.', '/') + ".class"; |