Deprecated StringUtils.mergeStringArrays

master
Juergen Hoeller 7 years ago
parent 1278459ad5
commit 0f740527c1
  1. 10
      spring-core/src/main/java/org/springframework/util/StringUtils.java
  2. 3
      spring-core/src/test/java/org/springframework/util/StringUtilsTests.java

@ -904,7 +904,10 @@ public abstract class StringUtils {
* @param array1 the first array (can be {@code null})
* @param array2 the second array (can be {@code null})
* @return the new array ({@code null} if both given arrays were {@code null})
* @deprecated as of 4.3.15, in favor of manual merging via {@link LinkedHashSet}
* (with every entry included at most once, even entries within the first array)
*/
@Deprecated
@Nullable
public static String[] mergeStringArrays(@Nullable String[] array1, @Nullable String[] array2) {
if (ObjectUtils.isEmpty(array1)) {
@ -1021,10 +1024,9 @@ public abstract class StringUtils {
/**
* Take an array of strings and split each element based on the given delimiter.
* A {@code Properties} instance is then generated, with the left of the
* delimiter providing the key, and the right of the delimiter providing the value.
* <p>Will trim both the key and value before adding them to the
* {@code Properties} instance.
* A {@code Properties} instance is then generated, with the left of the delimiter
* providing the key, and the right of the delimiter providing the value.
* <p>Will trim both the key and value before adding them to the {@code Properties}.
* @param array the array to process
* @param delimiter to split each element using (typically the equals symbol)
* @return a {@code Properties} instance representing the array contents,

@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@ -443,6 +443,7 @@ public class StringUtilsTests {
}
@Test
@Deprecated
public void testMergeStringArrays() {
String[] input1 = new String[] {"myString2"};
String[] input2 = new String[] {"myString1", "myString2"};

Loading…
Cancel
Save