Skip to content

Commit 04fdec6

Browse files
emacampolophilwebb
authored andcommitted
Replace explicit generics with diamond operator
Where possible, explicit generic declarations to use the Java 8 diamond operator. See gh-9781
1 parent eb35fc9 commit 04fdec6

File tree

44 files changed

+64
-68
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+64
-68
lines changed

spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/ManagementServerProperties.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ public static class Security {
169169
/**
170170
* Comma-separated list of roles that can access the management endpoint.
171171
*/
172-
private List<String> roles = new ArrayList<String>(
172+
private List<String> roles = new ArrayList<>(
173173
Collections.singletonList("ACTUATOR"));
174174

175175
/**

spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/EnvironmentEndpoint.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public PropertyResolver getResolver() {
8989
}
9090

9191
private Map<String, PropertySource<?>> getPropertySourcesAsMap() {
92-
Map<String, PropertySource<?>> map = new LinkedHashMap<String, PropertySource<?>>();
92+
Map<String, PropertySource<?>> map = new LinkedHashMap<>();
9393
for (PropertySource<?> source : getPropertySources()) {
9494
extract("", map, source);
9595
}

spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/CompositeHealthIndicator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public class CompositeHealthIndicator implements HealthIndicator {
4040
* @param healthAggregator the health aggregator
4141
*/
4242
public CompositeHealthIndicator(HealthAggregator healthAggregator) {
43-
this(healthAggregator, new LinkedHashMap<String, HealthIndicator>());
43+
this(healthAggregator, new LinkedHashMap<>());
4444
}
4545

4646
/**

spring-boot-actuator/src/main/java/org/springframework/boot/actuate/trace/WebRequestTraceFilter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ private Object getHeaderValue(HttpServletRequest request, String name) {
191191
}
192192

193193
private Map<String, String[]> getParameterMapCopy(HttpServletRequest request) {
194-
return new LinkedHashMap<String, String[]>(request.getParameterMap());
194+
return new LinkedHashMap<>(request.getParameterMap());
195195
}
196196

197197
/**

spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/CachePublicMetricsTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
*/
4646
public class CachePublicMetricsTests {
4747

48-
private Map<String, CacheManager> cacheManagers = new HashMap<String, CacheManager>();
48+
private Map<String, CacheManager> cacheManagers = new HashMap<>();
4949

5050
@Before
5151
public void setup() {
@@ -98,7 +98,7 @@ public void cacheMetricsWithTransactionAwareCacheDecorator() {
9898
private Map<String, Number> metrics(CachePublicMetrics cpm) {
9999
Collection<Metric<?>> metrics = cpm.metrics();
100100
assertThat(metrics).isNotNull();
101-
Map<String, Number> result = new HashMap<String, Number>();
101+
Map<String, Number> result = new HashMap<>();
102102
for (Metric<?> metric : metrics) {
103103
result.put(metric.getName(), metric.getValue());
104104
}

spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/ConfigurationPropertiesReportEndpointSerializationTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -435,9 +435,9 @@ public void setAddress(InetAddress address) {
435435

436436
public static class InitializedMapAndListProperties extends Foo {
437437

438-
private Map<String, Boolean> map = new HashMap<String, Boolean>();
438+
private Map<String, Boolean> map = new HashMap<>();
439439

440-
private List<String> list = new ArrayList<String>();
440+
private List<String> list = new ArrayList<>();
441441

442442
public Map<String, Boolean> getMap() {
443443
return this.map;

spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/EnvironmentEndpointTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ public void propertyWithTypeOtherThanStringShouldNotFail() throws Exception {
268268
this.context = new AnnotationConfigApplicationContext();
269269
MutablePropertySources propertySources = this.context.getEnvironment()
270270
.getPropertySources();
271-
Map<String, Object> source = new HashMap<String, Object>();
271+
Map<String, Object> source = new HashMap<>();
272272
source.put("foo", Collections.singletonMap("bar", "baz"));
273273
propertySources.addFirst(new MapPropertySource("test", source));
274274
this.context.register(Config.class);

spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/mvc/EnvironmentMvcEndpointTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ public void regex() throws Exception {
142142
@Test
143143
public void nestedPathWhenPlaceholderCannotBeResolvedShouldReturnUnresolvedProperty()
144144
throws Exception {
145-
Map<String, Object> map = new HashMap<String, Object>();
145+
Map<String, Object> map = new HashMap<>();
146146
map.put("my.foo", "${my.bar}");
147147
((ConfigurableEnvironment) this.context.getEnvironment()).getPropertySources()
148148
.addFirst(new MapPropertySource("unresolved-placeholder", map));
@@ -152,7 +152,7 @@ public void nestedPathWhenPlaceholderCannotBeResolvedShouldReturnUnresolvedPrope
152152

153153
@Test
154154
public void nestedPathWithSensitivePlaceholderShouldSanitize() throws Exception {
155-
Map<String, Object> map = new HashMap<String, Object>();
155+
Map<String, Object> map = new HashMap<>();
156156
map.put("my.foo", "${my.password}");
157157
map.put("my.password", "hello");
158158
((ConfigurableEnvironment) this.context.getEnvironment()).getPropertySources()
@@ -165,7 +165,7 @@ public void nestedPathWithSensitivePlaceholderShouldSanitize() throws Exception
165165
public void propertyWithTypeOtherThanStringShouldNotFail() throws Exception {
166166
MutablePropertySources propertySources = ((ConfigurableEnvironment) this.context
167167
.getEnvironment()).getPropertySources();
168-
Map<String, Object> source = new HashMap<String, Object>();
168+
Map<String, Object> source = new HashMap<>();
169169
source.put("foo", Collections.singletonMap("bar", "baz"));
170170
propertySources.addFirst(new MapPropertySource("test", source));
171171
this.mvc.perform(get("/application/env/foo.*")).andExpect(status().isOk())

spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/statsd/StatsdMetricWriterTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,15 +97,15 @@ public void periodPrefix() throws Exception {
9797

9898
@Test
9999
public void incrementMetricWithInvalidCharsInName() throws Exception {
100-
this.writer.increment(new Delta<Long>("counter.fo:o", 3L));
100+
this.writer.increment(new Delta<>("counter.fo:o", 3L));
101101
this.server.waitForMessage();
102102
assertThat(this.server.messagesReceived().get(0))
103103
.isEqualTo("me.counter.fo-o:3|c");
104104
}
105105

106106
@Test
107107
public void setMetricWithInvalidCharsInName() throws Exception {
108-
this.writer.set(new Metric<Long>("gauge.f:o:o", 3L));
108+
this.writer.set(new Metric<>("gauge.f:o:o", 3L));
109109
this.server.waitForMessage();
110110
assertThat(this.server.messagesReceived().get(0)).isEqualTo("me.gauge.f-o-o:3|g");
111111
}

spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ImportAutoConfigurationImportSelector.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ protected final Map<Class<?>, List<Annotation>> getAnnotations(
134134
AnnotationMetadata metadata) {
135135
MultiValueMap<Class<?>, Annotation> annotations = new LinkedMultiValueMap<>();
136136
Class<?> source = ClassUtils.resolveClassName(metadata.getClassName(), null);
137-
collectAnnotations(source, annotations, new HashSet<Class<?>>());
137+
collectAnnotations(source, annotations, new HashSet<>());
138138
return Collections.unmodifiableMap(annotations);
139139
}
140140

spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/elasticsearch/jest/JestProperties.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public class JestProperties {
3434
/**
3535
* Comma-separated list of the Elasticsearch instances to use.
3636
*/
37-
private List<String> uris = new ArrayList<String>(
37+
private List<String> uris = new ArrayList<>(
3838
Collections.singletonList("http://localhost:9200"));
3939

4040
/**

spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayProperties.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public class FlywayProperties {
7373
* SQL statements to execute to initialize a connection immediately after obtaining
7474
* it.
7575
*/
76-
private List<String> initSqls = new ArrayList<String>();
76+
private List<String> initSqls = new ArrayList<>();
7777

7878
public void setLocations(List<String> locations) {
7979
this.locations = locations;

spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/freemarker/FreeMarkerTemplateAvailabilityProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public FreeMarkerTemplateAvailabilityProvider() {
4141
static final class FreeMarkerTemplateAvailabilityProperties
4242
extends TemplateAvailabilityProperties {
4343

44-
private List<String> templateLoaderPath = new ArrayList<String>(
44+
private List<String> templateLoaderPath = new ArrayList<>(
4545
Arrays.asList(FreeMarkerProperties.DEFAULT_TEMPLATE_LOADER_PATH));
4646

4747
FreeMarkerTemplateAvailabilityProperties() {

spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/groovy/template/GroovyTemplateAvailabilityProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public GroovyTemplateAvailabilityProvider() {
4141
static final class GroovyTemplateAvailabilityProperties
4242
extends TemplateAvailabilityProperties {
4343

44-
private List<String> resourceLoaderPath = new ArrayList<String>(
44+
private List<String> resourceLoaderPath = new ArrayList<>(
4545
Arrays.asList(GroovyTemplateProperties.DEFAULT_RESOURCE_LOADER_PATH));
4646

4747
GroovyTemplateAvailabilityProperties() {

spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ldap/embedded/EmbeddedLdapAutoConfiguration.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,7 @@ private void setPortProperty(ApplicationContext context, int port) {
181181
private Map<String, Object> getLdapPorts(MutablePropertySources sources) {
182182
PropertySource<?> propertySource = sources.get(PROPERTY_SOURCE_NAME);
183183
if (propertySource == null) {
184-
propertySource = new MapPropertySource(PROPERTY_SOURCE_NAME,
185-
new HashMap<String, Object>());
184+
propertySource = new MapPropertySource(PROPERTY_SOURCE_NAME, new HashMap<>());
186185
sources.addFirst(propertySource);
187186
}
188187
return (Map<String, Object>) propertySource.getSource();

spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mongo/embedded/EmbeddedMongoAutoConfiguration.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,7 @@ private void setPortProperty(ApplicationContext currentContext, int port) {
179179
private Map<String, Object> getMongoPorts(MutablePropertySources sources) {
180180
PropertySource<?> propertySource = sources.get("mongo.ports");
181181
if (propertySource == null) {
182-
propertySource = new MapPropertySource("mongo.ports",
183-
new HashMap<String, Object>());
182+
propertySource = new MapPropertySource("mongo.ports", new HashMap<>());
184183
sources.addFirst(propertySource);
185184
}
186185
return (Map<String, Object>) propertySource.getSource();

spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/resource/UserInfoTokenServicesTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public class UserInfoTokenServicesTests {
6464
public void init() {
6565
this.resource.setClientId("foo");
6666
given(this.template.getForEntity(any(String.class), eq(Map.class)))
67-
.willReturn(new ResponseEntity<Map>(this.map, HttpStatus.OK));
67+
.willReturn(new ResponseEntity<>(this.map, HttpStatus.OK));
6868
given(this.template.getAccessToken())
6969
.willReturn(new DefaultOAuth2AccessToken("FOO"));
7070
given(this.template.getResource()).willReturn(this.resource);

spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/ServerPropertiesTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ public void testTomcatBinding() throws Exception {
120120

121121
@Test
122122
public void redirectContextRootIsNotConfiguredByDefault() throws Exception {
123-
bind(new HashMap<String, String>());
123+
bind(new HashMap<>());
124124
ServerProperties.Tomcat tomcat = this.properties.getTomcat();
125125
assertThat(tomcat.getRedirectContextRoot()).isNull();
126126
}
@@ -164,7 +164,7 @@ public void testCustomizeJettySelectors() throws Exception {
164164

165165
@Test
166166
public void testCustomizeJettyAccessLog() throws Exception {
167-
Map<String, String> map = new HashMap<String, String>();
167+
Map<String, String> map = new HashMap<>();
168168
map.put("server.jetty.accesslog.enabled", "true");
169169
map.put("server.jetty.accesslog.filename", "foo.txt");
170170
map.put("server.jetty.accesslog.file-date-format", "yyyymmdd");

spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/DefaultServletWebServerFactoryCustomizerTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public void tomcatAccessLogCanBeEnabled() {
107107
@Test
108108
public void tomcatAccessLogFileDateFormatByDefault() {
109109
TomcatServletWebServerFactory factory = new TomcatServletWebServerFactory();
110-
Map<String, String> map = new HashMap<String, String>();
110+
Map<String, String> map = new HashMap<>();
111111
map.put("server.tomcat.accesslog.enabled", "true");
112112
bindProperties(map);
113113
this.customizer.customize(factory);
@@ -118,7 +118,7 @@ public void tomcatAccessLogFileDateFormatByDefault() {
118118
@Test
119119
public void tomcatAccessLogFileDateFormatCanBeRedefined() {
120120
TomcatServletWebServerFactory factory = new TomcatServletWebServerFactory();
121-
Map<String, String> map = new HashMap<String, String>();
121+
Map<String, String> map = new HashMap<>();
122122
map.put("server.tomcat.accesslog.enabled", "true");
123123
map.put("server.tomcat.accesslog.file-date-format", "yyyy-MM-dd.HH");
124124
bindProperties(map);
@@ -397,7 +397,7 @@ public void customTomcatMaxHttpPostSize() {
397397

398398
@Test
399399
public void customTomcatDisableMaxHttpPostSize() {
400-
Map<String, String> map = new HashMap<String, String>();
400+
Map<String, String> map = new HashMap<>();
401401
map.put("server.tomcat.max-http-post-size", "-1");
402402
bindProperties(map);
403403
TomcatServletWebServerFactory factory = new TomcatServletWebServerFactory(0);

spring-boot-devtools/src/main/java/org/springframework/boot/devtools/autoconfigure/DevToolsDataSourceAutoConfiguration.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,7 @@ private enum InMemoryDatabase {
126126

127127
InMemoryDatabase(String urlPrefix, String... driverClassNames) {
128128
this.urlPrefix = urlPrefix;
129-
this.driverClassNames = new HashSet<String>(
130-
Arrays.asList(driverClassNames));
129+
this.driverClassNames = new HashSet<>(Arrays.asList(driverClassNames));
131130
}
132131

133132
boolean matches(DataSourceProperties properties) {

spring-boot-integration-tests/spring-boot-integration-tests-embedded-servlet-container/src/test/java/org/springframework/boot/context/embedded/AbstractEmbeddedServletContainerIntegrationTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public static Object[] parameters(String packaging,
5858

5959
private static List<Object> createParameters(String packaging, String container,
6060
List<Class<? extends AbstractApplicationLauncher>> applicationLaunchers) {
61-
List<Object> parameters = new ArrayList<Object>();
61+
List<Object> parameters = new ArrayList<>();
6262
ApplicationBuilder applicationBuilder = new ApplicationBuilder(temporaryFolder,
6363
packaging, container);
6464
for (Class<? extends AbstractApplicationLauncher> launcherClass : applicationLaunchers) {

spring-boot-integration-tests/spring-boot-integration-tests-embedded-servlet-container/src/test/java/org/springframework/boot/context/embedded/BootRunApplicationLauncher.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ protected List<String> getArguments(File archive) {
5656
if (archive.getName().endsWith(".war")) {
5757
populateSrcMainWebapp();
5858
}
59-
List<String> classpath = new ArrayList<String>();
59+
List<String> classpath = new ArrayList<>();
6060
classpath.add(targetClasses.getAbsolutePath());
6161
for (File dependency : dependencies.listFiles()) {
6262
classpath.add(dependency.getAbsolutePath());

spring-boot-integration-tests/spring-boot-integration-tests-embedded-servlet-container/src/test/java/org/springframework/boot/context/embedded/IdeApplicationLauncher.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ protected List<String> getArguments(File archive) {
6767
if (archive.getName().endsWith(".war")) {
6868
populateSrcMainWebapp();
6969
}
70-
List<String> classpath = new ArrayList<String>();
70+
List<String> classpath = new ArrayList<>();
7171
classpath.add(targetClasses.getAbsolutePath());
7272
for (File dependency : dependencies.listFiles()) {
7373
classpath.add(dependency.getAbsolutePath());

spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/properties/AnnotationsPropertySource.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public AnnotationsPropertySource(String name, Class<?> source) {
6060

6161
private Map<String, Object> getProperties(Class<?> source) {
6262
Map<String, Object> properties = new LinkedHashMap<>();
63-
collectProperties(source, source, properties, new HashSet<Class<?>>());
63+
collectProperties(source, source, properties, new HashSet<>());
6464
return Collections.unmodifiableMap(properties);
6565
}
6666

spring-boot-test/src/main/java/org/springframework/boot/test/context/SpringBootTestContextBootstrapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ private boolean isFromConfiguration(MergedContextConfiguration candidateConfig,
219219
ContextConfiguration configuration) {
220220
ContextConfigurationAttributes attributes = new ContextConfigurationAttributes(
221221
candidateConfig.getTestClass(), configuration);
222-
Set<Class<?>> configurationClasses = new HashSet<Class<?>>(
222+
Set<Class<?>> configurationClasses = new HashSet<>(
223223
Arrays.asList(attributes.getClasses()));
224224
for (Class<?> candidate : candidateConfig.getClasses()) {
225225
if (configurationClasses.contains(candidate)) {

spring-boot-test/src/main/java/org/springframework/boot/test/json/DuplicateJsonObjectContextCustomizerFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public void customizeContext(ConfigurableApplicationContext context,
6060
}
6161

6262
private List<URL> findJsonObjects() {
63-
List<URL> jsonObjects = new ArrayList<URL>();
63+
List<URL> jsonObjects = new ArrayList<>();
6464
try {
6565
Enumeration<URL> resources = getClass().getClassLoader()
6666
.getResources("org/json/JSONObject.class");

spring-boot-test/src/main/java/org/springframework/boot/test/json/JacksonTester.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ public static void initFields(Object testInstance,
158158
* @return the new instance
159159
*/
160160
public JacksonTester<T> forView(Class<?> view) {
161-
return new JacksonTester<T>(this.getResourceLoadClass(), this.getType(),
161+
return new JacksonTester<>(this.getResourceLoadClass(), this.getType(),
162162
this.objectMapper, view);
163163
}
164164

spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootArchiveSupport.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class BootArchiveSupport {
4646
private static final Set<String> DEFAULT_LAUNCHER_CLASSES;
4747

4848
static {
49-
Set<String> defaultLauncherClasses = new HashSet<String>();
49+
Set<String> defaultLauncherClasses = new HashSet<>();
5050
defaultLauncherClasses.add("org.springframework.boot.loader.JarLauncher");
5151
defaultLauncherClasses.add("org.springframework.boot.loader.PropertiesLauncher");
5252
defaultLauncherClasses.add("org.springframework.boot.loader.WarLauncher");
@@ -121,7 +121,7 @@ void setExcludeDevtools(boolean excludeDevtools) {
121121
}
122122

123123
private void configureExclusions() {
124-
Set<String> excludes = new HashSet<String>();
124+
Set<String> excludes = new HashSet<>();
125125
if (this.excludeDevtools) {
126126
excludes.add("**/spring-boot-devtools-*.jar");
127127
}

spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootZipCopyAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ private Spec<FileTreeElement> writeLoaderClassesIfNecessary(
132132
private Spec<FileTreeElement> writeLoaderClasses(ZipArchiveOutputStream out) {
133133
try (ZipInputStream in = new ZipInputStream(getClass()
134134
.getResourceAsStream("/META-INF/loader/spring-boot-loader.jar"))) {
135-
Set<String> entries = new HashSet<String>();
135+
Set<String> entries = new HashSet<>();
136136
java.util.zip.ZipEntry entry;
137137
while ((entry = in.getNextEntry()) != null) {
138138
if (entry.isDirectory() && !entry.getName().startsWith("META-INF/")) {

spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/LaunchScriptConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public class LaunchScriptConfiguration implements Serializable {
3434

3535
private boolean included = false;
3636

37-
private final Map<String, String> properties = new HashMap<String, String>();
37+
private final Map<String, String> properties = new HashMap<>();
3838

3939
private File script;
4040

spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/PomCondition.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class PomCondition extends Condition<File> {
4040
private Set<String> notExpectedContents;
4141

4242
PomCondition() {
43-
this(new HashSet<String>(), new HashSet<String>());
43+
this(new HashSet<>(), new HashSet<>());
4444
}
4545

4646
private PomCondition(Set<String> expectedContents, Set<String> notExpectedContents) {

spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/testkit/GradleBuild.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ public GradleRunner prepareRunner(String... arguments) throws IOException {
160160
if (this.gradleVersion != null) {
161161
gradleRunner.withGradleVersion(this.gradleVersion);
162162
}
163-
List<String> allArguments = new ArrayList<String>();
163+
List<String> allArguments = new ArrayList<>();
164164
allArguments.add("-PpluginClasspath=" + pluginClasspath());
165165
allArguments.add("-PbootVersion=" + getBootVersion());
166166
allArguments.add("--stacktrace");

spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/PropertiesLauncher.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ protected String getMainClass() throws Exception {
330330

331331
@Override
332332
protected ClassLoader createClassLoader(List<Archive> archives) throws Exception {
333-
Set<URL> urls = new LinkedHashSet<URL>(archives.size());
333+
Set<URL> urls = new LinkedHashSet<>(archives.size());
334334
for (Archive archive : archives) {
335335
urls.add(archive.getUrl());
336336
}
@@ -522,7 +522,7 @@ private List<Archive> getNestedArchives(String path) throws Exception {
522522
root = "";
523523
}
524524
EntryFilter filter = new PrefixMatchingArchiveFilter(root);
525-
List<Archive> archives = new ArrayList<Archive>(parent.getNestedArchives(filter));
525+
List<Archive> archives = new ArrayList<>(parent.getNestedArchives(filter));
526526
if (("".equals(root) || ".".equals(root)) && !path.endsWith(".jar")
527527
&& parent != this.parent) {
528528
// You can't find the root with an entry filter so it has to be added

0 commit comments

Comments
 (0)