webdav-jaxrs
  1. webdav-jaxrs
  2. WEBDAV_JAXRS-30

Using Collections.unmodifiableList() instead of Object.clone()

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Complete
    • Affects Version/s: 1.2
    • Fix Version/s: 1.2
    • Component/s: None
    • Labels:
      None

      Description

      It is a major project target that all JAXB elements are immutable, for improved stability and performance. Some elements guarantee immutability by returning .clone()'d collections.

      Using .clone() induces two negative impacts. First, it is a performance killer due to the fact that it must produce a full copy of the collection. Second, it enforces the use of array lists.

      It would be smarter to use Collections.unmodifiableList() instead. This prevents any copying and works with any implementation of the List interface.

        Activity

        Hide
        mkarg added a comment -

        Implemented in 1.2-SNAPSHOT

        Show
        mkarg added a comment - Implemented in 1.2-SNAPSHOT

          People

          • Assignee:
            mkarg
            Reporter:
            mkarg
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: