Polish ternary expressions
This commit is contained in:
@@ -260,7 +260,7 @@ public class RabbitProperties {
|
||||
}
|
||||
|
||||
public void setVirtualHost(String virtualHost) {
|
||||
this.virtualHost = ("".equals(virtualHost) ? "/" : virtualHost);
|
||||
this.virtualHost = "".equals(virtualHost) ? "/" : virtualHost;
|
||||
}
|
||||
|
||||
public Duration getRequestedHeartbeat() {
|
||||
|
||||
@@ -48,7 +48,7 @@ public final class ConditionMessage {
|
||||
}
|
||||
|
||||
private ConditionMessage(ConditionMessage prior, String message) {
|
||||
this.message = (prior.isEmpty() ? message : prior + "; " + message);
|
||||
this.message = prior.isEmpty() ? message : prior + "; " + message;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -111,7 +111,7 @@ public class ConditionOutcome {
|
||||
* @return the message or {@code null}
|
||||
*/
|
||||
public String getMessage() {
|
||||
return (this.message.isEmpty() ? null : this.message.toString());
|
||||
return this.message.isEmpty() ? null : this.message.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -52,7 +52,7 @@ public class H2ConsoleAutoConfiguration {
|
||||
@Bean
|
||||
public ServletRegistrationBean<WebServlet> h2Console() {
|
||||
String path = this.properties.getPath();
|
||||
String urlMapping = (path.endsWith("/") ? path + "*" : path + "/*");
|
||||
String urlMapping = path.endsWith("/") ? path + "*" : path + "/*";
|
||||
ServletRegistrationBean<WebServlet> registration = new ServletRegistrationBean<>(
|
||||
new WebServlet(), urlMapping);
|
||||
H2ConsoleProperties.Settings settings = this.properties.getSettings();
|
||||
|
||||
@@ -72,7 +72,7 @@ public class ProjectInfoAutoConfiguration {
|
||||
}
|
||||
|
||||
protected Properties loadFrom(Resource location, String prefix) throws IOException {
|
||||
String p = (prefix.endsWith(".") ? prefix : prefix + ".");
|
||||
String p = prefix.endsWith(".") ? prefix : prefix + ".";
|
||||
Properties source = PropertiesLoaderUtils.loadProperties(location);
|
||||
Properties target = new Properties();
|
||||
for (String key : source.stringPropertyNames()) {
|
||||
|
||||
@@ -195,7 +195,7 @@ public class JerseyAutoConfiguration implements ServletContextAware {
|
||||
if (!applicationPath.startsWith("/")) {
|
||||
applicationPath = "/" + applicationPath;
|
||||
}
|
||||
return (applicationPath.equals("/") ? "/*" : applicationPath + "/*");
|
||||
return applicationPath.equals("/") ? "/*" : applicationPath + "/*";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -69,7 +69,7 @@ public class ResourceProperties {
|
||||
String[] normalized = new String[staticLocations.length];
|
||||
for (int i = 0; i < staticLocations.length; i++) {
|
||||
String location = staticLocations[i];
|
||||
normalized[i] = (location.endsWith("/") ? location : location + "/");
|
||||
normalized[i] = location.endsWith("/") ? location : location + "/";
|
||||
}
|
||||
return normalized;
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ public class WebConversionService extends DefaultFormattingConversionService {
|
||||
*/
|
||||
public WebConversionService(String dateFormat) {
|
||||
super(false);
|
||||
this.dateFormat = (StringUtils.hasText(dateFormat) ? dateFormat : null);
|
||||
this.dateFormat = StringUtils.hasText(dateFormat) ? dateFormat : null;
|
||||
if (this.dateFormat != null) {
|
||||
addFormatters();
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ public class WebServicesAutoConfiguration {
|
||||
MessageDispatcherServlet servlet = new MessageDispatcherServlet();
|
||||
servlet.setApplicationContext(applicationContext);
|
||||
String path = this.properties.getPath();
|
||||
String urlMapping = (path.endsWith("/") ? path + "*" : path + "/*");
|
||||
String urlMapping = path.endsWith("/") ? path + "*" : path + "/*";
|
||||
ServletRegistrationBean<MessageDispatcherServlet> registration = new ServletRegistrationBean<>(
|
||||
servlet, urlMapping);
|
||||
WebServicesProperties.Servlet servletProperties = this.properties.getServlet();
|
||||
@@ -152,7 +152,7 @@ public class WebServicesAutoConfiguration {
|
||||
}
|
||||
|
||||
private String ensureTrailingSlash(String path) {
|
||||
return (path.endsWith("/") ? path : path + "/");
|
||||
return path.endsWith("/") ? path : path + "/";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user