mirror of
https://gitee.com/dcren/initializr.git
synced 2025-09-19 01:58:16 +08:00
Upgrade to spring-javaformat 0.0.6
This commit is contained in:
@@ -76,7 +76,7 @@ public class InitializrAutoConfiguration {
|
||||
public InitializrAutoConfiguration(
|
||||
ObjectProvider<List<ProjectRequestPostProcessor>> postProcessors) {
|
||||
List<ProjectRequestPostProcessor> list = postProcessors.getIfAvailable();
|
||||
this.postProcessors = (list != null ? list : new ArrayList<>());
|
||||
this.postProcessors = (list != null) ? list : new ArrayList<>();
|
||||
}
|
||||
|
||||
@Bean
|
||||
|
@@ -74,7 +74,7 @@ public class DependencyMetadataV21JsonMapper implements DependencyMetadataJsonMa
|
||||
private static JsonNode mapRepository(Repository repo) {
|
||||
ObjectNode node = nodeFactory.objectNode();
|
||||
node.put("name", repo.getName())
|
||||
.put("url", (repo.getUrl() != null ? repo.getUrl().toString() : null))
|
||||
.put("url", (repo.getUrl() != null) ? repo.getUrl().toString() : null)
|
||||
.put("snapshotEnabled", repo.isSnapshotsEnabled());
|
||||
return node;
|
||||
}
|
||||
|
@@ -27,7 +27,7 @@ public interface InitializrMetadataJsonMapper {
|
||||
|
||||
/**
|
||||
* Write a json representation of the specified metadata.
|
||||
* @param metadata The intializr metadata
|
||||
* @param metadata the initializr metadata
|
||||
* @param appUrl the app URL
|
||||
* @return the JSON representation
|
||||
*/
|
||||
|
@@ -65,7 +65,7 @@ public class InitializrMetadataV21JsonMapper extends InitializrMetadataV2JsonMap
|
||||
}
|
||||
|
||||
private ObjectNode dependenciesLink(String appUrl) {
|
||||
String uri = (appUrl != null ? appUrl + "/dependencies" : "/dependencies");
|
||||
String uri = (appUrl != null) ? appUrl + "/dependencies" : "/dependencies";
|
||||
UriTemplate uriTemplate = new UriTemplate(uri, this.dependenciesVariables);
|
||||
ObjectNode result = nodeFactory().objectNode();
|
||||
result.put("href", uriTemplate.toString());
|
||||
|
@@ -114,7 +114,7 @@ public class InitializrMetadataV2JsonMapper implements InitializrMetadataJsonMap
|
||||
}
|
||||
|
||||
private String generateTemplatedUri(String appUrl, Type type) {
|
||||
String uri = (appUrl != null ? appUrl + type.getAction() : type.getAction());
|
||||
String uri = (appUrl != null) ? appUrl + type.getAction() : type.getAction();
|
||||
uri = uri + "?type=" + type.getId();
|
||||
UriTemplate uriTemplate = new UriTemplate(uri, this.templateVariables);
|
||||
return uriTemplate.toString();
|
||||
|
@@ -52,7 +52,7 @@ public abstract class AbstractInitializrController {
|
||||
this.metadataProvider = metadataProvider;
|
||||
this.linkTo = (link) -> {
|
||||
String result = resourceUrlProvider.getForLookupPath(link);
|
||||
return (result != null ? result : link);
|
||||
return (result != null) ? result : link;
|
||||
};
|
||||
}
|
||||
|
||||
|
@@ -206,8 +206,8 @@ public class MainController extends AbstractInitializrController {
|
||||
private ResponseEntity<String> dependenciesFor(InitializrMetadataVersion version,
|
||||
String bootVersion) {
|
||||
InitializrMetadata metadata = this.metadataProvider.get();
|
||||
Version v = (bootVersion != null ? Version.parse(bootVersion)
|
||||
: Version.parse(metadata.getBootVersions().getDefault().getId()));
|
||||
Version v = (bootVersion != null) ? Version.parse(bootVersion)
|
||||
: Version.parse(metadata.getBootVersions().getDefault().getId());
|
||||
DependencyMetadata dependencyMetadata = this.dependencyMetadataProvider
|
||||
.get(metadata, v);
|
||||
String content = new DependencyMetadataV21JsonMapper().write(dependencyMetadata);
|
||||
@@ -339,8 +339,8 @@ public class MainController extends AbstractInitializrController {
|
||||
|
||||
private static String getWrapperScript(ProjectRequest request) {
|
||||
String script = ("gradle".equals(request.getBuild()) ? "gradlew" : "mvnw");
|
||||
return (request.getBaseDir() != null ? request.getBaseDir() + "/" + script
|
||||
: script);
|
||||
return (request.getBaseDir() != null) ? request.getBaseDir() + "/" + script
|
||||
: script;
|
||||
}
|
||||
|
||||
private ResponseEntity<byte[]> upload(File download, File dir, String fileName,
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2018 the original author or authors.
|
||||
* Copyright 2012-2018 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.
|
||||
@@ -202,7 +202,7 @@ final class JsonFieldProcessor {
|
||||
List<String> segments, Match parent) {
|
||||
this.payload = payload;
|
||||
this.path = path;
|
||||
this.segments = (segments != null ? segments : path.getSegments());
|
||||
this.segments = (segments != null) ? segments : path.getSegments();
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user