Skip to content

Commit 90cb7bb

Browse files
committed
Fix spotbugs.
1 parent 90ca5bf commit 90cb7bb

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
* to make Spotless work with all of Gradle's cache systems at once.
4848
*/
4949
public class ConfigurationCacheHackList implements java.io.Serializable {
50+
private static final long serialVersionUID = 1L;
5051
private final boolean optimizeForEquality;
5152
private final ArrayList<Object> backingList = new ArrayList<>();
5253

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,12 @@
2020
import java.util.Objects;
2121

2222
import edu.umd.cs.findbugs.annotations.Nullable;
23+
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
2324

2425
final class FormatterStepSerializationRoundtrip<RoundtripState extends Serializable, EqualityState extends Serializable> extends FormatterStepEqualityOnStateSerialization<EqualityState> {
2526
private static final long serialVersionUID = 1L;
2627
private final String name;
28+
@SuppressFBWarnings(value = "SE_TRANSIENT_FIELD_NOT_RESTORED", justification = "HackClone")
2729
private final transient ThrowingEx.Supplier<RoundtripState> initializer;
2830
private @Nullable RoundtripState roundtripStateInternal;
2931
private @Nullable EqualityState equalityStateInternal;
@@ -74,6 +76,8 @@ protected FormatterFunc stateToFormatter(EqualityState equalityState) throws Exc
7476
* It works in conjunction with ConfigurationCacheHackList to allow Spotless to work with all of Gradle's cache systems.
7577
*/
7678
static class HackClone<RoundtripState extends Serializable, EqualityState extends Serializable> implements Serializable {
79+
private static final long serialVersionUID = 1L;
80+
@SuppressFBWarnings(value = "SE_TRANSIENT_FIELD_NOT_RESTORED", justification = "HackClone")
7781
transient FormatterStepSerializationRoundtrip<?, ?> original;
7882
boolean optimizeForEquality;
7983
@Nullable
@@ -84,6 +88,7 @@ static class HackClone<RoundtripState extends Serializable, EqualityState extend
8488
this.optimizeForEquality = optimizeForEquality;
8589
}
8690

91+
@SuppressFBWarnings(value = "NP_NONNULL_PARAM_VIOLATION", justification = "HackClone")
8792
private void writeObject(java.io.ObjectOutputStream out) throws IOException {
8893
if (cleaned == null) {
8994
cleaned = new FormatterStepSerializationRoundtrip(original.name, null, original.equalityStateExtractor, original.equalityStateToFormatter);

0 commit comments

Comments
 (0)