Skip to content

Commit 6d23871

Browse files
committed
Avoid expensive de-duplication in BootstrapPropertySource#getPropertyNames.
Signed-off-by: qnnn <qiunan@cmbchina.com>
1 parent 0e98e1b commit 6d23871

1 file changed

Lines changed: 2 additions & 8 deletions

File tree

spring-cloud-context/src/main/java/org/springframework/cloud/bootstrap/config/BootstrapPropertySource.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,16 @@
1616

1717
package org.springframework.cloud.bootstrap.config;
1818

19-
import java.util.Arrays;
20-
import java.util.LinkedHashSet;
21-
import java.util.Set;
22-
2319
import org.springframework.core.env.EnumerablePropertySource;
2420
import org.springframework.core.env.PropertySource;
25-
import org.springframework.util.StringUtils;
2621

2722
import static org.springframework.cloud.bootstrap.config.PropertySourceBootstrapConfiguration.BOOTSTRAP_PROPERTY_SOURCE_NAME;
2823

2924
/**
3025
* Enumerable wrapper for a property source.
3126
*
3227
* @author Ryan Baxter
28+
* @author Nan Chiu
3329
*/
3430
public class BootstrapPropertySource<T> extends EnumerablePropertySource<T> {
3531

@@ -47,9 +43,7 @@ public Object getProperty(String name) {
4743

4844
@Override
4945
public String[] getPropertyNames() {
50-
Set<String> names = new LinkedHashSet<>(Arrays.asList(this.delegate.getPropertyNames()));
51-
52-
return StringUtils.toStringArray(names);
46+
return this.delegate.getPropertyNames();
5347
}
5448

5549
public PropertySource<T> getDelegate() {

0 commit comments

Comments
 (0)