Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/jdk.jfr/share/classes/jdk/jfr/internal/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ private static enum TimespanUnit {
}
}

// Tjis method can't handle Long.MIN_VALUE because absolute value is negative
// handle Long.MIN_VALUE as a special case since its absolute value is negative
private static String formatDataAmount(String formatter, long amount) {
int exp = (int) (Math.log(Math.abs(amount)) / Math.log(1024));
int exp = (amount == Long.MIN_VALUE) ? 6 : (int) (Math.log(Math.abs(amount)) / Math.log(1024));
char unitPrefix = "kMGTPE".charAt(exp - 1);
return String.format(formatter, amount / Math.pow(1024, exp), unitPrefix);
}
Expand Down