From a10325dc3a93dc7a847b330055d97a941ab50f8c Mon Sep 17 00:00:00 2001 From: Excavator Bot <33266368+svc-excavator-bot@users.noreply.github.com> Date: Fri, 8 Nov 2024 20:13:36 -0800 Subject: [PATCH] Excavator: Upgrades Baseline to the latest version (#2415) --- build.gradle | 2 +- .../annotations/processor/data/EndpointDefinitions.java | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index c91bf8077..5c63b5ba1 100644 --- a/build.gradle +++ b/build.gradle @@ -28,7 +28,7 @@ buildscript { classpath 'com.palantir.gradle.failure-reports:gradle-failure-reports:1.13.0' classpath 'org.revapi:gradle-revapi:1.8.0' classpath 'com.palantir.javaformat:gradle-palantir-java-format:2.50.0' - classpath 'com.palantir.baseline:gradle-baseline-java:6.0.0' + classpath 'com.palantir.baseline:gradle-baseline-java:6.1.0' classpath 'com.palantir.gradle.gitversion:gradle-git-version:3.1.0' classpath 'gradle.plugin.org.inferred:gradle-processors:3.7.0' classpath 'com.palantir.metricschema:gradle-metric-schema:0.32.0' diff --git a/dialogue-annotations-processor/src/main/java/com/palantir/dialogue/annotations/processor/data/EndpointDefinitions.java b/dialogue-annotations-processor/src/main/java/com/palantir/dialogue/annotations/processor/data/EndpointDefinitions.java index f4065fa73..37645f007 100644 --- a/dialogue-annotations-processor/src/main/java/com/palantir/dialogue/annotations/processor/data/EndpointDefinitions.java +++ b/dialogue-annotations-processor/src/main/java/com/palantir/dialogue/annotations/processor/data/EndpointDefinitions.java @@ -69,7 +69,8 @@ public Optional tryParseEndpointDefinition(ExecutableElement returnTypesResolver.getReturnType(endpointName, element, requestAnnotationReflector); List argumentDefinitions = element.getParameters().stream() .map(arg -> getArgumentDefinition(endpointName, arg)) - .flatMap(Optional::stream) + .filter(Optional::isPresent) + .map(Optional::get) .collect(Collectors.toList()); if (httpPath.isEmpty() @@ -80,7 +81,8 @@ public Optional tryParseEndpointDefinition(ExecutableElement Set expectedPathParams = httpPath.get().get().stream() .map(HttpPathSegments::getVariableName) - .flatMap(Optional::stream) + .filter(Optional::isPresent) + .map(Optional::get) .collect(Collectors.toSet()); Set actualPathParams = argumentDefinitions.stream() .filter(argument -> IS_PATH_PARAMETER.apply(argument.paramType()))