From ec1eb51aaf6bfebfc9a815a9eed7bf2de0da11c2 Mon Sep 17 00:00:00 2001 From: Denghui Dong Date: Tue, 17 Oct 2023 13:25:07 +0800 Subject: [PATCH] fix: use data directly if type is byte[] --- .../main/java/org/eclipse/jifa/server/ReadyListener.java | 7 +++++-- .../AnalysisApiStompResponseMessageConverter.java | 3 +++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/server/src/main/java/org/eclipse/jifa/server/ReadyListener.java b/server/src/main/java/org/eclipse/jifa/server/ReadyListener.java index 0e702961..9968a9a7 100644 --- a/server/src/main/java/org/eclipse/jifa/server/ReadyListener.java +++ b/server/src/main/java/org/eclipse/jifa/server/ReadyListener.java @@ -39,8 +39,11 @@ class ReadyListener extends ConfigurationAccessor { @EventListener(ApplicationReadyEvent.class) public void fireReadyEvent() { - //noinspection HttpUrlsUsage - log.info("Jifa Server: http://{}:{}", "localhost", config.getPort()); + Role role = config.getRole(); + if (role == Role.MASTER || role == Role.STANDALONE_WORKER) { + //noinspection HttpUrlsUsage + log.info("Jifa Server: http://{}:{}", "localhost", config.getPort()); + } if (config.getRole() == Role.STANDALONE_WORKER) { Path[] paths = config.getInputFiles(); diff --git a/server/src/main/java/org/eclipse/jifa/server/domain/converter/AnalysisApiStompResponseMessageConverter.java b/server/src/main/java/org/eclipse/jifa/server/domain/converter/AnalysisApiStompResponseMessageConverter.java index b700bd3a..72eafbe0 100644 --- a/server/src/main/java/org/eclipse/jifa/server/domain/converter/AnalysisApiStompResponseMessageConverter.java +++ b/server/src/main/java/org/eclipse/jifa/server/domain/converter/AnalysisApiStompResponseMessageConverter.java @@ -76,6 +76,9 @@ private static byte[] toData(Object o) { if (o == null) { return Constant.EMPTY_BYTE_ARRAY; } + if (o instanceof byte[] bs) { + return bs; + } try { return GsonHolder.GSON.toJson(o).getBytes(Constant.CHARSET); } catch (Throwable t) {