// Loop over the definitions, building the commands
// and getting their values
- ArrayList commands = new ArrayList();
+ ArrayList<Command> commands = new ArrayList<Command>();
for(int i=0; i<commandDefinitions.length; i++) {
int type = commandDefinitions[i].getType();
int offset = commandDefinitions[i].getOffset();
}
// Save the commands we liked the look of
- this.commands = (Command[])commands.toArray(
+ this.commands = commands.toArray(
new Command[commands.size()] );
// Now build up the blocks, if we had a command that tells
hdgf = new HDGFDiagram(fs);
assertNotNull(hdgf);
}
+
+ /**
+ * Tests that we can open a problematic file that triggers
+ * an ArrayIndexOutOfBoundsException when processing the
+ * chunk commands.
+ * @throws Exception
+ */
+ public void DISABLEDtestAIOOB() throws Exception {
+ fs = new POIFSFileSystem(_dgTests.openResourceAsStream("44501.vsd"));
+
+ HDGFDiagram hdgf = new HDGFDiagram(fs);
+ assertNotNull(hdgf);
+ }
}