Uploaded image for project: 'Thorntail'
  1. Thorntail
  2. THORN-992

Set modifiable List to fields in var-args mutator method for model of List to enable the fields to mutate

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 1.0.0.Final
    • Fix Version/s: 2017.2.0
    • Component/s: config-api
    • Labels:
      None

      Description

      The var-args mutator for some models whose type is List sets Unmodifiable List(jva.util.Arrays$ArrayList) to the field like the following.

      /**
       * The handlers associated with the root logger.
       */
      @SuppressWarnings("unchecked")
      public T handlers(String... args) {
        handlers(Arrays.asList(args));
        return (T) this;
      }
      

      If the field(in this case, handlers) initialize as java.util.Arrays$ArrayList, we can't add elements to the field.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                emag Yoshimasa Tanabe
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: