Return-Path: Delivered-To: apmail-jakarta-poi-dev-archive@www.apache.org Received: (qmail 27008 invoked from network); 21 Oct 2004 06:27:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 21 Oct 2004 06:27:49 -0000 Received: (qmail 34558 invoked by uid 500); 21 Oct 2004 06:27:48 -0000 Delivered-To: apmail-jakarta-poi-dev-archive@jakarta.apache.org Received: (qmail 34500 invoked by uid 500); 21 Oct 2004 06:27:47 -0000 Mailing-List: contact poi-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "POI Developers List" Reply-To: "POI Developers List" Delivered-To: mailing list poi-dev@jakarta.apache.org Received: (qmail 34484 invoked by uid 99); 21 Oct 2004 06:27:46 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [192.18.33.10] (HELO exchange.sun.com) (192.18.33.10) by apache.org (qpsmtpd/0.28) with SMTP; Wed, 20 Oct 2004 23:27:44 -0700 Received: (qmail 575 invoked by uid 50); 21 Oct 2004 06:29:46 -0000 Date: 21 Oct 2004 06:29:46 -0000 Message-ID: <20041021062946.574.qmail@nagoya.betaversion.org> From: bugzilla@apache.org To: poi-dev@jakarta.apache.org Cc: Subject: DO NOT REPLY [Bug 31821] New: - EscherArrayProperty class throws ArayIndexoutofbounds exception. X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT . ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=31821 EscherArrayProperty class throws ArayIndexoutofbounds exception. Summary: EscherArrayProperty class throws ArayIndexoutofbounds exception. Product: POI Version: 2.5 Platform: Other OS/Version: Windows XP Status: NEW Severity: Critical Priority: Other Component: HSSF AssignedTo: poi-dev@jakarta.apache.org ReportedBy: ash_sha_21@yahoo.com I am getting a exception when i am trying to biff view xls file. java.lang.ArrayIndexOutOfBoundsException at java.lang.System.arraycopy(Native Method) at org.apache.poi.ddf.EscherArrayProperty.getElement (EscherArrayProperty .java:111) at org.apache.poi.ddf.EscherArrayProperty.toString (EscherArrayProperty.j ava:146) at org.apache.poi.ddf.EscherOptRecord.toString (EscherOptRecord.java:138) at org.apache.poi.ddf.EscherContainerRecord.toString (EscherContainerReco rd.java:158) at org.apache.poi.hssf.record.AbstractEscherHolderRecord.toString (Abstra ctEscherHolderRecord.java:126) at org.apache.poi.hssf.dev.BiffViewer.dumpNormal(BiffViewer.java:148) at org.apache.poi.hssf.dev.BiffViewer.access$1(BiffViewer.java:144) at org.apache.poi.hssf.dev.BiffViewer$RecordDetails.dump (BiffViewer.java :700) at org.apache.poi.hssf.dev.BiffViewer.createRecords (BiffViewer.java:120) at org.apache.poi.hssf.dev.BiffViewer.run(BiffViewer.java:73) at org.apache.poi.hssf.dev.BiffViewer.main(BiffViewer.java:652) I just debugged a little and found a strange thing Here is the modified code i used to debug public byte[] getElement( int index ) { int actualSize = getActualSizeOfElements(getSizeOfElements()); byte[] result = new byte[actualSize]; try { System.arraycopy(complexData, FIXED_SIZE + index * actualSize, result, 0, result.length ); //System.arraycopy(complexData, 0, result, 0, result.length ); } catch (Exception exception) { System.out.println("================"); System.out.println("src array total length = "+complexData.length); //System.out.println("src position = "+FIXED_SIZE + index * actualSize); System.out.println("FIXED_SIZE "+FIXED_SIZE); System.out.println("index "+index); System.out.println("actualSize "+actualSize); System.out.println("dest array len = "+result.length); System.out.println("length = "+result.length); System.out.println("================="); } The results are surprising.. here are they src array total length = 6 FIXED_SIZE 6 index 7 actualSize 1290 dest array len = 1290 length = 1290 ================= ================ src array total length = 6 FIXED_SIZE 6 index 8 actualSize 1290 dest array len = 1290 length = 1290 ================= ================ src array total length = 6 FIXED_SIZE 6 index 9 actualSize 1290 dest array len = 1290 length = 1290 ================= ================ src array total length = 6 FIXED_SIZE 6 index 10 actualSize 1290 dest array len = 1290 length = 1290 ================= ================ src array total length = 6 FIXED_SIZE 6 index 11 actualSize 1290 dest array len = 1290 length = 1290 ================= ================ src array total length = 6 FIXED_SIZE 6 index 12 actualSize 1290 dest array len = 1290 length = 1290 ================= So is the logic System.arraycopy(complexData, FIXED_SIZE + index * actualSize, result, 0, result.length ); correct?? --------------------------------------------------------------------- To unsubscribe, e-mail: poi-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: poi-dev-help@jakarta.apache.org