You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Matt Benson (JIRA)" <de...@myfaces.apache.org> on 2011/05/06 23:10:03 UTC
[jira] [Created] (MYFACES-3132)
javax.faces.context.ResponseWriterWrapper implementation is overdone
javax.faces.context.ResponseWriterWrapper implementation is overdone
--------------------------------------------------------------------
Key: MYFACES-3132
URL: https://issues.apache.org/jira/browse/MYFACES-3132
Project: MyFaces Core
Issue Type: Bug
Reporter: Matt Benson
When using IceFaces an NPE is encountered when one of the lower-level Writer calls is made against its DomResponseWriter (specifically this was a result of HtmlRendererUtils.renderSelectOptions() calling writer.write(TABULATOR)). This is because java.io.Writer delegates all forms of #write() back to the abstract write(char[], int, int) variant. MyFaces' version of ResponseWriterWrapper implements write(int) directly, whereas the spec actually not does declare this method as being implemented here and thus allows the default implementation from Writer to delegate to the char[], int, int version. Since the MyFaces version calls getWrapped().write(int), an NPE is thrown that would be avoided if IceFaces were permitted to proceed through the call sequence as implicitly promised by the spec. True implementation of the spec requires deleting each of:
* append(char)
* append(CharSequence)
* append(CharSequence, int, int)
* write(char[])
* write(int)
* write(String)
* write(String, int, int)
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Resolved] (MYFACES-3132)
javax.faces.context.ResponseWriterWrapper implementation is overdone
Posted by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org>.
[ https://issues.apache.org/jira/browse/MYFACES-3132?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Leonardo Uribe resolved MYFACES-3132.
-------------------------------------
Resolution: Fixed
Fix Version/s: 2.1.0
2.0.6
Assignee: Leonardo Uribe
The base javadoc of java.io.Writer says this:
"... Abstract class for writing to character streams. The only methods that a subclass must implement are write(char[], int, int), flush(), and close(). Most subclasses, however, will override some of the methods defined here in order to provide higher efficiency, additional functionality, or both..."
so all other methods are not necessary to implement for javax.faces.context.ResponseWriterWrapper class.
> javax.faces.context.ResponseWriterWrapper implementation is overdone
> --------------------------------------------------------------------
>
> Key: MYFACES-3132
> URL: https://issues.apache.org/jira/browse/MYFACES-3132
> Project: MyFaces Core
> Issue Type: Bug
> Reporter: Matt Benson
> Assignee: Leonardo Uribe
> Fix For: 2.0.6, 2.1.0
>
> Attachments: MYFACES-3132-1.patch
>
>
> When using IceFaces an NPE is encountered when one of the lower-level Writer calls is made against its DomResponseWriter (specifically this was a result of HtmlRendererUtils.renderSelectOptions() calling writer.write(TABULATOR)). This is because java.io.Writer delegates all forms of #write() back to the abstract write(char[], int, int) variant. MyFaces' version of ResponseWriterWrapper implements write(int) directly, whereas the spec actually not does declare this method as being implemented here and thus allows the default implementation from Writer to delegate to the char[], int, int version. Since the MyFaces version calls getWrapped().write(int), an NPE is thrown that would be avoided if IceFaces were permitted to proceed through the call sequence as implicitly promised by the spec. True implementation of the spec requires deleting each of:
> * append(char)
> * append(CharSequence)
> * append(CharSequence, int, int)
> * write(char[])
> * write(int)
> * write(String)
> * write(String, int, int)
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (MYFACES-3132)
javax.faces.context.ResponseWriterWrapper implementation is overdone
Posted by "Matt Benson (JIRA)" <de...@myfaces.apache.org>.
[ https://issues.apache.org/jira/browse/MYFACES-3132?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13030904#comment-13030904 ]
Matt Benson commented on MYFACES-3132:
--------------------------------------
I do feel it is important to distinguish the fact that MyFaces' implementation of the javax.faces APIs should _exactly_ implement the specification, making the implemention of these methods a deficit rather than a benefit. This would likely almost never be the case with any "normal" situation. In any event, thanks for addressing this!
> javax.faces.context.ResponseWriterWrapper implementation is overdone
> --------------------------------------------------------------------
>
> Key: MYFACES-3132
> URL: https://issues.apache.org/jira/browse/MYFACES-3132
> Project: MyFaces Core
> Issue Type: Bug
> Reporter: Matt Benson
> Assignee: Leonardo Uribe
> Fix For: 2.0.6, 2.1.0
>
> Attachments: MYFACES-3132-1.patch
>
>
> When using IceFaces an NPE is encountered when one of the lower-level Writer calls is made against its DomResponseWriter (specifically this was a result of HtmlRendererUtils.renderSelectOptions() calling writer.write(TABULATOR)). This is because java.io.Writer delegates all forms of #write() back to the abstract write(char[], int, int) variant. MyFaces' version of ResponseWriterWrapper implements write(int) directly, whereas the spec actually not does declare this method as being implemented here and thus allows the default implementation from Writer to delegate to the char[], int, int version. Since the MyFaces version calls getWrapped().write(int), an NPE is thrown that would be avoided if IceFaces were permitted to proceed through the call sequence as implicitly promised by the spec. True implementation of the spec requires deleting each of:
> * append(char)
> * append(CharSequence)
> * append(CharSequence, int, int)
> * write(char[])
> * write(int)
> * write(String)
> * write(String, int, int)
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (MYFACES-3132)
javax.faces.context.ResponseWriterWrapper implementation is overdone
Posted by "Matt Benson (JIRA)" <de...@myfaces.apache.org>.
[ https://issues.apache.org/jira/browse/MYFACES-3132?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13032006#comment-13032006 ]
Matt Benson commented on MYFACES-3132:
--------------------------------------
I think the problem that was caused by this has indeed been solved. This, however, seems to be only the tip of the iceberg wrt making Icefaces compatible with MyFaces, but we shall see.
Thanks!
> javax.faces.context.ResponseWriterWrapper implementation is overdone
> --------------------------------------------------------------------
>
> Key: MYFACES-3132
> URL: https://issues.apache.org/jira/browse/MYFACES-3132
> Project: MyFaces Core
> Issue Type: Bug
> Reporter: Matt Benson
> Assignee: Leonardo Uribe
> Fix For: 2.0.6, 2.1.0
>
> Attachments: MYFACES-3132-1.patch
>
>
> When using IceFaces an NPE is encountered when one of the lower-level Writer calls is made against its DomResponseWriter (specifically this was a result of HtmlRendererUtils.renderSelectOptions() calling writer.write(TABULATOR)). This is because java.io.Writer delegates all forms of #write() back to the abstract write(char[], int, int) variant. MyFaces' version of ResponseWriterWrapper implements write(int) directly, whereas the spec actually not does declare this method as being implemented here and thus allows the default implementation from Writer to delegate to the char[], int, int version. Since the MyFaces version calls getWrapped().write(int), an NPE is thrown that would be avoided if IceFaces were permitted to proceed through the call sequence as implicitly promised by the spec. True implementation of the spec requires deleting each of:
> * append(char)
> * append(CharSequence)
> * append(CharSequence, int, int)
> * write(char[])
> * write(int)
> * write(String)
> * write(String, int, int)
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira