Bug 340353 - Inappropriate "Null pointer access" errors
Summary: Inappropriate "Null pointer access" errors
Status: VERIFIED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.7 M7   Edit
Assignee: Ayushman Jain CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-17 13:37 EDT by Szymon Ptaszkiewicz CLA
Modified: 2011-04-25 02:21 EDT (History)
3 users (show)

See Also:


Attachments
Test project (4.59 KB, application/octet-stream)
2011-03-17 13:37 EDT, Szymon Ptaszkiewicz CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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.