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:05:15 UTC

[jira] [Updated] (BCEL-81) ClassParser.parse() throws NullPointerException if class does not exist and ClassParser(String) constructor is used

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