File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed
tc-messaging/src/main/java/com/tc/util Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -44,11 +44,7 @@ public class Conversion {
44
44
45
45
private static final Pattern MEMORY_SIZE_PATTERN = Pattern .compile ("[0-9]*([.][0-9]+)? *([bkmg])?" );
46
46
private static final Pattern SIZE_MODIFIER_PATTERN = Pattern .compile ("[bkmg]" );
47
- private final static DecimalFormat twoDForm = new DecimalFormat ();
48
47
private static final byte [] EMPTY_BYTE_ARRAY = new byte [] {};
49
- static {
50
- twoDForm .applyLocalizedPattern ("#" + new DecimalFormatSymbols ().getDecimalSeparator () + "##" );
51
- }
52
48
53
49
private static int makeInt (byte b3 , byte b2 , byte b1 , byte b0 ) {
54
50
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
430
426
}
431
427
432
428
public static String memoryBytesAsSize (long bytes ) throws NumberFormatException {
429
+ DecimalFormat twoDForm = new DecimalFormat ();
430
+ twoDForm .applyLocalizedPattern ("#" + new DecimalFormatSymbols ().getDecimalSeparator () + "##" );
433
431
if (bytes < KILO .asBytes ()) {
434
432
return bytes + "b" ;
435
433
} else if (bytes < MEGA .asBytes ()) {
You can’t perform that action at this time.
0 commit comments