Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 341376 - redundant null check in FacetsPropertyPage
Summary: redundant null check in FacetsPropertyPage
Status: RESOLVED FIXED
Alias: None
Product: WTP Common Tools
Classification: WebTools
Component: Faceted Project Framework (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 minor (vote)
Target Milestone: 3.0 M7   Edit
Assignee: Konstantin Komissarchik CLA
QA Contact: Konstantin Komissarchik CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-30 11:00 EDT by David Williams CLA
Modified: 2011-03-31 12:02 EDT (History)
0 users

See Also:


Attachments
patch to remove redundant null check (1.45 KB, patch)
2011-03-30 11:01 EDT, David Williams CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Williams CLA 2011-03-30 11:00:24 EDT
While investigating bug 340923, I see the new compiler optimizes out a redundant null check at line 413 of subject class; there is a "if (config != null)" inside a block that has already checked "if (config != null)" 

I suggest the bundle be retagged, to make sure we distribute latest output from compiler, and if we do that, I'd suggest we go ahead and fix the code ... but, obviously doesn't hurt much.
Comment 1 David Williams CLA 2011-03-30 11:01:12 EDT
Created attachment 192201 [details]
patch to remove redundant null check
Comment 2 Konstantin Komissarchik CLA 2011-03-31 11:26:51 EDT
Comment on attachment 192201 [details]
patch to remove redundant null check

The compiler is indeed flagging an unnecessary null check, but the patch is incorrect. It removes the code in question from the else code flow, which is necessary.
Comment 3 Konstantin Komissarchik CLA 2011-03-31 11:43:11 EDT
Removed the redundant null check.
Comment 4 David Williams CLA 2011-03-31 12:02:37 EDT
> ... but the patch is
> incorrect. It removes the code in question from the else code flow, which is
> necessary.

doh, sorry for the sloppy patch. 
thanks for fixing.