Merge pull request #7539 from oscr:use-allAll
* pr/7539: Use addAll instead of manual array to collection copy
This commit is contained in:
commit
5560af735c
5
spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/server/RestartServer.java
Normal file → Executable file
5
spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/server/RestartServer.java
Normal file → Executable file
|
@ -20,6 +20,7 @@ import java.io.File;
|
|||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.net.URLClassLoader;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
|
@ -141,9 +142,7 @@ public class RestartServer {
|
|||
ClassLoader classLoader = this.classLoader;
|
||||
while (classLoader != null) {
|
||||
if (classLoader instanceof URLClassLoader) {
|
||||
for (URL url : ((URLClassLoader) classLoader).getURLs()) {
|
||||
urls.add(url);
|
||||
}
|
||||
Collections.addAll(urls, ((URLClassLoader) classLoader).getURLs());
|
||||
}
|
||||
classLoader = classLoader.getParent();
|
||||
}
|
||||
|
|
4
spring-boot/src/main/java/org/springframework/boot/context/ConfigurationWarningsApplicationContextInitializer.java
Normal file → Executable file
4
spring-boot/src/main/java/org/springframework/boot/context/ConfigurationWarningsApplicationContextInitializer.java
Normal file → Executable file
|
@ -183,9 +183,7 @@ public class ConfigurationWarningsApplicationContextInitializer
|
|||
|
||||
private void addPackages(Set<String> packages, String[] values) {
|
||||
if (values != null) {
|
||||
for (String value : values) {
|
||||
packages.add(value);
|
||||
}
|
||||
Collections.addAll(packages, values);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue