Skip to content

Commit e9d1d87

Browse files
kilinkdfuch
authored andcommitted
8357013: HttpURLConnection#getResponseCode can avoid substring call when parsing to int
Reviewed-by: dfuchs
1 parent bcf5cd6 commit e9d1d87

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/java.base/share/classes/java/net/HttpURLConnection.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ public int getResponseCode() throws IOException {
534534

535535
try {
536536
responseCode = Integer.parseInt
537-
(statusLine.substring(codePos+1, phrasePos));
537+
(statusLine, codePos+1, phrasePos, 10);
538538
return responseCode;
539539
} catch (NumberFormatException e) { }
540540
}

0 commit comments

Comments
 (0)