From d0d73d63b723d901b40ea1a9ccbe2fa0a81da35e Mon Sep 17 00:00:00 2001 From: svc-excavator-bot Date: Tue, 7 Nov 2023 15:56:31 +0000 Subject: [PATCH] Excavator: Upgrades Baseline to the latest version --- build.gradle | 2 +- .../main/java/com/palantir/javaformat/gradle/FormatDiff.java | 3 +-- .../palantir/javaformat/intellij/PalantirCodeStyleManager.java | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index 1373f1544..8e94f303b 100644 --- a/build.gradle +++ b/build.gradle @@ -7,7 +7,7 @@ buildscript { dependencies { classpath 'com.palantir.jakartapackagealignment:jakarta-package-alignment:0.6.0' classpath 'com.gradle.publish:plugin-publish-plugin:1.2.1' - classpath 'com.palantir.baseline:gradle-baseline-java:5.20.0' + classpath 'com.palantir.baseline:gradle-baseline-java:5.31.0' classpath 'com.palantir.gradle.consistentversions:gradle-consistent-versions:2.16.0' classpath 'com.palantir.gradle.externalpublish:gradle-external-publish-plugin:1.12.0' classpath 'com.palantir.gradle.gitversion:gradle-git-version:3.0.0' diff --git a/gradle-palantir-java-format/src/main/java/com/palantir/javaformat/gradle/FormatDiff.java b/gradle-palantir-java-format/src/main/java/com/palantir/javaformat/gradle/FormatDiff.java index d645b58ab..d12907dc7 100644 --- a/gradle-palantir-java-format/src/main/java/com/palantir/javaformat/gradle/FormatDiff.java +++ b/gradle-palantir-java-format/src/main/java/com/palantir/javaformat/gradle/FormatDiff.java @@ -28,7 +28,6 @@ import com.google.common.collect.RangeSet; import com.google.common.collect.Streams; import com.google.common.collect.TreeRangeSet; -import com.google.common.io.ByteStreams; import com.palantir.javaformat.java.FormatterException; import com.palantir.javaformat.java.FormatterService; import com.palantir.javaformat.java.Replacement; @@ -138,7 +137,7 @@ private static String gitCommand(Path dir, String... args) throws IOException, I Preconditions.checkState(process.exitValue() == 0, "Expected return code of 0"); ByteArrayOutputStream baos = new ByteArrayOutputStream(); - ByteStreams.copy(process.getInputStream(), baos); + process.getInputStream().transferTo(baos); return new String(baos.toByteArray(), UTF_8).trim(); } diff --git a/idea-plugin/src/main/java/com/palantir/javaformat/intellij/PalantirCodeStyleManager.java b/idea-plugin/src/main/java/com/palantir/javaformat/intellij/PalantirCodeStyleManager.java index dcbe737b4..ffa3a5b31 100644 --- a/idea-plugin/src/main/java/com/palantir/javaformat/intellij/PalantirCodeStyleManager.java +++ b/idea-plugin/src/main/java/com/palantir/javaformat/intellij/PalantirCodeStyleManager.java @@ -85,7 +85,7 @@ static Map getReplacements( formatter.getFormatReplacements(text, toRanges(ranges)).forEach(replacement -> { replacements.put(toTextRange(replacement.getReplaceRange()), replacement.getReplacementString()); }); - return replacements.build(); + return replacements.buildOrThrow(); } catch (FormatterException e) { log.debug("Formatter failed, no replacements", e); return ImmutableMap.of();