Skip to content

Commit 106a757

Browse files
committed
Polishing
1 parent 8637540 commit 106a757

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2017 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.
@@ -363,7 +363,7 @@ private void assertNotException(String attributeName, Object attributeValue) {
363363
private void assertAttributeType(String attributeName, Object attributeValue, Class<?> expectedType) {
364364
if (!expectedType.isInstance(attributeValue)) {
365365
throw new IllegalArgumentException(String.format(
366-
"Attribute '%s' is of type [%s], but [%s] was expected in attributes for annotation [%s]",
366+
"Attribute '%s' is of type %s, but %s was expected in attributes for annotation [%s]",
367367
attributeName, attributeValue.getClass().getSimpleName(), expectedType.getSimpleName(),
368368
this.displayName));
369369
}

spring-core/src/main/java/org/springframework/core/type/classreading/AnnotationReadingVisitorUtils.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2017 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.
@@ -28,6 +28,7 @@
2828
import org.springframework.core.annotation.AnnotationUtils;
2929
import org.springframework.lang.Nullable;
3030
import org.springframework.util.ClassUtils;
31+
import org.springframework.util.CollectionUtils;
3132
import org.springframework.util.LinkedMultiValueMap;
3233
import org.springframework.util.ObjectUtils;
3334

@@ -124,7 +125,7 @@ public static AnnotationAttributes getMergedAnnotationAttributes(
124125

125126
// Get the unmerged list of attributes for the target annotation.
126127
List<AnnotationAttributes> attributesList = attributesMap.get(annotationName);
127-
if (attributesList == null || attributesList.isEmpty()) {
128+
if (CollectionUtils.isEmpty(attributesList)) {
128129
return null;
129130
}
130131

spring-core/src/test/java/org/springframework/core/annotation/AnnotationAttributesTests.java

Lines changed: 2 additions & 2 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.
@@ -154,7 +154,7 @@ public void getEnumWithUnknownAttributeName() {
154154
public void getEnumWithTypeMismatch() {
155155
attributes.put("color", "RED");
156156
exception.expect(IllegalArgumentException.class);
157-
exception.expectMessage(containsString("Attribute 'color' is of type [String], but [Enum] was expected"));
157+
exception.expectMessage(containsString("Attribute 'color' is of type String, but Enum was expected"));
158158
attributes.getEnum("color");
159159
}
160160

spring-jdbc/src/test/resources/org/springframework/jdbc/datasource/init/test-data-with-multi-line-nested-comments.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ INSERT INTO users(first_name, last_name) VALUES('Juergen', 'Hoeller');
1111
-- A fancy multi-line comments that puts
1212
-- single line comments inside of a multi-line
1313
-- comment block.
14-
Moreover, the block commend end delimiter
14+
Moreover, the block comment end delimiter
1515
appears on a line that can potentially also
1616
be a single-line comment if we weren't
1717
already inside a multi-line comment run.

0 commit comments

Comments
 (0)