]> source.dussan.org Git - poi.git/commitdiff
findbugs fixes
authorAndreas Beeker <kiwiwings@apache.org>
Wed, 16 Mar 2016 22:10:27 +0000 (22:10 +0000)
committerAndreas Beeker <kiwiwings@apache.org>
Wed, 16 Mar 2016 22:10:27 +0000 (22:10 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1735319 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/poi/poifs/storage/BATBlock.java
src/java/org/apache/poi/sl/draw/DrawTextParagraph.java
src/java/org/apache/poi/util/HexDump.java

index b04591dde45bc9675f4430e20be7e562c473b2da..2aef116d6b57185677bf226f6ee2af51f8264856 100644 (file)
@@ -242,12 +242,13 @@ public final class BATBlock extends BigBlock {
      */
     public static long calculateMaximumSize(final POIFSBigBlockSize bigBlockSize,
           final int numBATs) {
-       long size = 1; // Header isn't FAT addressed
+       // Header isn't FAT addressed
+       long size = 1;
        
        // The header has up to 109 BATs, and extra ones are referenced
        //  from XBATs
        // However, all BATs can contain 128/1024 blocks
-       size += (numBATs * bigBlockSize.getBATEntriesPerBlock());
+       size += (((long)numBATs) * bigBlockSize.getBATEntriesPerBlock());
        
        // So far we've been in sector counts, turn into bytes
        return size * bigBlockSize.getBigBlockSize();
index 7b28bde58246bd159aa07faa8e043ee574d722ee..1ffa3cb94ce6448239f75d60b2ac1a2110499e6e 100644 (file)
@@ -122,11 +122,11 @@ public class DrawTextParagraph implements Drawable {
         Double leftMargin = paragraph.getLeftMargin();\r
         if (leftMargin == null) {\r
             // if the marL attribute is omitted, then a value of 347663 is implied\r
-            leftMargin = Units.toPoints(347663*indentLevel);\r
+            leftMargin = Units.toPoints(347663L*indentLevel);\r
         }\r
         Double indent = paragraph.getIndent();\r
         if (indent == null) {\r
-            indent = Units.toPoints(347663*indentLevel);\r
+            indent = Units.toPoints(347663L*indentLevel);\r
         }\r
         if (isHSLF()) {\r
             // special handling for HSLF\r
index e72a80ede48d3e8581a3f44a0913e9e025b9040d..d134b540f18eb6d6523173e2b969d121208a1dbe 100644 (file)
@@ -283,7 +283,7 @@ public class HexDump {
      * @return          The result right padded with 0
      */
     public static String toHex(int value) {
-        return xpad(value & 0xFFFFFFFF, 8, "");
+        return xpad(value & 0xFFFFFFFFL, 8, "");
     }
 
     /**