Skip to content

Commit 50e902a

Browse files
committed
varDataDisplay - use method getVarFieldName(Appendable) - no memory allocation. unlike calling method 'varFieldName' where it has new Byte and new String.
1 parent 94bdcf9 commit 50e902a

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/java/JavaGenerator.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3269,7 +3269,8 @@ private void appendDecoderDisplay(
32693269
}
32703270
else
32713271
{
3272-
append(sb, indent, "builder.append('\\'' + " + varDataName + "() + '\\'');");
3272+
//append(sb, indent, "builder.append('\\'' + " + varDataName + "() + '\\'');");
3273+
append(sb, indent, formatGetterName(varDataToken.name()) + "(builder);");
32733274
}
32743275

32753276
lengthBeforeLastGeneratedSeparator = sb.length();

sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/java/JavaUtil.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,18 @@ public static String formatPropertyName(final String value)
158158
return formattedValue;
159159
}
160160

161+
/**
162+
* Format a Getter name for generated code.
163+
* <p>
164+
*
165+
* @param value to be formatted.
166+
* @return the string formatted as a getter name.
167+
*/
168+
public static String formatGetterName(final String value)
169+
{
170+
return "get" + Generators.toUpperFirstChar(value);
171+
}
172+
161173
/**
162174
* Format a class name for the generated code.
163175
*

0 commit comments

Comments
 (0)