Polishing regarding JDK baseline upgrade

Closes gh-28440
This commit is contained in:
lihan
2022-05-10 21:11:07 +08:00
committed by Sam Brannen
parent 5c5c89e9fe
commit a892ce80c1
9 changed files with 21 additions and 26 deletions

View File

@@ -692,7 +692,7 @@ public class MockHttpServletResponse implements HttpServletResponse {
return true;
}
else if (HttpHeaders.CONTENT_LENGTH.equalsIgnoreCase(name)) {
setContentLength(value instanceof Number ? ((Number) value).intValue() :
setContentLength(value instanceof Number number ? number.intValue() :
Integer.parseInt(value.toString()));
return true;
}