mirror of
https://gitee.com/dcren/initializr.git
synced 2025-09-19 10:08:22 +08:00
Upgrade to spring-javaformat 0.0.15
Closes gh-949
This commit is contained in:
@@ -133,13 +133,13 @@ public class InitializrAutoConfiguration {
|
||||
static class InitializrWebConfiguration {
|
||||
|
||||
@Bean
|
||||
public InitializrWebConfig initializrWebConfig() {
|
||||
InitializrWebConfig initializrWebConfig() {
|
||||
return new InitializrWebConfig();
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
public MainController initializrMainController(InitializrMetadataProvider metadataProvider,
|
||||
MainController initializrMainController(InitializrMetadataProvider metadataProvider,
|
||||
TemplateRenderer templateRenderer, DependencyMetadataProvider dependencyMetadataProvider,
|
||||
ProjectGenerationInvoker projectGenerationInvoker) {
|
||||
return new MainController(metadataProvider, templateRenderer, dependencyMetadataProvider,
|
||||
@@ -148,7 +148,7 @@ public class InitializrAutoConfiguration {
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
public ProjectGenerationInvoker projectGenerationInvoker(ApplicationContext applicationContext,
|
||||
ProjectGenerationInvoker projectGenerationInvoker(ApplicationContext applicationContext,
|
||||
ApplicationEventPublisher eventPublisher,
|
||||
ProjectRequestToDescriptionConverter projectRequestToDescriptionConverter) {
|
||||
return new ProjectGenerationInvoker(applicationContext, eventPublisher,
|
||||
@@ -156,12 +156,12 @@ public class InitializrAutoConfiguration {
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ProjectRequestToDescriptionConverter projectRequestToDescriptionConverter() {
|
||||
ProjectRequestToDescriptionConverter projectRequestToDescriptionConverter() {
|
||||
return new ProjectRequestToDescriptionConverter();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public InitializrModule InitializrJacksonModule() {
|
||||
InitializrModule InitializrJacksonModule() {
|
||||
return new InitializrModule();
|
||||
}
|
||||
|
||||
@@ -175,7 +175,7 @@ public class InitializrAutoConfiguration {
|
||||
static class InitializrCacheConfiguration {
|
||||
|
||||
@Bean
|
||||
public JCacheManagerCustomizer initializrCacheManagerCustomizer() {
|
||||
JCacheManagerCustomizer initializrCacheManagerCustomizer() {
|
||||
return (cacheManager) -> {
|
||||
cacheManager.createCache("initializr.metadata",
|
||||
config().setExpiryPolicyFactory(CreatedExpiryPolicy.factoryOf(Duration.TEN_MINUTES)));
|
||||
|
@@ -140,7 +140,7 @@ public class Agent {
|
||||
|
||||
private static final Pattern NETBEANS_REGEX = Pattern.compile("nb-springboot-plugin\\/(.*)");
|
||||
|
||||
public static Agent parse(String userAgent) {
|
||||
static Agent parse(String userAgent) {
|
||||
Matcher matcher = TOOL_REGEX.matcher(userAgent);
|
||||
if (matcher.matches()) {
|
||||
String name = matcher.group(1);
|
||||
|
@@ -232,7 +232,7 @@ public class CommandLineHelpGenerator {
|
||||
* @param content the table content
|
||||
* @return the generated table
|
||||
*/
|
||||
public static String generate(String[][] content) {
|
||||
static String generate(String[][] content) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
int[] columnsLength = computeColumnsLength(content);
|
||||
appendTableSeparation(sb, columnsLength);
|
||||
|
@@ -52,7 +52,7 @@ class SpringBootMetadataReader {
|
||||
* Return the boot versions parsed by this instance.
|
||||
* @return the versions
|
||||
*/
|
||||
public List<DefaultMetadataElement> getBootVersions() {
|
||||
List<DefaultMetadataElement> getBootVersions() {
|
||||
ArrayNode releases = (ArrayNode) this.content.get("projectReleases");
|
||||
List<DefaultMetadataElement> list = new ArrayList<>();
|
||||
for (JsonNode node : releases) {
|
||||
|
@@ -160,7 +160,7 @@ class InitializrAutoConfigurationTests {
|
||||
private static final ResponseErrorHandler errorHandler = mock(ResponseErrorHandler.class);
|
||||
|
||||
@Bean
|
||||
public RestTemplateCustomizer testRestTemplateCustomizer() {
|
||||
RestTemplateCustomizer testRestTemplateCustomizer() {
|
||||
return (b) -> b.setErrorHandler(errorHandler);
|
||||
}
|
||||
|
||||
@@ -170,7 +170,7 @@ class InitializrAutoConfigurationTests {
|
||||
static class CustomTemplateRendererConfiguration {
|
||||
|
||||
@Bean
|
||||
public TemplateRenderer testTemplateRenderer() {
|
||||
TemplateRenderer testTemplateRenderer() {
|
||||
return Mockito.mock(TemplateRenderer.class);
|
||||
}
|
||||
|
||||
@@ -180,7 +180,7 @@ class InitializrAutoConfigurationTests {
|
||||
static class CustomInitializrMetadataUpdateStrategyConfiguration {
|
||||
|
||||
@Bean
|
||||
public InitializrMetadataUpdateStrategy testInitializrMetadataUpdateStrategy() {
|
||||
InitializrMetadataUpdateStrategy testInitializrMetadataUpdateStrategy() {
|
||||
return Mockito.mock(InitializrMetadataUpdateStrategy.class);
|
||||
}
|
||||
|
||||
@@ -190,7 +190,7 @@ class InitializrAutoConfigurationTests {
|
||||
static class CustomInitializrMetadataProviderConfiguration {
|
||||
|
||||
@Bean
|
||||
public InitializrMetadataProvider testInitializrMetadataProvider() {
|
||||
InitializrMetadataProvider testInitializrMetadataProvider() {
|
||||
return Mockito.mock(InitializrMetadataProvider.class);
|
||||
}
|
||||
|
||||
@@ -200,7 +200,7 @@ class InitializrAutoConfigurationTests {
|
||||
static class CustomDependencyMetadataProviderConfiguration {
|
||||
|
||||
@Bean
|
||||
public DependencyMetadataProvider testDependencyMetadataProvider() {
|
||||
DependencyMetadataProvider testDependencyMetadataProvider() {
|
||||
return Mockito.mock(DependencyMetadataProvider.class);
|
||||
}
|
||||
|
||||
|
@@ -43,7 +43,7 @@ class ProjectGenerationDescriptionCustomizerTests extends AbstractInitializrCont
|
||||
static class ProjectDescriptionCustomizerConfiguration {
|
||||
|
||||
@Bean
|
||||
public ProjectDescriptionCustomizer secondPostProcessor() {
|
||||
ProjectDescriptionCustomizer secondPostProcessor() {
|
||||
return new ProjectDescriptionCustomizer() {
|
||||
@Override
|
||||
public void customize(ProjectDescription description) {
|
||||
@@ -58,7 +58,7 @@ class ProjectGenerationDescriptionCustomizerTests extends AbstractInitializrCont
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ProjectDescriptionCustomizer firstPostProcessor() {
|
||||
ProjectDescriptionCustomizer firstPostProcessor() {
|
||||
return new ProjectDescriptionCustomizer() {
|
||||
@Override
|
||||
public void customize(ProjectDescription description) {
|
||||
|
@@ -191,22 +191,22 @@ public class ProjectGenerationInvokerTests {
|
||||
static class TestConfiguration {
|
||||
|
||||
@Bean
|
||||
public IndentingWriterFactory factory() {
|
||||
IndentingWriterFactory factory() {
|
||||
return IndentingWriterFactory.create(new SimpleIndentStrategy("\t"));
|
||||
}
|
||||
|
||||
@Bean
|
||||
public MustacheTemplateRenderer templateRenderer() {
|
||||
MustacheTemplateRenderer templateRenderer() {
|
||||
return new MustacheTemplateRenderer("classpath:/templates");
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ProjectDirectoryFactory projectDirectoryFactory() {
|
||||
ProjectDirectoryFactory projectDirectoryFactory() {
|
||||
return (description) -> Files.createTempDirectory("project-");
|
||||
}
|
||||
|
||||
@Bean
|
||||
public InitializrMetadataProvider initializrMetadataProvider() {
|
||||
InitializrMetadataProvider initializrMetadataProvider() {
|
||||
return () -> metadata;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user