Bug 264159 - Unexpected warning "Potential null pointer access" in assert message
Summary: Unexpected warning "Potential null pointer access" in assert message
Status: VERIFIED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.5   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.6 M5   Edit
Assignee: Ayushman Jain CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-09 07:41 EST by Jan Schnabel CLA
Modified: 2010-01-25 14:23 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Schnabel CLA 2009-02-09 07:41:16 EST
Build ID: 3.4.1

Steps To Reproduce:
Activate "Potential programming problems" --> "Potential null pointer access" (warning)
insert the following lines in you code:
Object o = null;
assert o == null : o.getClass();
I get a warning "Potential null pointer access: The variable o may be null at this location"


More information:
Comment 1 Mike Wilson CLA 2009-05-05 12:55:11 EDT
Changing Version tag to something more believable.
Comment 2 Ayushman Jain CLA 2009-12-10 07:53:14 EST
In version 3.5 as well as 3.6M3, i can see the expected warning "Redundant null check: The variable o can only be null at this location" on o == null.

Can you please upgrade?
Comment 3 Jan Schnabel CLA 2009-12-10 08:11:21 EST
I'm working with M20091202-0800 and actually the reported warning isn't displayed anymore. Maybe it's already fixed since 3.5? I reported it against 3.4.1
Comment 4 Ayushman Jain CLA 2009-12-10 08:23:19 EST
Yes you won't get the unexpected warning if you use 3.5 or latter.
Comment 5 Jan Schnabel CLA 2009-12-10 08:32:40 EST
so I propose to close the bug.
Comment 6 Olivier Thomann CLA 2009-12-10 08:57:57 EST
Closing as WORKSFORME.
Comment 7 Olivier Thomann CLA 2010-01-25 14:23:13 EST
Verified for 3.6M5 using I20100125-0800