Skip to content

Commit b157d2f

Browse files
committed
requireNonNull
1 parent af3f787 commit b157d2f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

bosk-core/src/main/java/works/bosk/Bosk.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@ public class Bosk<R extends StateTreeNode> implements BoskInfo<R> {
114114
*/
115115
@SuppressWarnings("this-escape")
116116
public Bosk(String name, Type rootType, DefaultRootFunction<R> defaultRootFunction, DriverFactory<R> driverFactory, RegistrarFactory registrarFactory) {
117-
this.name = name;
118-
this.pathCompiler = PathCompiler.withSourceType(rootType); // Required before rootRef
119-
this.localDriver = new LocalDriver(defaultRootFunction);
117+
this.name = requireNonNull(name);
118+
this.pathCompiler = PathCompiler.withSourceType(requireNonNull(rootType)); // Required before rootRef
119+
this.localDriver = new LocalDriver(requireNonNull(defaultRootFunction));
120120
this.rootRef = new RootRef(rootType);
121121
try {
122122
validateType(rootType);
@@ -131,8 +131,8 @@ public Bosk(String name, Type rootType, DefaultRootFunction<R> defaultRootFuncti
131131
// to do such things as create References, so it needs the rest of the
132132
// initialization to have completed already.
133133
//
134-
this.driver = new ValidatingDriver(driverFactory.build(boskInfo, this.localDriver));
135-
this.hookRegistrar = registrarFactory.build(boskInfo, this::localRegisterHook);
134+
this.driver = new ValidatingDriver(requireNonNull(driverFactory.build(boskInfo, this.localDriver)));
135+
this.hookRegistrar = requireNonNull(registrarFactory.build(boskInfo, this::localRegisterHook));
136136

137137
try {
138138
this.currentRoot = rootRef.targetClass().cast(requireNonNull(driver.initialRoot(rootType)));

0 commit comments

Comments
 (0)