https://issues.apache.org/bugzilla/show_bug.cgi?id=47488
Summary: java.lang.StringIndexOutOfBoundsException in
org.apache.poi.hwpf.usermodel.TableRow
Product: POI
Version: 3.5-dev
Platform: PC
OS/Version: Windows XP
Status: NEW
Severity: critical
Priority: P1
Component: HWPF
AssignedTo: [email protected]
ReportedBy: [email protected]
"2.doc" absolutely correct Word Doc file.
public class DocPassParser {
public static void main(String args[]) {
FileInputStream fis = null;
BufferedInputStream bufIStream = null;
try {
String filename = "D:\\Convertors\\DocPassParser\\2.doc";
fis = new FileInputStream(filename);
bufIStream = new BufferedInputStream(fis);
HWPFDocument doc = new HWPFDocument(bufIStream);
Range r = doc.getRange();
TableIterator tableIterator = new TableIterator(r);
int tableCounter = 0;
while (tableIterator.hasNext()) {
System.out.println("TABLE № "+(++tableCounter));
Table table = tableIterator.next(); // here !!!
....
TABLE № 8
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String
index out of range: -1
at java.lang.String.charAt(String.java:558)
at org.apache.poi.hwpf.usermodel.TableRow.<init>(TableRow.java:53)
at org.apache.poi.hwpf.usermodel.Table.<init>(Table.java:42)
at org.apache.poi.hwpf.usermodel.TableIterator.next(TableIterator.java:72)
at test.docpassparser.DocPassParser.main(DocPassParser.java:21)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]