Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
5.1
-
None
Description
I think it would be more helpful if JavaClass.dump(*OutputStream)
didnt call close as the caller may not be finished with the stream.
Only for JavaClass.dump(File) does BCEL "own" the OutputStream.
It also looks like the caller should provide an extra finally
{... os.close() }as JavaClass.dump may not close the stream in the event of an error.
For a concrete example: When writing a JAR using JarOutputStream
the stream shouldnt be closed till multiple classes have been written.
So the real stream has to be wrapped with a Filter/Proxy that ignores close.
This problem also appears for ClassParser.
Many thanks for your excellent code.