Skip to content

Commit

Permalink
Math.toIntExact is unnecessary because value is guaranteed to be betw…
Browse files Browse the repository at this point in the history
…een 0 and 15

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1915959 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
Axel Howind committed Feb 22, 2024
1 parent 17c6a1e commit 05af0e0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion poi/src/main/java/org/apache/poi/util/HexDump.java
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ private static void writeHex(StringBuilder sb, long value, int nDigits, String p
char[] buf = new char[nDigits];
long acc = value;
for(int i=nDigits-1; i>=0; i--) {
int digit = Math.toIntExact(acc & 0x0F);
int digit = (int) (acc & 0x0F);
buf[i] = (char) (digit < 10 ? ('0' + digit) : ('A' + digit - 10));
acc >>>= 4;
}
Expand Down

0 comments on commit 05af0e0

Please sign in to comment.