We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I use javassist to modify method in jar. The jar file which to be modified will be opened after process.
It will return JarURLInputStream When jar file is opened by openClassfile of JarClassPath. It will check cache when JarURLInputStream close.
class JarURLInputStream extends java.io.FilterInputStream {
JarURLInputStream (InputStream src) { super (src); } public void close () throws IOException { try { super.close(); } finally { if (!getUseCaches()) { jarFile.close(); } } } }
I modified openClassfile in JarClassPath like this. It will be ok.
public InputStream openClassfile(String classname) throws NotFoundException
{ URL jarURL = find(classname); if (null != jarURL) try { URLConnection urlConnection = jarURL.openConnection(); urlConnection.setUseCaches(false); return urlConnection.getInputStream(); } catch (IOException e) { throw new NotFoundException("broken jar file?: " + classname); } return null; }
The text was updated successfully, but these errors were encountered:
stops a potential leak in JarClassPath openClassfile(). Issues #222.
1719817
OK, I've fixed it.
Sorry, something went wrong.
The previous fix was reverted. To disable the cache, do javassist.ClassPool.cacheOpenedJarFile = false.
javassist.ClassPool.cacheOpenedJarFile = false
No branches or pull requests
I use javassist to modify method in jar. The jar file which to be modified will be opened after process.
It will return JarURLInputStream When jar file is opened by openClassfile of JarClassPath.
It will check cache when JarURLInputStream close.
I modified openClassfile in JarClassPath like this. It will be ok.
The text was updated successfully, but these errors were encountered: