| Summary: | Fix build warnings in I20161005-1430 | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Stefan Xenos <sxenos> |
| Component: | Core | Assignee: | Stefan Xenos <sxenos> |
| Status: | VERIFIED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | daniel_megert, jarthana, manoj.palat, stephan.herrmann |
| Version: | 4.6 | Flags: | manoj.palat:
review-
|
| Target Milestone: | 4.7 M3 | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| See Also: |
https://git.eclipse.org/r/82572 https://git.eclipse.org/r/82985 https://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?id=888efa82e8bf7dca948fafeddbba604ce0d35d22 |
||
| Whiteboard: | |||
|
Description
Stefan Xenos
New Gerrit change created: https://git.eclipse.org/r/82572 (In reply to Stefan Xenos from comment #0) > It looks like the Hudson builds are ignoring the fact that JDT core enables > the "hiding" warning, so it generates warnings when it is unnecessarily > suppressed. Any build (also PDE) uses the defaults and not the project settings. You can tell PDE (in build.properties) and Hudson (pom.xml) to enable the "hiding" warning. Take a look at how jdt.ui disables unavoidableGenericProblems. NOTE: Before enabling it in the build, make sure that in the code all problems are fixed (set it to error to test). (In reply to Dani Megert from comment #2) > (In reply to Stefan Xenos from comment #0) > > It looks like the Hudson builds are ignoring the fact that JDT core enables > > the "hiding" warning, so it generates warnings when it is unnecessarily > > suppressed. > > Any build (also PDE) uses the defaults and not the project settings. Just to clarify: it uses the defaults unless overridden in the top-level parent POM. Seeing this in the proposed change: org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore I believe it's good to have a consensus about such changes before pushing. In this particular case I kind-of agree *because* we already require all field references to be qualified with "this". In this context, allowing locals to hide a field has two implications: + our accustomed style of coding avoids ambiguity between local and field - we no longer get a warning when we forget "this.". What do others think? Ping! Waiting for project lead approval before pushing this change. (In reply to Stephan Herrmann from comment #4) > - we no longer get a warning when we forget "this.". I have found this useful in the past. In effect, we will be ignoring two warnings with this change. I don't mind introducing new warning to be in line with the global SDK build settings, but don't want to let go of existing ones. So, I will go with Dani's suggestion of adding custom warning options: <code.ignoredWarnings>-warn:-fieldHiding</code.ignoredWarnings> to the pom.xml and javacWarnings..=-fieldHiding to the build properties. (In reply to Jay Arthanareeswaran from comment #7) > (In reply to Stephan Herrmann from comment #4) > > - we no longer get a warning when we forget "this.". > > I have found this useful in the past. In effect, we will be ignoring two > warnings with this change. I don't mind introducing new warning to be in > line with the global SDK build settings, but don't want to let go of > existing ones. So, I will go with Dani's suggestion of adding custom warning > options: > > <code.ignoredWarnings>-warn:-fieldHiding</code.ignoredWarnings> > > to the pom.xml and > > javacWarnings..=-fieldHiding to the build properties. I also wouldn't want to let go of any existing warnings. +1 for Jay's suggestion. New Gerrit change created: https://git.eclipse.org/r/82984 New Gerrit change created: https://git.eclipse.org/r/82985 (In reply to Eclipse Genie from comment #10) > New Gerrit change created: https://git.eclipse.org/r/82985 This one is bad too. Sorry about the noise, will fix this. Gerrit change https://git.eclipse.org/r/82985 was merged to [master]. Commit: http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?id=888efa82e8bf7dca948fafeddbba604ce0d35d22 (In reply to Eclipse Genie from comment #12) > Gerrit change https://git.eclipse.org/r/82985 was merged to [master]. > Commit: > http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/ > ?id=888efa82e8bf7dca948fafeddbba604ce0d35d22 Stefan, not sure if my changes were correct. I saw warnings in the Hudson build hence aborted. I meant to fix it today. Or am I missing something? The problem is still there in the lasted build. And this is expected. '-' disables a diagnostic - you need to use '+' ;-) I have fixed it now: http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?id=a4212f660b3eb77ae0a548ba05f5445b9b81d72c Also verified with a local build that there are no warnings. Not really sure how to verify the changes in the build.properties, though. Verified in N20161013-2000. |