Skip to content

Commit

Permalink
Upgrade to Spring Java Format 0.0.29
Browse files Browse the repository at this point in the history
Closes gh-28205
  • Loading branch information
wilkinsona committed Oct 6, 2021
1 parent 747cd9d commit 9c9fbf4
Show file tree
Hide file tree
Showing 29 changed files with 66 additions and 64 deletions.
2 changes: 1 addition & 1 deletion buildSrc/gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
javaFormatVersion=0.0.26
javaFormatVersion=0.0.29
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
import java.util.TreeMap;
import java.util.stream.Collectors;

import io.spring.javaformat.gradle.CheckTask;
import io.spring.javaformat.gradle.FormatTask;
import io.spring.javaformat.gradle.SpringJavaFormatPlugin;
import io.spring.javaformat.gradle.tasks.CheckFormat;
import io.spring.javaformat.gradle.tasks.Format;
import org.gradle.api.JavaVersion;
import org.gradle.api.Project;
import org.gradle.api.artifacts.Configuration;
Expand Down Expand Up @@ -70,8 +70,8 @@
* <li>A {@code testRuntimeOnly} dependency upon
* {@code org.junit.platform:junit-platform-launcher} is added to projects with the
* {@link JavaPlugin} applied
* <li>{@link JavaCompile}, {@link Javadoc}, and {@link FormatTask} tasks are configured
* to use UTF-8 encoding
* <li>{@link JavaCompile}, {@link Javadoc}, and {@link Format} tasks are configured to
* use UTF-8 encoding
* <li>{@link JavaCompile} tasks are configured to use {@code -parameters}.
* <li>When building with Java 8, {@link JavaCompile} tasks are also configured to:
* <ul>
Expand Down Expand Up @@ -157,7 +157,7 @@ private void configureTestConventions(Project project) {
test.useJUnitPlatform();
test.setMaxHeapSize("1024M");
project.getTasks().withType(Checkstyle.class, (checkstyle) -> test.mustRunAfter(checkstyle));
project.getTasks().withType(CheckTask.class, (checkFormat) -> test.mustRunAfter(checkFormat));
project.getTasks().withType(CheckFormat.class, (checkFormat) -> test.mustRunAfter(checkFormat));
});
project.getPlugins().withType(JavaPlugin.class, (javaPlugin) -> project.getDependencies()
.add(JavaPlugin.TEST_RUNTIME_ONLY_CONFIGURATION_NAME, "org.junit.platform:junit-platform-launcher"));
Expand Down Expand Up @@ -206,10 +206,10 @@ else if (JavaVersion.current() == JavaVersion.VERSION_1_8) {

private void configureSpringJavaFormat(Project project) {
project.getPlugins().apply(SpringJavaFormatPlugin.class);
project.getTasks().withType(FormatTask.class, (formatTask) -> formatTask.setEncoding("UTF-8"));
project.getTasks().withType(Format.class, (Format) -> Format.setEncoding("UTF-8"));
project.getPlugins().apply(CheckstylePlugin.class);
CheckstyleExtension checkstyle = project.getExtensions().getByType(CheckstyleExtension.class);
checkstyle.setToolVersion("8.29");
checkstyle.setToolVersion("8.45.1");
checkstyle.getConfigDirectory().set(project.getRootProject().file("src/checkstyle"));
String version = SpringJavaFormatPlugin.class.getPackage().getImplementationVersion();
DependencySet checkstyleDependencies = project.getConfigurations().getByName("checkstyle").getDependencies();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2021 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.
Expand All @@ -26,8 +26,8 @@
* Customizers are guaranteed to be applied before any {@link Meter} is registered with
* the registry.
*
* @author Jon Schneider
* @param <T> the registry type to customize
* @author Jon Schneider
* @since 2.0.0
*/
@FunctionalInterface
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2021 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.
Expand Down Expand Up @@ -55,9 +55,9 @@
/**
* {@link EnableAutoConfiguration Auto-configuration} for exporting metrics to Prometheus.
*
* @since 2.0.0
* @author Jon Schneider
* @author David J. M. Karlsen
* @since 2.0.0
*/
@Configuration(proxyBeanMethods = false)
@AutoConfigureBefore({ CompositeMeterRegistryAutoConfiguration.class, SimpleMetricsExportAutoConfiguration.class })
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2021 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.
Expand All @@ -19,8 +19,8 @@
/**
* Strategy class that can be used to filter {@link ExposableEndpoint endpoints}.
*
* @author Phillip Webb
* @param <E> the endpoint type
* @author Phillip Webb
* @since 2.0.0
*/
@FunctionalInterface
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2021 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.
Expand Down Expand Up @@ -34,8 +34,8 @@
* Repositories.
*
* @author Eddú Meléndez
* @see EnableCassandraRepositories
* @since 1.3.0
* @see EnableCassandraRepositories
*/
@Configuration(proxyBeanMethods = false)
@ConditionalOnClass({ CqlSession.class, CassandraRepository.class })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
* @author Brian Clozel
* @author Artur Konczak
* @author Mohsin Husen
* @since 1.1.0
* @see EnableElasticsearchRepositories
* @see EnableReactiveElasticsearchRepositories
* @since 1.1.0
*/
@Configuration(proxyBeanMethods = false)
@ConditionalOnClass({ ElasticsearchRestTemplate.class })
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2021 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.
Expand Down Expand Up @@ -34,8 +34,8 @@
*
* @author Artur Konczak
* @author Mohsin Husen
* @see EnableElasticsearchRepositories
* @since 1.1.0
* @see EnableElasticsearchRepositories
*/
@Configuration(proxyBeanMethods = false)
@ConditionalOnClass({ Client.class, ElasticsearchRepository.class })
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2021 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.
Expand Down Expand Up @@ -32,8 +32,8 @@
* Reactive Repositories.
*
* @author Brian Clozel
* @see EnableReactiveElasticsearchRepositories
* @since 2.2.0
* @see EnableReactiveElasticsearchRepositories
*/
@Configuration(proxyBeanMethods = false)
@ConditionalOnClass({ ReactiveElasticsearchClient.class, ReactiveElasticsearchRepository.class })
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2021 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.
Expand Down Expand Up @@ -35,8 +35,8 @@
* {@link EnableAutoConfiguration Auto-configuration} for Spring Data R2DBC Repositories.
*
* @author Mark Paluch
* @see EnableR2dbcRepositories
* @since 2.3.0
* @see EnableR2dbcRepositories
*/
@Configuration(proxyBeanMethods = false)
@ConditionalOnClass({ ConnectionFactory.class, R2dbcRepository.class })
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2021 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.
Expand Down Expand Up @@ -34,8 +34,8 @@
*
* @author Eddú Meléndez
* @author Stephane Nicoll
* @see EnableRedisRepositories
* @since 1.4.0
* @see EnableRedisRepositories
*/
@Configuration(proxyBeanMethods = false)
@ConditionalOnClass(EnableRedisRepositories.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
*
* @author Christoph Strobl
* @author Oliver Gierke
* @deprecated since 2.3.9 for removal in 2.5 as Spring Data Solr is deprecated
* @since 1.1.0
* @deprecated since 2.3.9 for removal in 2.5 as Spring Data Solr is deprecated
*/
@Configuration(proxyBeanMethods = false)
@ConditionalOnClass({ SolrClient.class, SolrRepository.class })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@
*
* @author Dave Syer
*/
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT, properties = { "spring.jersey.type=filter",
"server.servlet.context-path=/app", "server.servlet.register-default-servlet=true" })
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT,
properties = { "spring.jersey.type=filter", "server.servlet.context-path=/app",
"server.servlet.register-default-servlet=true" })
@DirtiesContext
class JerseyAutoConfigurationCustomFilterContextPathTests {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2021 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.
Expand Down Expand Up @@ -53,8 +53,8 @@
*
* @author Phillip Webb
* @author Eddú Meléndez
* @see AutoConfigureJsonTesters
* @since 1.4.0
* @see AutoConfigureJsonTesters
*/
@Configuration(proxyBeanMethods = false)
@ConditionalOnClass(name = "org.assertj.core.api.Assert")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2021 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.
Expand Down Expand Up @@ -44,8 +44,8 @@
* @author Phillip Webb
* @author Andy Wilkinson
* @author Stephane Nicoll
* @see AutoConfigureWebMvc
* @since 1.4.0
* @see AutoConfigureWebMvc
*/
@Configuration(proxyBeanMethods = false)
@ConditionalOnWebApplication(type = Type.SERVLET)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2021 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.
Expand Down Expand Up @@ -28,8 +28,8 @@
* Auto-configuration for {@link MockWebServiceServer} support.
*
* @author Dmytro Nosan
* @see AutoConfigureMockWebServiceServer
* @since 2.3.0
* @see AutoConfigureMockWebServiceServer
*/
@Configuration(proxyBeanMethods = false)
@ConditionalOnProperty(prefix = "spring.test.webservice.client.mockserver", name = "enabled")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@
*
* @author Stephane Nicoll
*/
@SpringBootTest(properties = "spring.main.web-application-type=reactive", classes = {
WebTestClientSpringBootTestIntegrationTests.TestConfiguration.class, ExampleWebFluxApplication.class })
@SpringBootTest(properties = "spring.main.web-application-type=reactive",
classes = { WebTestClientSpringBootTestIntegrationTests.TestConfiguration.class,
ExampleWebFluxApplication.class })
@AutoConfigureWebTestClient
class WebTestClientSpringBootTestIntegrationTests {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2021 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.
Expand All @@ -22,9 +22,9 @@
* Callback interface used to process an {@link ApplicationContext} with the ability to
* throw a (checked) exception.
*
* @param <C> the application context type
* @author Stephane Nicoll
* @author Andy Wilkinson
* @param <C> the application context type
* @since 2.0.0
* @see AbstractApplicationContextRunner
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2021 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.
Expand All @@ -19,9 +19,9 @@
/**
* Callback interface that can be used to filter layer contents.
*
* @param <T> the content type
* @author Madhura Bhave
* @author Phillip Webb
* @param <T> the content type
* @since 2.3.0
*/
@FunctionalInterface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ default List<Archive> getNestedArchives(EntryFilter filter) throws IOException {

/**
* Return a new iterator for the archive entries.
* @see java.lang.Iterable#iterator()
* @deprecated since 2.3.0 for removal in 2.5.0 in favor of using
* @see java.lang.Iterable#iterator()
* {@link org.springframework.boot.loader.jar.JarFile} to access entries and
* {@link #getNestedArchives(EntryFilter, EntryFilter)} for accessing nested archives.
*/
Expand All @@ -97,10 +97,10 @@ default List<Archive> getNestedArchives(EntryFilter filter) throws IOException {
/**
* Performs the given action for each element of the {@code Iterable} until all
* elements have been processed or the action throws an exception.
* @see Iterable#forEach
* @deprecated since 2.3.0 for removal in 2.5.0 in favor of using
* {@link org.springframework.boot.loader.jar.JarFile} to access entries and
* {@link #getNestedArchives(EntryFilter, EntryFilter)} for accessing nested archives.
* @see Iterable#forEach {@link org.springframework.boot.loader.jar.JarFile} to access
* entries and {@link #getNestedArchives(EntryFilter, EntryFilter)} for accessing
* nested archives.
*/
@Deprecated
@Override
Expand All @@ -113,10 +113,10 @@ default void forEach(Consumer<? super Entry> action) {

/**
* Creates a {@link Spliterator} over the elements described by this {@code Iterable}.
* @see Iterable#spliterator
* @deprecated since 2.3.0 for removal in 2.5.0 in favor of using
* {@link org.springframework.boot.loader.jar.JarFile} to access entries and
* {@link #getNestedArchives(EntryFilter, EntryFilter)} for accessing nested archives.
* @see Iterable#spliterator {@link org.springframework.boot.loader.jar.JarFile} to
* access entries and {@link #getNestedArchives(EntryFilter, EntryFilter)} for
* accessing nested archives.
*/
@Deprecated
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,8 @@ public Stream<java.util.jar.JarEntry> stream() {

/**
* Return an iterator for the contained entries.
* @see java.lang.Iterable#iterator()
* @since 2.3.0
* @see java.lang.Iterable#iterator()
*/
@Override
@SuppressWarnings({ "unchecked", "rawtypes" })
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2021 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.
Expand All @@ -22,8 +22,8 @@
* Callback interface that can be used to customize a {@link RSocketServer}.
*
* @author Brian Clozel
* @see RSocketServer
* @since 2.3.0
* @see RSocketServer
*/
@FunctionalInterface
public interface RSocketServerCustomizer {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2021 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.
Expand All @@ -22,8 +22,8 @@
* Callback interface that can be used to customize a Jetty {@link Server}.
*
* @author Dave Syer
* @see JettyServletWebServerFactory
* @since 2.0.0
* @see JettyServletWebServerFactory
*/
@FunctionalInterface
public interface JettyServerCustomizer {
Expand Down
Loading

0 comments on commit 9c9fbf4

Please sign in to comment.