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);
/**
* 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.
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") ) {