Skip to content

Commit 532078b

Browse files
committed
Fix a long-standing bug where delegate steps (which are created by filename filters) weren't getting cleaned-up.
1 parent a4f8e2b commit 532078b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/src/main/java/com/diffplug/spotless/Formatter.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,9 @@ public boolean equals(Object obj) {
304304
@Override
305305
public void close() {
306306
for (FormatterStep step : steps) {
307+
if (step instanceof DelegateFormatterStep) {
308+
step = ((DelegateFormatterStep) step).delegateStep;
309+
}
307310
if (step instanceof FormatterStepImpl.Standard) {
308311
((FormatterStepImpl.Standard) step).cleanupFormatterFunc();
309312
} else if (step instanceof FormatterStepEqualityOnStateSerialization) {

0 commit comments

Comments
 (0)