Skip to content

Commit ac4c37d

Browse files
committed
Merge branch '5.1.x'
2 parents 17930d6 + 6c87ef0 commit ac4c37d

File tree

16 files changed

+94
-88
lines changed

16 files changed

+94
-88
lines changed

spring-beans/src/main/java/org/springframework/beans/factory/config/YamlProcessor.java

Lines changed: 1 addition & 1 deletion
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.

spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanDefinition.java

Lines changed: 1 addition & 1 deletion
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.

spring-context/src/main/java/org/springframework/context/annotation/DeferredImportSelector.java

Lines changed: 14 additions & 11 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,8 +40,10 @@
4040
public interface DeferredImportSelector extends ImportSelector {
4141

4242
/**
43-
* Return a specific import group or {@code null} if no grouping is required.
44-
* @return the import group class or {@code null}
43+
* Return a specific import group.
44+
* <p>The default implementations return {@code null} for no grouping required.
45+
* @return the import group class, or {@code null} if none
46+
* @since 5.0
4547
*/
4648
@Nullable
4749
default Class<? extends Group> getImportGroup() {
@@ -61,11 +63,12 @@ interface Group {
6163
void process(AnnotationMetadata metadata, DeferredImportSelector selector);
6264

6365
/**
64-
* Return the {@link Entry entries} of which class(es) should be imported for this
65-
* group.
66+
* Return the {@link Entry entries} of which class(es) should be imported
67+
* for this group.
6668
*/
6769
Iterable<Entry> selectImports();
6870

71+
6972
/**
7073
* An entry that holds the {@link AnnotationMetadata} of the importing
7174
* {@link Configuration} class and the class name to import.
@@ -97,16 +100,16 @@ public String getImportClassName() {
97100
}
98101

99102
@Override
100-
public boolean equals(Object o) {
101-
if (this == o) {
103+
public boolean equals(Object other) {
104+
if (this == other) {
102105
return true;
103106
}
104-
if (o == null || getClass() != o.getClass()) {
107+
if (other == null || getClass() != other.getClass()) {
105108
return false;
106109
}
107-
Entry entry = (Entry) o;
108-
return Objects.equals(this.metadata, entry.metadata) &&
109-
Objects.equals(this.importClassName, entry.importClassName);
110+
Entry entry = (Entry) other;
111+
return (Objects.equals(this.metadata, entry.metadata) &&
112+
Objects.equals(this.importClassName, entry.importClassName));
110113
}
111114

112115
@Override

spring-context/src/main/java/org/springframework/context/annotation/ImportBeanDefinitionRegistrar.java

Lines changed: 2 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-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.
@@ -58,7 +58,6 @@ public interface ImportBeanDefinitionRegistrar {
5858
* @param importingClassMetadata annotation metadata of the importing class
5959
* @param registry current bean definition registry
6060
*/
61-
public void registerBeanDefinitions(
62-
AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry);
61+
void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry);
6362

6463
}

spring-context/src/main/java/org/springframework/context/annotation/ImportSelector.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,23 @@
2020

2121
/**
2222
* Interface to be implemented by types that determine which @{@link Configuration}
23-
* class(es) should be imported based on a given selection criteria, usually one or more
24-
* annotation attributes.
23+
* class(es) should be imported based on a given selection criteria, usually one or
24+
* more annotation attributes.
2525
*
2626
* <p>An {@link ImportSelector} may implement any of the following
27-
* {@link org.springframework.beans.factory.Aware Aware} interfaces, and their respective
28-
* methods will be called prior to {@link #selectImports}:
27+
* {@link org.springframework.beans.factory.Aware Aware} interfaces,
28+
* and their respective methods will be called prior to {@link #selectImports}:
2929
* <ul>
3030
* <li>{@link org.springframework.context.EnvironmentAware EnvironmentAware}</li>
3131
* <li>{@link org.springframework.beans.factory.BeanFactoryAware BeanFactoryAware}</li>
3232
* <li>{@link org.springframework.beans.factory.BeanClassLoaderAware BeanClassLoaderAware}</li>
3333
* <li>{@link org.springframework.context.ResourceLoaderAware ResourceLoaderAware}</li>
3434
* </ul>
3535
*
36-
* <p>ImportSelectors are usually processed in the same way as regular {@code @Import}
37-
* annotations, however, it is also possible to defer selection of imports until all
38-
* {@code @Configuration} classes have been processed (see {@link DeferredImportSelector}
39-
* for details).
36+
* <p>{@code ImportSelector} implementations are usually processed in the same way
37+
* as regular {@code @Import} annotations, however, it is also possible to defer
38+
* selection of imports until all {@code @Configuration} classes have been processed
39+
* (see {@link DeferredImportSelector} for details).
4040
*
4141
* @author Chris Beams
4242
* @since 3.1

spring-core/src/main/java/org/springframework/util/ObjectUtils.java

Lines changed: 21 additions & 21 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.
@@ -640,7 +640,7 @@ public static String getDisplayString(@Nullable Object obj) {
640640

641641
/**
642642
* Determine the class name for the given object.
643-
* <p>Returns {@code "null"} if {@code obj} is {@code null}.
643+
* <p>Returns a {@code "null"} String if {@code obj} is {@code null}.
644644
* @param obj the object to introspect (may be {@code null})
645645
* @return the corresponding class name
646646
*/
@@ -651,7 +651,7 @@ public static String nullSafeClassName(@Nullable Object obj) {
651651
/**
652652
* Return a String representation of the specified Object.
653653
* <p>Builds a String representation of the contents in case of an array.
654-
* Returns {@code "null"} if {@code obj} is {@code null}.
654+
* Returns a {@code "null"} String if {@code obj} is {@code null}.
655655
* @param obj the object to build a String representation for
656656
* @return a String representation of {@code obj}
657657
*/
@@ -697,8 +697,8 @@ public static String nullSafeToString(@Nullable Object obj) {
697697
* Return a String representation of the contents of the specified array.
698698
* <p>The String representation consists of a list of the array's elements,
699699
* enclosed in curly braces ({@code "{}"}). Adjacent elements are separated
700-
* by the characters {@code ", "} (a comma followed by a space). Returns
701-
* {@code "null"} if {@code array} is {@code null}.
700+
* by the characters {@code ", "} (a comma followed by a space).
701+
* Returns a {@code "null"} String if {@code array} is {@code null}.
702702
* @param array the array to build a String representation for
703703
* @return a String representation of {@code array}
704704
*/
@@ -721,8 +721,8 @@ public static String nullSafeToString(@Nullable Object[] array) {
721721
* Return a String representation of the contents of the specified array.
722722
* <p>The String representation consists of a list of the array's elements,
723723
* enclosed in curly braces ({@code "{}"}). Adjacent elements are separated
724-
* by the characters {@code ", "} (a comma followed by a space). Returns
725-
* {@code "null"} if {@code array} is {@code null}.
724+
* by the characters {@code ", "} (a comma followed by a space).
725+
* Returns a {@code "null"} String if {@code array} is {@code null}.
726726
* @param array the array to build a String representation for
727727
* @return a String representation of {@code array}
728728
*/
@@ -753,8 +753,8 @@ public static String nullSafeToString(@Nullable boolean[] array) {
753753
* Return a String representation of the contents of the specified array.
754754
* <p>The String representation consists of a list of the array's elements,
755755
* enclosed in curly braces ({@code "{}"}). Adjacent elements are separated
756-
* by the characters {@code ", "} (a comma followed by a space). Returns
757-
* {@code "null"} if {@code array} is {@code null}.
756+
* by the characters {@code ", "} (a comma followed by a space).
757+
* Returns a {@code "null"} String if {@code array} is {@code null}.
758758
* @param array the array to build a String representation for
759759
* @return a String representation of {@code array}
760760
*/
@@ -784,8 +784,8 @@ public static String nullSafeToString(@Nullable byte[] array) {
784784
* Return a String representation of the contents of the specified array.
785785
* <p>The String representation consists of a list of the array's elements,
786786
* enclosed in curly braces ({@code "{}"}). Adjacent elements are separated
787-
* by the characters {@code ", "} (a comma followed by a space). Returns
788-
* {@code "null"} if {@code array} is {@code null}.
787+
* by the characters {@code ", "} (a comma followed by a space).
788+
* Returns a {@code "null"} String if {@code array} is {@code null}.
789789
* @param array the array to build a String representation for
790790
* @return a String representation of {@code array}
791791
*/
@@ -815,8 +815,8 @@ public static String nullSafeToString(@Nullable char[] array) {
815815
* Return a String representation of the contents of the specified array.
816816
* <p>The String representation consists of a list of the array's elements,
817817
* enclosed in curly braces ({@code "{}"}). Adjacent elements are separated
818-
* by the characters {@code ", "} (a comma followed by a space). Returns
819-
* {@code "null"} if {@code array} is {@code null}.
818+
* by the characters {@code ", "} (a comma followed by a space).
819+
* Returns a {@code "null"} String if {@code array} is {@code null}.
820820
* @param array the array to build a String representation for
821821
* @return a String representation of {@code array}
822822
*/
@@ -847,8 +847,8 @@ public static String nullSafeToString(@Nullable double[] array) {
847847
* Return a String representation of the contents of the specified array.
848848
* <p>The String representation consists of a list of the array's elements,
849849
* enclosed in curly braces ({@code "{}"}). Adjacent elements are separated
850-
* by the characters {@code ", "} (a comma followed by a space). Returns
851-
* {@code "null"} if {@code array} is {@code null}.
850+
* by the characters {@code ", "} (a comma followed by a space).
851+
* Returns a {@code "null"} String if {@code array} is {@code null}.
852852
* @param array the array to build a String representation for
853853
* @return a String representation of {@code array}
854854
*/
@@ -879,8 +879,8 @@ public static String nullSafeToString(@Nullable float[] array) {
879879
* Return a String representation of the contents of the specified array.
880880
* <p>The String representation consists of a list of the array's elements,
881881
* enclosed in curly braces ({@code "{}"}). Adjacent elements are separated
882-
* by the characters {@code ", "} (a comma followed by a space). Returns
883-
* {@code "null"} if {@code array} is {@code null}.
882+
* by the characters {@code ", "} (a comma followed by a space).
883+
* Returns a {@code "null"} String if {@code array} is {@code null}.
884884
* @param array the array to build a String representation for
885885
* @return a String representation of {@code array}
886886
*/
@@ -910,8 +910,8 @@ public static String nullSafeToString(@Nullable int[] array) {
910910
* Return a String representation of the contents of the specified array.
911911
* <p>The String representation consists of a list of the array's elements,
912912
* enclosed in curly braces ({@code "{}"}). Adjacent elements are separated
913-
* by the characters {@code ", "} (a comma followed by a space). Returns
914-
* {@code "null"} if {@code array} is {@code null}.
913+
* by the characters {@code ", "} (a comma followed by a space).
914+
* Returns a {@code "null"} String if {@code array} is {@code null}.
915915
* @param array the array to build a String representation for
916916
* @return a String representation of {@code array}
917917
*/
@@ -941,8 +941,8 @@ public static String nullSafeToString(@Nullable long[] array) {
941941
* Return a String representation of the contents of the specified array.
942942
* <p>The String representation consists of a list of the array's elements,
943943
* enclosed in curly braces ({@code "{}"}). Adjacent elements are separated
944-
* by the characters {@code ", "} (a comma followed by a space). Returns
945-
* {@code "null"} if {@code array} is {@code null}.
944+
* by the characters {@code ", "} (a comma followed by a space).
945+
* Returns a {@code "null"} String if {@code array} is {@code null}.
946946
* @param array the array to build a String representation for
947947
* @return a String representation of {@code array}
948948
*/

spring-jms/src/main/java/org/springframework/jms/config/MethodJmsListenerEndpoint.java

Lines changed: 5 additions & 2 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.
@@ -147,8 +147,11 @@ protected MessagingMessageListenerAdapter createMessageListener(MessageListenerC
147147
Assert.state(this.messageHandlerMethodFactory != null,
148148
"Could not create message listener - MessageHandlerMethodFactory not set");
149149
MessagingMessageListenerAdapter messageListener = createMessageListenerInstance();
150+
Object bean = getBean();
151+
Method method = getMethod();
152+
Assert.state(bean != null && method != null, "No bean+method set on endpoint");
150153
InvocableHandlerMethod invocableHandlerMethod =
151-
this.messageHandlerMethodFactory.createInvocableHandlerMethod(getBean(), getMethod());
154+
this.messageHandlerMethodFactory.createInvocableHandlerMethod(bean, method);
152155
messageListener.setHandlerMethod(invocableHandlerMethod);
153156
String responseDestination = getDefaultResponseDestination();
154157
if (StringUtils.hasText(responseDestination)) {

spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/support/MethodArgumentNotValidException.java

Lines changed: 2 additions & 1 deletion
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.
@@ -34,6 +34,7 @@
3434
@SuppressWarnings("serial")
3535
public class MethodArgumentNotValidException extends MethodArgumentResolutionException {
3636

37+
@Nullable
3738
private final BindingResult bindingResult;
3839

3940

spring-messaging/src/main/java/org/springframework/messaging/simp/user/MultiServerUserRegistry.java

Lines changed: 2 additions & 2 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.
@@ -64,7 +64,7 @@ public class MultiServerUserRegistry implements SimpUserRegistry, SmartApplicati
6464
* Create an instance wrapping the local user registry.
6565
*/
6666
public MultiServerUserRegistry(SimpUserRegistry localRegistry) {
67-
Assert.notNull(localRegistry, "'localRegistry' is required.");
67+
Assert.notNull(localRegistry, "'localRegistry' is required");
6868
this.id = generateId();
6969
this.localRegistry = localRegistry;
7070
this.delegateApplicationEvents = this.localRegistry instanceof SmartApplicationListener;

spring-test/src/main/java/org/springframework/test/context/TestContext.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,19 +64,17 @@ public interface TestContext extends AttributeAccessor, Serializable {
6464
/**
6565
* Get the current {@linkplain Object test instance} for this test context.
6666
* <p>Note: this is a mutable property.
67-
* @return the current test instance (may be {@code null})
67+
* @return the current test instance (never {@code null})
6868
* @see #updateState(Object, Method, Throwable)
6969
*/
70-
@Nullable
7170
Object getTestInstance();
7271

7372
/**
7473
* Get the current {@linkplain Method test method} for this test context.
7574
* <p>Note: this is a mutable property.
76-
* @return the current test method (may be {@code null})
75+
* @return the current test method (never {@code null})
7776
* @see #updateState(Object, Method, Throwable)
7877
*/
79-
@Nullable
8078
Method getTestMethod();
8179

8280
/**
@@ -103,7 +101,7 @@ public interface TestContext extends AttributeAccessor, Serializable {
103101

104102
/**
105103
* Update this test context to reflect the state of the currently executing test.
106-
* <p><strong>WARNING</strong>: this method should only be invoked by the
104+
* <p><strong>WARNING</strong>: This method should only be invoked by the
107105
* {@link TestContextManager}.
108106
* <p>Caution: concurrent invocations of this method might not be thread-safe,
109107
* depending on the underlying implementation.

spring-test/src/main/java/org/springframework/test/web/reactive/server/DefaultMockServerSpec.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.
@@ -13,6 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
1617
package org.springframework.test.web.reactive.server;
1718

1819
import org.springframework.util.Assert;
@@ -32,7 +33,7 @@ class DefaultMockServerSpec extends AbstractMockServerSpec<DefaultMockServerSpec
3233

3334

3435
DefaultMockServerSpec(WebHandler webHandler) {
35-
Assert.notNull(webHandler, "'WebHandler' is required");
36+
Assert.notNull(webHandler, "WebHandler is required");
3637
this.webHandler = webHandler;
3738
}
3839

spring-test/src/main/java/org/springframework/test/web/reactive/server/MockServerConfigurer.java

Lines changed: 2 additions & 1 deletion
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.
@@ -13,6 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
1617
package org.springframework.test.web.reactive.server;
1718

1819
import org.springframework.web.server.adapter.WebHttpHandlerBuilder;

spring-test/src/main/java/org/springframework/test/web/reactive/server/WebTestClientConfigurer.java

Lines changed: 2 additions & 1 deletion
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.
@@ -13,6 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
1617
package org.springframework.test.web.reactive.server;
1718

1819
import org.springframework.http.client.reactive.ClientHttpConnector;

spring-test/src/main/java/org/springframework/test/web/reactive/server/XpathAssertions.java

Lines changed: 1 addition & 2 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.
@@ -30,7 +30,6 @@
3030
import org.springframework.util.Assert;
3131
import org.springframework.util.MimeType;
3232

33-
3433
/**
3534
* XPath assertions for the {@link WebTestClient}.
3635
*

0 commit comments

Comments
 (0)