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

Use String.isBlank to simplify code in sun.net.www.protocol.mailto.Handler

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P5 P5
    • 19
    • None
    • core-libs
    • None
    • b08

      Code in sun.net.www.protocol.mailto.Handler#parseURL can be simplified.
      Manual cycle could be replaced with String.isBlank

              boolean nogood = false;
              if (file == null || file.isEmpty())
                  nogood = true;
              else {
                  boolean allwhites = true;
                  for (int i = 0; i < file.length(); i++)
                      if (!Character.isWhitespace(file.charAt(i)))
                          allwhites = false;
                  if (allwhites)
                      nogood = true;
              }
              if (nogood)
                  throw new RuntimeException("No email address");

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

              Created:
              Updated:
              Resolved: