File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed
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 @@ -30,11 +30,7 @@ public class Conversion {
30
30
31
31
private static final Pattern MEMORY_SIZE_PATTERN = Pattern .compile ("[0-9]*([.][0-9]+)? *([bkmg])?" );
32
32
private static final Pattern SIZE_MODIFIER_PATTERN = Pattern .compile ("[bkmg]" );
33
- private final static DecimalFormat twoDForm = new DecimalFormat ();
34
33
private static final byte [] EMPTY_BYTE_ARRAY = new byte [] {};
35
- static {
36
- twoDForm .applyLocalizedPattern ("#" + new DecimalFormatSymbols ().getDecimalSeparator () + "##" );
37
- }
38
34
39
35
private static int makeInt (byte b3 , byte b2 , byte b1 , byte b0 ) {
40
36
return ((((b3 & 0xff ) << 24 ) | ((b2 & 0xff ) << 16 ) | ((b1 & 0xff ) << 8 ) | ((b0 & 0xff ) << 0 )));
@@ -416,6 +412,8 @@ public static long memorySizeAsLongBytes(String memorySizeInUnits) throws Metric
416
412
}
417
413
418
414
public static String memoryBytesAsSize (long bytes ) throws NumberFormatException {
415
+ DecimalFormat twoDForm = new DecimalFormat ();
416
+ twoDForm .applyLocalizedPattern ("#" + new DecimalFormatSymbols ().getDecimalSeparator () + "##" );
419
417
if (bytes < KILO .asBytes ()) {
420
418
return bytes + "b" ;
421
419
} else if (bytes < MEGA .asBytes ()) {
You can’t perform that action at this time.
0 commit comments