See gh-20192
This commit is contained in:
zhangt2333
2020-02-15 12:14:40 +08:00
committed by Stephane Nicoll
parent ff4de95b3e
commit e2d87a89d0
5 changed files with 6 additions and 18 deletions

View File

@@ -70,7 +70,7 @@ public enum ApiVersion {
private static ApiVersion forType(String type) {
if (type.startsWith(MEDIA_TYPE_PREFIX)) {
type = type.substring(MEDIA_TYPE_PREFIX.length());
int suffixIndex = type.indexOf("+");
int suffixIndex = type.indexOf('+');
type = (suffixIndex != -1) ? type.substring(0, suffixIndex) : type;
try {
return valueOf(type.toUpperCase());