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

Bug 340923

Summary: many comparator errors in latest I-build
Product: [WebTools] WTP Releng Reporter: David Williams <david_williams>
Component: relengAssignee: David Williams <david_williams>
Status: RESOLVED FIXED QA Contact: David Williams <david_williams>
Severity: normal    
Priority: P3 CC: ccc, keith.chong.ca, Olivier_Thomann, raghunathan.srinivasan, thatnitind
Version: unspecifiedFlags: david_williams: pmc_approved+
Target Milestone: 3.10.0   
Hardware: PC   
OS: Windows 7   
Whiteboard: PMC_approved

Description David Williams CLA 2011-03-24 19:06:27 EDT
Not sure why, but there's many comparator errors in latest I build, indicating bundles need to be retagged, to get latest byte codes. 

http://build.eclipse.org/webtools/committers/wtp-R3.3.0-I/20110324075937/I-3.3.0-20110324075937/testResults/comparatorUnexpectedMessages.log.txt

Unknown at this point if this is due to some "unharmful" change, accidental compiler flag change, or if some static constant changed. If the later, then current "delivered" code would be invalid.
Comment 1 David Williams CLA 2011-03-26 17:17:35 EDT
What I've learned so far ... we did switch to new compiler, in I-build. For M6, we used "base builder", which included the JDT compiler marked 

Eclipse Compiler for Java(TM) Version: 0.B37, 3.7.0 M6

Now, for post M6, we no longer use base builder, but directly use the Eclipse SDK, and incidentally moved to M6, and thus moved to the compiler build 42 ... or, more exactly, the one marked 

Eclipse Compiler for Java(TM) Version: 0.B42, 3.7.0 M6
Comment 2 Nitin Dahyabhai CLA 2011-03-28 13:41:58 EDT
Updated for newly-detected dead code block in org.eclipse.wst.common.snippets.
Comment 3 David Williams CLA 2011-03-30 10:29:25 EDT
FWIW, the slightly more persistent URL for these comparator warnings, after promoting weekly build, is 

http://download.eclipse.org/webtools/downloads/drops/R3.3.0/I-3.3.0-20110324075937/testResults/comparatorUnexpectedMessages.log.txt
Comment 4 David Williams CLA 2011-03-30 16:29:33 EDT
I've investigated several cases in detail, and all I've looked at 
had to do with redundant null checks being optimized out (or left in) 
the resultant byte codes. I think most of this work in 
JDT compiler was described in bug 326950. 

I don't plan on doing any additional detailed analysis and will encourage 
everyone to a) at least re-tag the listed bundles, to make sure 
their qualifier increases, and b) set "redundant null checks" to error, 
so can fix source where desired, and c) set "dead code" to error, 
so can fix/improve some cases. I think most projects could have "redundant
null checks" and "dead code" set to error as part of project settings, 
but some may want to leave as 'warning', such as if lots 
of "intentional" dead code.  

= = = = = 

JemProjectUtilities

unnecessary null check is optimized out
opened bug 341367 
(but, by chance, discovered bug 341353 which is more important to fix)


FacetsPropertyPage

unnecessary null check is optimized out
opened bug 341376


