Your suggestion sounds sensible enough to me (without having found time to take a look at the code), +1.


Vincent Hennebert wrote:

Author: jeremias
Date: Fri Apr  3 07:44:09 2009
New Revision: 761554

Fixed a bug that left the PrintRenderer unconfigured even if a configuration was specified for "application/X-fop-print".
+    /** {...@inheritdoc} */
+    public String getMimeType() {
+        return MimeConstants.MIME_FOP_PRINT;
+    }

This method is defined in AbstractRenderer to return null. That makes me
wonder: is there a use case where you can expect a renderer to return
a null mime type?
The answer probably is no, in which case the definition of this method
should be removed from AbstractRenderer. That would force concrete
classes to implement a sensible getMimeType method and prevent this kind
of bug from occurring.
If I do it, the only class that no longer compiles is PageableRenderer.
Given that it is sub-classed by PrintRenderer and its constructor is not
called by external classes, I guess it can be made abstract.

Is that ok if I apply such changes?

Reply via email to