From 55b01c4ad3acf58255f48fbadee0cd39d9e51f96 Mon Sep 17 00:00:00 2001 From: toyeshhm Date: Thu, 5 Nov 2026 10:04:25 -0600 Subject: [PATCH 1/2] Fix GrEclipse leaving a `file%3A` directory in the working directory --- .../glue/groovy/GrEclipseFormatterStepImpl.java | 4 +++- .../extra/groovy/GrEclipseFormatterStepTest.java | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/lib-extra/src/groovy/java/com/diffplug/spotless/extra/glue/groovy/GrEclipseFormatterStepImpl.java b/lib-extra/src/groovy/java/com/diffplug/spotless/extra/glue/groovy/GrEclipseFormatterStepImpl.java index 861729e798..b06df2a8a3 100644 --- a/lib-extra/src/groovy/java/com/diffplug/spotless/extra/glue/groovy/GrEclipseFormatterStepImpl.java +++ b/lib-extra/src/groovy/java/com/diffplug/spotless/extra/glue/groovy/GrEclipseFormatterStepImpl.java @@ -92,10 +92,12 @@ private static Logger warnAsInfo(Logger delegate) { // used by the formatter. Solstice removes them before starting it. solstice.warnAndModifyManifestsToFix(warnAsInfo(LOGGER)); + // Solstice URL-encodes an explicit instance area into a directory name relative to + // the working directory (#2019), so set it through the default Equinox falls back on. var props = Map.of( "osgi.nl", "en_US", Constants.FRAMEWORK_STORAGE_CLEAN, Constants.FRAMEWORK_STORAGE_CLEAN_ONFIRSTINIT, - EquinoxLocations.PROP_INSTANCE_AREA, + EquinoxLocations.PROP_INSTANCE_AREA_DEFAULT, Files.createTempDirectory("spotless-groovy-instance").toAbsolutePath().toString(), EquinoxLocations.PROP_CONFIG_AREA, Files.createTempDirectory("spotless-groovy-config").toAbsolutePath().toString()); diff --git a/lib-extra/src/test/java/com/diffplug/spotless/extra/groovy/GrEclipseFormatterStepTest.java b/lib-extra/src/test/java/com/diffplug/spotless/extra/groovy/GrEclipseFormatterStepTest.java index b2185602ea..972945fa6e 100644 --- a/lib-extra/src/test/java/com/diffplug/spotless/extra/groovy/GrEclipseFormatterStepTest.java +++ b/lib-extra/src/test/java/com/diffplug/spotless/extra/groovy/GrEclipseFormatterStepTest.java @@ -15,8 +15,13 @@ */ package com.diffplug.spotless.extra.groovy; +import static org.assertj.core.api.Assertions.assertThat; + +import java.nio.file.Files; +import java.nio.file.Path; import java.util.stream.Stream; +import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -42,4 +47,13 @@ void formatWithVersion(String version) throws Exception { private static Stream formatWithVersion() { return Stream.of("4.18", GrEclipseFormatterStep.defaultVersion()); } + + /** https://github.com/diffplug/spotless/issues/2019 */ + @Test + void doesNotCreateDirectoriesInWorkingDirectory() throws Exception { + harnessFor(GrEclipseFormatterStep.defaultVersion()).test("test.groovy", INPUT, EXPECTED); + try (Stream files = Files.list(Path.of(System.getProperty("user.dir")))) { + assertThat(files.map(file -> file.getFileName().toString())).noneMatch(name -> name.startsWith("file%3A")); + } + } } From 120c6a738b927b74d33bf09da69cb0f4b030bad9 Mon Sep 17 00:00:00 2001 From: toyeshhm Date: Thu, 5 Nov 2026 10:04:25 -0600 Subject: [PATCH 2/2] Add changelog entries for #2019 --- CHANGES.md | 2 ++ plugin-gradle/CHANGES.md | 2 ++ plugin-maven/CHANGES.md | 2 ++ 3 files changed, 6 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 50b28f3e72..eb93716703 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -10,6 +10,8 @@ This document is intended for Spotless developers. We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (starting after version `1.27.0`). ## [Unreleased] +### Fixed +- GrEclipse no longer leaves a `file%3A...` directory in the working directory. ([#2019](https://github.com/diffplug/spotless/issues/2019)) ## [4.11.0] - 2026-11-02 ### Added diff --git a/plugin-gradle/CHANGES.md b/plugin-gradle/CHANGES.md index ca01a77fe6..5aaef36403 100644 --- a/plugin-gradle/CHANGES.md +++ b/plugin-gradle/CHANGES.md @@ -3,6 +3,8 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (starting after version `3.27.0`). ## [Unreleased] +### Fixed +- GrEclipse no longer leaves a `file%3A...` directory in the working directory. ([#2019](https://github.com/diffplug/spotless/issues/2019)) ## [8.11.0] - 2026-11-02 ### Added diff --git a/plugin-maven/CHANGES.md b/plugin-maven/CHANGES.md index 3a79292d20..4081c6671e 100644 --- a/plugin-maven/CHANGES.md +++ b/plugin-maven/CHANGES.md @@ -3,6 +3,8 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (starting after version `1.27.0`). ## [Unreleased] +### Fixed +- GrEclipse no longer leaves a `file%3A...` directory in the working directory. ([#2019](https://github.com/diffplug/spotless/issues/2019)) ## [3.11.0] - 2026-11-02 ### Added