Cleanup and format code
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2016 the original author or authors.
|
||||
* Copyright 2012-2017 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.
|
||||
@@ -165,7 +165,7 @@ public class FullyExecutableJarTests {
|
||||
|
||||
private List<String> readLines(File file) throws IOException {
|
||||
BufferedReader reader = new BufferedReader(new FileReader(file));
|
||||
List<String> lines = new ArrayList<String>();
|
||||
List<String> lines = new ArrayList<>();
|
||||
try {
|
||||
String line = reader.readLine();
|
||||
while (line != null && lines.size() < 50) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2016 the original author or authors.
|
||||
* Copyright 2012-2017 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.
|
||||
@@ -60,7 +60,7 @@ public class SpringLoadedTests {
|
||||
BufferedReader reader = new BufferedReader(new FileReader(
|
||||
new File("target/spring-loaded-jvm-args/build/output.txt")));
|
||||
try {
|
||||
List<String> lines = new ArrayList<String>();
|
||||
List<String> lines = new ArrayList<>();
|
||||
|
||||
String line;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2016 the original author or authors.
|
||||
* Copyright 2012-2017 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.
|
||||
@@ -44,11 +44,11 @@ public class WarPackagingTests {
|
||||
|
||||
private static final String WEB_INF_LIB_PREFIX = "WEB-INF/lib/";
|
||||
|
||||
private static final Set<String> TOMCAT_EXPECTED_IN_WEB_INF_LIB_PROVIDED = new HashSet<String>(
|
||||
private static final Set<String> TOMCAT_EXPECTED_IN_WEB_INF_LIB_PROVIDED = new HashSet<>(
|
||||
Arrays.asList("spring-boot-starter-tomcat-", "tomcat-embed-core-",
|
||||
"tomcat-embed-el-", "tomcat-embed-websocket-"));
|
||||
|
||||
private static final Set<String> JETTY_EXPECTED_IN_WEB_INF_LIB_PROVIDED = new HashSet<String>(
|
||||
private static final Set<String> JETTY_EXPECTED_IN_WEB_INF_LIB_PROVIDED = new HashSet<>(
|
||||
Arrays.asList("spring-boot-starter-jetty-", "jetty-continuation",
|
||||
"jetty-util-", "javax.servlet-", "jetty-client", "jetty-io-",
|
||||
"jetty-http-", "jetty-server-", "jetty-security-", "jetty-servlet-",
|
||||
@@ -105,7 +105,7 @@ public class WarPackagingTests {
|
||||
throws IOException {
|
||||
Set<String> entries = getWebInfLibProvidedEntries(war);
|
||||
assertThat(entries).hasSameSizeAs(expectedEntries);
|
||||
List<String> unexpectedLibProvidedEntries = new ArrayList<String>();
|
||||
List<String> unexpectedLibProvidedEntries = new ArrayList<>();
|
||||
for (String entry : entries) {
|
||||
if (!isExpectedInWebInfLibProvided(entry, expectedEntries)) {
|
||||
unexpectedLibProvidedEntries.add(entry);
|
||||
@@ -117,7 +117,7 @@ public class WarPackagingTests {
|
||||
private void checkWebInfLibEntries(JarFile war, Set<String> entriesOnlyInLibProvided)
|
||||
throws IOException {
|
||||
Set<String> entries = getWebInfLibEntries(war);
|
||||
List<String> unexpectedLibEntries = new ArrayList<String>();
|
||||
List<String> unexpectedLibEntries = new ArrayList<>();
|
||||
for (String entry : entries) {
|
||||
if (!isExpectedInWebInfLib(entry, entriesOnlyInLibProvided)) {
|
||||
unexpectedLibEntries.add(entry);
|
||||
@@ -127,7 +127,7 @@ public class WarPackagingTests {
|
||||
}
|
||||
|
||||
private Set<String> getWebInfLibProvidedEntries(JarFile war) throws IOException {
|
||||
Set<String> webInfLibProvidedEntries = new HashSet<String>();
|
||||
Set<String> webInfLibProvidedEntries = new HashSet<>();
|
||||
Enumeration<JarEntry> entries = war.entries();
|
||||
while (entries.hasMoreElements()) {
|
||||
String name = entries.nextElement().getName();
|
||||
@@ -139,7 +139,7 @@ public class WarPackagingTests {
|
||||
}
|
||||
|
||||
private Set<String> getWebInfLibEntries(JarFile war) throws IOException {
|
||||
Set<String> webInfLibEntries = new HashSet<String>();
|
||||
Set<String> webInfLibEntries = new HashSet<>();
|
||||
Enumeration<JarEntry> entries = war.entries();
|
||||
while (entries.hasMoreElements()) {
|
||||
String name = entries.nextElement().getName();
|
||||
|
||||
@@ -58,7 +58,7 @@ public class StarterDependenciesIntegrationTests {
|
||||
|
||||
@Parameters
|
||||
public static List<String[]> getStarters() {
|
||||
List<String[]> starters = new ArrayList<String[]>();
|
||||
List<String[]> starters = new ArrayList<>();
|
||||
for (File file : new File("../../spring-boot-starters").listFiles()) {
|
||||
if (file.isDirectory() && new File(file, "pom.xml").exists()) {
|
||||
String name = file.getName();
|
||||
|
||||
@@ -65,7 +65,7 @@ abstract class AbstractApplicationLauncher extends ExternalResource {
|
||||
private Process startApplication() throws Exception {
|
||||
this.serverPortFile.delete();
|
||||
File archive = this.applicationBuilder.buildApplication();
|
||||
List<String> arguments = new ArrayList<String>();
|
||||
List<String> arguments = new ArrayList<>();
|
||||
arguments.add(System.getProperty("java.home") + "/bin/java");
|
||||
arguments.addAll(getArguments(archive));
|
||||
ProcessBuilder processBuilder = new ProcessBuilder(
|
||||
|
||||
@@ -48,7 +48,7 @@ public abstract class AbstractEmbeddedServletContainerIntegrationTests {
|
||||
protected final RestTemplate rest = new RestTemplate();
|
||||
|
||||
public static Object[] parameters(String packaging) {
|
||||
List<Object> parameters = new ArrayList<Object>();
|
||||
List<Object> parameters = new ArrayList<>();
|
||||
parameters.addAll(createParameters(packaging, "jetty"));
|
||||
parameters.addAll(createParameters(packaging, "tomcat"));
|
||||
parameters.addAll(createParameters(packaging, "undertow"));
|
||||
@@ -57,7 +57,7 @@ public abstract class AbstractEmbeddedServletContainerIntegrationTests {
|
||||
|
||||
private static List<Object> createParameters(String packaging, String container,
|
||||
String... versions) {
|
||||
List<Object> parameters = new ArrayList<Object>();
|
||||
List<Object> parameters = new ArrayList<>();
|
||||
ApplicationBuilder applicationBuilder = new ApplicationBuilder(temporaryFolder,
|
||||
packaging, container);
|
||||
parameters.add(new Object[] {
|
||||
|
||||
@@ -98,7 +98,7 @@ class ApplicationBuilder {
|
||||
|
||||
private void writePom(File appFolder, File resourcesJar)
|
||||
throws FileNotFoundException, IOException {
|
||||
Map<String, Object> context = new HashMap<String, Object>();
|
||||
Map<String, Object> context = new HashMap<>();
|
||||
context.put("packaging", this.packaging);
|
||||
context.put("container", this.container);
|
||||
context.put("bootVersion", Versions.getBootVersion());
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2016 the original author or authors.
|
||||
* Copyright 2012-2017 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.
|
||||
@@ -73,7 +73,7 @@ public class SysVinitLaunchScriptIT {
|
||||
|
||||
@Parameters(name = "{0} {1}")
|
||||
public static List<Object[]> parameters() {
|
||||
List<Object[]> parameters = new ArrayList<Object[]>();
|
||||
List<Object[]> parameters = new ArrayList<>();
|
||||
for (File os : new File("src/test/resources/conf").listFiles()) {
|
||||
for (File version : os.listFiles()) {
|
||||
parameters.add(new Object[] { os.getName(), version.getName() });
|
||||
|
||||
Reference in New Issue
Block a user