diff --git a/buildSrc/src/main/java/org/springframework/boot/build/mavenplugin/PluginXmlParser.java b/buildSrc/src/main/java/org/springframework/boot/build/mavenplugin/PluginXmlParser.java index 19f66707e7..fd7eee0010 100644 --- a/buildSrc/src/main/java/org/springframework/boot/build/mavenplugin/PluginXmlParser.java +++ b/buildSrc/src/main/java/org/springframework/boot/build/mavenplugin/PluginXmlParser.java @@ -132,7 +132,7 @@ class PluginXmlParser { @Override public Iterator iterator() { - return new Iterator() { + return new Iterator<>() { private int index = 0; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/ReactiveCloudFoundrySecurityService.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/ReactiveCloudFoundrySecurityService.java index 5b8d70f71a..ac4ee8b39b 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/ReactiveCloudFoundrySecurityService.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/ReactiveCloudFoundrySecurityService.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2023 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. @@ -46,7 +46,7 @@ import org.springframework.web.reactive.function.client.WebClientResponseExcepti */ class ReactiveCloudFoundrySecurityService { - private static final ParameterizedTypeReference> STRING_OBJECT_MAP = new ParameterizedTypeReference>() { + private static final ParameterizedTypeReference> STRING_OBJECT_MAP = new ParameterizedTypeReference<>() { }; private final WebClient webClient; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/health/HealthEndpointConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/health/HealthEndpointConfiguration.java index 30ca029b85..3b2192a6aa 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/health/HealthEndpointConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/health/HealthEndpointConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2023 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. @@ -174,7 +174,7 @@ class HealthEndpointConfiguration { @Override public Iterator> iterator() { Iterator> iterator = composite.iterator(); - return new Iterator>() { + return new Iterator<>() { @Override public boolean hasNext() { diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/wavefront/MeterRegistrySpanMetricsTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/wavefront/MeterRegistrySpanMetricsTests.java index e185e66b36..35b24c3616 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/wavefront/MeterRegistrySpanMetricsTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/wavefront/MeterRegistrySpanMetricsTests.java @@ -70,7 +70,7 @@ class MeterRegistrySpanMetricsTests { @Test void registerQueueSizeShouldCreateGauge() { - BlockingQueue queue = new ArrayBlockingQueue(2); + BlockingQueue queue = new ArrayBlockingQueue<>(2); this.sut.registerQueueSize(queue); assertThat(getGaugeValue("wavefront.reporter.queue.size")).isZero(); queue.offer(1); @@ -79,7 +79,7 @@ class MeterRegistrySpanMetricsTests { @Test void registerQueueRemainingCapacityShouldCreateGauge() { - BlockingQueue queue = new ArrayBlockingQueue(2); + BlockingQueue queue = new ArrayBlockingQueue<>(2); this.sut.registerQueueRemainingCapacity(queue); assertThat(getGaugeValue("wavefront.reporter.queue.remaining_capacity")).isEqualTo(2); queue.offer(1); diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/CompositeHealthContributorReactiveAdapter.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/CompositeHealthContributorReactiveAdapter.java index f92a500579..41dace35ee 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/CompositeHealthContributorReactiveAdapter.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/CompositeHealthContributorReactiveAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2023 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. @@ -40,7 +40,7 @@ class CompositeHealthContributorReactiveAdapter implements CompositeReactiveHeal @Override public Iterator> iterator() { Iterator> iterator = this.delegate.iterator(); - return new Iterator>() { + return new Iterator<>() { @Override public boolean hasNext() { diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/DefaultContributorRegistry.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/DefaultContributorRegistry.java index 7a255ee305..faae11ae44 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/DefaultContributorRegistry.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/DefaultContributorRegistry.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2023 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. @@ -95,7 +95,7 @@ class DefaultContributorRegistry implements ContributorRegistry { @Override public Iterator> iterator() { Iterator> iterator = this.contributors.entrySet().iterator(); - return new Iterator>() { + return new Iterator<>() { @Override public boolean hasNext() { diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/NamedContributor.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/NamedContributor.java index dc7a0584d4..3922eeb4e9 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/NamedContributor.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/NamedContributor.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2023 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,7 +44,7 @@ public interface NamedContributor { static NamedContributor of(String name, C contributor) { Assert.notNull(name, "Name must not be null"); Assert.notNull(contributor, "Contributor must not be null"); - return new NamedContributor() { + return new NamedContributor<>() { @Override public String getName() { diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/NamedContributorsMapAdapter.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/NamedContributorsMapAdapter.java index ccfb14c8a8..f5c10c89f5 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/NamedContributorsMapAdapter.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/NamedContributorsMapAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2023 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. @@ -62,7 +62,7 @@ abstract class NamedContributorsMapAdapter implements NamedContributors @Override public Iterator> iterator() { Iterator> iterator = this.map.entrySet().iterator(); - return new Iterator>() { + return new Iterator<>() { @Override public boolean hasNext() { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cache/AbstractCacheAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cache/AbstractCacheAutoConfigurationTests.java index 81c3ea549d..68b041c293 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cache/AbstractCacheAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cache/AbstractCacheAutoConfigurationTests.java @@ -102,7 +102,7 @@ abstract class AbstractCacheAutoConfigurationTests { @Bean CacheManagerCustomizer couchbaseCacheManagerCustomizer() { - return new CacheManagerTestCustomizer() { + return new CacheManagerTestCustomizer<>() { }; } @@ -130,7 +130,7 @@ abstract class AbstractCacheAutoConfigurationTests { @Bean CacheManagerCustomizer cache2kCacheManagerCustomizer() { - return new CacheManagerTestCustomizer() { + return new CacheManagerTestCustomizer<>() { }; } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jackson/JacksonAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jackson/JacksonAutoConfigurationTests.java index 026a4867e9..ca9fc101ce 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jackson/JacksonAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jackson/JacksonAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2023 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. @@ -523,7 +523,7 @@ class JacksonAutoConfigurationTests { @Bean Module jacksonModule() { SimpleModule module = new SimpleModule(); - module.addSerializer(Foo.class, new JsonSerializer() { + module.addSerializer(Foo.class, new JsonSerializer<>() { @Override public void serialize(Foo value, JsonGenerator jgen, SerializerProvider provider) throws IOException { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/socket/NamedPipeSocket.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/socket/NamedPipeSocket.java index edaa77392e..0feda07377 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/socket/NamedPipeSocket.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/socket/NamedPipeSocket.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2023 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. @@ -113,7 +113,7 @@ public class NamedPipeSocket extends Socket { @Override public void read(ByteBuffer dst, A attachment, CompletionHandler handler) { - this.fileChannel.read(dst, 0, attachment, new CompletionHandler() { + this.fileChannel.read(dst, 0, attachment, new CompletionHandler<>() { @Override public void completed(Integer read, A attachment) { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/PropertiesLauncherTests.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/PropertiesLauncherTests.java index 2c270dd9fc..387ebb9625 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/PropertiesLauncherTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/PropertiesLauncherTests.java @@ -406,7 +406,7 @@ class PropertiesLauncherTests { } private Condition endingWith(String value) { - return new Condition() { + return new Condition<>() { @Override public boolean matches(Archive archive) { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/MavenBuild.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/MavenBuild.java index ce2c52a70e..c106f58d6c 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/MavenBuild.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/MavenBuild.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2023 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. @@ -130,7 +130,7 @@ class MavenBuild { try { Path destination = this.temp.toPath(); Path source = this.projectDir.toPath(); - Files.walkFileTree(source, new SimpleFileVisitor() { + Files.walkFileTree(source, new SimpleFileVisitor<>() { @Override public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException { diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/BootstrapRegistry.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/BootstrapRegistry.java index ae29cbc3ed..82ef359a8f 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/BootstrapRegistry.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/BootstrapRegistry.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2023 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. @@ -123,7 +123,7 @@ public interface BootstrapRegistry { default InstanceSupplier withScope(Scope scope) { Assert.notNull(scope, "Scope must not be null"); InstanceSupplier parent = this; - return new InstanceSupplier() { + return new InstanceSupplier<>() { @Override public T get(BootstrapContext context) { diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigDataEnvironmentPostProcessorIntegrationTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigDataEnvironmentPostProcessorIntegrationTests.java index 475db62b9b..046bdaa5e6 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigDataEnvironmentPostProcessorIntegrationTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigDataEnvironmentPostProcessorIntegrationTests.java @@ -814,7 +814,7 @@ class ConfigDataEnvironmentPostProcessorIntegrationTests { } private Condition matchingPropertySource(final String sourceName) { - return new Condition("environment containing property source " + sourceName) { + return new Condition<>("environment containing property source " + sourceName) { @Override public boolean matches(ConfigurableEnvironment value) { diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/JavaBeanBinderTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/JavaBeanBinderTests.java index def14c8351..3dfad6341a 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/JavaBeanBinderTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/JavaBeanBinderTests.java @@ -507,7 +507,7 @@ class JavaBeanBinderTests { void beanPropertiesPreferMatchingType() { // gh-16206 ResolvableType type = ResolvableType.forClass(PropertyWithOverloadedSetter.class); - Bean bean = new Bean(type, type.resolve()) { + Bean bean = new Bean<>(type, type.resolve()) { @Override protected void addProperties(Method[] declaredMethods, Field[] declaredFields) { diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/source/SpringConfigurationPropertySourceTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/source/SpringConfigurationPropertySourceTests.java index a2681162fe..7676d13dab 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/source/SpringConfigurationPropertySourceTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/source/SpringConfigurationPropertySourceTests.java @@ -105,7 +105,7 @@ class SpringConfigurationPropertySourceTests { @Test void fromWhenNonEnumerableShouldReturnNonIterable() { - PropertySource propertySource = new PropertySource("test", new Object()) { + PropertySource propertySource = new PropertySource<>("test", new Object()) { @Override public Object getProperty(String name) { @@ -120,7 +120,7 @@ class SpringConfigurationPropertySourceTests { @Test void fromWhenEnumerableButRestrictedShouldReturnNonIterable() { - Map source = new LinkedHashMap() { + Map source = new LinkedHashMap<>() { @Override public int size() { diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/security/servlet/ApplicationContextRequestMatcherTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/security/servlet/ApplicationContextRequestMatcherTests.java index 54d8a9815a..1a3e42e728 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/security/servlet/ApplicationContextRequestMatcherTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/security/servlet/ApplicationContextRequestMatcherTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2023 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. @@ -86,7 +86,7 @@ class ApplicationContextRequestMatcherTests { @Test void initializeAndMatchesAreNotCalledIfContextIsIgnored() { StaticWebApplicationContext context = createWebApplicationContext(); - TestApplicationContextRequestMatcher matcher = new TestApplicationContextRequestMatcher( + TestApplicationContextRequestMatcher matcher = new TestApplicationContextRequestMatcher<>( ApplicationContext.class) { @Override diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/java/org/springframework/boot/launchscript/AbstractLaunchScriptIntegrationTests.java b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/java/org/springframework/boot/launchscript/AbstractLaunchScriptIntegrationTests.java index 781d5367cf..4e02d45db7 100644 --- a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/java/org/springframework/boot/launchscript/AbstractLaunchScriptIntegrationTests.java +++ b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/java/org/springframework/boot/launchscript/AbstractLaunchScriptIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2023 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. @@ -68,7 +68,7 @@ abstract class AbstractLaunchScriptIntegrationTests { protected Condition coloredString(AnsiColor color, String string) { String colorString = ESC + "[0;" + color + "m" + string + ESC + "[0m"; - return new Condition() { + return new Condition<>() { @Override public boolean matches(String value) { diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-session-hazelcast/src/test/java/smoketest/session/hazelcast/SampleSessionHazelcastApplicationTests.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-session-hazelcast/src/test/java/smoketest/session/hazelcast/SampleSessionHazelcastApplicationTests.java index c8ef914b40..b2bcd157dd 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-session-hazelcast/src/test/java/smoketest/session/hazelcast/SampleSessionHazelcastApplicationTests.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-session-hazelcast/src/test/java/smoketest/session/hazelcast/SampleSessionHazelcastApplicationTests.java @@ -80,7 +80,7 @@ class SampleSessionHazelcastApplicationTests { headers.set("Authorization", getBasicAuth()); RequestEntity request = new RequestEntity<>(headers, HttpMethod.GET, URI.create("/actuator/sessions?username=user")); - ParameterizedTypeReference> stringObjectMap = new ParameterizedTypeReference>() { + ParameterizedTypeReference> stringObjectMap = new ParameterizedTypeReference<>() { }; return this.restTemplate.exchange(request, stringObjectMap); } diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-session-jdbc/src/test/java/smoketest/session/SampleSessionJdbcApplicationTests.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-session-jdbc/src/test/java/smoketest/session/SampleSessionJdbcApplicationTests.java index 1a4c237b0f..cfd21a8320 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-session-jdbc/src/test/java/smoketest/session/SampleSessionJdbcApplicationTests.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-session-jdbc/src/test/java/smoketest/session/SampleSessionJdbcApplicationTests.java @@ -115,7 +115,7 @@ class SampleSessionJdbcApplicationTests { HttpHeaders headers = getHeaders(null); RequestEntity request = new RequestEntity<>(headers, HttpMethod.GET, URI.create("/actuator/sessions?username=user")); - ParameterizedTypeReference> stringObjectMap = new ParameterizedTypeReference>() { + ParameterizedTypeReference> stringObjectMap = new ParameterizedTypeReference<>() { }; return this.restTemplate.exchange(request, stringObjectMap); } diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-session-redis/src/test/java/smoketest/session/redis/SampleSessionRedisApplicationTests.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-session-redis/src/test/java/smoketest/session/redis/SampleSessionRedisApplicationTests.java index 27ca03f285..f4042ad8fa 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-session-redis/src/test/java/smoketest/session/redis/SampleSessionRedisApplicationTests.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-session-redis/src/test/java/smoketest/session/redis/SampleSessionRedisApplicationTests.java @@ -96,7 +96,7 @@ class SampleSessionRedisApplicationTests { private ResponseEntity> getSessions() { RequestEntity request = getRequestEntity(URI.create("/actuator/sessions?username=user")); - ParameterizedTypeReference> stringObjectMap = new ParameterizedTypeReference>() { + ParameterizedTypeReference> stringObjectMap = new ParameterizedTypeReference<>() { }; return this.restTemplate.exchange(request, stringObjectMap); } diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-groovy-templates/src/main/java/smoketest/groovytemplates/SampleGroovyTemplateApplication.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-groovy-templates/src/main/java/smoketest/groovytemplates/SampleGroovyTemplateApplication.java index 2f2260e2b4..bb3082408b 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-groovy-templates/src/main/java/smoketest/groovytemplates/SampleGroovyTemplateApplication.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-groovy-templates/src/main/java/smoketest/groovytemplates/SampleGroovyTemplateApplication.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2023 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. @@ -31,7 +31,7 @@ public class SampleGroovyTemplateApplication { @Bean public Converter messageConverter() { - return new Converter() { + return new Converter<>() { @Override public Message convert(String id) { return messageRepository().findMessage(Long.valueOf(id)); diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-thymeleaf/src/main/java/smoketest/web/thymeleaf/SampleWebUiApplication.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-thymeleaf/src/main/java/smoketest/web/thymeleaf/SampleWebUiApplication.java index fb9b7b04a2..1d85c84147 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-thymeleaf/src/main/java/smoketest/web/thymeleaf/SampleWebUiApplication.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-thymeleaf/src/main/java/smoketest/web/thymeleaf/SampleWebUiApplication.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2023 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. @@ -31,7 +31,7 @@ public class SampleWebUiApplication { @Bean public Converter messageConverter() { - return new Converter() { + return new Converter<>() { @Override public Message convert(String id) { return messageRepository().findMessage(Long.valueOf(id));