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

Inconsistency in spec for RenderingHints.entrySet()

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P4
    • Resolution: Approved
    • Fix Version/s: 15
    • Component/s: client-libs
    • Labels:
      None
    • Subcomponent:
      2d
    • Compatibility Kind:
      behavioral
    • Compatibility Risk:
      minimal
    • Interface Kind:
      Java API
    • Scope:
      SE

      Description

      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() {

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                serb Sergey Bylokhov
                Reporter:
                visaenko Vasily Isaenko
                Reviewed By:
                Philip Race
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: