Skip to content

Commit cee7cad

Browse files
committed
Fix spotbugs.
1 parent 532078b commit cee7cad

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,8 +311,8 @@ public void close() {
311311
((FormatterStepImpl.Standard) step).cleanupFormatterFunc();
312312
} else if (step instanceof FormatterStepEqualityOnStateSerialization) {
313313
((FormatterStepEqualityOnStateSerialization) step).cleanupFormatterFunc();
314-
} else if (step instanceof FenceStep.Apply) {
315-
((FenceStep.Apply) step).cleanup();
314+
} else if (step instanceof FenceStep.BaseStep) {
315+
((FenceStep.BaseStep) step).cleanup();
316316
}
317317
}
318318
}

lib/src/main/java/com/diffplug/spotless/generic/FenceStep.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public FormatterStep applyWithin(List<FormatterStep> steps) {
9494
return new ApplyWithin(name, regex, steps);
9595
}
9696

97-
static class ApplyWithin extends Apply implements FormatterFunc.Closeable.ResourceFuncNeedsFile<Formatter> {
97+
static class ApplyWithin extends BaseStep {
9898
private static final long serialVersionUID = 17061466531957339L;
9999

100100
ApplyWithin(String name, Pattern regex, List<FormatterStep> steps) {
@@ -114,7 +114,7 @@ public String apply(Formatter formatter, String unix, File file) throws Exceptio
114114
}
115115
}
116116

117-
static class PreserveWithin extends Apply implements FormatterFunc.Closeable.ResourceFuncNeedsFile<Formatter> {
117+
static class PreserveWithin extends BaseStep {
118118
private static final long serialVersionUID = -8676786492305178343L;
119119

120120
PreserveWithin(String name, Pattern regex, List<FormatterStep> steps) {
@@ -139,7 +139,7 @@ public String apply(Formatter formatter, String unix, File file) throws Exceptio
139139
}
140140

141141
@SuppressFBWarnings("SE_TRANSIENT_FIELD_NOT_RESTORED")
142-
public static abstract class Apply implements Serializable, FormatterStep, FormatterFunc.Closeable.ResourceFuncNeedsFile<Formatter> {
142+
public static abstract class BaseStep implements Serializable, FormatterStep, FormatterFunc.Closeable.ResourceFuncNeedsFile<Formatter> {
143143
final String name;
144144
private static final long serialVersionUID = -2301848328356559915L;
145145
final Pattern regex;
@@ -148,7 +148,7 @@ public static abstract class Apply implements Serializable, FormatterStep, Forma
148148
transient ArrayList<String> groups = new ArrayList<>();
149149
transient StringBuilder builderInternal;
150150

151-
public Apply(String name, Pattern regex, List<FormatterStep> steps) {
151+
public BaseStep(String name, Pattern regex, List<FormatterStep> steps) {
152152
this.name = name;
153153
this.regex = regex;
154154
this.steps = steps;
@@ -238,7 +238,7 @@ public boolean equals(Object o) {
238238
return true;
239239
if (o == null || getClass() != o.getClass())
240240
return false;
241-
Apply step = (Apply) o;
241+
BaseStep step = (BaseStep) o;
242242
return name.equals(step.name) && regex.pattern().equals(step.regex.pattern()) && regex.flags() == step.regex.flags() && steps.equals(step.steps);
243243
}
244244

0 commit comments

Comments
 (0)