Bug 340353

Summary: Inappropriate "Null pointer access" errors
Product: [Eclipse Project] JDT Reporter: Szymon Ptaszkiewicz <sptaszkiewicz>
Component: CoreAssignee: Ayushman Jain <amj87.iitr>
Status: VERIFIED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: amj87.iitr, Olivier_Thomann, srikanth_sankaran
Version: 3.4.2   
Target Milestone: 3.7 M7   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Test project none

Description Szymon Ptaszkiewicz CLA 2011-03-17 13:37:42 EDT
Created attachment 191448 [details]
Test project

Attached test project shows two examples of wrong "Null pointer access" errors:
1. If in Main line 13 is commented out, we get error in line 22.
2. If in Main line 17 (for loop) is NOT commented out, we get error in line 20.

Please note that 'Null pointer access' compiler option was raised to Error and 'Potential null pointer access' raised to Warning. If line 17 is commented out, issue number 1 does not occur so both issues are related to each other somehow.

It looks similar to bug 195638 but the other one is about try-catch inside a loop while here we have loop inside try-catch (there is bug 195638 comment 3 which looks similar to this one but it is left without comment there).
Comment 1 Olivier Thomann CLA 2011-03-17 13:44:08 EDT
Are you really reporting that against 3.4.2 ?
Comment 2 Ayushman Jain CLA 2011-03-18 02:43:43 EDT
I couldn't reproduce this with 3.7.
This error might have been fixed post 3.4.2, so please use a newer build.
Comment 3 Ayushman Jain CLA 2011-03-21 09:14:02 EDT
Closing as WORKSFORME since this issue no longer shows up.
Comment 4 Srikanth Sankaran CLA 2011-04-25 02:21:04 EDT
Verified for 3.7 M7 using build I20110421-1800.