HttpURLConnection#getResponseCode can avoid substring call when parsing to int

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P4
    • 25
    • Affects Version/s: None
    • Component/s: core-libs
    • b24
    • generic
    • generic

      A DESCRIPTION OF THE PROBLEM :
      HttpURLConnection#getResponseCode creates a substring of the status line in order to parse the integer response code, however there now exists an Integer.parseInt variant that accepts a full String with start / end indices that can be used to avoid allocating the substring.

      See: https://github.com/openjdk/jdk/commit/b2d42d35a1d113649adb696646218d8b63bce9c5


            Assignee:
            Daniel Fuchs
            Reporter:
            Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: