Bug 232744 - Potential NPE in JavaModelManager#readState
Summary: Potential NPE in JavaModelManager#readState
Status: VERIFIED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: 3.4 RC2   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-05-19 05:37 EDT by Maxime Daniel CLA
Modified: 2008-05-23 06:45 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Maxime Daniel CLA 2008-05-19 05:37:55 EDT
Source based, v_865 (aka 3.4 RC1).

If the file tested on line 3111 happens to disappear before line 3113 (unlikely but possible) or is not readable for the current user (in which case exists() should still return true provided that the directory is readable), then an NPE would be thrown on line 3126.
Comment 1 Maxime Daniel CLA 2008-05-19 05:42:23 EDT
Reading the code again, this is untrue. A failure to open the stream will jump the finally block of the innermost try statement.
Comment 2 Frederic Fusier CLA 2008-05-23 06:45:47 EDT
Agreed, any exception on input stream opening line 3113 will be caught by the catch(Exception ex) block at line 3128 avoiding the finally block at line 3125.

Verified for 3.4RC2 using v_868 code.