findbugs fixes

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1735319 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Andreas Beeker 2016-03-16 22:10:27 +00:00
parent 4c4d718f52
commit d6d47e0bca
3 changed files with 6 additions and 5 deletions

View 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();

View File

@ -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

View 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, "");
}
/**