Merge branch '5.3.x'
This commit is contained in:
commit
70415b1781
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
@ -378,7 +378,7 @@ public class AspectJExpressionPointcut extends AbstractExpressionPointcut
|
|||
}
|
||||
catch (Throwable ex) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Failed to evaluate join point for arguments " + Arrays.asList(args) +
|
||||
logger.debug("Failed to evaluate join point for arguments " + Arrays.toString(args) +
|
||||
" - falling back to non-match", ex);
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -424,7 +424,7 @@ public class ProxyFactoryBean extends ProxyCreatorSupport
|
|||
if (!this.advisorChainInitialized && !ObjectUtils.isEmpty(this.interceptorNames)) {
|
||||
if (this.beanFactory == null) {
|
||||
throw new IllegalStateException("No BeanFactory available anymore (probably due to serialization) " +
|
||||
"- cannot resolve interceptor names " + Arrays.asList(this.interceptorNames));
|
||||
"- cannot resolve interceptor names " + Arrays.toString(this.interceptorNames));
|
||||
}
|
||||
|
||||
// Globals can't be last unless we specified a targetSource using the property...
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
package org.springframework.beans.factory.support;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.BeanMetadataElement;
|
||||
|
|
@ -31,6 +31,8 @@ import org.springframework.lang.Nullable;
|
|||
* @author Rod Johnson
|
||||
* @author Rob Harrop
|
||||
* @author Juergen Hoeller
|
||||
* @author Stephane Nicoll
|
||||
* @author Sam Brannen
|
||||
* @since 27.05.2003
|
||||
* @param <E> the element type
|
||||
*/
|
||||
|
|
@ -55,16 +57,16 @@ public class ManagedList<E> extends ArrayList<E> implements Mergeable, BeanMetad
|
|||
|
||||
|
||||
/**
|
||||
* Return a new instance containing an arbitrary number of elements.
|
||||
* Create a new instance containing an arbitrary number of elements.
|
||||
* @param elements the elements to be contained in the list
|
||||
* @param <E> the {@code List}'s element type
|
||||
* @return a {@code List} containing the specified elements
|
||||
* @return a {@code ManagedList} containing the specified elements
|
||||
* @since 5.3.16
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@SafeVarargs
|
||||
public static <E> ManagedList<E> of(E... elements) {
|
||||
ManagedList<E> list = new ManagedList<>();
|
||||
list.addAll(Arrays.asList(elements));
|
||||
Collections.addAll(list, elements);
|
||||
return list;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
package org.springframework.beans.factory.support;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Set;
|
||||
|
||||
|
|
@ -30,6 +30,8 @@ import org.springframework.lang.Nullable;
|
|||
*
|
||||
* @author Juergen Hoeller
|
||||
* @author Rob Harrop
|
||||
* @author Stephane Nicoll
|
||||
* @author Sam Brannen
|
||||
* @since 21.01.2004
|
||||
* @param <E> the element type
|
||||
*/
|
||||
|
|
@ -54,16 +56,16 @@ public class ManagedSet<E> extends LinkedHashSet<E> implements Mergeable, BeanMe
|
|||
|
||||
|
||||
/**
|
||||
* Return a new instance containing an arbitrary number of elements.
|
||||
* Create a new instance containing an arbitrary number of elements.
|
||||
* @param elements the elements to be contained in the set
|
||||
* @param <E> the {@code Set}'s element type
|
||||
* @return a {@code Set} containing the specified elements
|
||||
* @return a {@code ManagedSet} containing the specified elements
|
||||
* @since 5.3.16
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@SafeVarargs
|
||||
public static <E> ManagedSet<E> of(E... elements) {
|
||||
ManagedSet<E> set = new ManagedSet<>();
|
||||
set.addAll(Arrays.asList(elements));
|
||||
Collections.addAll(set, elements);
|
||||
return set;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -25,61 +25,61 @@ import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException
|
|||
import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
|
||||
|
||||
/**
|
||||
* Unit tests for {@link ManagedList}.
|
||||
*
|
||||
* @author Rick Evans
|
||||
* @author Juergen Hoeller
|
||||
* @author Sam Brannen
|
||||
*/
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
public class ManagedListTests {
|
||||
class ManagedListTests {
|
||||
|
||||
@Test
|
||||
public void mergeSunnyDay() {
|
||||
void mergeSunnyDay() {
|
||||
ManagedList parent = ManagedList.of("one", "two");
|
||||
ManagedList child = ManagedList.of("three");
|
||||
child.setMergeEnabled(true);
|
||||
List mergedList = child.merge(parent);
|
||||
assertThat(mergedList.size()).as("merge() obviously did not work.").isEqualTo(3);
|
||||
assertThat(mergedList).as("merge() obviously did not work.").containsExactly("one", "two", "three");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void mergeWithNullParent() {
|
||||
void mergeWithNullParent() {
|
||||
ManagedList child = ManagedList.of("one");
|
||||
child.setMergeEnabled(true);
|
||||
assertThat(child.merge(null)).isSameAs(child);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void mergeNotAllowedWhenMergeNotEnabled() {
|
||||
void mergeNotAllowedWhenMergeNotEnabled() {
|
||||
ManagedList child = new ManagedList();
|
||||
assertThatIllegalStateException().isThrownBy(() ->
|
||||
child.merge(null));
|
||||
assertThatIllegalStateException().isThrownBy(() -> child.merge(null));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void mergeWithNonCompatibleParentType() {
|
||||
void mergeWithIncompatibleParentType() {
|
||||
ManagedList child = ManagedList.of("one");
|
||||
child.setMergeEnabled(true);
|
||||
assertThatIllegalArgumentException().isThrownBy(() ->
|
||||
child.merge("hello"));
|
||||
assertThatIllegalArgumentException().isThrownBy(() -> child.merge("hello"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void mergeEmptyChild() {
|
||||
void mergeEmptyChild() {
|
||||
ManagedList parent = ManagedList.of("one", "two");
|
||||
ManagedList child = new ManagedList();
|
||||
child.setMergeEnabled(true);
|
||||
List mergedList = child.merge(parent);
|
||||
assertThat(mergedList.size()).as("merge() obviously did not work.").isEqualTo(2);
|
||||
assertThat(mergedList).as("merge() obviously did not work.").containsExactly("one", "two");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void mergeChildValuesOverrideTheParents() {
|
||||
void mergedChildValuesDoNotOverrideTheParents() {
|
||||
// doesn't make much sense in the context of a list...
|
||||
ManagedList parent = ManagedList.of("one", "two");
|
||||
ManagedList child = ManagedList.of("one");
|
||||
child.setMergeEnabled(true);
|
||||
List mergedList = child.merge(parent);
|
||||
assertThat(mergedList.size()).as("merge() obviously did not work.").isEqualTo(3);
|
||||
assertThat(mergedList).as("merge() obviously did not work.").containsExactly("one", "two", "one");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,61 +25,62 @@ import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException
|
|||
import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
|
||||
|
||||
/**
|
||||
* Unit tests for {@link ManagedSet}.
|
||||
*
|
||||
* @author Rick Evans
|
||||
* @author Juergen Hoeller
|
||||
* @author Sam Brannen
|
||||
*/
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
public class ManagedSetTests {
|
||||
class ManagedSetTests {
|
||||
|
||||
@Test
|
||||
public void mergeSunnyDay() {
|
||||
void mergeSunnyDay() {
|
||||
ManagedSet parent = ManagedSet.of("one", "two");
|
||||
ManagedSet child = ManagedSet.of("three");
|
||||
child.add("three");
|
||||
child.add("four");
|
||||
child.setMergeEnabled(true);
|
||||
Set mergedSet = child.merge(parent);
|
||||
assertThat(mergedSet.size()).as("merge() obviously did not work.").isEqualTo(3);
|
||||
assertThat(mergedSet).as("merge() obviously did not work.").containsExactly("one", "two", "three", "four");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void mergeWithNullParent() {
|
||||
void mergeWithNullParent() {
|
||||
ManagedSet child = ManagedSet.of("one");
|
||||
child.setMergeEnabled(true);
|
||||
assertThat(child.merge(null)).isSameAs(child);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void mergeNotAllowedWhenMergeNotEnabled() {
|
||||
assertThatIllegalStateException().isThrownBy(() ->
|
||||
new ManagedSet().merge(null));
|
||||
void mergeNotAllowedWhenMergeNotEnabled() {
|
||||
assertThatIllegalStateException().isThrownBy(() -> new ManagedSet().merge(null));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void mergeWithNonCompatibleParentType() {
|
||||
void mergeWithNonCompatibleParentType() {
|
||||
ManagedSet child = ManagedSet.of("one");
|
||||
child.setMergeEnabled(true);
|
||||
assertThatIllegalArgumentException().isThrownBy(() ->
|
||||
child.merge("hello"));
|
||||
assertThatIllegalArgumentException().isThrownBy(() -> child.merge("hello"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void mergeEmptyChild() {
|
||||
void mergeEmptyChild() {
|
||||
ManagedSet parent = ManagedSet.of("one", "two");
|
||||
ManagedSet child = new ManagedSet();
|
||||
child.setMergeEnabled(true);
|
||||
Set mergedSet = child.merge(parent);
|
||||
assertThat(mergedSet.size()).as("merge() obviously did not work.").isEqualTo(2);
|
||||
assertThat(mergedSet).as("merge() obviously did not work.").containsExactly("one", "two");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void mergeChildValuesOverrideTheParents() {
|
||||
void mergeChildValuesOverrideTheParents() {
|
||||
// asserts that the set contract is not violated during a merge() operation...
|
||||
ManagedSet parent = ManagedSet.of("one", "two");
|
||||
ManagedSet child = ManagedSet.of("one");
|
||||
child.setMergeEnabled(true);
|
||||
Set mergedSet = child.merge(parent);
|
||||
assertThat(mergedSet.size()).as("merge() obviously did not work.").isEqualTo(2);
|
||||
assertThat(mergedSet).as("merge() obviously did not work.").containsExactly("one", "two");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
@ -143,7 +143,7 @@ public class NotificationListenerRegistrar extends NotificationListenerHolder
|
|||
this.actualObjectNames = getResolvedObjectNames();
|
||||
if (this.actualObjectNames != null) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Registering NotificationListener for MBeans " + Arrays.asList(this.actualObjectNames));
|
||||
logger.debug("Registering NotificationListener for MBeans " + Arrays.toString(this.actualObjectNames));
|
||||
}
|
||||
for (ObjectName actualObjectName : this.actualObjectNames) {
|
||||
this.server.addNotificationListener(
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
@ -297,7 +297,7 @@ public abstract class AbstractEnvironment implements ConfigurableEnvironment {
|
|||
public void setActiveProfiles(String... profiles) {
|
||||
Assert.notNull(profiles, "Profile array must not be null");
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Activating profiles " + Arrays.asList(profiles));
|
||||
logger.debug("Activating profiles " + Arrays.toString(profiles));
|
||||
}
|
||||
synchronized (this.activeProfiles) {
|
||||
this.activeProfiles.clear();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
@ -451,7 +451,7 @@ public abstract class AbstractJdbcInsert {
|
|||
if (getGeneratedKeyNames().length > 1) {
|
||||
throw new InvalidDataAccessApiUsageException(
|
||||
"Current database only supports retrieving the key for a single column. There are " +
|
||||
getGeneratedKeyNames().length + " columns specified: " + Arrays.asList(getGeneratedKeyNames()));
|
||||
getGeneratedKeyNames().length + " columns specified: " + Arrays.toString(getGeneratedKeyNames()));
|
||||
}
|
||||
|
||||
Assert.state(getTableName() != null, "No table name set");
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
@ -117,7 +117,7 @@ public class SpringConfigurator extends Configurator {
|
|||
beanNamesByType.put(endpointClass, NO_VALUE);
|
||||
if (names.length > 1) {
|
||||
throw new IllegalStateException("Found multiple @ServerEndpoint's of type [" +
|
||||
endpointClass.getName() + "]: bean names " + Arrays.asList(names));
|
||||
endpointClass.getName() + "]: bean names " + Arrays.toString(names));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
@ -83,7 +83,7 @@ public abstract class AbstractHttpReceivingTransportHandler extends AbstractTran
|
|||
return;
|
||||
}
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("Received message(s): " + Arrays.asList(messages));
|
||||
logger.trace("Received message(s): " + Arrays.toString(messages));
|
||||
}
|
||||
response.setStatusCode(getResponseStatus());
|
||||
response.getHeaders().setContentType(new MediaType("text", "plain", StandardCharsets.UTF_8));
|
||||
|
|
|
|||
Loading…
Reference in New Issue