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

Update constant collections to use the new immutable collections

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: In Progress
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 9, 10, openjfx11
    • Fix Version/s: openjfx13
    • Component/s: javafx
    • Labels:
    • Subcomponent:
    • Understanding:
      Fix Understood

      Description

      JavaFX contains many collections which are supposed to be immutable. With the addition of the built-in immutable collections in Java 9, we should update the current collections to these.

      The possible advantages are better performance and finding bugs due to invalid entries.

      All of the identifiers for this collections will be renamed to constant style (uppercase with underscores) to signify that the collection is immutable (though not necessarily the items it contains). For maps, the keys and values will be visually aligned for readability.

      A list of all affected places will be maintained here:

      --- MAP ---

      1. javafx.scene.control.skin.ColorPickerSkin: colorNameMap and cssNameMap

      2. com.sun.javafx.fxml.builder.ProxyBuilder: defaultsMap - double 'int.class' entry found and removed. Since it contains a null value it can't be converted to immutable.

      3. javafx.scene.web.WebView: idMap

      4. com.sun.javafx.webkit.KeyCodeMap: MAP

      5. com.sun.javafx.iio.ios.IosImageLoader: colorSpaceMapping - there seems to be an initialization order intricacy here.

      6. com.sun.scenario.effect.compiler.backend.hw.ES2Backend/GLSLBackend/HLSLBackend: qualMap, varMap, funcMap, typeMap

      7. javafx.scene.paint.Color: namedColors

      8. com.sun.webkit.network.DateParser: MONTH_MAP

      9. com.sun.webkit.network.URLs: handlerMap

      10. com.sun.webkit.text.TextCodec: reMap

      11. com.sun.prism.j2d.print.J2DPrinter: preDefinedTrayMap and predefinedPaperMap.

      --- SET ---

      1. com.sun.scenario.effect.impl.prism.PrRenderer: intrinsicPeerNames

      --- LIST ---

      1. javafx.scene.Node: STYLEABLES. Need to think about the subclasses' use - they copy the list and add to it, which is not suitable for an immutable list.

      2. com.sun.glass.ui.mac.MacAccessible: baseAttributes, textAttributes, textParameterizedAttributes

      3. com.sun.javafx.scene.input.InputEventUtils: TM_ANY and TM_COPY_OR_MOVE, and in the method safeTransferModes.

      4. com.sun.prism.impl.PrismSettings: tryOrder (didn't change identifier style so it fits with the rest of the constants in the class)

      5. javafx.scene.paint.Stop: NO_STOPS

        Attachments

          Activity

            People

            • Assignee:
              nlisker Nir Lisker
              Reporter:
              nlisker Nir Lisker
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: