Polishing

(cherry picked from commit b5127dc)
This commit is contained in:
Juergen Hoeller
2016-07-20 22:16:35 +02:00
parent 9ec50a278e
commit 74b4dd0a40
17 changed files with 215 additions and 204 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2013 the original author or authors.
* Copyright 2002-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,11 +17,12 @@
package org.springframework.http;
/**
* Java 5 enumeration of HTTP status codes.
* Enumeration of HTTP status codes.
*
* <p>The HTTP status code series can be retrieved via {@link #series()}.
*
* @author Arjen Poutsma
* @since 3.0
* @see HttpStatus.Series
* @see <a href="http://www.iana.org/assignments/http-status-codes">HTTP Status Code Registry</a>
* @see <a href="http://en.wikipedia.org/wiki/List_of_HTTP_status_codes">List of HTTP status codes - Wikipedia</a>
@@ -364,17 +365,17 @@ public enum HttpStatus {
NETWORK_AUTHENTICATION_REQUIRED(511, "Network Authentication Required");
private final int value;
private final String reasonPhrase;
private HttpStatus(int value, String reasonPhrase) {
HttpStatus(int value, String reasonPhrase) {
this.value = value;
this.reasonPhrase = reasonPhrase;
}
/**
* Return the integer value of this status code.
*/
@@ -386,7 +387,7 @@ public enum HttpStatus {
* Return the reason phrase of this status code.
*/
public String getReasonPhrase() {
return reasonPhrase;
return this.reasonPhrase;
}
/**
@@ -402,7 +403,7 @@ public enum HttpStatus {
*/
@Override
public String toString() {
return Integer.toString(value);
return Integer.toString(this.value);
}
@@ -423,10 +424,10 @@ public enum HttpStatus {
/**
* Java 5 enumeration of HTTP status series.
* Enumeration of HTTP status series.
* <p>Retrievable via {@link HttpStatus#series()}.
*/
public static enum Series {
public enum Series {
INFORMATIONAL(1),
SUCCESSFUL(2),
@@ -436,7 +437,7 @@ public enum HttpStatus {
private final int value;
private Series(int value) {
Series(int value) {
this.value = value;
}
@@ -460,7 +461,6 @@ public enum HttpStatus {
public static Series valueOf(HttpStatus status) {
return valueOf(status.value);
}
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -243,7 +243,7 @@ public class UrlPathHelper {
if (c1 == c2) {
continue;
}
if (ignoreCase && (Character.toLowerCase(c1) == Character.toLowerCase(c2))) {
else if (ignoreCase && (Character.toLowerCase(c1) == Character.toLowerCase(c2))) {
continue;
}
return null;
@@ -251,7 +251,7 @@ public class UrlPathHelper {
if (index2 != mapping.length()) {
return null;
}
if (index1 == requestUri.length()) {
else if (index1 == requestUri.length()) {
return "";
}
else if (requestUri.charAt(index1) == ';') {
@@ -452,8 +452,8 @@ public class UrlPathHelper {
* @return the updated URI string
*/
public String removeSemicolonContent(String requestUri) {
return this.removeSemicolonContent ?
removeSemicolonContentInternal(requestUri) : removeJsessionid(requestUri);
return (this.removeSemicolonContent ?
removeSemicolonContentInternal(requestUri) : removeJsessionid(requestUri));
}
private String removeSemicolonContentInternal(String requestUri) {

View File

@@ -1,11 +1,9 @@
<!-- File containing all charcter entity references definied
<!-- File containing all character entity references defined
by the HTML 4.0 standard. -->
<!-- Valuable informations and a complete description of the
<!-- Valuable information and a complete description of the
HTML 4.0 character set can be found at
http://www.w3.org/TR/html4/charset.html.
-->
http://www.w3.org/TR/html4/charset.html. -->
<!-- Portions © International Organization for Standardization 1986
Permission to copy in any form is granted for use with
conforming SGML systems and applications as defined in