Browse Source

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
tags/REL_3_7_BETA1
Nick Burch 14 years ago
parent
commit
47c7d08456

+ 2
- 2
src/scratchpad/src/org/apache/poi/hdgf/chunks/Chunk.java 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

+ 13
- 0
src/scratchpad/testcases/org/apache/poi/hdgf/TestHDGFCore.java 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 View File


Loading…
Cancel
Save