Skip to content

Commit 078945d

Browse files
committed
fix: repair the configuration cache for NPM tasks by using a mutable instead of an immutable list
workaround for #2372
1 parent e15778e commit 078945d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/src/main/java/com/diffplug/spotless/npm/NpmPathResolver.java

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

1818
import java.io.File;
1919
import java.io.Serializable;
20+
import java.util.ArrayList;
2021
import java.util.List;
2122
import java.util.Optional;
2223

@@ -35,7 +36,9 @@ public NpmPathResolver(File explicitNpmExecutable, File explicitNodeExecutable,
3536
this.explicitNpmExecutable = explicitNpmExecutable;
3637
this.explicitNodeExecutable = explicitNodeExecutable;
3738
this.explicitNpmrcFile = explicitNpmrcFile;
38-
this.additionalNpmrcLocations = List.copyOf(additionalNpmrcLocations);
39+
// We must not use an immutable list (e.g. List.copyOf) here, because immutable lists cannot be restored
40+
// from Gradle’s serialisation. See https://github.com/diffplug/spotless/issues/2372
41+
this.additionalNpmrcLocations = new ArrayList<>(additionalNpmrcLocations);
3942
}
4043

4144
/**

0 commit comments

Comments
 (0)