Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 332846 - Compiler warnings in N20101216-2000 build
Summary: Compiler warnings in N20101216-2000 build
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: Compendium (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 3.7 M5   Edit
Assignee: John Ross CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-17 08:31 EST by Olivier Thomann CLA
Modified: 2010-12-17 16:05 EST (History)
2 users (show)

See Also:


Attachments
Patch 1 (45.28 KB, patch)
2010-12-17 11:38 EST, John Ross CLA
no flags Details | Diff
Patch 2 (7.29 KB, patch)
2010-12-17 12:14 EST, John Ross CLA
tjwatson: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Olivier Thomann CLA 2010-12-17 08:31:45 EST
1. WARNING in /src/org/eclipse/equinox/coordinator/CoordinationImpl.java
 (at line 85)
@SuppressWarnings("hiding")
Unnecessary @SuppressWarnings("hiding")
2. WARNING in /src/org/eclipse/equinox/coordinator/CoordinationImpl.java
 (at line 311)
private void validateName(@SuppressWarnings("hiding")
Unnecessary @SuppressWarnings("hiding")
1. WARNING in /src/org/eclipse/equinox/coordinator/CoordinatorImpl.java
 (at line 126)
@SuppressWarnings("hiding")
Unnecessary @SuppressWarnings("hiding")
2. WARNING in /src/org/eclipse/equinox/coordinator/CoordinatorImpl.java
 (at line 151)
@SuppressWarnings("hiding")
Unnecessary @SuppressWarnings("hiding")
3. WARNING in /src/org/eclipse/equinox/coordinator/CoordinatorImpl.java
 (at line 165)
@SuppressWarnings("hiding")
Unnecessary @SuppressWarnings("hiding")
4. WARNING in /src/org/eclipse/equinox/coordinator/CoordinatorImpl.java
 (at line 222)
@SuppressWarnings("hiding")
Unnecessary @SuppressWarnings("hiding")
5. WARNING in /src/org/eclipse/equinox/coordinator/CoordinatorImpl.java
 (at line 239)
@SuppressWarnings("hiding")
Unnecessary @SuppressWarnings("hiding")
6. WARNING in /src/org/eclipse/equinox/coordinator/CoordinatorImpl.java
 (at line 258)
@SuppressWarnings("hiding")
Unnecessary @SuppressWarnings("hiding")
Comment 1 Thomas Watson CLA 2010-12-17 08:48:22 EST
I don't understand these warnings.  It looks to me that the @SuppressWarnings("hiding") are needed.  My preference would be to change the code to rename local vars to not hide other vars though.

John could you provide a patch to rename the vars in question?

Olivier, is there a jdt bug here?  When I remove the @SuppressWarnings("hiding")
 from the code jdt gives a warning in the editor, but the build seems to think there is no hiding going on.
Comment 2 Olivier Thomann CLA 2010-12-17 08:51:13 EST
hiding warning might not be set up inside pde.build.
I'll investigate.
Comment 3 Olivier Thomann CLA 2010-12-17 09:01:38 EST
I think you might need this line in the build.properties:
javacWarnings..=+hiding
since the hiding warnings are disabled by default.
Comment 4 Thomas Watson CLA 2010-12-17 09:10:30 EST
(In reply to comment #3)
> I think you might need this line in the build.properties:
> javacWarnings..=+hiding
> since the hiding warnings are disabled by default.

Thanks Olivier, I prefer to fix the code to eliminate the the need for this.  It is not important, but I am still confused why the +hiding would be needed in the build.properties.  Shouldn't the annotations be recognized anyway?
Comment 5 Olivier Thomann CLA 2010-12-17 09:16:24 EST
They are recognized. But since the corresponding warning level is off by default, there is no warning to suppress and therefore you get a warning that it is not necessary.
Comment 6 John Arthorne CLA 2010-12-17 09:23:59 EST
(In reply to comment #1)
> John could you provide a patch to rename the vars in question?

Syntax error. "John" is an ambiguous name reference. Please use resolved names or add an appropriate qualified name on the CC list.
Comment 7 Olivier Thomann CLA 2010-12-17 09:29:17 EST
I thought that pde.build was matching the same level of warnings directly inside the build.xml file.
Andrew, should not this work for free ?
Comment 8 Thomas Watson CLA 2010-12-17 10:22:01 EST
(In reply to comment #6)
> (In reply to comment #1)
> > John could you provide a patch to rename the vars in question?
> 
> Syntax error. "John" is an ambiguous name reference. Please use resolved names
> or add an appropriate qualified name on the CC list.

Sorry John Arthorne! :-)  Yes this is meant for John Ross.  Assigning to John Ross to make it clear.
Comment 9 John Ross CLA 2010-12-17 11:38:47 EST
Created attachment 185441 [details]
Patch 1

Removes all @SuppressWarnings("hiding").

Note that if you examine the patch manually, you will see a full replacement of the contents of the two affected files, even though I only modified a few lines. The Create Patch wizard simply refuses to identify only the contents that actually changed. This is only happening with the new org.eclipse.equinox.coordinator project I just pulled from the repo.

However, if you use Apply Patch, you will only see what actually changed.

Perhaps this is normal behavior and you're wondering why I'm even bothering to mention it. It's just something I've never experienced and seems strange.
Comment 10 John Ross CLA 2010-12-17 12:14:25 EST
Created attachment 185443 [details]
Patch 2

Contains only what changed.
Comment 11 Thomas Watson CLA 2010-12-17 12:19:08 EST
Thanks John R. for the patch!