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

Replace Collections.unmodifiableList with List.of

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • jfx21
    • jfx19
    • javafx
    • b03

      Reported on behalf of Glavo ( https://mail.openjdk.org/pipermail/openjfx-dev/2023-February/038362.html ):

      List.of is cleaner, and can slightly reduce the memory footprint for lists of one or two elements.

      Because List.of can only store non-null elements, I have only replaced a few usage.

            nlisker Nir Lisker
            aoqi Qi Ao
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: