[OpenJDK 2D-Dev]  Review Request: Cleanup of sun.java2d.pipe.Region
Sergey.Bylokhov at oracle.com
Thu May 12 20:50:10 UTC 2016
> This looks great!
> I guess the final was removed from the getters because the class is now
> final, though it probably doesn't hurt anything to leave them final. In
> any case, you only removed it from 3 of them, so it is unbalanced now.
Ouch, it was the last minute change. Yes, the final keywords were
removed because I change the class itself to final.
An updated version:
> I suppose Hotspot is smart enough to inline accessors in a wide variety
> of conditions, even non-final methods on non-final classes in some
> cases, but I usually make accessors final to underscore their status as
> a bare accessor even when it isn't really necessary. Just a personal
> On 05/12/2016 12:04 PM, Sergey Bylokhov wrote:
>> Can somebody take a look to the proposed cleanup of
>> sun.java2d.pipe.Region. When I worked on some bugs I got a situation
>> when I tried to change the Region object via a different set methods.
>> But these changes are ignored because the reference was to
>> ImmutableRegion which replaces all setter to no-op methods.
>> In the fix I propose to remove specific ImmutableRegion class, and make
>> the whole Region class immutable:
>> - setXX methods are removed, since most of them are unused.
>> - the new getInstance(int box, SpanIterator) was added, so the
>> appendSpans() can be changed to the private.
>> - small cleanup in equals, toString.
>> If the change will be approved I will file a corresponding CR.
>> Webrev can be found at:
Best regards, Sergey.
More information about the 2d-dev