Skip to content

Commit 7d282b7

Browse files
committed
fix json escape
1 parent e87ed29 commit 7d282b7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/org/labkey/test/util/EscapeUtil.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,14 @@ static public String toJSONStr(String str)
5757
static public String toJSONRow(Map<String, Object> row)
5858
{
5959
StringBuilder sb = new StringBuilder("{");
60+
String comma = "";
6061
for (Map.Entry<String, Object> entry : row.entrySet())
6162
{
63+
sb.append(comma);
6264
Object value = entry.getValue();
6365
sb.append(EscapeUtil.toJSONStr(entry.getKey()))
64-
.append(": ").append(value instanceof String ? EscapeUtil.toJSONStr((String) entry.getValue()) : value).append(",");
66+
.append(": ").append(value instanceof String ? EscapeUtil.toJSONStr((String) entry.getValue()) : value);
67+
comma = ",";
6568
}
6669
sb.append("}");
6770
return sb.toString();

0 commit comments

Comments
 (0)