Skip to content

Polish #21130

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Polish #21130

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public boolean isActive(Environment environment) {
*/
public boolean isEnforced(Environment environment) {
String platform = environment.getProperty("spring.main.cloud-platform");
return (platform != null) ? name().equalsIgnoreCase(platform) : false;
return name().equalsIgnoreCase(platform);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,7 @@ private <T> T getNewInstanceIfPossible(Binder.Context context, ResolvableType ty
}

private boolean isEmptyDefaultValueAllowed(Class<?> type) {
if (type.isPrimitive() || type.isEnum() || isAggregate(type) || type.getName().startsWith("java.lang")) {
return false;
}
return true;
return !type.isPrimitive() && !type.isEnum() && !isAggregate(type) && !type.getName().startsWith("java.lang");
}

private boolean isAggregate(Class<?> type) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,6 @@ private static void logTo(Log log, LogLevel level, Object message, Throwable thr
return;
case FATAL:
log.fatal(message, throwable);
return;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import java.time.Duration;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import org.apache.catalina.Container;
Expand Down Expand Up @@ -106,9 +107,7 @@ private boolean active(Container context) {
private List<Connector> getConnectors() {
List<Connector> connectors = new ArrayList<>();
for (Service service : this.tomcat.getServer().findServices()) {
for (Connector connector : service.findConnectors()) {
connectors.add(connector);
}
connectors.addAll(Arrays.asList(service.findConnectors()));
}
return connectors;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,11 +251,11 @@ public int getPort() {

@Override
public boolean shutDownGracefully() {
return (this.gracefulShutdown != null) ? this.gracefulShutdown.shutDownGracefully() : false;
return (this.gracefulShutdown != null) && this.gracefulShutdown.shutDownGracefully();
}

boolean inGracefulShutdown() {
return (this.gracefulShutdown != null) ? this.gracefulShutdown.isShuttingDown() : false;
return (this.gracefulShutdown != null) && this.gracefulShutdown.isShuttingDown();
}

/**
Expand Down