Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 341367 - unnecessary null check in jem utility method
Summary: unnecessary null check in jem utility method
Status: RESOLVED FIXED
Alias: None
Product: WTP Java EE Tools
Classification: WebTools
Component: jst.j2ee (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 minor (vote)
Target Milestone: 3.3 M7   Edit
Assignee: David Williams CLA
QA Contact: Chuck Bridgham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-30 10:23 EDT by David Williams CLA
Modified: 2011-03-30 17:03 EDT (History)
1 user (show)

See Also:


Attachments
patch to remove unneccessary null check (1.09 KB, patch)
2011-03-30 10:23 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 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.