Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Fixed
-
0.16.0
-
None
-
None
Description
The corrent code is:
public synchronized String makeCompactString() { StringBuffer buffer = new StringBuffer(); for(Group group: this){ boolean first = true; for(Counter counter: group) { if (first) { first = false; } else { buffer.append(','); } buffer.append(group.getDisplayName()); buffer.append('.'); buffer.append(counter.getDisplayName()); buffer.append('='); buffer.append(counter.getCounter()); } } return buffer.toString(); }
The correct code should be like:
public synchronized String makeCompactString() { StringBuffer buffer = new StringBuffer(); boolean first = true; for(Group group: this){ for(Counter counter: group) { if (first) { first = false; } else { buffer.append(','); } buffer.append(group.getDisplayName()); buffer.append('.'); buffer.append(counter.getDisplayName()); buffer.append('='); buffer.append(counter.getCounter()); } } return buffer.toString(); }