Polish ternary expressions
This commit is contained in:
@@ -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 + " " : "";
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -322,7 +322,7 @@ public class GroovyCompiler {
|
||||
return node;
|
||||
}
|
||||
}
|
||||
return (classes.isEmpty() ? null : classes.get(0));
|
||||
return classes.isEmpty() ? null : classes.get(0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user