Skip to content

Commit f69d92b

Browse files
authored
Merge pull request #843 from quickfix-j/replace-integer-tostring
Replaced `Integer.toString()` by `NumbersCache.get()` where applicable
2 parents 53efb6d + 2b8aea5 commit f69d92b

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

quickfixj-base/src/main/java/quickfix/FieldMap.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ protected void setGroupCount(int countTag, int groupSize) {
643643
} else {
644644
count = getField(countTag);
645645
}
646-
count.setValue(Integer.toString(groupSize));
646+
count.setValue(NumbersCache.get(groupSize));
647647
} catch (final FieldNotFound e) {
648648
// Shouldn't happen
649649
throw new RuntimeError(e);

quickfixj-base/src/main/java/quickfix/Message.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ private void toXMLFields(Element message, String section, FieldMap fieldMap,
410410
fieldElement.setAttribute("enum", enumValue);
411411
}
412412
}
413-
fieldElement.setAttribute("tag", Integer.toString(field.getTag()));
413+
fieldElement.setAttribute("tag", NumbersCache.get(field.getTag()));
414414
final CDATASection value = document.createCDATASection(field.getObject().toString());
415415
fieldElement.appendChild(value);
416416
fields.appendChild(fieldElement);
@@ -424,7 +424,7 @@ private void toXMLFields(Element message, String section, FieldMap fieldMap,
424424
groupsElement.setAttribute("name", name);
425425
}
426426
}
427-
groupsElement.setAttribute("tag", Integer.toString(groupKey));
427+
groupsElement.setAttribute("tag", NumbersCache.get(groupKey));
428428
final List<Group> groups = fieldMap.getGroups(groupKey);
429429
for (Group group : groups) {
430430
toXMLFields(groupsElement, "group", group, dataDictionary);

quickfixj-base/src/main/java/quickfix/MessageUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ static Message getMinimalMessage(String messageString) {
173173

174174
public static String getStringField(String messageString, int tag) {
175175
String value = null;
176-
final String tagString = Integer.toString(tag);
176+
final String tagString = NumbersCache.get(tag);
177177
int start = messageString.indexOf(tagString, 0);
178178
while (start != -1 && value == null) {
179179
if ((start == 0 || messageString.charAt(start - 1) == FIELD_SEPARATOR)) {

0 commit comments

Comments
 (0)