aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/poi
diff options
context:
space:
mode:
authorAndreas Beeker <kiwiwings@apache.org>2016-03-16 22:10:27 +0000
committerAndreas Beeker <kiwiwings@apache.org>2016-03-16 22:10:27 +0000
commit5499c36019fb445253800404ea850ce64c658651 (patch)
treed87476f62656e384f9f6212b519837fe777bfeaf /src/java/org/apache/poi
parente6a96fd11d16bbadf9e2025cda713bf3b0ebae1f (diff)
downloadpoi-5499c36019fb445253800404ea850ce64c658651.tar.gz
poi-5499c36019fb445253800404ea850ce64c658651.zip
findbugs fixes
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1735319 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/poi')
-rw-r--r--src/java/org/apache/poi/poifs/storage/BATBlock.java5
-rw-r--r--src/java/org/apache/poi/sl/draw/DrawTextParagraph.java4
-rw-r--r--src/java/org/apache/poi/util/HexDump.java2
3 files changed, 6 insertions, 5 deletions
diff --git a/src/java/org/apache/poi/poifs/storage/BATBlock.java b/src/java/org/apache/poi/poifs/storage/BATBlock.java
index b04591dde4..2aef116d6b 100644
--- a/src/java/org/apache/poi/poifs/storage/BATBlock.java
+++ b/src/java/org/apache/poi/poifs/storage/BATBlock.java
@@ -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();
diff --git a/src/java/org/apache/poi/sl/draw/DrawTextParagraph.java b/src/java/org/apache/poi/sl/draw/DrawTextParagraph.java
index 7b28bde582..1ffa3cb94c 100644
--- a/src/java/org/apache/poi/sl/draw/DrawTextParagraph.java
+++ b/src/java/org/apache/poi/sl/draw/DrawTextParagraph.java
@@ -122,11 +122,11 @@ public class DrawTextParagraph implements Drawable {
Double leftMargin = paragraph.getLeftMargin();
if (leftMargin == null) {
// if the marL attribute is omitted, then a value of 347663 is implied
- leftMargin = Units.toPoints(347663*indentLevel);
+ leftMargin = Units.toPoints(347663L*indentLevel);
}
Double indent = paragraph.getIndent();
if (indent == null) {
- indent = Units.toPoints(347663*indentLevel);
+ indent = Units.toPoints(347663L*indentLevel);
}
if (isHSLF()) {
// special handling for HSLF
diff --git a/src/java/org/apache/poi/util/HexDump.java b/src/java/org/apache/poi/util/HexDump.java
index e72a80ede4..d134b540f1 100644
--- a/src/java/org/apache/poi/util/HexDump.java
+++ b/src/java/org/apache/poi/util/HexDump.java
@@ -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, "");
}
/**