Skip to content

Commit 47724e5

Browse files
Don't pass nulls instead of env
Wonderful choice by me only a few months ago to pass null instead of the TylerEnv to the CodeDatabase when starting up, just to make tables; switching to an actual object means we null pointer exeption immediately. Not sure how no tests didn't catch this, will need to fix that.
1 parent b7b1182 commit 47724e5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

proxyserver/src/main/java/edu/suffolk/litlab/efsp/server/EfspServer.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ protected void stopServers() {
121121
*
122122
* @throws InterruptedException
123123
*/
124-
private static void setupDatabases(DataSource codeDs, DataSource userDs)
124+
private static void setupDatabases(DataSource codeDs, DataSource userDs, Optional<TylerEnv> env)
125125
throws NoSuchAlgorithmException, InterruptedException {
126126

127127
// Update / make the latest definition of the databases if necessary
@@ -132,7 +132,7 @@ private static void setupDatabases(DataSource codeDs, DataSource userDs)
132132
LoginDatabase ld = new LoginDatabase(userConn);
133133
@SuppressWarnings("resource")
134134
// Jurisdiction and env args can be null, we're just making the tables
135-
CodeDatabase cd = new CodeDatabase(null, null, codeConn);
135+
CodeDatabase cd = new CodeDatabase(null, env.orElse(TylerEnv.STAGE), codeConn);
136136
boolean brandNew = !ld.tablesExist() || !cd.tablesExist();
137137

138138
// Now we can tell if everything is being set up fresh. If so, we'll make everything now.
@@ -193,9 +193,9 @@ public static void main(String[] args) throws Exception {
193193
DatabaseCreator.makeDataSource(
194194
dbUrl, dbPortInt, userDatabaseName, dbUser, dbPassword, 7, 100);
195195

196-
setupDatabases(codeDs, userDs);
197-
198196
Optional<TylerEnv> tylerEnv = GetEnv("TYLER_ENV").map(TylerEnv::parse);
197+
setupDatabases(codeDs, userDs, tylerEnv);
198+
199199
InterviewToFilingInformationConverter daJsonConverter =
200200
new DocassembleToFilingInformationConverter(
201201
EfspServer.class.getResourceAsStream("/taxonomy.csv"), tylerEnv);

0 commit comments

Comments
 (0)