Skip to content

Commit f524e9b

Browse files
committed
We still need to trigger storing the roundtripState on writeObject.
1 parent 90cb7bb commit f524e9b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,13 @@ protected FormatterFunc stateToFormatter(EqualityState equalityState) throws Exc
6464
return equalityStateToFormatter.apply(equalityState);
6565
}
6666

67+
private void writeObject(java.io.ObjectOutputStream out) throws IOException {
68+
if (roundtripStateInternal == null) {
69+
roundtripStateInternal = ThrowingEx.get(this::roundtripStateSupplier);
70+
}
71+
out.defaultWriteObject();
72+
}
73+
6774
HackClone<?, ?> hackClone(boolean optimizeForEquality) {
6875
return new HackClone<>(this, optimizeForEquality);
6976
}

0 commit comments

Comments
 (0)