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:28:29 UTC
svn commit: r904062 - in /poi/trunk:
src/scratchpad/src/org/apache/poi/hdgf/chunks/Chunk.java
src/scratchpad/testcases/org/apache/poi/hdgf/TestHDGFCore.java
test-data/diagram/44501.vsd
Author: nick
Date: Thu Jan 28 12:28:29 2010
New Revision: 904062
URL: http://svn.apache.org/viewvc?rev=904062&view=rev
Log:
Add a disabled test for bug #44501, which still remains, plus fix a generics warning
Added:
poi/trunk/test-data/diagram/44501.vsd (with props)
Modified:
poi/trunk/src/scratchpad/src/org/apache/poi/hdgf/chunks/Chunk.java
poi/trunk/src/scratchpad/testcases/org/apache/poi/hdgf/TestHDGFCore.java
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hdgf/chunks/Chunk.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hdgf/chunks/Chunk.java?rev=904062&r1=904061&r2=904062&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hdgf/chunks/Chunk.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hdgf/chunks/Chunk.java Thu Jan 28 12:28:29 2010
@@ -116,7 +116,7 @@
// 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 @@
}
// 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
Modified: poi/trunk/src/scratchpad/testcases/org/apache/poi/hdgf/TestHDGFCore.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hdgf/TestHDGFCore.java?rev=904062&r1=904061&r2=904062&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/testcases/org/apache/poi/hdgf/TestHDGFCore.java (original)
+++ poi/trunk/src/scratchpad/testcases/org/apache/poi/hdgf/TestHDGFCore.java Thu Jan 28 12:28:29 2010
@@ -77,4 +77,17 @@
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);
+ }
}
Added: poi/trunk/test-data/diagram/44501.vsd
URL: http://svn.apache.org/viewvc/poi/trunk/test-data/diagram/44501.vsd?rev=904062&view=auto
==============================================================================
Binary file - no diff available.
Propchange: poi/trunk/test-data/diagram/44501.vsd
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org