Fix checkstyle ternary issues

Fix checkstyle issues with ternary expressions following the
spring-javaformat upgrade.

See gh-13932
This commit is contained in:
Phillip Webb
2018-07-27 22:54:20 +01:00
parent ec1100a896
commit 7fc455654a
293 changed files with 714 additions and 685 deletions

View File

@@ -332,7 +332,7 @@ public abstract class AbstractRunMojo extends AbstractDependencyFilterMojo {
StringBuilder classpath = new StringBuilder();
for (URL ele : getClassPathUrls()) {
classpath = classpath
.append((classpath.length() > 0 ? File.pathSeparator : "")
.append(((classpath.length() > 0) ? File.pathSeparator : "")
+ new File(ele.toURI()));
}
getLog().debug("Classpath for forked process: " + classpath);
@@ -450,7 +450,7 @@ public abstract class AbstractRunMojo extends AbstractDependencyFilterMojo {
public void uncaughtException(Thread thread, Throwable ex) {
if (!(ex instanceof ThreadDeath)) {
synchronized (this.monitor) {
this.exception = (this.exception != null ? this.exception : ex);
this.exception = (this.exception != null) ? this.exception : ex;
}
getLog().warn(ex);
}
@@ -480,7 +480,7 @@ public abstract class AbstractRunMojo extends AbstractDependencyFilterMojo {
LaunchRunner(String startClassName, String... args) {
this.startClassName = startClassName;
this.args = (args != null ? args : new String[] {});
this.args = (args != null) ? args : new String[] {};
}
@Override

View File

@@ -68,7 +68,7 @@ public class PropertiesMergingResourceTransformer implements ResourceTransformer
private void process(String name, String value) {
String existing = this.data.getProperty(name);
this.data.setProperty(name, (existing != null ? existing + "," + value : value));
this.data.setProperty(name, (existing != null) ? existing + "," + value : value);
}
@Override

View File

@@ -226,7 +226,7 @@ public class RepackageMojo extends AbstractDependencyFilterMojo {
}
private File getTargetFile() {
String classifier = (this.classifier != null ? this.classifier.trim() : "");
String classifier = (this.classifier != null) ? this.classifier.trim() : "";
if (!classifier.isEmpty() && !classifier.startsWith("-")) {
classifier = "-" + classifier;
}
@@ -287,7 +287,7 @@ public class RepackageMojo extends AbstractDependencyFilterMojo {
}
private String removeLineBreaks(String description) {
return (description != null ? description.replaceAll("\\s+", " ") : null);
return (description != null) ? description.replaceAll("\\s+", " ") : null;
}
private void putIfMissing(Properties properties, String key,