Warnings Cleanup in java.util.<various> (more from hack day)

John Rose john.r.rose at oracle.com
Fri Dec 2 16:16:33 PST 2011


On Dec 2, 2011, at 2:32 PM, Martijn Verburg wrote:

> I think the original patch provider (Prasanna) was aiming at simply
> removing the deprecation warning.  Interesting point on the performance
> aspect!

Presently we are aiming at removing warnings with no changes to semantics (i.e., bytecodes).

I'll risk stating the obvious:  If we have 900 warnings removals, and 30 of them remove warnings by changing code (to call a non-deprecated API element), and 1 of those 30 introduces a bug, we have put the 900 removals at risk, because we have made it much harder for the integrator to batch the warning changes.

So let's try to keep the deprecated call and suppress the deprecation.  (There may be an exception, of course; that's when reviews help.)

And (this is equally important) comment the @SuppressWarnings() with the relevant information.

        @SuppressWarnings("deprecation")  // String(byte[],int) in String has been deprecated
        // and this is actually useful because alskjdflsadkfjasl
        String x = new String(new byte[0], 0);

Thanks!

-- John


More information about the jdk8-dev mailing list