Skip to content

Commit

Permalink
fix bug: fix compliant in Jenkins scan (#541)
Browse files Browse the repository at this point in the history
  • Loading branch information
puremilkfan committed Mar 20, 2020
1 parent f3944e7 commit 3b53285
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,6 @@ private void runScript(String defaultUrl, Boolean flag, List<String> tableSqlLis

@Override
public void close() throws Exception {
log.error("resource is close");
log.info("resource is close");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -435,9 +435,10 @@ public static StatisticWeEvent getStatisticWeEvent() {
}

private static class DBThread implements Runnable {
private volatile boolean flag = false;

public void run() {
while (true) {
while (!flag) {
try {
// if the quene is null,then the thread sleep 1s
long ideaTime = 1000L;
Expand All @@ -453,9 +454,9 @@ public void run() {
}
}
} catch (InterruptedException e) {
log.info("insert is fail,{}", e.toString());
log.info("insert fail,{}", e.toString());
Thread.currentThread().interrupt();
break;
flag = true;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
Expand Down Expand Up @@ -135,20 +136,11 @@ public static List<String> getKeys(String objJson) {
try {
Map<String, Object> map = JsonHelper.json2Object(objJson, new TypeReference<Map<String, Object>>() {
});

if (JsonHelper.isValid(objJson)) {
for (Map.Entry<String, Object> entry : map.entrySet()) {
keys.add(entry.getKey());
}
} else {
keys = null;
}

return Arrays.asList(map.keySet().toArray(new String[]{}));
} catch (Exception e) {
keys = null;
log.info("json get key error");
log.info("json get key error", e);
return Collections.emptyList();
}
return keys;
}

public static boolean checkJson(String content, String objJson) {
Expand Down

0 comments on commit 3b53285

Please sign in to comment.