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

Wrong exception catch for FTPClient in JDK-8055032

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 9
    • 9
    • 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

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

              Created:
              Updated:
              Resolved: