You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Emmanuel Bourg (JIRA)" <ji...@apache.org> on 2014/04/24 14:45:16 UTC

[jira] [Updated] (BCEL-63) JavaClass.dump(OutputStream/DataOutputStream) shouldnt call close

     [ https://issues.apache.org/jira/browse/BCEL-63?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Emmanuel Bourg updated BCEL-63:
-------------------------------

         Priority: Minor
      Environment:     (was: Operating System: other
Platform: All)
    Fix Version/s: 5.2
         Priority:   (was: P2)
         Severity:   (was: minor)

> JavaClass.dump(OutputStream/DataOutputStream) shouldnt call close
> -----------------------------------------------------------------
>
>                 Key: BCEL-63
>                 URL: https://issues.apache.org/jira/browse/BCEL-63
>             Project: Commons BCEL
>          Issue Type: Bug
>          Components: Main
>    Affects Versions: 5.1
>            Reporter: sam
>            Assignee: Apache Commons Developers
>            Priority: Minor
>             Fix For: 5.2
>
>
> 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.



--
This message was sent by Atlassian JIRA
(v6.2#6252)