Skip to content

Commit

Permalink
refactor: address pr feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
miles-grant-ibigroup committed May 12, 2023
1 parent 6a3214e commit b77f9c3
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,8 @@ public byte[] generateRouterConfig() throws IOException {
Project project = this.parentProject();

byte[] customRouterConfigString = customRouterConfig != null
? customRouterConfig.getBytes(StandardCharsets.UTF_8) : null;
? customRouterConfig.getBytes(StandardCharsets.UTF_8)
: null;

byte[] routerConfigString = project.routerConfig != null
? writeToBytes(project.routerConfig)
Expand All @@ -455,7 +456,7 @@ public byte[] generateRouterConfig() throws IOException {
Map<String, Object> map1 = mapper.readValue(customRouterConfigString, Map.class);
Map<String, Object> map2 = mapper.readValue(routerConfigString, Map.class);
Map<String, Object> merged = new HashMap<String, Object>(map2);
merged.putAll(map1);
new HashMap<String, Object>(map2).putAll(map1);
return mapper.writeValueAsString(merged).getBytes();
}

Expand All @@ -469,10 +470,9 @@ public byte[] generateRouterConfig() throws IOException {
/** Generate router config for deployment as byte array (for writing to file output stream). */
public String generateRouterConfigAsString() {
try {
return new String(this.generateRouterConfig(), "UTF-8");
return new String(generateRouterConfig(), StandardCharsets.UTF_8);
} catch (IOException e) {
LOG.error("Failed to generate router config:");
LOG.error(e.toString());
LOG.error("Failed to generate router config: ", e);
return "";
}
}
Expand Down

0 comments on commit b77f9c3

Please sign in to comment.