Skip to content

Commit 995b6a9

Browse files
thc202nedtwigg
authored andcommitted
Remove redundant null check in ResourceHarness (#216)
Remove the null check in constructor of WriterAsserter as the reference being checked is guaranteed to be non-null (a NullPointerException would be thrown in a previous statement).
1 parent d7c87b8 commit 995b6a9

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

testlib/src/main/java/com/diffplug/spotless/ResourceHarness.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import java.util.ArrayList;
2626
import java.util.Arrays;
2727
import java.util.List;
28-
import java.util.Objects;
2928
import java.util.function.Consumer;
3029
import java.util.logging.Logger;
3130

@@ -196,7 +195,7 @@ public static class WriteAsserter {
196195

197196
private WriteAsserter(File file) {
198197
file.getParentFile().mkdirs();
199-
this.file = Objects.requireNonNull(file);
198+
this.file = file;
200199
}
201200

202201
public File toLines(String... lines) throws IOException {

0 commit comments

Comments
 (0)