From 09d28d596ad6b6747f53eb0c9009c2f9b41e3e83 Mon Sep 17 00:00:00 2001 From: zhaojunxia Date: Thu, 4 May 2023 14:56:55 +0800 Subject: [PATCH] Modify Daily FossScan for 3.2 Release Signed-off-by: zhaojunxia --- .../src/com/sk/dialog/GenerateDialogPane.java | 16 +++---- napi_vs_plugin/src/gen/tools/VsPluginTool.js | 43 +++++++++---------- 2 files changed, 29 insertions(+), 30 deletions(-) diff --git a/napi_IntelliJ_plugin/src/com/sk/dialog/GenerateDialogPane.java b/napi_IntelliJ_plugin/src/com/sk/dialog/GenerateDialogPane.java index a45373bd..45b731b5 100644 --- a/napi_IntelliJ_plugin/src/com/sk/dialog/GenerateDialogPane.java +++ b/napi_IntelliJ_plugin/src/com/sk/dialog/GenerateDialogPane.java @@ -458,21 +458,21 @@ public class GenerateDialogPane extends JDialog { } static class StreamConsumer extends Thread { - InputStream is; + InputStream inS; - StreamConsumer(InputStream is) { + StreamConsumer(InputStream in) { super.setName("StreamConsumer"); - this.is = is; + this.is = in; } @Override public void run() { try { - InputStreamReader isr = new InputStreamReader(is); - BufferedReader br = new BufferedReader(isr); - String line; - while ((line = br.readLine()) != null) { - LOG.error("StreamConsumer" + line); + InputStreamReader inStr = new InputStreamReader(in); + BufferedReader bufR = new BufferedReader(inStr); + String lineStr; + while ((lineStr = bufR.readLine()) != null) { + LOG.error("StreamConsumer" + lineStr); } } catch (IOException ioException) { LOG.error("StreamConsumer io error" + ioException); diff --git a/napi_vs_plugin/src/gen/tools/VsPluginTool.js b/napi_vs_plugin/src/gen/tools/VsPluginTool.js index c00a6a71..217c030d 100644 --- a/napi_vs_plugin/src/gen/tools/VsPluginTool.js +++ b/napi_vs_plugin/src/gen/tools/VsPluginTool.js @@ -63,36 +63,35 @@ function checkFileError(ifname) { } function utf8ArrayToStr(array) { - var out, i, len, c; - var char2, char3; + var res, i, arrLen; + var ch1, ch2, ch3; - out = ""; - len = array.length; + res = ""; + arrLen = array.length; i = 0; - while (i < len) { - c = array[i++]; - switch (c >> 4) { - case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: - // 0xxxxxxx - out += String.fromCharCode(c); + while (i < arrLen) { + ch1 = array[i++]; + switch (ch1 >> 4) { + // 0xxxxxxx + case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: + res += String.fromCharCode(ch1); break; + // 110x xxxx 10xx xxxx case 12: case 13: - // 110x xxxx 10xx xxxx - char2 = array[i++]; - out += String.fromCharCode(((c & 0x1F) << 6) | (char2 & 0x3F)); + ch2 = array[i++]; + res += String.fromCharCode(((ch1 & 0x1F) << 6) | (ch2 & 0x3F)); break; + // 1110 xxxx 10xx xxxx 10xx xxxx case 14: - // 1110 xxxx 10xx xxxx 10xx xxxx - char2 = array[i++]; - char3 = array[i++]; - out += String.fromCharCode(((c & 0x0F) << 12) | - ((char2 & 0x3F) << 6) | - ((char3 & 0x3F) << 0)); + ch2 = array[i++]; + ch3 = array[i++]; + res += String.fromCharCode(((ch1 & 0x0F) << 12) | + ((ch2 & 0x3F) << 6) | + ((ch3 & 0x3F) << 0)); break; } - } - - return out; + } + return res; } function readFile(fn) { -- Gitee