Skip to content

Commit

Permalink
fix: repair the configuration cache for NPM tasks by using a mutable …
Browse files Browse the repository at this point in the history
…instead of an immutable list

workaround for diffplug#2372
  • Loading branch information
jGleitz committed Jan 8, 2025
1 parent e15778e commit 078945d
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import java.io.File;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;

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

/**
Expand Down

0 comments on commit 078945d

Please sign in to comment.