Skip to content

Commit 3616f14

Browse files
committed
[bugfix] Don't display the contents if it is null
1 parent 1acc85d commit 3616f14

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

exist-core/src/main/java/org/exist/xquery/AbstractPragma.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,13 @@ public void resetState(final boolean postOptimization) {
9393

9494
@Override
9595
public String toString() {
96-
return "(# " + name + ' ' + contents + "#)";
96+
final StringBuilder builder = new StringBuilder();
97+
builder.append("(# ");
98+
builder.append(name);
99+
if (contents != null && !contents.isEmpty()) {
100+
builder.append(' ').append(contents);
101+
}
102+
builder.append("#)");
103+
return builder.toString();
97104
}
98105
}

0 commit comments

Comments
 (0)