Skip to content

Commit

Permalink
fix: Add default values to each yo-rc.json property (#226)
Browse files Browse the repository at this point in the history
This prevents throwing nullpointer exceptions for cases where the values are null.

Fixes #223
  • Loading branch information
SudharakaP authored Sep 2, 2020
1 parent ac11902 commit dca7766
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,23 @@ public YoRC deserialize(JsonParser jp, DeserializationContext ctxt) throws IOExc
JsonNode node = jp.getCodec().readTree(jp);

String serverPort = getDefaultIfNull(node.get("serverPort"), "8080");
String authenticationType = node.get("authenticationType").asText();
String authenticationType = getDefaultIfNull(node.get("authenticationType"), "");
String cacheProvider = getDefaultIfNull(node.get("cacheProvider"), "no");
boolean enableHibernateCache = getDefaultIfNull(node.get("enableHibernateCache"), false);
boolean webSocket = node.get("websocket").asBoolean();
String databaseType = node.get("databaseType").asText();
String devDatabaseType = node.get("devDatabaseType").asText();
String prodDatabaseType = node.get("prodDatabaseType").asText();
boolean webSocket = getDefaultIfNull(node.get("websocket"), false);
String databaseType = getDefaultIfNull(node.get("databaseType"), "");
String devDatabaseType = getDefaultIfNull(node.get("devDatabaseType"), "");
String prodDatabaseType = getDefaultIfNull(node.get("prodDatabaseType"), "");
boolean searchEngine = getDefaultIfNull(node.get("searchEngine"), false);
boolean messageBroker = getDefaultIfNull(node.get("messageBroker"), false);
boolean serviceDiscoveryType = getDefaultIfNull(node.get("serviceDiscoveryType"), false);
String buildTool = node.get("buildTool").asText();
String buildTool = getDefaultIfNull(node.get("buildTool"), "");
boolean enableSwaggerCodegen = getDefaultIfNull(node.get("enableSwaggerCodegen"), false);
String clientFramework = getDefaultIfNull(node.get("clientFramework"), "none");
boolean useSass = getDefaultIfNull(node.get("useSass"), false);
String clientPackageManager = node.get("clientPackageManager").asText();
String applicationType = node.get("applicationType").asText();
boolean enableTranslation = node.get("enableTranslation").asBoolean();
String clientPackageManager = getDefaultIfNull(node.get("clientPackageManager"), "");
String applicationType = getDefaultIfNull(node.get("applicationType"), "");
boolean enableTranslation = getDefaultIfNull(node.get("enableTranslation"), false);
String nativeLanguage = getDefaultIfNull(node.get("nativeLanguage"), "");
boolean hasProtractor = false;
boolean hasGatling = false;
Expand Down

0 comments on commit dca7766

Please sign in to comment.