Skip to content

Commit cca037a

Browse files
committed
Polishing
1 parent 6685c78 commit cca037a

File tree

8 files changed

+89
-73
lines changed

8 files changed

+89
-73
lines changed

spring-core/src/main/java/org/springframework/core/annotation/AnnotationUtils.java

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -309,9 +309,9 @@ public static <A extends Annotation> Set<A> getRepeatableAnnotation(AnnotatedEle
309309
* compiler if the supplied element is a {@link Method}.
310310
* <p>Meta-annotations will be searched if the annotation is not
311311
* <em>present</em> on the supplied element.
312-
* @param annotatedElement the element to look for annotations on; never {@code null}
313-
* @param annotationType the annotation type to look for; never {@code null}
314-
* @return the annotations found or an empty set; never {@code null}
312+
* @param annotatedElement the element to look for annotations on
313+
* @param annotationType the annotation type to look for
314+
* @return the annotations found or an empty set (never {@code null})
315315
* @since 4.2
316316
* @see #getRepeatableAnnotations(AnnotatedElement, Class, Class)
317317
* @see #getDeclaredRepeatableAnnotations(AnnotatedElement, Class, Class)
@@ -339,13 +339,13 @@ public static <A extends Annotation> Set<A> getRepeatableAnnotations(AnnotatedEl
339339
* compiler if the supplied element is a {@link Method}.
340340
* <p>Meta-annotations will be searched if the annotation is not
341341
* <em>present</em> on the supplied element.
342-
* @param annotatedElement the element to look for annotations on; never {@code null}
343-
* @param annotationType the annotation type to look for; never {@code null}
342+
* @param annotatedElement the element to look for annotations on
343+
* @param annotationType the annotation type to look for
344344
* @param containerAnnotationType the type of the container that holds
345345
* the annotations; may be {@code null} if a container is not supported
346346
* or if it should be looked up via @{@link java.lang.annotation.Repeatable}
347347
* when running on Java 8 or higher
348-
* @return the annotations found or an empty set; never {@code null}
348+
* @return the annotations found or an empty set (never {@code null})
349349
* @since 4.2
350350
* @see #getRepeatableAnnotations(AnnotatedElement, Class)
351351
* @see #getDeclaredRepeatableAnnotations(AnnotatedElement, Class)
@@ -388,9 +388,9 @@ public static <A extends Annotation> Set<A> getRepeatableAnnotations(AnnotatedEl
388388
* compiler if the supplied element is a {@link Method}.
389389
* <p>Meta-annotations will be searched if the annotation is not
390390
* <em>present</em> on the supplied element.
391-
* @param annotatedElement the element to look for annotations on; never {@code null}
392-
* @param annotationType the annotation type to look for; never {@code null}
393-
* @return the annotations found or an empty set; never {@code null}
391+
* @param annotatedElement the element to look for annotations on
392+
* @param annotationType the annotation type to look for
393+
* @return the annotations found or an empty set (never {@code null})
394394
* @since 4.2
395395
* @see #getRepeatableAnnotations(AnnotatedElement, Class)
396396
* @see #getRepeatableAnnotations(AnnotatedElement, Class, Class)
@@ -419,13 +419,13 @@ public static <A extends Annotation> Set<A> getDeclaredRepeatableAnnotations(Ann
419419
* compiler if the supplied element is a {@link Method}.
420420
* <p>Meta-annotations will be searched if the annotation is not
421421
* <em>present</em> on the supplied element.
422-
* @param annotatedElement the element to look for annotations on; never {@code null}
423-
* @param annotationType the annotation type to look for; never {@code null}
422+
* @param annotatedElement the element to look for annotations on
423+
* @param annotationType the annotation type to look for
424424
* @param containerAnnotationType the type of the container that holds
425425
* the annotations; may be {@code null} if a container is not supported
426426
* or if it should be looked up via @{@link java.lang.annotation.Repeatable}
427427
* when running on Java 8 or higher
428-
* @return the annotations found or an empty set; never {@code null}
428+
* @return the annotations found or an empty set (never {@code null})
429429
* @since 4.2
430430
* @see #getRepeatableAnnotations(AnnotatedElement, Class)
431431
* @see #getRepeatableAnnotations(AnnotatedElement, Class, Class)
@@ -447,15 +447,15 @@ public static <A extends Annotation> Set<A> getDeclaredRepeatableAnnotations(Ann
447447
* compiler if the supplied element is a {@link Method}.
448448
* <p>Meta-annotations will be searched if the annotation is not
449449
* <em>present</em> on the supplied element.
450-
* @param annotatedElement the element to look for annotations on; never {@code null}
451-
* @param annotationType the annotation type to look for; never {@code null}
450+
* @param annotatedElement the element to look for annotations on
451+
* @param annotationType the annotation type to look for
452452
* @param containerAnnotationType the type of the container that holds
453453
* the annotations; may be {@code null} if a container is not supported
454454
* or if it should be looked up via @{@link java.lang.annotation.Repeatable}
455455
* when running on Java 8 or higher
456456
* @param declaredMode {@code true} if only declared annotations (i.e.,
457457
* directly or indirectly present) should be considered
458-
* @return the annotations found or an empty set; never {@code null}
458+
* @return the annotations found or an empty set (never {@code null})
459459
* @since 4.2
460460
* @see org.springframework.core.BridgeMethodResolver#findBridgedMethod
461461
* @see java.lang.annotation.Repeatable
@@ -497,8 +497,8 @@ private static <A extends Annotation> Set<A> getRepeatableAnnotations(AnnotatedE
497497
public static <A extends Annotation> A findAnnotation(AnnotatedElement annotatedElement, Class<A> annotationType) {
498498
// Do NOT store result in the findAnnotationCache since doing so could break
499499
// findAnnotation(Class, Class) and findAnnotation(Method, Class).
500-
return synthesizeAnnotation(findAnnotation(annotatedElement, annotationType, new HashSet<Annotation>()),
501-
annotatedElement);
500+
return synthesizeAnnotation(
501+
findAnnotation(annotatedElement, annotationType, new HashSet<Annotation>()), annotatedElement);
502502
}
503503

504504
/**
@@ -660,7 +660,7 @@ public static <A extends Annotation> A findAnnotation(Class<?> clazz, Class<A> a
660660
/**
661661
* Perform the actual work for {@link #findAnnotation(AnnotatedElement, Class)},
662662
* honoring the {@code synthesize} flag.
663-
* @param clazz the class to look for annotations on; never {@code null}
663+
* @param clazz the class to look for annotations on
664664
* @param annotationType the type of annotation to look for
665665
* @param synthesize {@code true} if the result should be
666666
* {@linkplain #synthesizeAnnotation(Annotation) synthesized}
@@ -860,7 +860,7 @@ public static boolean isAnnotationInherited(Class<? extends Annotation> annotati
860860
/**
861861
* Determine if an annotation of type {@code metaAnnotationType} is
862862
* <em>meta-present</em> on the supplied {@code annotationType}.
863-
* @param annotationType the annotation type to search on; never {@code null}
863+
* @param annotationType the annotation type to search on
864864
* @param metaAnnotationType the type of meta-annotation to search for
865865
* @return {@code true} if such an annotation is meta-present
866866
* @since 4.2.1
@@ -914,7 +914,7 @@ public static boolean isInJavaLangAnnotationPackage(String annotationType) {
914914
* However, the {@code Map} signature has been preserved for binary compatibility.
915915
* @param annotation the annotation to retrieve the attributes for
916916
* @return the Map of annotation attributes, with attribute names as keys and
917-
* corresponding attribute values as values; never {@code null}
917+
* corresponding attribute values as values (never {@code null})
918918
* @see #getAnnotationAttributes(AnnotatedElement, Annotation)
919919
* @see #getAnnotationAttributes(Annotation, boolean, boolean)
920920
* @see #getAnnotationAttributes(AnnotatedElement, Annotation, boolean, boolean)
@@ -934,7 +934,7 @@ public static Map<String, Object> getAnnotationAttributes(Annotation annotation)
934934
* compatibility with {@link org.springframework.core.type.AnnotationMetadata})
935935
* or to preserve them as Class references
936936
* @return the Map of annotation attributes, with attribute names as keys and
937-
* corresponding attribute values as values; never {@code null}
937+
* corresponding attribute values as values (never {@code null})
938938
* @see #getAnnotationAttributes(Annotation, boolean, boolean)
939939
*/
940940
public static Map<String, Object> getAnnotationAttributes(Annotation annotation, boolean classValuesAsString) {
@@ -954,7 +954,7 @@ public static Map<String, Object> getAnnotationAttributes(Annotation annotation,
954954
* {@link org.springframework.core.type.AnnotationMetadata}) or to preserve them as
955955
* {@code Annotation} instances
956956
* @return the annotation attributes (a specialized Map) with attribute names as keys
957-
* and corresponding attribute values as values; never {@code null}
957+
* and corresponding attribute values as values (never {@code null})
958958
* @since 3.1.1
959959
*/
960960
public static AnnotationAttributes getAnnotationAttributes(Annotation annotation, boolean classValuesAsString,
@@ -972,7 +972,7 @@ public static AnnotationAttributes getAnnotationAttributes(Annotation annotation
972972
* may be {@code null} if unknown
973973
* @param annotation the annotation to retrieve the attributes for
974974
* @return the annotation attributes (a specialized Map) with attribute names as keys
975-
* and corresponding attribute values as values; never {@code null}
975+
* and corresponding attribute values as values (never {@code null})
976976
* @since 4.2
977977
* @see #getAnnotationAttributes(AnnotatedElement, Annotation, boolean, boolean)
978978
*/
@@ -995,7 +995,7 @@ public static AnnotationAttributes getAnnotationAttributes(AnnotatedElement anno
995995
* {@link org.springframework.core.type.AnnotationMetadata}) or to preserve them as
996996
* {@code Annotation} instances
997997
* @return the annotation attributes (a specialized Map) with attribute names as keys
998-
* and corresponding attribute values as values; never {@code null}
998+
* and corresponding attribute values as values (never {@code null})
999999
* @since 4.2
10001000
*/
10011001
public static AnnotationAttributes getAnnotationAttributes(AnnotatedElement annotatedElement,
@@ -1037,7 +1037,7 @@ public static AnnotationAttributes getAnnotationAttributes(AnnotatedElement anno
10371037
* @param mergeMode whether the annotation attributes should be created
10381038
* using <em>merge mode</em>
10391039
* @return the annotation attributes (a specialized Map) with attribute names as keys
1040-
* and corresponding attribute values as values; never {@code null}
1040+
* and corresponding attribute values as values (never {@code null})
10411041
* @since 4.2
10421042
* @see #postProcessAnnotationAttributes
10431043
*/
@@ -1296,7 +1296,7 @@ public static <A extends Annotation> A synthesizeAnnotation(A annotation, Annota
12961296
* {@link Map} that is an ideal candidate for this method's
12971297
* {@code attributes} argument.
12981298
* @param attributes the map of annotation attributes to synthesize
1299-
* @param annotationType the type of annotation to synthesize; never {@code null}
1299+
* @param annotationType the type of annotation to synthesize
13001300
* @param annotatedElement the element that is annotated with the annotation
13011301
* corresponding to the supplied attributes; may be {@code null} if unknown
13021302
* @return the synthesized annotation, or {@code null} if the supplied attributes
@@ -1333,7 +1333,7 @@ public static <A extends Annotation> A synthesizeAnnotation(Map<String, Object>
13331333
* {@link #synthesizeAnnotation(Map, Class, AnnotatedElement)},
13341334
* supplying an empty map for the source attribute values and {@code null}
13351335
* for the {@link AnnotatedElement}.
1336-
* @param annotationType the type of annotation to synthesize; never {@code null}
1336+
* @param annotationType the type of annotation to synthesize
13371337
* @return the synthesized annotation
13381338
* @throws IllegalArgumentException if a required attribute is missing
13391339
* @throws AnnotationConfigurationException if invalid configuration of
@@ -1422,7 +1422,7 @@ static <A extends Annotation> A[] synthesizeAnnotationArray(Map<String, Object>[
14221422
* <p>An empty return value implies that the annotation does not declare
14231423
* any attribute aliases.
14241424
* @param annotationType the annotation type to find attribute aliases in
1425-
* @return a map containing attribute aliases; never {@code null}
1425+
* @return a map containing attribute aliases (never {@code null})
14261426
* @since 4.2
14271427
*/
14281428
static Map<String, List<String>> getAttributeAliasMap(Class<? extends Annotation> annotationType) {
@@ -1499,9 +1499,9 @@ else if (Annotation.class.isAssignableFrom(returnType)) {
14991499
/**
15001500
* Get the names of the aliased attributes configured via
15011501
* {@link AliasFor @AliasFor} for the supplied annotation {@code attribute}.
1502-
* @param attribute the attribute to find aliases for; never {@code null}
1503-
* @return the names of the aliased attributes; never {@code null}, though
1504-
* potentially <em>empty</em>
1502+
* @param attribute the attribute to find aliases for
1503+
* @return the names of the aliased attributes (never {@code null}, though
1504+
* potentially <em>empty</em>)
15051505
* @throws IllegalArgumentException if the supplied attribute method is
15061506
* {@code null} or not from an annotation
15071507
* @throws AnnotationConfigurationException if invalid configuration of
@@ -1549,7 +1549,7 @@ static String getAttributeOverrideName(Method attribute, Class<? extends Annotat
15491549
* @param annotationType the type in which to search for attribute methods;
15501550
* never {@code null}
15511551
* @return all annotation attribute methods in the specified annotation
1552-
* type; never {@code null}, though potentially <em>empty</em>
1552+
* type (never {@code null}, though potentially <em>empty</em>)
15531553
* @since 4.2
15541554
*/
15551555
static List<Method> getAttributeMethods(Class<? extends Annotation> annotationType) {
@@ -1575,7 +1575,7 @@ static List<Method> getAttributeMethods(Class<? extends Annotation> annotationTy
15751575
* supplied {@code element}.
15761576
* @param element the element to search on
15771577
* @param annotationName the fully qualified class name of the annotation
1578-
* type to find; never {@code null} or empty
1578+
* type to find
15791579
* @return the annotation if found; {@code null} otherwise
15801580
* @since 4.2
15811581
*/
@@ -2126,10 +2126,10 @@ public String toString() {
21262126
* one of the attributes has been declared while simultaneously ensuring
21272127
* that at least one of the attributes has been declared.
21282128
* @param aliasFor the {@code @AliasFor} annotation from which to retrieve
2129-
* the aliased attribute name; never {@code null}
2129+
* the aliased attribute name
21302130
* @param attribute the attribute that is annotated with {@code @AliasFor},
2131-
* used solely for building an exception message; never {@code null}
2132-
* @return the name of the aliased attribute, never {@code null} or empty
2131+
* used solely for building an exception message
2132+
* @return the name of the aliased attribute (never {@code null} or empty)
21332133
* @throws AnnotationConfigurationException if invalid configuration of
21342134
* {@code @AliasFor} is detected
21352135
* @since 4.2

spring-jdbc/src/main/java/org/springframework/jdbc/core/SqlParameter.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2014 the original author or authors.
2+
* Copyright 2002-2015 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.
@@ -43,7 +43,6 @@ public class SqlParameter {
4343
/** Used for types that are user-named like: STRUCT, DISTINCT, JAVA_OBJECT, named array types */
4444
private String typeName;
4545

46-
4746
/** The scale to apply in case of a NUMERIC or DECIMAL type, if any */
4847
private Integer scale;
4948

@@ -126,7 +125,7 @@ public SqlParameter(SqlParameter otherParam) {
126125

127126

128127
/**
129-
* Return the name of the parameter.
128+
* Return the name of the parameter, or {@code null} if anonymous.
130129
*/
131130
public String getName() {
132131
return this.name;

spring-jdbc/src/test/java/org/springframework/jdbc/core/simple/SimpleJdbcCallTests.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,7 @@ public void testAddInvoiceProcWithoutMetaDataUsingMapParamSource() throws Except
105105
adder.declareParameters(
106106
new SqlParameter("amount", Types.INTEGER),
107107
new SqlParameter("custid", Types.INTEGER),
108-
new SqlOutParameter("newid",
109-
Types.INTEGER));
108+
new SqlOutParameter("newid", Types.INTEGER));
110109
Number newId = adder.executeObject(Number.class, new MapSqlParameterSource().
111110
addValue("amount", 1103).
112111
addValue("custid", 3));
@@ -122,8 +121,7 @@ public void testAddInvoiceProcWithoutMetaDataUsingArrayParams() throws Exception
122121
adder.declareParameters(
123122
new SqlParameter("amount", Types.INTEGER),
124123
new SqlParameter("custid", Types.INTEGER),
125-
new SqlOutParameter("newid",
126-
Types.INTEGER));
124+
new SqlOutParameter("newid", Types.INTEGER));
127125
Number newId = adder.executeObject(Number.class, 1103, 3);
128126
assertEquals(4, newId.intValue());
129127
verifyAddInvoiceWithoutMetaData(false);
@@ -230,12 +228,12 @@ public void testCorrectProcedureStatementNamed() throws Exception {
230228
verifyStatement(adder, "{call ADD_INVOICE(AMOUNT => ?, CUSTID => ?, NEWID => ?)}");
231229
}
232230

231+
233232
private void verifyStatement(SimpleJdbcCall adder, String expected) {
234233
Assert.assertEquals("Incorrect call statement", expected, adder.getCallString());
235234
}
236235

237-
private void initializeAddInvoiceWithoutMetaData(boolean isFunction)
238-
throws SQLException {
236+
private void initializeAddInvoiceWithoutMetaData(boolean isFunction) throws SQLException {
239237
given(databaseMetaData.getDatabaseProductName()).willReturn("MyDB");
240238
given(databaseMetaData.getUserName()).willReturn("me");
241239
given(databaseMetaData.storesLowerCaseIdentifiers()).willReturn(true);
@@ -313,4 +311,5 @@ private void verifyAddInvoiceWithMetaData(boolean isFunction) throws SQLExceptio
313311
verify(proceduresResultSet).close();
314312
verify(procedureColumnsResultSet).close();
315313
}
314+
316315
}

spring-messaging/src/main/java/org/springframework/messaging/handler/HandlerMethodSelector.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2013 the original author or authors.
2+
* Copyright 2002-2015 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.
@@ -37,8 +37,8 @@
3737
public abstract class HandlerMethodSelector {
3838

3939
/**
40-
* Selects handler methods for the given handler type. Callers of this method define handler methods
41-
* of interest through the {@link MethodFilter} parameter.
40+
* Select handler methods for the given handler type.
41+
* <p>Callers define handler methods of interest through the {@link MethodFilter} parameter.
4242
* @param handlerType the handler type to search handler methods on
4343
* @param handlerMethodFilter a {@link MethodFilter} to help recognize handler methods of interest
4444
* @return the selected methods, or an empty set

0 commit comments

Comments
 (0)