From afda71e4192a68c247976c91285e03c5afa726a4 Mon Sep 17 00:00:00 2001 From: dreis2211 Date: Tue, 28 Aug 2018 16:36:08 +0200 Subject: [PATCH] Polish some joining collectors Closes gh-14221 --- .../endpoint/web/annotation/DiscoveredWebOperation.java | 4 ++-- .../endpoint/web/annotation/RequestPredicateFactory.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/DiscoveredWebOperation.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/DiscoveredWebOperation.java index a2bc7071c7..75eb021bf6 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/DiscoveredWebOperation.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/DiscoveredWebOperation.java @@ -61,8 +61,8 @@ class DiscoveredWebOperation extends AbstractDiscoveredOperation implements WebO } private String getId(String endpointId, Method method) { - return endpointId + Stream.of(method.getParameters()).filter(this::hasSelector) - .map(this::dashName).collect(Collectors.joining()); + return Stream.of(method.getParameters()).filter(this::hasSelector) + .map(this::dashName).collect(Collectors.joining("", endpointId, "")); } private boolean hasSelector(Parameter parameter) { diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/RequestPredicateFactory.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/RequestPredicateFactory.java index 8ce5291b81..1672fcb039 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/RequestPredicateFactory.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/RequestPredicateFactory.java @@ -62,8 +62,8 @@ class RequestPredicateFactory { } private String getPath(String rootPath, Method method) { - return rootPath + Stream.of(method.getParameters()).filter(this::hasSelector) - .map(this::slashName).collect(Collectors.joining()); + return Stream.of(method.getParameters()).filter(this::hasSelector) + .map(this::slashName).collect(Collectors.joining("", rootPath, "")); } private boolean hasSelector(Parameter parameter) {