From eaa30d1e381c49babce6144dad1c39d0a69d0470 Mon Sep 17 00:00:00 2001 From: Minh Nguyen Date: Sun, 10 Apr 2022 17:32:35 +0700 Subject: [PATCH] - fix sonarqube --- src/main/java/org/nqm/vertx/CommandVerticle.java | 2 +- src/main/java/org/nqm/vertx/GisVertx.java | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/nqm/vertx/CommandVerticle.java b/src/main/java/org/nqm/vertx/CommandVerticle.java index 1e4a2e6..f526d1e 100644 --- a/src/main/java/org/nqm/vertx/CommandVerticle.java +++ b/src/main/java/org/nqm/vertx/CommandVerticle.java @@ -74,7 +74,7 @@ private void safelyPrint(Process pr) { var sb = new StringBuilder(infof("%s", "" + path.getFileName())); try { while (isNotBlank(line = input.readLine())) { - sb.append(commandWithArgs[1].equals("status") ? gitStatus(line) : "\n %s".formatted(line)); + sb.append(commandWithArgs[1].equals("status") ? gitStatus(line) : "%n %s".formatted(line)); } out.println(sb.toString()); Optional.of(pr.waitFor()) diff --git a/src/main/java/org/nqm/vertx/GisVertx.java b/src/main/java/org/nqm/vertx/GisVertx.java index fd3316d..0957c6e 100644 --- a/src/main/java/org/nqm/vertx/GisVertx.java +++ b/src/main/java/org/nqm/vertx/GisVertx.java @@ -50,11 +50,8 @@ private static void addNewModule(Message msg) { } private static void processedModule(Message msg) { - var module = "" + msg.body(); var modules = processedModules(); - if (modules.get(module) != null) { - modules.put(module, true); - } + modules.computeIfPresent("" + msg.body(), (k, v) -> true); if (!modules.isEmpty() && modules.values().stream().allMatch(Boolean.TRUE::equals)) { System.exit(0); }