org.eclipse.jst.ws.axis.consumption.core
unnecessary null check is ?left in?, in both classes
Java2WSDLCommand
WSDL2JavaCommand
This all involve a check for null input stream, in statements such as 
            finStream = new FileInputStream(tempOutputWsdlFile);
            if(finStream != null)
            { ...
But in this case, I think the "new" compiler leaves in the null 
checks, instead of optimizing it out ... unless I got my files confused. 


XDocletBuilder
unnecessary null check is ?left in?

Looking at bytes codes, this one more confusing than most, 
since a lot of code is, apparently intentionally,
"omitted" by some 'if' statements, such it has an
if (performValidateEdit) 
where performValidateEdit is a final static set to false.
This makes the "before/after" byte codes even more confusing ... 
such as ends up with something like 
IStatus status = null; if (status == null || status.isOk) ... 
which makes little sense ... but, would take some effort to 
clean up and support. 
For this reason, I suggest this one just be re-tagged, unless 
someone really wants to go and clean up the code? 

I'm assuming other cases are similar, where the changes in byte codes 
"don't really matter", but for purposes of long term maintenance, etc., 
would be best to (at least) re-tag, so our deliverables match latest
compiler output.
Comment 5 David Williams CLA 2011-03-30 16:33:01 EDT
Adding you to CC, Olivier, just in case you are interested in many "real life" cases. No action required.
Comment 6 David Williams CLA 2011-03-30 16:39:35 EDT
The following are latest list of bundles that should be retagged so qualifier increases: 

org.eclipse.jem.workbench,2.0.300.v200910290230
org.eclipse.wst.common.project.facet.ui,1.4.200.v201101240054
org.eclipse.jst.ws.axis.consumption.core,1.0.406.v201004211805
org.eclipse.jst.ws.axis.creation.ui,1.0.700.v201010181550
org.eclipse.jst.jsf.facesconfig,1.2.1.v20100906
org.eclipse.wst.wsi,1.0.400.v201004220210
org.eclipse.jst.common.ui,1.0.100.v201101101900
org.eclipse.jst.ws,1.0.507.v201004211805
org.eclipse.wst.wsdl.validation,1.1.501.v201004201506
org.eclipse.wst.wsi.ui,1.0.501.v201004201506
org.eclipse.wst.xsd.core,1.1.600.v201011122042
org.eclipse.jst.ws.jaxrs.ui,1.0.400.v201012031836
org.eclipse.jst.j2ee.ejb.annotations.xdoclet,1.2.100.v201003112036
Comment 7 David Williams CLA 2011-03-30 16:41:08 EDT
(In reply to comment #6)
> The following are latest list of bundles that should be retagged so qualifier
> increases: 
> 

Should have said "at least" re-tagged. In some cases, source code could probably be improved, as well, if "redundant null checks" or "dead code" turned to "errors" and fixed.
Comment 8 David Williams CLA 2011-03-30 17:53:40 EDT
I've fixed 
org.eclipse.jem.workbench, and 
org.eclipse.jst.j2ee.ejb.annotations.xdoclet
(Note, there is no "maintenance" branch for xdoclet bundle, but I left "as is". 
since didn't make a code, change, just incremented service field and retagged, so 3.3 version will be district, since byte codes different). 

That leaves, 

org.eclipse.wst.common.project.facet.ui,1.4.200.v201101240054
org.eclipse.jst.ws.axis.consumption.core,1.0.406.v201004211805
org.eclipse.jst.ws.axis.creation.ui,1.0.700.v201010181550
org.eclipse.jst.jsf.facesconfig,1.2.1.v20100906
org.eclipse.wst.wsi,1.0.400.v201004220210
org.eclipse.jst.common.ui,1.0.100.v201101101900
org.eclipse.jst.ws,1.0.507.v201004211805
org.eclipse.wst.wsdl.validation,1.1.501.v201004201506
org.eclipse.wst.wsi.ui,1.0.501.v201004201506
org.eclipse.wst.xsd.core,1.1.600.v201011122042
org.eclipse.jst.ws.jaxrs.ui,1.0.400.v201012031836
Comment 9 Keith Chong CLA 2011-03-31 14:56:24 EDT
Looks like the defaults are:

Redundant null check: Ignore
Dead code (e.g. "if (false)"): Warning
Comment 10 Keith Chong CLA 2011-04-06 23:25:27 EDT
The following have been retagged for the 3.3 build:
org.eclipse.jst.ws.axis.consumption.core
org.eclipse.jst.ws.axis.creation.ui
org.eclipse.wst.wsi
org.eclipse.jst.ws
org.eclipse.wst.wsdl.validation
org.eclipse.wst.wsi.ui
org.eclipse.wst.xsd.core
org.eclipse.jst.ws.jaxrs.ui
Comment 11 David Williams CLA 2011-05-03 00:38:17 EDT
There's only a few of these left to tag. 

I'll do 

org.eclipse.jst.common.ui
Comment 12 David Williams CLA 2011-05-03 00:48:22 EDT
Appears 
org.eclipse.jst.common.ui
has already had a service field increment in HEAD (vs. R3_3_maintenance)
so I literally just retagged. 

That leaves only 
org.eclipse.jst.jsf.facesconfig

(There is another showing up in comparator logs, but for different reasons, and there's another bug open for that: bug 344207.
Comment 13 David Williams CLA 2011-05-03 00:52:48 EDT
Raghu, 

Can you re-tag 
org.eclipse.jst.jsf.facesconfig

so we can get this one closed? 

(Or, if there's some reason you don't want to, let me know that too).
Comment 14 Raghunathan Srinivasan CLA 2011-05-03 13:34:57 EDT
(In reply to comment #13)
> Raghu, 
> 
> Can you re-tag 
> org.eclipse.jst.jsf.facesconfig
> 
> so we can get this one closed? 
> 
> (Or, if there's some reason you don't want to, let me know that too).

For re-tagging, don't I need to increment the service version too to avoid version errors?
Comment 15 David Williams CLA 2011-05-03 13:43:59 EDT
(In reply to comment #14)
> (In reply to comment #13)
> > Raghu, 
> > 
> > Can you re-tag 
> > org.eclipse.jst.jsf.facesconfig
> > 
> > so we can get this one closed? 
> > 
> > (Or, if there's some reason you don't want to, let me know that too).
> 
> For re-tagging, don't I need to increment the service version too to avoid
> version errors?

Yes. 

This could be a reason why some people would prefer not to retag, and continue to use the old version, compiled by the old compiler, but ... to me it seems cleaner and easier to maintain to be "current".
Comment 16 Raghunathan Srinivasan CLA 2011-05-03 14:43:28 EDT
Released fix for org.eclipse.jst.jsf.facesconfig
Comment 17 Raghunathan Srinivasan CLA 2011-05-03 14:43:44 EDT
fixed