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

Use String.stripTrailing instead of hand-crafted method in SwingUtilities2

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P5 P5
    • 18
    • 17, 18
    • client-libs
    • None

      There is opportunity to use String.stripTrailing() method in java.desktop in SwingUtilities2 class.
      Currently used method has the same logic:

          private static String trimTrailingSpaces(String s) {
              int i = s.length() - 1;
              while(i >= 0 && Character.isWhitespace(s.charAt(i))) {
                  i--;
              }
              return s.substring(0, i + 1);
          }

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

              Created:
              Updated:
              Resolved: