DO NOT REPLY [Bug 39770] New: - ClassParser.parse() throws NullPointerException if class does not exist and ClassParser(String) constructor is used
| Newsgroups | gmane.comp.jakarta.bcel.devel |
|---|---|
| Message-ID | <[email protected]/bugzilla/> |
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39770>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=39770
Summary: ClassParser.parse() throws NullPointerException if class
does not exist and ClassParser(String) constructor is
used
Product: BCEL
Version: unspecified
Platform: All
OS/Version: All
Status: NEW
Severity: regression
Priority: P2
Component: Main
AssignedTo: [email protected]
ReportedBy: [email protected]
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.
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.