https://bz.apache.org/bugzilla/show_bug.cgi?id=60102

--- Comment #4 from Javen O'Neal <[email protected]> ---
Created attachment 34231
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=34231&action=edit
Replace OpenXML4J return boolean with throws OpenXML4JException

(In reply to Javen O'Neal from comment #3)
> I have not yet implemented throwing an exception when writing an open
> document to a closed output stream.
> OutputStream out;
> out.close();
> doc.write(out);

To get this one closed, we're going to have to make quite a few changes to 
methods in org.apache.poi.openxml4j.opc.internal.
These methods currently catch exceptions, occasionally log the error to the
POILogger, and then return a boolean success value.
These will need to be replaced with void-returning functions that raise an
exception. This will eliminate the need to check a return code, enable the POI
logger, and check the logs.

A quick glance at the source code history reveals that the OpenXML4j classes
have returned boolean success rather than throwing exceptions. Perhaps this is
because this library originated from a C project rewritten in Java without
replacing the C idioms with Java idioms.
https://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/marshallers/DefaultMarshaller.java?revision=738842&view=markup#l41

-- 
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]

Reply via email to