Review Request: 7193406 - Clean-up JDK Build Warnings in java.util, java.io
dl at cs.oswego.edu
Fri Aug 24 10:45:13 UTC 2012
Rémi Forax wrote:
> Hi Dan,
> I'm not sure to like the fact that you introduce some local variables
> just to get ride of some warnings given that Hotspot compilers are
> sometimes sensitive to that.
> I think this practice should be discussed on this list before committing
> this changeset.
Yes. We discussed this during the last warnings cleanup.
If javac cannot provide a means of shutting up these kinds
of warnings without changing the emitted bytecode, then
warning-free-compiles should not be required within JDK.
(We hit a lot of warnings in j.u.c anyway because of uses
of Unsafe that have no pure-java equivalents.)
> so is it a good idea to add a temporary local variable to fix a generics
> warning or should @SuppressWarnings should be set on the whole method ?
We end up doing this this too often as a workaround.
More information about the core-libs-dev