diff --git a/spring-web/src/main/java/org/springframework/http/HttpHeaders.java b/spring-web/src/main/java/org/springframework/http/HttpHeaders.java index c0e38db6bb..f13cdb182f 100644 --- a/spring-web/src/main/java/org/springframework/http/HttpHeaders.java +++ b/spring-web/src/main/java/org/springframework/http/HttpHeaders.java @@ -496,7 +496,8 @@ public class HttpHeaders implements MultiValueMap, Serializable } /** - * Set the (new) value of the {@code Content-Disposition} header for {@code form-data}. + * Set the (new) value of the {@code Content-Disposition} header + * for {@code form-data}. * @param name the control name * @param filename the filename (may be {@code null}) */ @@ -512,16 +513,16 @@ public class HttpHeaders implements MultiValueMap, Serializable } /** - * Set the length of the body in bytes, - * as specified by the {@code Content-Length} header. + * Set the length of the body in bytes, as specified by the + * {@code Content-Length} header. */ public void setContentLength(long contentLength) { set(CONTENT_LENGTH, Long.toString(contentLength)); } /** - * Return the length of the body in bytes, - * as specified by the {@code Content-Length} header. + * Return the length of the body in bytes, as specified by the + * {@code Content-Length} header. *

Returns -1 when the content-length is unknown. */ public long getContentLength() { @@ -540,7 +541,8 @@ public class HttpHeaders implements MultiValueMap, Serializable } /** - * Return the {@linkplain MediaType media type} of the body, as specified by the {@code Content-Type} header. + * Return the {@linkplain MediaType media type} of the body, as specified + * by the {@code Content-Type} header. *

Returns {@code null} when the content-type is unknown. */ public MediaType getContentType() { @@ -549,20 +551,20 @@ public class HttpHeaders implements MultiValueMap, Serializable } /** - * Set the date and time at which the message was created, - * as specified by the {@code Date} header. - *

The date should be specified as the number of milliseconds - * since January 1, 1970 GMT. + * Set the date and time at which the message was created, as specified + * by the {@code Date} header. + *

The date should be specified as the number of milliseconds since + * January 1, 1970 GMT. */ public void setDate(long date) { setDate(DATE, date); } /** - * Returns the date and time at which the message was created, - * as specified by the {@code Date} header. - *

The date is returned as the number of milliseconds - * since January 1, 1970 GMT. Returns -1 when the date is unknown. + * Return the date and time at which the message was created, as specified + * by the {@code Date} header. + *

The date is returned as the number of milliseconds since + * January 1, 1970 GMT. Returns -1 when the date is unknown. * @throws IllegalArgumentException if the value can't be converted to a date */ public long getDate() { @@ -582,7 +584,7 @@ public class HttpHeaders implements MultiValueMap, Serializable } /** - * Returns the entity tag of the body, as specified by the {@code ETag} header. + * Return the entity tag of the body, as specified by the {@code ETag} header. */ public String getETag() { return getFirst(ETAG); @@ -591,19 +593,18 @@ public class HttpHeaders implements MultiValueMap, Serializable /** * Set the date and time at which the message is no longer valid, * as specified by the {@code Expires} header. - *

The date should be specified as the number of milliseconds - * since January 1, 1970 GMT. + *

The date should be specified as the number of milliseconds since + * January 1, 1970 GMT. */ public void setExpires(long expires) { setDate(EXPIRES, expires); } /** - * Returns the date and time at which the message is no longer valid, + * Return the date and time at which the message is no longer valid, * as specified by the {@code Expires} header. - *

The date is returned as the number of milliseconds - * since January 1, 1970 GMT. - * Returns -1 when the date is unknown. + *

The date is returned as the number of milliseconds since + * January 1, 1970 GMT. Returns -1 when the date is unknown. */ public long getExpires() { try { @@ -616,17 +617,17 @@ public class HttpHeaders implements MultiValueMap, Serializable /** * Set the (new) value of the {@code If-Modified-Since} header. - *

The date should be specified as the number of milliseconds - * since January 1, 1970 GMT. + *

The date should be specified as the number of milliseconds since + * January 1, 1970 GMT. */ public void setIfModifiedSince(long ifModifiedSince) { setDate(IF_MODIFIED_SINCE, ifModifiedSince); } /** - * Returns the value of the {@code IfModifiedSince} header. - *

The date is returned as the number of milliseconds - * since January 1, 1970 GMT. Returns -1 when the date is unknown. + * Return the value of the {@code IfModifiedSince} header. + *

The date is returned as the number of milliseconds since + * January 1, 1970 GMT. Returns -1 when the date is unknown. * @deprecated use {@link #getIfModifiedSince()} */ @Deprecated @@ -635,9 +636,9 @@ public class HttpHeaders implements MultiValueMap, Serializable } /** - * Returns the value of the {@code If-Modified-Since} header. - *

The date is returned as the number of milliseconds - * since January 1, 1970 GMT. Returns -1 when the date is unknown. + * Return the value of the {@code If-Modified-Since} header. + *

The date is returned as the number of milliseconds since + * January 1, 1970 GMT. Returns -1 when the date is unknown. */ public long getIfModifiedSince() { return getFirstDate(IF_MODIFIED_SINCE); @@ -689,20 +690,20 @@ public class HttpHeaders implements MultiValueMap, Serializable } /** - * Set the time the resource was last changed, - * as specified by the {@code Last-Modified} header. - *

The date should be specified as the number of milliseconds - * since January 1, 1970 GMT. + * Set the time the resource was last changed, as specified by the + * {@code Last-Modified} header. + *

The date should be specified as the number of milliseconds since + * January 1, 1970 GMT. */ public void setLastModified(long lastModified) { setDate(LAST_MODIFIED, lastModified); } /** - * Return the time the resource was last changed, - * as specified by the {@code Last-Modified} header. - *

The date is returned as the number of milliseconds - * since January 1, 1970 GMT. Returns -1 when the date is unknown. + * Return the time the resource was last changed, as specified by the + * {@code Last-Modified} header. + *

The date is returned as the number of milliseconds since + * January 1, 1970 GMT. Returns -1 when the date is unknown. */ public long getLastModified() { return getFirstDate(LAST_MODIFIED); @@ -769,9 +770,9 @@ public class HttpHeaders implements MultiValueMap, Serializable } /** - * Parse the first header value for the given header name as a date, return -1 if - * there is no value, or raise {@link IllegalArgumentException} if the value cannot be - * parsed as a date. + * Parse the first header value for the given header name as a date, + * return -1 if there is no value, or raise {@link IllegalArgumentException} + * if the value cannot be parsed as a date. */ public long getFirstDate(String headerName) { String headerValue = getFirst(headerName); diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/server/standard/ServerEndpointExporter.java b/spring-websocket/src/main/java/org/springframework/web/socket/server/standard/ServerEndpointExporter.java index 952102d5d1..3e00c27417 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/server/standard/ServerEndpointExporter.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/server/standard/ServerEndpointExporter.java @@ -119,10 +119,9 @@ public class ServerEndpointExporter extends WebApplicationObjectSupport ApplicationContext context = getApplicationContext(); if (context != null) { - String[] endpointNames = context.getBeanNamesForAnnotation(ServerEndpoint.class); - for (String beanName : endpointNames) { - Class beanType = context.getType(beanName); - endpointClasses.add(beanType); + String[] endpointBeanNames = context.getBeanNamesForAnnotation(ServerEndpoint.class); + for (String beanName : endpointBeanNames) { + endpointClasses.add(context.getType(beanName)); } } @@ -132,9 +131,7 @@ public class ServerEndpointExporter extends WebApplicationObjectSupport if (context != null) { Map endpointConfigMap = context.getBeansOfType(ServerEndpointConfig.class); - for (Map.Entry configEntry : endpointConfigMap.entrySet()) { - String beanName = configEntry.getKey(); - ServerEndpointConfig endpointConfig = configEntry.getValue(); + for (ServerEndpointConfig endpointConfig : endpointConfigMap.values()) { registerEndpoint(endpointConfig); } }