You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hugegraph.apache.org by pe...@apache.org on 2025/11/16 03:36:47 UTC

(incubator-hugegraph) 03/03: fix tinkerpop test open graph panic and other bugs

This is an automated email from the ASF dual-hosted git repository.

pengjunzhi pushed a commit to branch tmp-170
in repository https://gitbox.apache.org/repos/asf/incubator-hugegraph.git

commit 374e221743ada5ca84083e1d640fb6c1e87903a8
Author: Peng Junzhi <20...@smail.nju.edu.cn>
AuthorDate: Sat Nov 15 23:20:31 2025 +0800

    fix tinkerpop test open graph panic and other bugs
---
 .../src/main/java/org/apache/hugegraph/pd/client/PDConfig.java        | 4 ++++
 .../src/main/java/org/apache/hugegraph/io/HugeGraphSONModule.java     | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/hugegraph-pd/hg-pd-client/src/main/java/org/apache/hugegraph/pd/client/PDConfig.java b/hugegraph-pd/hg-pd-client/src/main/java/org/apache/hugegraph/pd/client/PDConfig.java
index 5555bae30..6ab70192f 100644
--- a/hugegraph-pd/hg-pd-client/src/main/java/org/apache/hugegraph/pd/client/PDConfig.java
+++ b/hugegraph-pd/hg-pd-client/src/main/java/org/apache/hugegraph/pd/client/PDConfig.java
@@ -101,6 +101,10 @@ public final class PDConfig {
     }
 
     public PDConfig setAuthority(String userName, String pwd) {
+        // If userName is null or empty, keep default values for test environment
+        if (StringUtils.isEmpty(userName)) {
+            return this;
+        }
         this.userName = userName;
         String auth = userName + ':' + pwd;
         this.authority = Base64.getEncoder().encodeToString(auth.getBytes(UTF_8));
diff --git a/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/io/HugeGraphSONModule.java b/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/io/HugeGraphSONModule.java
index e37338f9b..ddb7c1a98 100644
--- a/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/io/HugeGraphSONModule.java
+++ b/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/io/HugeGraphSONModule.java
@@ -87,7 +87,7 @@ public class HugeGraphSONModule extends TinkerPopJacksonModule {
 
     private static final String TYPE_NAMESPACE = "hugegraph";
 
-    private static final boolean OPTIMIZE_SERIALIZE = true;
+    private static boolean OPTIMIZE_SERIALIZE = true;
 
     @SuppressWarnings("rawtypes")
     private static final Map<Class, String> TYPE_DEFINITIONS;