Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
topframe committed Apr 19, 2024
1 parent 88a81d3 commit 452d68a
Showing 1 changed file with 1 addition and 6 deletions.
Expand Up @@ -867,7 +867,6 @@ public int compareTo(@NonNull MediaType other) {
}
}
}

return 0;
}

Expand Down Expand Up @@ -1111,8 +1110,7 @@ private static Map<String, String> addCharsetParameter(@NonNull Charset charset,
/**
* Comparator used by {@link #sortBySpecificity(List)}.
*/
public static final Comparator<MediaType> SPECIFICITY_COMPARATOR = new SpecificityComparator<MediaType>() {

public static final Comparator<MediaType> SPECIFICITY_COMPARATOR = new SpecificityComparator<>() {
@Override
protected int compareParameters(@NonNull MediaType mediaType1, @NonNull MediaType mediaType2) {
double quality1 = mediaType1.getQualityValue();
Expand All @@ -1123,7 +1121,6 @@ protected int compareParameters(@NonNull MediaType mediaType1, @NonNull MediaTyp
}
return super.compareParameters(mediaType1, mediaType2);
}

};


Expand All @@ -1132,7 +1129,6 @@ protected int compareParameters(@NonNull MediaType mediaType1, @NonNull MediaTyp
* @param <T> the type of mime types that may be compared by this comparator
*/
public static class SpecificityComparator<T extends MediaType> implements Comparator<T> {

@Override
public int compare(@NonNull T MediaType1, T MediaType2) {
if (MediaType1.isWildcardType() && !MediaType2.isWildcardType()) { // */* < audio/*
Expand All @@ -1159,7 +1155,6 @@ protected int compareParameters(@NonNull T mediaType1, @NonNull T mediaType2) {
int paramsSize2 = mediaType2.getParameters().size();
return Integer.compare(paramsSize2, paramsSize1); // audio/basic;level=1 < audio/basic
}

}

}

0 comments on commit 452d68a

Please sign in to comment.