]> source.dussan.org Git - poi.git/commitdiff
Math.toIntExact is unnecessary because value is guaranteed to be between 0 and 15
authorAxel Howind <axh@apache.org>
Thu, 22 Feb 2024 20:56:03 +0000 (20:56 +0000)
committerAxel Howind <axh@apache.org>
Thu, 22 Feb 2024 20:56:03 +0000 (20:56 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1915959 13f79535-47bb-0310-9956-ffa450edef68

poi/src/main/java/org/apache/poi/util/HexDump.java

index f3ce580e4e720744b17e9fecf54248c84b301c05..a9a48c6836e752b5baae8cd0090fa571d793c21e 100644 (file)
@@ -294,7 +294,7 @@ public final class HexDump {
         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;
         }