Skip to content

Commit

Permalink
Fix spotbugs.
Browse files Browse the repository at this point in the history
  • Loading branch information
nedtwigg committed Oct 13, 2024
1 parent 90ca5bf commit 90cb7bb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
* to make Spotless work with all of Gradle's cache systems at once.
*/
public class ConfigurationCacheHackList implements java.io.Serializable {
private static final long serialVersionUID = 1L;
private final boolean optimizeForEquality;
private final ArrayList<Object> backingList = new ArrayList<>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@
import java.util.Objects;

import edu.umd.cs.findbugs.annotations.Nullable;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

final class FormatterStepSerializationRoundtrip<RoundtripState extends Serializable, EqualityState extends Serializable> extends FormatterStepEqualityOnStateSerialization<EqualityState> {
private static final long serialVersionUID = 1L;
private final String name;
@SuppressFBWarnings(value = "SE_TRANSIENT_FIELD_NOT_RESTORED", justification = "HackClone")
private final transient ThrowingEx.Supplier<RoundtripState> initializer;
private @Nullable RoundtripState roundtripStateInternal;
private @Nullable EqualityState equalityStateInternal;
Expand Down Expand Up @@ -74,6 +76,8 @@ protected FormatterFunc stateToFormatter(EqualityState equalityState) throws Exc
* It works in conjunction with ConfigurationCacheHackList to allow Spotless to work with all of Gradle's cache systems.
*/
static class HackClone<RoundtripState extends Serializable, EqualityState extends Serializable> implements Serializable {
private static final long serialVersionUID = 1L;
@SuppressFBWarnings(value = "SE_TRANSIENT_FIELD_NOT_RESTORED", justification = "HackClone")
transient FormatterStepSerializationRoundtrip<?, ?> original;
boolean optimizeForEquality;
@Nullable
Expand All @@ -84,6 +88,7 @@ static class HackClone<RoundtripState extends Serializable, EqualityState extend
this.optimizeForEquality = optimizeForEquality;
}

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

0 comments on commit 90cb7bb

Please sign in to comment.