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

Bug 418661

Summary: [Metadata] Get rid of compile warnings in platform projects in official build
Product: [Eclipse Project] Platform Reporter: Dani Megert <daniel_megert>
Component: UIAssignee: Andrey Loskutov <loskutov>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: emoffatt, gamma32, Lars.Vogel, loskutov
Version: 4.5   
Target Milestone: 4.5 M7   
Hardware: All   
OS: All   
See Also: https://git.eclipse.org/r/45269
https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=3a2fa1fad22a05ba57dcc425cf4dc199eb53e85a
https://git.eclipse.org/r/45299
https://git.eclipse.org/r/45300
https://git.eclipse.org/r/45302
https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=a7a9831ec9324f493b778f2debe6366cca033fc3
https://git.eclipse.org/r/45303
https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=05ebbc7b4891a24ca95be20f5ebf33cf9e2b8833
https://git.eclipse.org/r/45306
https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=c21b10add6637ba71ad6a82a5b4fa7a5d572e611
https://git.eclipse.org/r/45308
https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=aa3c28b81ab9773d9e5b98913e97a79d0d0f56ed
https://git.eclipse.org/c/platform/eclipse.platform.ui.tools.git/commit/?id=96ab90fcc2742e9aa7e7bc8fa2c23a19a37894a6
https://git.eclipse.org/c/platform/eclipse.platform.ui.tools.git/commit/?id=03679fe6f9e1efc1c6837b4a9ffa9dd3eb9e51ab
Whiteboard:

Description Dani Megert CLA 2013-10-04 05:59:24 EDT
org.eclipse.e4.*
org.eclipse.ui.*
and
org.eclipse.jface.*

cause thousands of compile warnings in official build.
Comment 1 Eric Moffatt CLA 2013-10-28 15:16:27 EDT
Dani, that's going to be a *huge* amount of churn so I'm not sure when / how we're going to get there. I'm +1 for 'e4.*' at least since we have a chance there because there's less code and fewer warnings to start with.

