Remove the second parameter of substring() if possible

Closes gh-5720
This commit is contained in:
Johnny Lim
2016-04-18 19:00:35 +09:00
committed by Stephane Nicoll
parent 58dac43b8d
commit b914b4aa52
7 changed files with 7 additions and 8 deletions

View File

@@ -250,8 +250,7 @@ class InitializrService {
String value = header.getValue();
int start = value.indexOf(FILENAME_HEADER_PREFIX);
if (start != -1) {
value = value.substring(start + FILENAME_HEADER_PREFIX.length(),
value.length());
value = value.substring(start + FILENAME_HEADER_PREFIX.length());
int end = value.indexOf("\"");
if (end != -1) {
return value.substring(0, end);