[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-2d-dev
Subject:    [OpenJDK 2D-Dev] Fwd: Re: Warnings Cleanup in java.util.<various> (more from hack day)
From:       james.graham () oracle ! com (Jim Graham)
Date:       2011-12-03 0:43:12
Message-ID: 4ED970A0.8090309 () oracle ! com
[Download RAW message or body]

Though, there is some dissension as to just how far we should go in 
minimizing the scope.  I think Mario's fixes walk the line pretty well 
(even with my suggested dup of a line or two of code in Path2D), but I'm 
forwarding these messages for transparency about the process and strategy...

			...jim

-------- Original Message --------
Subject: Re: Warnings Cleanup in java.util.<various> (more from hack day)
Date: Fri, 02 Dec 2011 19:30:46 -0500
From: Doug Lea <dl at cs.oswego.edu>
To: jdk8-dev at openjdk.java.net

On 12/02/11 19:16, John Rose wrote:

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

Note that this is at odds with suggestions such as:

> java/util/Currency.java --
>
> The @SuppressWarnings covers the entire method. We're trying to use
> @SuppressWarnings with as narrow a scope as possible. Sometimes it's helpful to
> create a local variable declaration for this purpose; perhaps something like
> this will help:
>
> @SuppressedWarnings("unchecked")
> Set<Currency> result = (Set<Currency>) available.clone();
> return result;

This generates two more bytecodes and a local variable.
This won't matter when the code is actually JIT-compiled, but
the increased size might inhibit inlining or compilation.
Surely it doesn't matter in this class, but we are very careful
about these and many related issues in performance-sensitive
java.util.concurrent code.

Too bad you cannot place annotations on expressions.

Also too bad that javac doesn't do trivial optimizations.

-Doug


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic