aboutsummaryrefslogtreecommitdiffstats
path: root/src/scratchpad
diff options
context:
space:
mode:
authorDominik Stadler <centic@apache.org>2020-01-30 21:09:17 +0000
committerDominik Stadler <centic@apache.org>2020-01-30 21:09:17 +0000
commitd3767e1de7134aad5de8a6e207914b0ec7850edc (patch)
tree9b93943b1927cc12c54f6905aabcd021c27cd209 /src/scratchpad
parent522ee9c5545a80426d1e494204aee40541da8e01 (diff)
downloadpoi-d3767e1de7134aad5de8a6e207914b0ec7850edc.tar.gz
poi-d3767e1de7134aad5de8a6e207914b0ec7850edc.zip
Improve some assertions and error messages for exceptions seen in the regression tests
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1873385 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/scratchpad')
-rw-r--r--src/scratchpad/src/org/apache/poi/hpbf/model/HPBFPart.java4
-rw-r--r--src/scratchpad/src/org/apache/poi/hwpf/model/ComplexFileTable.java3
2 files changed, 4 insertions, 3 deletions
diff --git a/src/scratchpad/src/org/apache/poi/hpbf/model/HPBFPart.java b/src/scratchpad/src/org/apache/poi/hpbf/model/HPBFPart.java
index 2a19670f1f..ae6e8fdad7 100644
--- a/src/scratchpad/src/org/apache/poi/hpbf/model/HPBFPart.java
+++ b/src/scratchpad/src/org/apache/poi/hpbf/model/HPBFPart.java
@@ -60,7 +60,7 @@ public abstract class HPBFPart {
dir = (DirectoryNode)dir.getEntry(path[i]);
} catch (FileNotFoundException e) {
throw new IllegalArgumentException("File invalid - failed to find directory entry '"
- + path[i] + "'");
+ + path[i] + "': " + e);
}
}
return dir;
@@ -101,7 +101,7 @@ public abstract class HPBFPart {
public final byte[] getData() {
return data;
}
-
+
protected final void setData(byte[] data) {
this.data = data.clone();
}
diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/ComplexFileTable.java b/src/scratchpad/src/org/apache/poi/hwpf/model/ComplexFileTable.java
index ee6e15051d..adf2c75e5d 100644
--- a/src/scratchpad/src/org/apache/poi/hwpf/model/ComplexFileTable.java
+++ b/src/scratchpad/src/org/apache/poi/hwpf/model/ComplexFileTable.java
@@ -64,7 +64,8 @@ public class ComplexFileTable {
this._grpprls = sprmBuffers.toArray(new SprmBuffer[0]);
if (tableStream[offset] != TEXT_PIECE_TABLE_TYPE) {
- throw new IOException("The text piece table is corrupted");
+ throw new IOException("The text piece table is corrupted, expected byte value " + TEXT_PIECE_TABLE_TYPE +
+ " but had " + tableStream[offset]);
}
int pieceTableSize = LittleEndian.getInt(tableStream, ++offset);
offset += LittleEndian.INT_SIZE;