Browse Source

Polishing

pull/425/head
Juergen Hoeller 11 years ago
parent
commit
f70739430b
  1. 12
      spring-web/src/main/java/org/springframework/http/MediaType.java

12
spring-web/src/main/java/org/springframework/http/MediaType.java

@ -234,16 +234,15 @@ public class MediaType extends MimeType implements Serializable { @@ -234,16 +234,15 @@ public class MediaType extends MimeType implements Serializable {
* Create a new {@code MediaType} for the given type, subtype, and character set.
* @param type the primary type
* @param subtype the subtype
* @param charSet the character set
* @param charset the character set
* @throws IllegalArgumentException if any of the parameters contain illegal characters
*/
public MediaType(String type, String subtype, Charset charSet) {
super(type, subtype, charSet);
public MediaType(String type, String subtype, Charset charset) {
super(type, subtype, charset);
}
/**
* Create a new {@code MediaType} for the given type, subtype, and quality value.
*
* @param type the primary type
* @param subtype the subtype
* @param qualityValue the quality value
@ -275,6 +274,7 @@ public class MediaType extends MimeType implements Serializable { @@ -275,6 +274,7 @@ public class MediaType extends MimeType implements Serializable {
super(type, subtype, parameters);
}
protected void checkParameters(String attribute, String value) {
super.checkParameters(attribute, value);
if (PARAM_QUALITY_FACTOR.equals(attribute)) {
@ -343,6 +343,7 @@ public class MediaType extends MimeType implements Serializable { @@ -343,6 +343,7 @@ public class MediaType extends MimeType implements Serializable {
return new MediaType(this, params);
}
/**
* Parse the given String value into a {@code MediaType} object,
* with this method name following the 'valueOf' naming convention
@ -360,7 +361,6 @@ public class MediaType extends MimeType implements Serializable { @@ -360,7 +361,6 @@ public class MediaType extends MimeType implements Serializable {
* @throws InvalidMediaTypeException if the string cannot be parsed
*/
public static MediaType parseMediaType(String mediaType) {
MimeType type;
try {
type = MimeTypeUtils.parseMimeType(mediaType);
@ -368,7 +368,6 @@ public class MediaType extends MimeType implements Serializable { @@ -368,7 +368,6 @@ public class MediaType extends MimeType implements Serializable {
catch (InvalidMimeTypeException ex) {
throw new InvalidMediaTypeException(ex);
}
try {
return new MediaType(type.getType(), type.getSubtype(), type.getParameters());
}
@ -524,6 +523,7 @@ public class MediaType extends MimeType implements Serializable { @@ -524,6 +523,7 @@ public class MediaType extends MimeType implements Serializable {
}
};
/**
* Comparator used by {@link #sortBySpecificity(List)}.
*/

Loading…
Cancel
Save