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

Add final modifier to several DataFlavor static fields

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P3 P3
    • 17
    • client-libs
    • None
    • source, binary, behavioral
    • low
    • 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.
    • Java API
    • SE

      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");

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

              Created:
              Updated:
              Resolved: