Skip to content

Commit 4c49833

Browse files
committed
Polishing
1 parent 4bfa2cc commit 4c49833

File tree

11 files changed

+61
-66
lines changed

11 files changed

+61
-66
lines changed

spring-messaging/src/main/java/org/springframework/messaging/handler/invocation/AsyncHandlerMethodReturnValueHandler.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2015 the original author or authors.
2+
* Copyright 2002-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -42,8 +42,8 @@ public interface AsyncHandlerMethodReturnValueHandler extends HandlerMethodRetur
4242
* {@link #supportsReturnType(org.springframework.core.MethodParameter)}
4343
* is called and it returns {@code true}.
4444
* @param returnValue the value returned from the handler method
45-
* @param returnType the type of the return value.
46-
* @return true if the return value type represents an async value.
45+
* @param returnType the type of the return value
46+
* @return {@code true} if the return value type represents an async value
4747
*/
4848
boolean isAsyncReturnValue(Object returnValue, MethodParameter returnType);
4949

@@ -57,9 +57,9 @@ public interface AsyncHandlerMethodReturnValueHandler extends HandlerMethodRetur
5757
* {@link #supportsReturnType(org.springframework.core.MethodParameter)}
5858
* is called and it returns {@code true}.
5959
* @param returnValue the value returned from the handler method
60-
* @param returnType the type of the return value.
61-
* @return the resulting ListenableFuture or {@code null} in which case no
62-
* further handling will be performed.
60+
* @param returnType the type of the return value
61+
* @return the resulting ListenableFuture, or {@code null} in which case
62+
* no further handling will be performed
6363
*/
6464
ListenableFuture<?> toListenableFuture(Object returnValue, MethodParameter returnType);
6565

spring-messaging/src/main/java/org/springframework/messaging/support/AbstractMessageChannel.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2016 the original author or authors.
2+
* Copyright 2002-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -41,10 +41,10 @@ public abstract class AbstractMessageChannel implements MessageChannel, Intercep
4141

4242
protected final Log logger = LogFactory.getLog(getClass());
4343

44-
private final List<ChannelInterceptor> interceptors = new ArrayList<ChannelInterceptor>(5);
45-
4644
private String beanName;
4745

46+
private final List<ChannelInterceptor> interceptors = new ArrayList<ChannelInterceptor>(5);
47+
4848

4949
public AbstractMessageChannel() {
5050
this.beanName = getClass().getSimpleName() + "@" + ObjectUtils.getIdentityHexString(this);

spring-oxm/src/main/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -337,8 +337,8 @@ public void setSchemaLanguage(String schemaLanguage) {
337337
/**
338338
* Set the resource resolver, as used to load the schema resources.
339339
* @see SchemaFactory#setResourceResolver(org.w3c.dom.ls.LSResourceResolver)
340-
* @see #setSchema(Resource)
341-
* @see #setSchemas(Resource[])
340+
* @see #setSchema
341+
* @see #setSchemas
342342
*/
343343
public void setSchemaResourceResolver(LSResourceResolver schemaResourceResolver) {
344344
this.schemaResourceResolver = schemaResourceResolver;
@@ -401,22 +401,22 @@ public void setMappedClass(Class<?> mappedClass) {
401401
}
402402

403403
/**
404-
* Indicates whether DTD parsing should be supported.
404+
* Indicate whether DTD parsing should be supported.
405405
* <p>Default is {@code false} meaning that DTD is disabled.
406406
*/
407407
public void setSupportDtd(boolean supportDtd) {
408408
this.supportDtd = supportDtd;
409409
}
410410

411411
/**
412-
* Whether DTD parsing is supported.
412+
* Return whether DTD parsing is supported.
413413
*/
414414
public boolean isSupportDtd() {
415415
return this.supportDtd;
416416
}
417417

418418
/**
419-
* Indicates whether external XML entities are processed when unmarshalling.
419+
* Indicate whether external XML entities are processed when unmarshalling.
420420
* <p>Default is {@code false}, meaning that external entities are not resolved.
421421
* Note that processing of external entities will only be enabled/disabled when the
422422
* {@code Source} passed to {@link #unmarshal(Source)} is a {@link SAXSource} or
@@ -433,7 +433,7 @@ public void setProcessExternalEntities(boolean processExternalEntities) {
433433
}
434434

435435
/**
436-
* Returns the configured value for whether XML external entities are allowed.
436+
* Return whether XML external entities are allowed.
437437
*/
438438
public boolean isProcessExternalEntities() {
439439
return this.processExternalEntities;

spring-oxm/src/main/java/org/springframework/oxm/support/AbstractMarshaller.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2016 the original author or authors.
2+
* Copyright 2002-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -82,22 +82,22 @@ public abstract class AbstractMarshaller implements Marshaller, Unmarshaller {
8282

8383

8484
/**
85-
* Indicates whether DTD parsing should be supported.
85+
* Indicate whether DTD parsing should be supported.
8686
* <p>Default is {@code false} meaning that DTD is disabled.
8787
*/
8888
public void setSupportDtd(boolean supportDtd) {
8989
this.supportDtd = supportDtd;
9090
}
9191

9292
/**
93-
* Whether DTD parsing is supported.
93+
* Return whether DTD parsing is supported.
9494
*/
9595
public boolean isSupportDtd() {
9696
return this.supportDtd;
9797
}
9898

9999
/**
100-
* Indicates whether external XML entities are processed when unmarshalling.
100+
* Indicate whether external XML entities are processed when unmarshalling.
101101
* <p>Default is {@code false}, meaning that external entities are not resolved.
102102
* Note that processing of external entities will only be enabled/disabled when the
103103
* {@code Source} passed to {@link #unmarshal(Source)} is a {@link SAXSource} or
@@ -114,7 +114,7 @@ public void setProcessExternalEntities(boolean processExternalEntities) {
114114
}
115115

116116
/**
117-
* Returns the configured value for whether XML external entities are allowed.
117+
* Return whether XML external entities are allowed.
118118
* @see #createXmlReader()
119119
*/
120120
public boolean isProcessExternalEntities() {

spring-tx/src/main/java/org/springframework/transaction/annotation/Propagation.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 the original author or authors.
2+
* Copyright 2002-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -40,7 +40,7 @@ public enum Propagation {
4040
* Support a current transaction, execute non-transactionally if none exists.
4141
* Analogous to EJB transaction attribute of the same name.
4242
* <p>Note: For transaction managers with transaction synchronization,
43-
* PROPAGATION_SUPPORTS is slightly different from no transaction at all,
43+
* {@code SUPPORTS} is slightly different from no transaction at all,
4444
* as it defines a transaction scope that synchronization will apply for.
4545
* As a consequence, the same resources (JDBC Connection, Hibernate Session, etc)
4646
* will be shared for the entire specified scope. Note that this depends on
@@ -87,7 +87,7 @@ public enum Propagation {
8787

8888
/**
8989
* Execute within a nested transaction if a current transaction exists,
90-
* behave like PROPAGATION_REQUIRED else. There is no analogous feature in EJB.
90+
* behave like {@code REQUIRED} else. There is no analogous feature in EJB.
9191
* <p>Note: Actual creation of a nested transaction will only work on specific
9292
* transaction managers. Out of the box, this only applies to the JDBC
9393
* DataSourceTransactionManager when working on a JDBC 3.0 driver.

spring-web/src/main/java/org/springframework/http/converter/xml/Jaxb2RootElementHttpMessageConverter.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 the original author or authors.
2+
* Copyright 2002-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -54,9 +54,8 @@
5454
* {@link XmlType}, and write classes annotated with {@link XmlRootElement},
5555
* or subclasses thereof.
5656
*
57-
* <p>Note that if using Spring's Marshaller/Unmarshaller abstractions from the
58-
* {@code spring-oxm} module you should can the
59-
* {@link MarshallingHttpMessageConverter} instead.
57+
* <p>Note: When using Spring's Marshaller/Unmarshaller abstractions from {@code spring-oxm},
58+
* you should use the {@link MarshallingHttpMessageConverter} instead.
6059
*
6160
* @author Arjen Poutsma
6261
* @author Sebastien Deleuze
@@ -72,22 +71,22 @@ public class Jaxb2RootElementHttpMessageConverter extends AbstractJaxb2HttpMessa
7271

7372

7473
/**
75-
* Indicates whether DTD parsing should be supported.
74+
* Indicate whether DTD parsing should be supported.
7675
* <p>Default is {@code false} meaning that DTD is disabled.
7776
*/
7877
public void setSupportDtd(boolean supportDtd) {
7978
this.supportDtd = supportDtd;
8079
}
8180

8281
/**
83-
* Whether DTD parsing is supported.
82+
* Return whether DTD parsing is supported.
8483
*/
8584
public boolean isSupportDtd() {
8685
return this.supportDtd;
8786
}
8887

8988
/**
90-
* Indicates whether external XML entities are processed when converting to a Source.
89+
* Indicate whether external XML entities are processed when converting to a Source.
9190
* <p>Default is {@code false}, meaning that external entities are not resolved.
9291
* <p><strong>Note:</strong> setting this option to {@code true} also
9392
* automatically sets {@link #setSupportDtd} to {@code true}.
@@ -100,7 +99,7 @@ public void setProcessExternalEntities(boolean processExternalEntities) {
10099
}
101100

102101
/**
103-
* Returns the configured value for whether XML external entities are allowed.
102+
* Return whether XML external entities are allowed.
104103
*/
105104
public boolean isProcessExternalEntities() {
106105
return this.processExternalEntities;

spring-web/src/main/java/org/springframework/http/converter/xml/SourceHttpMessageConverter.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2016 the original author or authors.
2+
* Copyright 2002-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -94,22 +94,22 @@ public SourceHttpMessageConverter() {
9494

9595

9696
/**
97-
* Indicates whether DTD parsing should be supported.
97+
* Indicate whether DTD parsing should be supported.
9898
* <p>Default is {@code false} meaning that DTD is disabled.
9999
*/
100100
public void setSupportDtd(boolean supportDtd) {
101101
this.supportDtd = supportDtd;
102102
}
103103

104104
/**
105-
* Whether DTD parsing is supported.
105+
* Return whether DTD parsing is supported.
106106
*/
107107
public boolean isSupportDtd() {
108108
return this.supportDtd;
109109
}
110110

111111
/**
112-
* Indicates whether external XML entities are processed when converting to a Source.
112+
* Indicate whether external XML entities are processed when converting to a Source.
113113
* <p>Default is {@code false}, meaning that external entities are not resolved.
114114
* <p><strong>Note:</strong> setting this option to {@code true} also
115115
* automatically sets {@link #setSupportDtd} to {@code true}.
@@ -122,7 +122,7 @@ public void setProcessExternalEntities(boolean processExternalEntities) {
122122
}
123123

124124
/**
125-
* Returns the configured value for whether XML external entities are allowed.
125+
* Return whether XML external entities are allowed.
126126
*/
127127
public boolean isProcessExternalEntities() {
128128
return this.processExternalEntities;

spring-web/src/main/java/org/springframework/web/method/support/AsyncHandlerMethodReturnValueHandler.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2015 the original author or authors.
2+
* Copyright 2002-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -27,7 +27,8 @@
2727
* For example custom (async) handlers, by default ordered after built-in
2828
* handlers, should take precedence over {@code @ResponseBody} or
2929
* {@code @ModelAttribute} handling, which should occur once the async value is
30-
* ready.
30+
* ready. By contrast, built-in (async) handlers are already ordered ahead of
31+
* sync handlers.
3132
*
3233
* @author Rossen Stoyanchev
3334
* @since 4.2
@@ -36,9 +37,9 @@ public interface AsyncHandlerMethodReturnValueHandler extends HandlerMethodRetur
3637

3738
/**
3839
* Whether the given return value represents asynchronous computation.
39-
* @param returnValue the return value
40+
* @param returnValue the value returned from the handler method
4041
* @param returnType the return type
41-
* @return {@code true} if the return value is asynchronous.
42+
* @return {@code true} if the return value type represents an async value
4243
*/
4344
boolean isAsyncReturnValue(Object returnValue, MethodParameter returnType);
4445

spring-webmvc/src/main/java/org/springframework/web/servlet/support/RequestContextUtils.java

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2015 the original author or authors.
2+
* Copyright 2002-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -256,9 +256,8 @@ public static Theme getTheme(HttpServletRequest request) {
256256
}
257257

258258
/**
259-
* Return a read-only {@link Map} with "input" flash attributes saved on a
260-
* previous request.
261-
* @param request the current request
259+
* Return read-only "input" flash attributes from request before redirect.
260+
* @param request current request
262261
* @return a read-only Map, or {@code null} if not found
263262
* @see FlashMap
264263
*/
@@ -268,20 +267,20 @@ public static Theme getTheme(HttpServletRequest request) {
268267
}
269268

270269
/**
271-
* Return the "output" FlashMap with attributes to save for a subsequent request.
272-
* @param request the current request
273-
* @return a {@link FlashMap} instance (never {@code null} within a DispatcherServlet request)
274-
* @see FlashMap
270+
* Return "output" FlashMap to save attributes for request after redirect.
271+
* @param request current request
272+
* @return a {@link FlashMap} instance, never {@code null} within a
273+
* {@code DispatcherServlet}-handled request
275274
*/
276275
public static FlashMap getOutputFlashMap(HttpServletRequest request) {
277276
return (FlashMap) request.getAttribute(DispatcherServlet.OUTPUT_FLASH_MAP_ATTRIBUTE);
278277
}
279278

280279
/**
281-
* Return the FlashMapManager instance to save flash attributes with
282-
* before a redirect.
280+
* Return the {@code FlashMapManager} instance to save flash attributes.
283281
* @param request the current request
284-
* @return a {@link FlashMapManager} instance (never {@code null} within a DispatcherServlet request)
282+
* @return a {@link FlashMapManager} instance, never {@code null} within a
283+
* {@code DispatcherServlet}-handled request
285284
*/
286285
public static FlashMapManager getFlashMapManager(HttpServletRequest request) {
287286
return (FlashMapManager) request.getAttribute(DispatcherServlet.FLASH_MAP_MANAGER_ATTRIBUTE);

spring-webmvc/src/main/java/org/springframework/web/servlet/view/RedirectView.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2016 the original author or authors.
2+
* Copyright 2002-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -371,7 +371,7 @@ private String getContextPath(HttpServletRequest request) {
371371
* attributes or URI variables from the current request. Model attributes
372372
* referenced in the URL are removed from the model.
373373
* @param targetUrl the redirect URL
374-
* @param model Map that contains model attributes
374+
* @param model a Map that contains model attributes
375375
* @param currentUriVariables current request URI variables to use
376376
* @param encodingScheme the encoding scheme to use
377377
* @throws UnsupportedEncodingException if string encoding failed
@@ -438,7 +438,7 @@ protected void appendCurrentQueryParams(StringBuilder targetUrl, HttpServletRequ
438438
* Append query properties to the redirect URL.
439439
* Stringifies, URL-encodes and formats model attributes as query properties.
440440
* @param targetUrl the StringBuilder to append the properties to
441-
* @param model Map that contains model attributes
441+
* @param model a Map that contains model attributes
442442
* @param encodingScheme the encoding scheme to use
443443
* @throws UnsupportedEncodingException if string encoding failed
444444
* @see #queryProperties
@@ -557,8 +557,9 @@ protected boolean isEligibleProperty(String key, Object value) {
557557

558558
/**
559559
* Determine whether the given model element value is eligible for exposure.
560-
* <p>The default implementation considers primitives, Strings, Numbers, Dates,
561-
* URIs, URLs and Locale objects as eligible. This can be overridden in subclasses.
560+
* <p>The default implementation considers primitives, strings, numbers, dates,
561+
* URIs, URLs etc as eligible, according to {@link BeanUtils#isSimpleValueType}.
562+
* This can be overridden in subclasses.
562563
* @param value the model element value
563564
* @return whether the element value is eligible
564565
* @see BeanUtils#isSimpleValueType
@@ -575,7 +576,6 @@ protected boolean isEligibleValue(Object value) {
575576
* @return the encoded output String
576577
* @throws UnsupportedEncodingException if thrown by the JDK URLEncoder
577578
* @see java.net.URLEncoder#encode(String, String)
578-
* @see java.net.URLEncoder#encode(String)
579579
*/
580580
protected String urlEncode(String input, String encodingScheme) throws UnsupportedEncodingException {
581581
return (input != null ? URLEncoder.encode(input, encodingScheme) : null);
@@ -605,7 +605,7 @@ protected String updateTargetUrl(String targetUrl, Map<String, Object> model,
605605
}
606606

607607
/**
608-
* Send a redirect back to the HTTP client
608+
* Send a redirect back to the HTTP client.
609609
* @param request current HTTP request (allows for reacting to request method)
610610
* @param response current HTTP response (for sending response headers)
611611
* @param targetUrl the target URL to redirect to

0 commit comments

Comments
 (0)