Replace explicit generics with diamond operator
Where possible, explicit generic declarations to use the Java 8 diamond operator. See gh-9781
This commit is contained in:
committed by
Phillip Webb
parent
eb35fc9fa6
commit
04fdec6f8b
@@ -330,7 +330,7 @@ public class PropertiesLauncher extends Launcher {
|
||||
|
||||
@Override
|
||||
protected ClassLoader createClassLoader(List<Archive> archives) throws Exception {
|
||||
Set<URL> urls = new LinkedHashSet<URL>(archives.size());
|
||||
Set<URL> urls = new LinkedHashSet<>(archives.size());
|
||||
for (Archive archive : archives) {
|
||||
urls.add(archive.getUrl());
|
||||
}
|
||||
@@ -522,7 +522,7 @@ public class PropertiesLauncher extends Launcher {
|
||||
root = "";
|
||||
}
|
||||
EntryFilter filter = new PrefixMatchingArchiveFilter(root);
|
||||
List<Archive> archives = new ArrayList<Archive>(parent.getNestedArchives(filter));
|
||||
List<Archive> archives = new ArrayList<>(parent.getNestedArchives(filter));
|
||||
if (("".equals(root) || ".".equals(root)) && !path.endsWith(".jar")
|
||||
&& parent != this.parent) {
|
||||
// You can't find the root with an entry filter so it has to be added
|
||||
|
||||
@@ -66,7 +66,7 @@ public abstract class SystemPropertyUtils {
|
||||
if (text == null) {
|
||||
return text;
|
||||
}
|
||||
return parseStringValue(null, text, text, new HashSet<String>());
|
||||
return parseStringValue(null, text, text, new HashSet<>());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -83,7 +83,7 @@ public abstract class SystemPropertyUtils {
|
||||
if (text == null) {
|
||||
return text;
|
||||
}
|
||||
return parseStringValue(properties, text, text, new HashSet<String>());
|
||||
return parseStringValue(properties, text, text, new HashSet<>());
|
||||
}
|
||||
|
||||
private static String parseStringValue(Properties properties, String value,
|
||||
|
||||
@@ -266,7 +266,7 @@ public class PropertiesLauncherTests {
|
||||
}
|
||||
|
||||
private List<Archive> archives() throws Exception {
|
||||
List<Archive> archives = new ArrayList<Archive>();
|
||||
List<Archive> archives = new ArrayList<>();
|
||||
String path = System.getProperty("java.class.path");
|
||||
for (String url : path.split(File.pathSeparator)) {
|
||||
archives.add(archive(url));
|
||||
|
||||
Reference in New Issue
Block a user