Skip to content

Commit 5d219bc

Browse files
committed
Polish
1 parent 45121f2 commit 5d219bc

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/MappingWebEndpointPathMapper.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
import org.springframework.boot.actuate.endpoint.EndpointId;
2323
import org.springframework.boot.actuate.endpoint.web.PathMapper;
24+
import org.springframework.util.StringUtils;
2425

2526
/**
2627
* A {@link PathMapper} implementation that uses a simple {@link Map} to determine the
@@ -46,7 +47,9 @@ public String getRootPath(String endpointId) {
4647

4748
@Override
4849
public String getRootPath(EndpointId endpointId) {
49-
return this.pathMapping.getOrDefault(endpointId, endpointId.toString());
50+
String path = this.pathMapping.get(endpointId);
51+
return StringUtils.hasText(path) ? path
52+
: PathMapper.useEndpointId().getRootPath(endpointId);
5053
}
5154

5255
}

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/couchbase/CouchbaseHealthIndicator.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,7 @@ private static class ClusterHealthCheck implements HealthCheck {
147147
@Override
148148
public void checkHealth(Builder builder) throws Exception {
149149
DiagnosticsReport diagnostics = this.cluster.diagnostics();
150-
if (isCouchbaseUp(diagnostics)) {
151-
builder.up();
152-
}
153-
else {
154-
builder.down();
155-
}
150+
builder = isCouchbaseUp(diagnostics) ? builder.up() : builder.down();
156151
builder.withDetail("sdk", diagnostics.sdk());
157152
builder.withDetail("endpoints", diagnostics.endpoints().stream()
158153
.map(this::describe).collect(Collectors.toList()));

0 commit comments

Comments
 (0)