Skip to content

Commit 4bfe4bd

Browse files
committed
Defensive verify if parameters are not null
1 parent f10a454 commit 4bfe4bd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

presto-tests/src/main/java/io/prestosql/tests/sql/TestTable.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import static java.lang.Character.MAX_RADIX;
1919
import static java.lang.Math.abs;
2020
import static java.lang.Math.min;
21+
import static java.util.Objects.requireNonNull;
2122

2223
public class TestTable
2324
implements AutoCloseable
@@ -30,7 +31,9 @@ public class TestTable
3031

3132
public TestTable(SqlExecutor sqlExecutor, String namePrefix, String createDdlTemplate)
3233
{
33-
this.sqlExecutor = sqlExecutor;
34+
this.sqlExecutor = requireNonNull(sqlExecutor, "sqlExecutor is null");
35+
requireNonNull(namePrefix, "namePrefix is null");
36+
requireNonNull(createDdlTemplate, "createDdlTemplate is null");
3437
this.name = namePrefix + "_" + randomTableSuffix();
3538
sqlExecutor.execute(createDdlTemplate.replace("{TABLE_NAME}", this.name));
3639
}

0 commit comments

Comments
 (0)