Skip to content

Commit 6e89dd9

Browse files
author
Myron Scott
committed
Merge branch 'update_conv' into merge_update_conv_main
2 parents 8691f7e + 11f659f commit 6e89dd9

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

tc-messaging/src/main/java/com/tc/util/Conversion.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,7 @@ public class Conversion {
4444

4545
private static final Pattern MEMORY_SIZE_PATTERN = Pattern.compile("[0-9]*([.][0-9]+)? *([bkmg])?");
4646
private static final Pattern SIZE_MODIFIER_PATTERN = Pattern.compile("[bkmg]");
47-
private final static DecimalFormat twoDForm = new DecimalFormat();
4847
private static final byte[] EMPTY_BYTE_ARRAY = new byte[] {};
49-
static {
50-
twoDForm.applyLocalizedPattern("#" + new DecimalFormatSymbols().getDecimalSeparator() + "##");
51-
}
5248

5349
private static int makeInt(byte b3, byte b2, byte b1, byte b0) {
5450
return ((((b3 & 0xff) << 24) | ((b2 & 0xff) << 16) | ((b1 & 0xff) << 8) | ((b0 & 0xff) << 0)));
@@ -430,6 +426,8 @@ public static long memorySizeAsLongBytes(String memorySizeInUnits) throws Metric
430426
}
431427

432428
public static String memoryBytesAsSize(long bytes) throws NumberFormatException {
429+
DecimalFormat twoDForm = new DecimalFormat();
430+
twoDForm.applyLocalizedPattern("#" + new DecimalFormatSymbols().getDecimalSeparator() + "##");
433431
if (bytes < KILO.asBytes()) {
434432
return bytes + "b";
435433
} else if (bytes < MEGA.asBytes()) {

0 commit comments

Comments
 (0)