Wrong exception catch for FTPClient in JDK-8055032

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 9
    • Affects Version/s: 9
    • Component/s: core-libs
    • b33
    • b114

      Code changed in b33 :-
      src/java.base/share/classes/sun/net/ftp/impl/FtpClient.java

      else {
                       try {
      - code = Integer.parseInt(response.substring(0, 3));
      + code = Integer.parseInt(response, 0, 3, 10);
                       } catch (NumberFormatException e) {
                           code = -1;
                       } catch (StringIndexOutOfBoundsException e) {

      With this change the catch should be IndexOutOfBoundsException in place of StringIndexOutOfBoundsException

            Assignee:
            Vyom Tewari
            Reporter:
            Vyom Tewari
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: