29
29
import com .diffplug .spotless .FormatterStep ;
30
30
import com .diffplug .spotless .LineEnding ;
31
31
32
+ import edu .umd .cs .findbugs .annotations .SuppressFBWarnings ;
33
+
32
34
public class FenceStep {
33
35
/** Declares the name of the step. */
34
36
public static FenceStep named (String name ) {
@@ -94,6 +96,8 @@ public FormatterStep applyWithin(List<FormatterStep> steps) {
94
96
}
95
97
96
98
static class ApplyWithin extends Apply implements FormatterFunc .Closeable .ResourceFuncNeedsFile <Formatter > {
99
+ private static final long serialVersionUID = 17061466531957339L ;
100
+
97
101
ApplyWithin (Pattern regex , List <FormatterStep > steps ) {
98
102
super (regex , steps );
99
103
}
@@ -112,6 +116,8 @@ public String apply(Formatter formatter, String unix, File file) throws Exceptio
112
116
}
113
117
114
118
static class PreserveWithin extends Apply implements FormatterFunc .Closeable .ResourceFuncNeedsFile <Formatter > {
119
+ private static final long serialVersionUID = -8676786492305178343L ;
120
+
115
121
PreserveWithin (Pattern regex , List <FormatterStep > steps ) {
116
122
super (regex , steps );
117
123
}
@@ -133,7 +139,9 @@ public String apply(Formatter formatter, String unix, File file) throws Exceptio
133
139
}
134
140
}
135
141
142
+ @ SuppressFBWarnings ("SE_TRANSIENT_FIELD_NOT_RESTORED" )
136
143
static class Apply implements Serializable {
144
+ private static final long serialVersionUID = -2301848328356559915L ;
137
145
final Pattern regex ;
138
146
final List <FormatterStep > steps ;
139
147
@@ -189,8 +197,9 @@ protected String assembleGroups(String unix) {
189
197
builder .append (unix , lastEnd , unix .length ());
190
198
return builder .toString ();
191
199
} else {
192
- int startLine = 1 + (int ) builder .toString ().codePoints ().filter (c -> c == '\n' ).count ();
193
- int endLine = 1 + (int ) unix .codePoints ().filter (c -> c == '\n' ).count ();
200
+ // these will be needed to generate Lints later on
201
+ // int startLine = 1 + (int) builder.toString().codePoints().filter(c -> c == '\n').count();
202
+ // int endLine = 1 + (int) unix.codePoints().filter(c -> c == '\n').count();
194
203
195
204
// throw an error with either the full regex, or the nicer open/close pair
196
205
Matcher openClose = Pattern .compile ("\\ \\ Q([\\ s\\ S]*?)\\ \\ E" + "\\ Q([\\ s\\ S]*?)\\ E" + "\\ \\ Q([\\ s\\ S]*?)\\ \\ E" )
0 commit comments