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

Bug 341367

Summary: unnecessary null check in jem utility method
Product: [WebTools] WTP Java EE Tools Reporter: David Williams <david_williams>
Component: jst.j2eeAssignee: David Williams <david_williams>
Status: RESOLVED FIXED QA Contact: Chuck Bridgham <cbridgha>
Severity: minor    
Priority: P3 CC: ccc
Version: unspecified   
Target Milestone: 3.3 M7   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
patch to remove unneccessary null check none

Description David Williams CLA 2011-03-30 10:23:20 EDT
While investigating bug 340923, part of the reason for different byte codes is that now the compiler more correctly (or aggressively?) optimizes out unnecessary null checks. 

I'll attach patch, but in short, there's a point where a 'folders' variable can not be null, in
org.eclipse.jem.workbench/workbench/org/eclipse/jem/workbench/utility/JemProjectUtilities.java 


To avoid "bytes changed but qualifier did not change" warning, the bundle should be re-tagged, and if we are going to that trouble, just as well fix the code.
Comment 1 David Williams CLA 2011-03-30 10:23:53 EDT
Created attachment 192194 [details]
patch to remove unneccessary null check
Comment 2 David Williams CLA 2011-03-30 17:03:04 EDT
actually fixed two unnecessary null checks, so that way projects settings can be left "on" to flag unnecessary null checks as errors.