Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6800516

sun.java2d.pipe.Region should be immutable

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • 6u14
    • client-libs
    • None
    • 2d
    • generic
    • generic

      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.

            Unassigned Unassigned
            anthony Anthony Petrov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: