diff options
author | Andreas Beeker <kiwiwings@apache.org> | 2015-09-30 23:06:39 +0000 |
---|---|---|
committer | Andreas Beeker <kiwiwings@apache.org> | 2015-09-30 23:06:39 +0000 |
commit | fad6546d8a8172aaf197a95a4af086a387390fbb (patch) | |
tree | cb5dfa581dceb06959b03e825e6a1ea53c22c770 /src/java/org/apache/poi/poifs | |
parent | 5366f02c2c317bc6ddf65a9c9d9d33136c38bf49 (diff) | |
download | poi-fad6546d8a8172aaf197a95a4af086a387390fbb.tar.gz poi-fad6546d8a8172aaf197a95a4af086a387390fbb.zip |
sonar fixes
Very interesting was the exception swallowing in PackagePropertiesPart. When it was properly thrown, it already led to various errors in the junits test - I've fixed the handling for at least the ones which are in our test set
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1706169 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/poi/poifs')
-rw-r--r-- | src/java/org/apache/poi/poifs/filesystem/BlockStore.java | 2 | ||||
-rw-r--r-- | src/java/org/apache/poi/poifs/property/NPropertyTable.java | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/java/org/apache/poi/poifs/filesystem/BlockStore.java b/src/java/org/apache/poi/poifs/filesystem/BlockStore.java index 1da9b6a965..0ef8082270 100644 --- a/src/java/org/apache/poi/poifs/filesystem/BlockStore.java +++ b/src/java/org/apache/poi/poifs/filesystem/BlockStore.java @@ -80,7 +80,7 @@ public abstract class BlockStore { protected class ChainLoopDetector { private boolean[] used_blocks; protected ChainLoopDetector(long rawSize) { - int numBlocks = (int)Math.ceil( rawSize / getBlockStoreBlockSize() ); + int numBlocks = (int)Math.ceil( ((double)rawSize) / getBlockStoreBlockSize() ); used_blocks = new boolean[numBlocks]; } protected void claim(int offset) { diff --git a/src/java/org/apache/poi/poifs/property/NPropertyTable.java b/src/java/org/apache/poi/poifs/property/NPropertyTable.java index eb2e51458a..ec38ddecb2 100644 --- a/src/java/org/apache/poi/poifs/property/NPropertyTable.java +++ b/src/java/org/apache/poi/poifs/property/NPropertyTable.java @@ -120,7 +120,7 @@ public final class NPropertyTable extends PropertyTableBase { public int countBlocks() { int size = _properties.size() * POIFSConstants.PROPERTY_SIZE; - return (int)Math.ceil(size / _bigBigBlockSize.getBigBlockSize()); + return (int)Math.ceil( ((double)size) / _bigBigBlockSize.getBigBlockSize()); } /** |