commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Emmanuel Bourg (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (BCEL-63) JavaClass.dump(OutputStream/DataOutputStream) shouldnt call close
Date Thu, 24 Apr 2014 12:45:16 GMT

     [ 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)

Mime
View raw message