Hi, I'm writing to report a small documentation problem in the class
org.apache.poi.hssf.eventusermodel.AbortableHSSFListener, and possible
related bug. The javadoc that states the class is an interface, but the
code declares itself to be an abstract class. Because it's not an
interface, code in HSSFRequest might not be working per your expectations.
Here's the long version:
I am trying to solve the same problem that was discussed years ago on
the POI users list, namely reading 1 row from excel file:
http://mail-archives.apache.org/mod_mbox/poi-user/200608.mbox/%3cofa72d53de.1f179a06-on862571d9.004d5826-862571d9.004e2...@swbc.com%3e
I too have hit situations in which POI blows up the JVM with an
out-of-memory error. I confess I'm using the default -mx128Mb JVM args,
which many of you will probably laugh at, but I don't want or need to
have the whole thing in memory.
So the event user model seems the perfect solution to this problem,
especially when I discovered the AbortableHSSFListener feature. My
design is as follows: open the file, process records until the first row
is complete, then have the abortableProcessRecord() method return
nonzero to tell the HSSFEventFactory to stop processing.
What I see is that my abortableProcessRecord(Record) method is never
called. I looked into HSSFRequest at the processRecord(Record) method,
and I see that it checks whether the listener is an instance of
AbortableHSSFListener. But that's an abstract class (not an interface),
so I suspect the test always fails, and that just might explain why my
code does not work.
I am sending this to the poi user list, wich cc to the email addresses
that I found in the headers of those classes, I hope that is the right
thing to do. Please reply, and thanks for your time!!
chris...
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]