diff options
author | nickl- <github@jigsoft.co.za> | 2017-10-30 20:37:23 +0200 |
---|---|---|
committer | nickl- <github@jigsoft.co.za> | 2017-10-30 20:37:23 +0200 |
commit | 62851d0af30cdb0c54046627585451a468aacd2a (patch) | |
tree | fd7632ac39246a9598cb5bf6176c4bf0bcb21744 /src/main/javassist/ClassClassPath.java | |
parent | 45b4c55361eef93542db8014e3ef8941169c97bd (diff) | |
download | javassist-62851d0af30cdb0c54046627585451a468aacd2a.tar.gz javassist-62851d0af30cdb0c54046627585451a468aacd2a.zip |
Source walk/Spring clean/Parameterize/Enhance et.al.
The following were applied during multiple itterations through the source.
* Parameterize raw types.
* Mark unused members.
* Annotate override and deprecated methods.
* Convert loops to enhance for loop.
* Remove redundant else statements.
* Widening collection type references.
* Optimize code for improved readability.
* Squash compiler warnings.
* Identify smells.
Diffstat (limited to 'src/main/javassist/ClassClassPath.java')
-rw-r--r-- | src/main/javassist/ClassClassPath.java | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/main/javassist/ClassClassPath.java b/src/main/javassist/ClassClassPath.java index 3befbf4c..ccc42fa4 100644 --- a/src/main/javassist/ClassClassPath.java +++ b/src/main/javassist/ClassClassPath.java @@ -19,8 +19,6 @@ package javassist; import java.io.InputStream; import java.net.URL; -import javassist.bytecode.ClassFile; - /** * A search-path for obtaining a class file * by <code>getResourceAsStream()</code> in <code>java.lang.Class</code>. @@ -43,13 +41,13 @@ import javassist.bytecode.ClassFile; * <p>Class files in a named module are private to that module. * This method cannot obtain class files in named modules. * </p> - * + * * @see ClassPool#insertClassPath(ClassPath) * @see ClassPool#appendClassPath(ClassPath) * @see LoaderClassPath */ public class ClassClassPath implements ClassPath { - private Class thisClass; + private Class<?> thisClass; /** Creates a search path. * @@ -57,7 +55,7 @@ public class ClassClassPath implements ClassPath { * file. <code>getResourceAsStream()</code> is called on * this object. */ - public ClassClassPath(Class c) { + public ClassClassPath(Class<?> c) { thisClass = c; } @@ -76,6 +74,7 @@ public class ClassClassPath implements ClassPath { /** * Obtains a class file by <code>getResourceAsStream()</code>. */ + @Override public InputStream openClassfile(String classname) throws NotFoundException { String filename = '/' + classname.replace('.', '/') + ".class"; return thisClass.getResourceAsStream(filename); @@ -84,8 +83,9 @@ public class ClassClassPath implements ClassPath { /** * Obtains the URL of the specified class file. * - * @return null if the class file could not be found. + * @return null if the class file could not be found. */ + @Override public URL find(String classname) { String filename = '/' + classname.replace('.', '/') + ".class"; return thisClass.getResource(filename); @@ -94,9 +94,11 @@ public class ClassClassPath implements ClassPath { /** * Does nothing. */ + @Override public void close() { } + @Override public String toString() { return thisClass.getName() + ".class"; } |