From 2880d934f96a4346f33e80c62ea283a10f835acf Mon Sep 17 00:00:00 2001 From: Nick Burch Date: Thu, 28 Jan 2010 12:00:38 +0000 Subject: [PATCH] Improve error message, and fix generics warnings git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@904049 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/poi/util/StringUtil.java | 2 +- .../src/org/apache/poi/hdgf/chunks/ChunkFactory.java | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/java/org/apache/poi/util/StringUtil.java b/src/java/org/apache/poi/util/StringUtil.java index 62e42c2a2..81568fe9c 100644 --- a/src/java/org/apache/poi/util/StringUtil.java +++ b/src/java/org/apache/poi/util/StringUtil.java @@ -67,7 +67,7 @@ public class StringUtil { final int len) throws ArrayIndexOutOfBoundsException, IllegalArgumentException { if ((offset < 0) || (offset >= string.length)) { - throw new ArrayIndexOutOfBoundsException("Illegal offset"); + throw new ArrayIndexOutOfBoundsException("Illegal offset " + offset + " (String data is of length " + string.length + ")"); } if ((len < 0) || (((string.length - offset) / 2) < len)) { throw new IllegalArgumentException("Illegal length " + len); diff --git a/src/scratchpad/src/org/apache/poi/hdgf/chunks/ChunkFactory.java b/src/scratchpad/src/org/apache/poi/hdgf/chunks/ChunkFactory.java index 3bc35883d..55cb5a7f1 100644 --- a/src/scratchpad/src/org/apache/poi/hdgf/chunks/ChunkFactory.java +++ b/src/scratchpad/src/org/apache/poi/hdgf/chunks/ChunkFactory.java @@ -41,7 +41,8 @@ public final class ChunkFactory { /** * Key is a Chunk's type, value is an array of its CommandDefinitions */ - private Hashtable chunkCommandDefinitions = new Hashtable(); + private Hashtable chunkCommandDefinitions = + new Hashtable(); /** * What the name is of the chunk table definitions file? * This file comes from the scratchpad resources directory. @@ -81,7 +82,7 @@ public final class ChunkFactory { throw new IllegalStateException("Expecting start xxx, found " + line); } int chunkType = Integer.parseInt(line.substring(6)); - ArrayList defsL = new ArrayList(); + ArrayList defsL = new ArrayList(); // Data entries while( ! (line = inp.readLine()).startsWith("end") ) {