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

Inconsistency in spec for RenderingHints.entrySet()

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P4 P4
    • 15
    • client-libs
    • None
    • 2d
    • behavioral
    • minimal
    • Java API
    • SE

      Summary

      Inconsistency in specification of java.awt.RenderingHints#entrySet() method.

      Problem

      The method description says that the Set, returned by the method, can be changed and these modifications will be reflected in the RenderingHints. However, the last statement of the specification prohibits any modifications of this Set. So this needs to be clarified.

      Solution

      The specification of the method should be updated, "and vice-versa" part should be removed

      Specification

       src/java.desktop/share/classes/java/awt/RenderingHints.java
      
            * Returns a {@code Set} view of the mappings contained
            * in this {@code RenderingHints}.  Each element in the
            * returned {@code Set} is a {@code Map.Entry}.
            * The {@code Set} is backed by the {@code RenderingHints},
            * so changes to the {@code RenderingHints} are reflected
      -     * in the {@code Set}, and vice-versa.  If the
      -     * {@code RenderingHints} is modified while
      +     * in the {@code Set}. If the {@code RenderingHints} is modified while
            * while an iteration over the {@code Set} is in progress,
            * the results of the iteration are undefined.
            * <p>
            * The entrySet returned from a {@code RenderingHints} object
            * is not modifiable.
           public Set<Map.Entry<Object,Object>> entrySet() {

            serb Sergey Bylokhov
            visaenko Vasily Isaenko (Inactive)
            Philip Race
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: