Relates :
|
Fixing 6797587, it was discovered that the Region instances should be immutable. As a temporary solution there was introduced a private static inner class Region.ImmutableRegion for two constant regions declared in the class (EMPTY_REGION and WHOLE_REGION). However, it seems that all the methods that may mutate the object should be private, since mutation is appropriate whithin the factory methods Region.getInstance() only. There's currently only one location where the mutation happens outside of the object: sun.java2d.SunGraphics2D.validateCompClip(). The code should be slightly factored to enable using immutable regions.