I am a bit skeptical whether attacking the warnings on the more mature components is worth the time (and the risk of a regression happening).
Comment 2 Dani Megert CLA 2013-10-29 04:19:58 EDT
(In reply to Eric Moffatt from comment #1)
> Dani, that's going to be a *huge* amount of churn so I'm not sure when / how
> we're going to get there. I'm +1 for 'e4.*' at least since we have a chance
> there because there's less code and fewer warnings to start with.
> 
> I am a bit skeptical whether attacking the warnings on the more mature
> components is worth the time (and the risk of a regression happening).

In those cases we have to ignore them - at least in the build, otherwise there is no chance to see and fix "real" warnings. I can do that if you list the projects where you don't intend to get rid of the warnings.
Comment 4 Dani Megert CLA 2013-10-30 11:55:40 EDT
(In reply to Paul Webster from comment #3)
> Dani, are we talking about pages like:
> http://download.eclipse.org/eclipse/downloads/drops4/I20131029-2000/
> compilelogs/plugins/org.eclipse.jface_3.10.0.v20131015-1506/@dot.html
> 
> PW

What I meant, is, I need the list of those that *you* want to disable ;-).
Comment 5 Dani Megert CLA 2013-10-30 12:25:35 EDT
Here you go: I've disabled 'raw' and 'unchecked' for all non-e4 bundles with http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=5438d8323aa6ff6cc59f5de9f305a490c7392410
Comment 6 Paul Webster CLA 2014-04-14 10:20:12 EDT
Dani, am I trying to get rid of compile and discouraged access warnings at the bottom of this page?

http://download.eclipse.org/eclipse/downloads/drops4/I20140408-1645/testResults.php

PW
Comment 7 Dani Megert CLA 2014-04-14 11:14:30 EDT
(In reply to Paul Webster from comment #6)
> Dani, am I trying to get rid of compile and discouraged access warnings at
> the bottom of this page?
> 
> http://download.eclipse.org/eclipse/downloads/drops4/I20140408-1645/
> testResults.php
> 
> PW

This bug is about the Java compile warnings. The discouraged ones existed even in 3.x and it will probably be lots of work to fix them now.
Comment 10 Dani Megert CLA 2014-04-15 06:04:32 EDT
(In reply to Paul Webster from comment #8)
> Within eclipse, I get a warning unless I include
> @SuppressWarning("unchecked").
> 
> http://download.eclipse.org/eclipse/downloads/drops4/I20140408-1645/
> compilelogs/plugins/org.eclipse.e4.emf.xpath_0.1.1.v20130515-1857/@dot.html
> 
> 1. WARNING in /src/org/eclipse/e4/emf/internal/xpath/JXPathContextImpl.java
>  (at line 86)
> @SuppressWarnings("unchecked")
> Unnecessary @SuppressWarnings("unchecked")
> 
> PW

This happens because the project specific compiler option
[ ] Ignore unavoidable generic type problems due to raw APIs.
is not enabled.
Comment 11 Dani Megert CLA 2014-04-24 03:04:08 EDT
(In reply to Dani Megert from comment #10)
> (In reply to Paul Webster from comment #8)
> > Within eclipse, I get a warning unless I include
> > @SuppressWarning("unchecked").
> > 
> > http://download.eclipse.org/eclipse/downloads/drops4/I20140408-1645/
> > compilelogs/plugins/org.eclipse.e4.emf.xpath_0.1.1.v20130515-1857/@dot.html
> > 
> > 1. WARNING in /src/org/eclipse/e4/emf/internal/xpath/JXPathContextImpl.java
> >  (at line 86)
> > @SuppressWarnings("unchecked")
> > Unnecessary @SuppressWarnings("unchecked")
> > 
> > PW
> 
> This happens because the project specific compiler option
> [ ] Ignore unavoidable generic type problems due to raw APIs.
> is not enabled.

I've fixed that.
Comment 12 Paul Webster CLA 2014-04-24 16:43:37 EDT
(In reply to Dani Megert from comment #11)
> 
> I've fixed that.

Thanks Dani.  I've done a couple more: http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=31d49147a2fa7c327633dbc42ab73c36577e4926

PW
Comment 13 Lars Vogel CLA 2014-04-28 14:53:52 EDT
I think this is not "only" about the build but about warning messages in general -> adjusted the title
Comment 14 Lars Vogel CLA 2014-04-28 14:54:20 EDT
*** Bug 428355 has been marked as a duplicate of this bug. ***
Comment 15 Dani Megert CLA 2014-04-29 07:30:20 EDT
(In reply to Lars Vogel from comment #13)
> I think this is not "only" about the build but about warning messages in
> general -> adjusted the title

No this is about the warnings we still have in the build.
Comment 17 Dani Megert CLA 2015-03-27 06:09:49 EDT
Lars, it would be good if we can get rid of them for 4.5.
Comment 18 Dani Megert CLA 2015-03-27 06:12:49 EDT
Current state:

org.eclipse.e4.tools.compat_1.0.0.N20150326-2000 	0 	2
org.eclipse.e4.tools.emf.ui_1.0.0.N20150326-2000 	0 	8
org.eclipse.e4.ui.css.core_0.10.200.N20150326-2000 	0 	111
org.eclipse.e4.ui.services_1.1.0.N20150326-2000 	0 	15
org.eclipse.e4.ui.tests.css.swt_0.9.1.N20150326-2000 	0 	13
org.eclipse.e4.ui.workbench.swt_0.12.100.N20150326-2000 0 	40
org.eclipse.e4.ui.workbench_1.3.0.N20150326-2000 	0 	45
Comment 19 Andrey Loskutov CLA 2015-04-01 05:34:57 EDT
(In reply to Dani Megert from comment #18)
> Current state:
> 
> org.eclipse.e4.tools.compat_1.0.0.N20150326-2000 	0 	2
> org.eclipse.e4.tools.emf.ui_1.0.0.N20150326-2000 	0 	8
> org.eclipse.e4.ui.css.core_0.10.200.N20150326-2000 	0 	111
> org.eclipse.e4.ui.services_1.1.0.N20150326-2000 	0 	15
> org.eclipse.e4.ui.tests.css.swt_0.9.1.N20150326-2000 	0 	13
> org.eclipse.e4.ui.workbench.swt_0.12.100.N20150326-2000 0 	40
> org.eclipse.e4.ui.workbench_1.3.0.N20150326-2000 	0 	45

Dani, how one can correlate the results above with Eclipse compiler settings we use for the projects above?

Is there some "default" preferences file for jdt one can download and apply to the projects (at least locally) so that one can see exact those numbers above in the Problems view and kill them one-by-one?

I'm willing to spend time on it, but I fear that I introduce even more warnings similar to bug 463618.
Comment 20 Dani Megert CLA 2015-04-01 06:44:13 EDT
(In reply to Andrey Loskutov from comment #19)
> (In reply to Dani Megert from comment #18)
> > Current state:
> > 
> > org.eclipse.e4.tools.compat_1.0.0.N20150326-2000 	0 	2
> > org.eclipse.e4.tools.emf.ui_1.0.0.N20150326-2000 	0 	8
> > org.eclipse.e4.ui.css.core_0.10.200.N20150326-2000 	0 	111
> > org.eclipse.e4.ui.services_1.1.0.N20150326-2000 	0 	15
> > org.eclipse.e4.ui.tests.css.swt_0.9.1.N20150326-2000 	0 	13
> > org.eclipse.e4.ui.workbench.swt_0.12.100.N20150326-2000 0 	40
> > org.eclipse.e4.ui.workbench_1.3.0.N20150326-2000 	0 	45
> 
> Dani, how one can correlate the results above with Eclipse compiler settings
> we use for the projects above?

This is pretty easy: the builder (usually - see last paragraph below) uses the defaults except for deprecation warnings (Ignore) and also ignores unavoidable generic type problems due to raw APIs.

So, simply start with a new workspace (or reset the 'Errors/Warnings' preferences), make those two changes, and then on the UI project(s) uncheck 'Enable project specific settings'.

NOTE: Some UI projects (not the ones listed above) tweak the options used by the official build. Look out for <code.ignoredWarnings> in the pom.xml.
Comment 21 Eclipse Genie CLA 2015-04-03 18:12:25 EDT
New Gerrit change created: https://git.eclipse.org/r/45269
Comment 23 Eclipse Genie CLA 2015-04-04 16:34:31 EDT
New Gerrit change created: https://git.eclipse.org/r/45299
Comment 24 Eclipse Genie CLA 2015-04-04 18:26:58 EDT
New Gerrit change created: https://git.eclipse.org/r/45300
Comment 25 Eclipse Genie CLA 2015-04-05 03:05:42 EDT
New Gerrit change created: https://git.eclipse.org/r/45302
Comment 27 Eclipse Genie CLA 2015-04-05 05:20:55 EDT
New Gerrit change created: https://git.eclipse.org/r/45303
Comment 29 Eclipse Genie CLA 2015-04-05 10:53:47 EDT
New Gerrit change created: https://git.eclipse.org/r/45306
Comment 31 Eclipse Genie CLA 2015-04-05 11:56:04 EDT
New Gerrit change created: https://git.eclipse.org/r/45308
Comment 33 Andrey Loskutov CLA 2015-04-06 03:41:08 EDT
I think I've fixed all warnings in platform from the list in comment 18, see http://download.eclipse.org/eclipse/downloads/drops4/N20150405-2000/testResults.php#PluginsErrors.

Lars, can you please integrate those 2 patches below (I have no rights to push to e4 tools):
https://git.eclipse.org/r/45300
https://git.eclipse.org/r/45302
Comment 36 Lars Vogel CLA 2015-04-07 05:27:23 EDT
(In reply to Andrey Loskutov from comment #33)
> I think I've fixed all warnings in platform from the list in comment 18, see
> http://download.eclipse.org/eclipse/downloads/drops4/N20150405-2000/
> testResults.php#PluginsErrors.

Thanks Andrey, I think this is fixed with your series of patches.
Comment 37 Lars Vogel CLA 2015-04-28 06:47:39 EDT
Verified by looking really hard at http://download.eclipse.org/eclipse/downloads/drops4/I20150428-0100/testResults.php