Add a disabled test for bug #44501, which still remains, plus fix a generics warning

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@904062 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Nick Burch 2010-01-28 12:28:29 +00:00
parent 069207f64e
commit 47c7d08456
3 changed files with 15 additions and 2 deletions

View File

@ -116,7 +116,7 @@ public final class Chunk {
// 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();
@ -232,7 +232,7 @@ public final class Chunk {
}
// 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

View File

@ -77,4 +77,17 @@ public final class TestHDGFCore extends TestCase {
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);
}
}

BIN
test-data/diagram/44501.vsd Normal file

Binary file not shown.