[jOOQ/jOOQ#10112] Fix formatting of nested JSON_OBJECT()

This commit is contained in:
Lukas Eder 2020-04-29 10:33:05 +02:00
parent efb4979033
commit d2f3ce261a
2 changed files with 5 additions and 8 deletions

View File

@ -712,12 +712,9 @@ class DefaultRenderContext extends AbstractContext<RenderContext> implements Ren
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("rendering [");
sb.append(render());
sb.append("]\n");
sb.append("parameters [");
sb.append(paramType);
sb.append("]\n");
sb.append("rendering [").append(render()).append("]\n");
sb.append("formatting [").append(format()).append("]\n");
sb.append("parameters [").append(paramType).append("]\n");
toString(sb);
return sb.toString();

View File

@ -112,7 +112,7 @@ class QueryPartCollectionView<T extends QueryPart> extends AbstractQueryPart imp
rendersContent.set(i++, ((QueryPartInternal) e).rendersContent(ctx));
int size = rendersContent.cardinality();
boolean format = size >= indentSize;
boolean format = ctx.format() && size >= indentSize;
boolean previousQualify = ctx.qualify();
if (qualify != null)
@ -157,7 +157,7 @@ class QueryPartCollectionView<T extends QueryPart> extends AbstractQueryPart imp
ctx.formatNewLine();
if (indent) {
ctx.data(DATA_LIST_ALREADY_INDENTED, part instanceof QueryPartCollectionView);
ctx.data(DATA_LIST_ALREADY_INDENTED, part instanceof QueryPartCollectionView && ((QueryPartCollectionView<?>) part).size() > 1);
ctx.visit(part);
ctx.data(DATA_LIST_ALREADY_INDENTED, previousIndented);
}