[OpenJDK 2D-Dev] JDK 9: RFR: 8033716: Fix raw and unchecked lint warnings in com.sun.imageio

Joe Darcy joe.darcy at oracle.com
Thu Feb 6 02:01:12 UTC 2014

Hi Henry,

On 02/05/2014 12:19 PM, Henry Jen wrote:
> Hi,
> Please review the webrev to clean up raw and unchecked warnings in 
> com.sun.imageio packag at,
> http://cr.openjdk.java.net/~henryjen/jdk9/8033716/0/webrev/
> The more significant change in this webrev is that I have changed the 
> clone() method of MarkerSegment-derived classes to return exact type 
> rather than Object. Otherwise, it's basically add type information and 
> eliminate cast no longer needed.
> Cheers,
> Henry

I looked over the changes and they generally look good. I've taken a 
closer look at the clone-related changes.

The types SOSMarkerSegment, SOFMarkerSegment, MarkerSegment, etc. are 
call package-private and all have had their Object-returning clone 
methods replaced with a self-type returning clone method, a covariant 

Since there are no other potential subclasses of these com.sun.* type 
that would already have had a covariant override of clone, I believe the 
changes to clone on these three methods is fine. (This avoid the hazards 
outlined in JDK-7140820: (coll) Add covariant overrides to Collections 
clone methods.)



More information about the 2d-dev mailing list