Polish ternary expressions

This commit is contained in:
Phillip Webb
2018-07-29 09:16:06 +01:00
parent b24bb688b8
commit aeb885192e
49 changed files with 59 additions and 60 deletions

View File

@@ -54,7 +54,7 @@ public class CommandRunner implements Iterable<Command> {
* @param name the name of the runner or {@code null}
*/
public CommandRunner(String name) {
this.name = (StringUtils.hasLength(name) ? name + " " : "");
this.name = StringUtils.hasLength(name) ? name + " " : "";
}
/**

View File

@@ -212,7 +212,7 @@ class InitializrServiceMetadata {
private String getStringValue(JSONObject object, String name, String defaultValue)
throws JSONException {
return (object.has(name) ? object.getString(name) : defaultValue);
return object.has(name) ? object.getString(name) : defaultValue;
}
private Map<String, String> parseStringItems(JSONObject json) throws JSONException {

View File

@@ -54,7 +54,7 @@ public class ShellPrompts {
* @return the current prompt
*/
public String getPrompt() {
return (this.prompts.isEmpty() ? DEFAULT_PROMPT : this.prompts.peek());
return this.prompts.isEmpty() ? DEFAULT_PROMPT : this.prompts.peek();
}
}

View File

@@ -322,7 +322,7 @@ public class GroovyCompiler {
return node;
}
}
return (classes.isEmpty() ? null : classes.get(0));
return classes.isEmpty() ? null : classes.get(0);
}
}

View File

@@ -154,7 +154,7 @@ public class CliTester implements TestRule {
}
}
else {
sources[i] = (new File(arg).isAbsolute() ? arg : this.prefix + arg);
sources[i] = new File(arg).isAbsolute() ? arg : this.prefix + arg;
}
}
return sources;