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

Add final modifier to several DataFlavor static fields

    XMLWordPrintable

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P3
    • Resolution: Approved
    • Fix Version/s: 17
    • Component/s: client-libs
    • Labels:
      None
    • Subcomponent:
    • Compatibility Kind:
      source, binary, behavioral
    • Compatibility Risk:
      low
    • Compatibility Risk Description:
      An application which modifies these fields will need to be updated but since these fields are not expected fo be modified and there Is no obvious reason an application would be doing this, it seems very unlikely any applications will be affected.
    • Interface Kind:
      Java API
    • Scope:
      SE

      Description

      Summary

      Mark several public static fields in java.awt.datatransfer.DataFlavor as final.

      Problem

      Several constants added to the java.awt.datatransfer.DataFlavor class in JDK8 were not marked as final as are other similar constants in this class.

      Solution

      Add the final keyword to each constant.

      Specification

      src/java.datatransfer/share/classes/java/awt/datatransfer/DataFlavor.java
      
           *
           * @since 1.8
           */
         - public static DataFlavor selectionHtmlFlavor = initHtmlDataFlavor("selection");
         + public static final DataFlavor selectionHtmlFlavor = initHtml("selection");
      
           *
           * @since 1.8
           */
         - public static DataFlavor fragmentHtmlFlavor = initHtmlDataFlavor("fragment");
         + public static final DataFlavor fragmentHtmlFlavor = initHtml("fragment");
      
           *
           * @since 1.8
           */
         - public static DataFlavor allHtmlFlavor = initHtmlDataFlavor("all");
         + public static final DataFlavor allHtmlFlavor = initHtml("all");

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              serb Sergey Bylokhov
              Reporter:
              serb Sergey Bylokhov
              Reviewed By:
              Alexander Zvegintsev, Philip Race
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: