Skip to content

Commit d6c9c7d

Browse files
Simplify substring() usage in MimeTypeUtils
Closes gh-24933
1 parent 3dadcae commit d6c9c7d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spring-core/src/main/java/org/springframework/util/MimeTypeUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ private static MimeType parseMimeTypeInternal(String mimeType) {
219219
throw new InvalidMimeTypeException(mimeType, "does not contain subtype after '/'");
220220
}
221221
String type = fullType.substring(0, subIndex);
222-
String subtype = fullType.substring(subIndex + 1, fullType.length());
222+
String subtype = fullType.substring(subIndex + 1);
223223
if (MimeType.WILDCARD_TYPE.equals(type) && !MimeType.WILDCARD_TYPE.equals(subtype)) {
224224
throw new InvalidMimeTypeException(mimeType, "wildcard type is legal only in '*/*' (all mime types)");
225225
}
@@ -248,7 +248,7 @@ else if (ch == '"') {
248248
int eqIndex = parameter.indexOf('=');
249249
if (eqIndex >= 0) {
250250
String attribute = parameter.substring(0, eqIndex).trim();
251-
String value = parameter.substring(eqIndex + 1, parameter.length()).trim();
251+
String value = parameter.substring(eqIndex + 1).trim();
252252
parameters.put(attribute, value);
253253
}
254254
}

0 commit comments

Comments
 (0)