Skip to content

Commit 123124c

Browse files
committed
extract to a variable
1 parent 8d4b486 commit 123124c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/main/java/com/box/sdk/BinaryBodyUtils.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,12 @@ private static long getContentLengthFromAPIResponse(BoxAPIResponse response) {
100100
}
101101

102102
if (headerValue != null) {
103+
String trimmedHeaderValue = headerValue.trim();
103104
try {
104-
length = Long.parseLong(headerValue.trim());
105+
length = Long.parseLong(trimmedHeaderValue);
105106
} catch (NumberFormatException e) {
106-
throw new RuntimeException("Invalid content length: " + headerValue.trim() + " with: "
107-
+ headerValue.trim().length() + " number of characters.");
107+
throw new RuntimeException("Invalid content length: " + trimmedHeaderValue + " with: "
108+
+ trimmedHeaderValue.length() + " number of characters.");
108109
}
109110
}
110111
}

0 commit comments

Comments
 (0)