Skip to content

Commit 6e46423

Browse files
krzykphilwebb
authored andcommitted
Use diamond operators
See gh-33987
1 parent 5120242 commit 6e46423

File tree

24 files changed

+41
-41
lines changed

24 files changed

+41
-41
lines changed

buildSrc/src/main/java/org/springframework/boot/build/mavenplugin/PluginXmlParser.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ private static Iterable<Node> of(NodeList nodeList) {
132132
@Override
133133
public Iterator<Node> iterator() {
134134

135-
return new Iterator<Node>() {
135+
return new Iterator<>() {
136136

137137
private int index = 0;
138138

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/ReactiveCloudFoundrySecurityService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2022 the original author or authors.
2+
* Copyright 2012-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -46,7 +46,7 @@
4646
*/
4747
class ReactiveCloudFoundrySecurityService {
4848

49-
private static final ParameterizedTypeReference<Map<String, Object>> STRING_OBJECT_MAP = new ParameterizedTypeReference<Map<String, Object>>() {
49+
private static final ParameterizedTypeReference<Map<String, Object>> STRING_OBJECT_MAP = new ParameterizedTypeReference<>() {
5050
};
5151

5252
private final WebClient webClient;

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/health/HealthEndpointConfiguration.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2022 the original author or authors.
2+
* Copyright 2012-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -174,7 +174,7 @@ private CompositeHealthContributor adapt(CompositeReactiveHealthContributor comp
174174
@Override
175175
public Iterator<NamedContributor<HealthContributor>> iterator() {
176176
Iterator<NamedContributor<ReactiveHealthContributor>> iterator = composite.iterator();
177-
return new Iterator<NamedContributor<HealthContributor>>() {
177+
return new Iterator<>() {
178178

179179
@Override
180180
public boolean hasNext() {

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/wavefront/MeterRegistrySpanMetricsTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ void reportErrorsShouldIncreaseCounter() {
7070

7171
@Test
7272
void registerQueueSizeShouldCreateGauge() {
73-
BlockingQueue<Integer> queue = new ArrayBlockingQueue<Integer>(2);
73+
BlockingQueue<Integer> queue = new ArrayBlockingQueue<>(2);
7474
this.sut.registerQueueSize(queue);
7575
assertThat(getGaugeValue("wavefront.reporter.queue.size")).isZero();
7676
queue.offer(1);
@@ -79,7 +79,7 @@ void registerQueueSizeShouldCreateGauge() {
7979

8080
@Test
8181
void registerQueueRemainingCapacityShouldCreateGauge() {
82-
BlockingQueue<Integer> queue = new ArrayBlockingQueue<Integer>(2);
82+
BlockingQueue<Integer> queue = new ArrayBlockingQueue<>(2);
8383
this.sut.registerQueueRemainingCapacity(queue);
8484
assertThat(getGaugeValue("wavefront.reporter.queue.remaining_capacity")).isEqualTo(2);
8585
queue.offer(1);

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -40,7 +40,7 @@ class CompositeHealthContributorReactiveAdapter implements CompositeReactiveHeal
4040
@Override
4141
public Iterator<NamedContributor<ReactiveHealthContributor>> iterator() {
4242
Iterator<NamedContributor<HealthContributor>> iterator = this.delegate.iterator();
43-
return new Iterator<NamedContributor<ReactiveHealthContributor>>() {
43+
return new Iterator<>() {
4444

4545
@Override
4646
public boolean hasNext() {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -95,7 +95,7 @@ public C getContributor(String name) {
9595
@Override
9696
public Iterator<NamedContributor<C>> iterator() {
9797
Iterator<Map.Entry<String, C>> iterator = this.contributors.entrySet().iterator();
98-
return new Iterator<NamedContributor<C>>() {
98+
return new Iterator<>() {
9999

100100
@Override
101101
public boolean hasNext() {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -44,7 +44,7 @@ public interface NamedContributor<C> {
4444
static <C> NamedContributor<C> of(String name, C contributor) {
4545
Assert.notNull(name, "Name must not be null");
4646
Assert.notNull(contributor, "Contributor must not be null");
47-
return new NamedContributor<C>() {
47+
return new NamedContributor<>() {
4848

4949
@Override
5050
public String getName() {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2022 the original author or authors.
2+
* Copyright 2012-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -62,7 +62,7 @@ private C adapt(V value, Function<V, ? extends C> valueAdapter) {
6262
@Override
6363
public Iterator<NamedContributor<C>> iterator() {
6464
Iterator<Entry<String, C>> iterator = this.map.entrySet().iterator();
65-
return new Iterator<NamedContributor<C>>() {
65+
return new Iterator<>() {
6666

6767
@Override
6868
public boolean hasNext() {

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cache/AbstractCacheAutoConfigurationTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ CacheManagerCustomizer<SimpleCacheManager> genericCacheManagerCustomizer() {
102102

103103
@Bean
104104
CacheManagerCustomizer<CouchbaseCacheManager> couchbaseCacheManagerCustomizer() {
105-
return new CacheManagerTestCustomizer<CouchbaseCacheManager>() {
105+
return new CacheManagerTestCustomizer<>() {
106106

107107
};
108108
}
@@ -130,7 +130,7 @@ CacheManagerCustomizer<SpringEmbeddedCacheManager> infinispanCacheManagerCustomi
130130

131131
@Bean
132132
CacheManagerCustomizer<SpringCache2kCacheManager> cache2kCacheManagerCustomizer() {
133-
return new CacheManagerTestCustomizer<SpringCache2kCacheManager>() {
133+
return new CacheManagerTestCustomizer<>() {
134134

135135
};
136136
}

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jackson/JacksonAutoConfigurationTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2022 the original author or authors.
2+
* Copyright 2012-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -523,7 +523,7 @@ static class DoubleModulesConfig {
523523
@Bean
524524
Module jacksonModule() {
525525
SimpleModule module = new SimpleModule();
526-
module.addSerializer(Foo.class, new JsonSerializer<Foo>() {
526+
module.addSerializer(Foo.class, new JsonSerializer<>() {
527527

528528
@Override
529529
public void serialize(Foo value, JsonGenerator jgen, SerializerProvider provider) throws IOException {

0 commit comments

Comments
 (0)