Skip to content

Commit ac53cdf

Browse files
committed
Polish
1 parent 021a962 commit ac53cdf

File tree

1 file changed

+10
-16
lines changed

1 file changed

+10
-16
lines changed

spring-javaformat/spring-javaformat-checkstyle/src/main/java/io/spring/javaformat/checkstyle/FilteredModuleFactory.java

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,15 @@
2626

2727
class FilteredModuleFactory implements ModuleFactory {
2828

29+
static final TreeWalkerFilter FILTERED = new TreeWalkerFilter() {
30+
31+
@Override
32+
public boolean accept(TreeWalkerAuditEvent treeWalkerAuditEvent) {
33+
return true;
34+
}
35+
36+
};
37+
2938
private final ModuleFactory moduleFactory;
3039

3140
private final Set<String> excludes;
@@ -46,24 +55,9 @@ public Object createModule(String name) throws CheckstyleException {
4655

4756
private Object filter(AbstractCheck check) {
4857
if (this.excludes != null && this.excludes.contains(check.getClass().getName())) {
49-
return new FilteredCheck(check);
58+
return FILTERED;
5059
}
5160
return check;
5261
}
5362

54-
static class FilteredCheck implements TreeWalkerFilter {
55-
56-
private final AbstractCheck check;
57-
58-
FilteredCheck(AbstractCheck check) {
59-
this.check = check;
60-
}
61-
62-
@Override
63-
public boolean accept(TreeWalkerAuditEvent treeWalkerAuditEvent) {
64-
return true;
65-
}
66-
67-
}
68-
6963
}

0 commit comments

Comments
 (0)