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-81) ClassParser.parse() throws NullPointerException if class does not exist and ClassParser(String) constructor is used
Date Thu, 24 Apr 2014 12:05:15 GMT

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

Emmanuel Bourg updated BCEL-81:
-------------------------------

             Priority: Major
          Environment:     (was: Operating System: All
Platform: All)
    Affects Version/s:     (was: unspecified)
        Fix Version/s: 6.0
             Priority:   (was: P2)
             Severity:   (was: regression)

> ClassParser.parse() throws NullPointerException if class does not exist and ClassParser(String)
constructor is used
> -------------------------------------------------------------------------------------------------------------------
>
>                 Key: BCEL-81
>                 URL: https://issues.apache.org/jira/browse/BCEL-81
>             Project: Commons BCEL
>          Issue Type: Bug
>          Components: Main
>            Reporter: Alex Kinneer
>            Assignee: Apache Commons Developers
>             Fix For: 6.0
>
>         Attachments: ClassParser.patch
>
>
> Reproduce:
> ClassParser cp = new ClassParser("does/not/exist/Classfile.class");
> JavaClass jc = cp.parse();
> --> throws NullPointerException instead of FileNotFoundException
> The problem is that when the constructor that accepts a string is used, the
> fileOwned flag is set and parse() attempts to close the file in the finally
> block. The guarded region for the finally block includes the attempt to open the
> input stream, which may fail, but the finally block itself erroneously assumes
> the input stream object has been created.
> Previously this situation caused the method to correctly throw a
> FileNotFoundException.



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

Mime
View raw message