File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
src/jdk.jfr/share/classes/jdk/jfr/internal Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -126,11 +126,13 @@ private static enum TimespanUnit {
126126 }
127127 }
128128
129- // handle Long.MIN_VALUE as a special case since its absolute value is negative
130129 private static String formatDataAmount (String formatter , long amount ) {
131- int exp = (amount == Long .MIN_VALUE ) ? 6 : (int ) (Math .log (Math .abs (amount )) / Math .log (1024 ));
132- char unitPrefix = "kMGTPE" .charAt (exp - 1 );
133- return String .format (formatter , amount / Math .pow (1024 , exp ), unitPrefix );
130+ if (amount == Long .MIN_VALUE ) {
131+ return "N/A" ;
132+ }
133+ int exp = (int ) (Math .log (Math .abs (amount )) / Math .log (1024 ));
134+ char unit = "kMGTPE" .charAt (exp - 1 );
135+ return String .format (formatter , amount / Math .pow (1024 , exp ), unit );
134136 }
135137
136138 public static String formatBytesCompact (long bytes ) {
You can’t perform that action at this time.
0 commit comments