Skip to content

Commit

Permalink
[Java] Tidy up generated code style. PR #892.
Browse files Browse the repository at this point in the history
  • Loading branch information
mjpt777 committed Mar 7, 2022
1 parent 9b8c5db commit c24b793
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3475,12 +3475,12 @@ private void appendDecoderDisplay(
final String groupName = formatPropertyName(groupToken.name());
final String groupDecoderName = decoderName(groupToken.name());

append(sb, indent, "int " + groupName + "OriginalOffset = " + groupName + ".offset;");
append(sb, indent, "int " + groupName + "OriginalIndex = " + groupName + ".index;");

append(
sb, indent, "builder.append(\"" + groupName + Separator.KEY_VALUE + Separator.BEGIN_GROUP + "\");");
append(sb, indent, groupDecoderName + " " + groupName + " = " + groupName + "();");
append(sb, indent, "final int " + groupName + "OriginalOffset = " + groupName + ".offset;");
append(sb, indent, "final int " + groupName + "OriginalIndex = " + groupName + ".index;");
append(sb, indent, "final " + groupDecoderName + " " + groupName + " = " + groupName + "();");

append(sb, indent, "if (" + groupName + ".count() > 0)");
append(sb, indent, "{");
append(sb, indent, " while (" + groupName + ".hasNext())");
Expand All @@ -3490,10 +3490,11 @@ private void appendDecoderDisplay(
append(sb, indent, " }");
append(sb, indent, " builder.setLength(builder.length() - 1);");
append(sb, indent, "}");
Separator.END_GROUP.appendToGeneratedBuilder(sb, indent);

append(sb, indent, groupName + ".offset = " + groupName + "OriginalOffset;");
append(sb, indent, groupName + ".index = " + groupName + "OriginalIndex;");
Separator.END_GROUP.appendToGeneratedBuilder(sb, indent);


lengthBeforeLastGeneratedSeparator = sb.length();
Separator.FIELD.appendToGeneratedBuilder(sb, indent);
Expand Down

0 comments on commit c24b793

Please sign in to comment.