Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 341376

Summary: redundant null check in FacetsPropertyPage
Product: [WebTools] WTP Common Tools Reporter: David Williams <david_williams>
Component: Faceted Project FrameworkAssignee: Konstantin Komissarchik <konstantin>
Status: RESOLVED FIXED QA Contact: Konstantin Komissarchik <konstantin>
Severity: minor    
Priority: P3    
Version: unspecified   
Target Milestone: 3.0 M7   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
patch to remove redundant null check none

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.