You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ni...@apache.org on 2010/01/28 13:00:39 UTC
svn commit: r904049 - in /poi/trunk/src:
java/org/apache/poi/util/StringUtil.java
scratchpad/src/org/apache/poi/hdgf/chunks/ChunkFactory.java
Author: nick
Date: Thu Jan 28 12:00:38 2010
New Revision: 904049
URL: http://svn.apache.org/viewvc?rev=904049&view=rev
Log:
Improve error message, and fix generics warnings
Modified:
poi/trunk/src/java/org/apache/poi/util/StringUtil.java
poi/trunk/src/scratchpad/src/org/apache/poi/hdgf/chunks/ChunkFactory.java
Modified: poi/trunk/src/java/org/apache/poi/util/StringUtil.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/util/StringUtil.java?rev=904049&r1=904048&r2=904049&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/util/StringUtil.java (original)
+++ poi/trunk/src/java/org/apache/poi/util/StringUtil.java Thu Jan 28 12:00:38 2010
@@ -67,7 +67,7 @@
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);
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hdgf/chunks/ChunkFactory.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hdgf/chunks/ChunkFactory.java?rev=904049&r1=904048&r2=904049&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hdgf/chunks/ChunkFactory.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hdgf/chunks/ChunkFactory.java Thu Jan 28 12:00:38 2010
@@ -41,7 +41,8 @@
/**
* Key is a Chunk's type, value is an array of its CommandDefinitions
*/
- private Hashtable chunkCommandDefinitions = new Hashtable();
+ private Hashtable<Integer, CommandDefinition[]> chunkCommandDefinitions =
+ new Hashtable<Integer, CommandDefinition[]>();
/**
* What the name is of the chunk table definitions file?
* This file comes from the scratchpad resources directory.
@@ -81,7 +82,7 @@
throw new IllegalStateException("Expecting start xxx, found " + line);
}
int chunkType = Integer.parseInt(line.substring(6));
- ArrayList defsL = new ArrayList();
+ ArrayList<CommandDefinition> defsL = new ArrayList<CommandDefinition>();
// Data entries
while( ! (line = inp.readLine()).startsWith("end") ) {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org