File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
jdbc-v2/src/main/java/com/clickhouse/jdbc Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -457,6 +457,8 @@ public long executeLargeUpdate() throws SQLException {
457457 }
458458
459459 private static String encodeObject (Object x ) throws SQLException {
460+ LOG .trace ("Encoding object: {}" , x );
461+
460462 try {
461463 if (x == null ) {
462464 return "NULL" ;
@@ -500,14 +502,14 @@ private static String encodeObject(Object x) throws SQLException {
500502 listString .append ("]" );
501503
502504 return listString .toString ();
503- } else if (x instanceof Map ) {
504- Map <?, ?> tmpMap = (Map <?, ?>) x ;
505+ } else if (x instanceof Map <?, ?> tmpMap ) {
505506 StringBuilder mapString = new StringBuilder ();
506507 mapString .append ("{" );
507508 for (Object key : tmpMap .keySet ()) {
508509 mapString .append (encodeObject (key )).append (": " ).append (encodeObject (tmpMap .get (key ))).append (", " );
509510 }
510- mapString .delete (mapString .length () - 2 , mapString .length ());
511+ if (!tmpMap .isEmpty ())
512+ mapString .delete (mapString .length () - 2 , mapString .length ());
511513 mapString .append ("}" );
512514
513515 return mapString .toString ();
You can’t perform that action at this time.
0 commit comments