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

Use String.join() instead of manual loop in DescriptorSupport.toString

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P5 P5
    • 21
    • None
    • core-svc
    • None

      There is opportunity to use String.join in DescriptorSupport.toString implementation.

              for (int i=0; i < fields.length; i++) {
                  if (i == (fields.length - 1)) {
                      respStr = respStr.concat(fields[i]);
                  } else {
                      respStr = respStr.concat(fields[i] + ", ");
                  }
              }

      Result code is shorter and clearer.

            aturbanov Andrey Turbanov
            aturbanov Andrey Turbanov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: