You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Alex Yavorskiy (Created) (JIRA)" <ji...@apache.org> on 2011/10/25 17:50:32 UTC

[jira] [Created] (WW-3694) JSONResult - buildSMDObject method is never called internally

JSONResult - buildSMDObject method is never called internally
-------------------------------------------------------------

                 Key: WW-3694
                 URL: https://issues.apache.org/jira/browse/WW-3694
             Project: Struts 2
          Issue Type: Bug
          Components: Plugin - JSON
    Affects Versions: 2.2.3.1
         Environment: Tomcat on windows, JDK1.5
            Reporter: Alex Yavorskiy


Pre version 2.2.3.1 JSONResult object used to have a protected method that allowed us to have a subclass that could modify URL of the SMD command being sent in the response right before it was sent. That method was "writeSMD". In version 2.2.3.1 of Struts there is no more method named "writeSMD", but there appears to be equivalent protected method named "buildSMDObject". However, we observed that buildSMDObject is never called by the infrastructure, so there is no use overriding it.

After inspecting source for JSONResult, it looks like line 180 in the readRootObject function is really intended to call buildSMDObject. However, instead of calling the protected method in question, it creates SMD object right there.

 if (enableSMD) {
            return new SMDGenerator(root, excludeProperties, ignoreInterfaces).generate(invocation);
        }

Fixing line 180 to call buildSMDObject should fix the issue. We had to significantly re-write our subclass for JSONResult to work around the deficiency. Hope this can be fixed in a future release.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (WW-3694) JSONResult - buildSMDObject method is never called internally

Posted by "Lukasz Lenart (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WW-3694?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13135767#comment-13135767 ] 

Lukasz Lenart commented on WW-3694:
-----------------------------------

@Maurizio I made a simple mistake during refactoring :-(
The patch looks good for me as well :-)
                
> JSONResult - buildSMDObject method is never called internally
> -------------------------------------------------------------
>
>                 Key: WW-3694
>                 URL: https://issues.apache.org/jira/browse/WW-3694
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - JSON
>    Affects Versions: 2.2.3.1
>         Environment: Tomcat on windows, JDK1.5
>            Reporter: Alex Yavorskiy
>         Attachments: WW-3694.patch
>
>
> Pre version 2.2.3.1 JSONResult object used to have a protected method that allowed us to have a subclass that could modify URL of the SMD command being sent in the response right before it was sent. That method was "writeSMD". In version 2.2.3.1 of Struts there is no more method named "writeSMD", but there appears to be equivalent protected method named "buildSMDObject". However, we observed that buildSMDObject is never called by the infrastructure, so there is no use overriding it.
> After inspecting source for JSONResult, it looks like line 180 in the readRootObject function is really intended to call buildSMDObject. However, instead of calling the protected method in question, it creates SMD object right there.
>  if (enableSMD) {
>             return new SMDGenerator(root, excludeProperties, ignoreInterfaces).generate(invocation);
>         }
> Fixing line 180 to call buildSMDObject should fix the issue. We had to significantly re-write our subclass for JSONResult to work around the deficiency. Hope this can be fixed in a future release.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (WW-3694) JSONResult - buildSMDObject method is never called internally

Posted by "Maurizio Cucchiara (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WW-3694?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Maurizio Cucchiara updated WW-3694:
-----------------------------------

    Attachment: WW-3694.patch

Calling directly {{buildSMD}} would risk to loop infinitely. 
Please check the attached patch and let me know what you think about.

                
> JSONResult - buildSMDObject method is never called internally
> -------------------------------------------------------------
>
>                 Key: WW-3694
>                 URL: https://issues.apache.org/jira/browse/WW-3694
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - JSON
>    Affects Versions: 2.2.3.1
>         Environment: Tomcat on windows, JDK1.5
>            Reporter: Alex Yavorskiy
>         Attachments: WW-3694.patch
>
>
> Pre version 2.2.3.1 JSONResult object used to have a protected method that allowed us to have a subclass that could modify URL of the SMD command being sent in the response right before it was sent. That method was "writeSMD". In version 2.2.3.1 of Struts there is no more method named "writeSMD", but there appears to be equivalent protected method named "buildSMDObject". However, we observed that buildSMDObject is never called by the infrastructure, so there is no use overriding it.
> After inspecting source for JSONResult, it looks like line 180 in the readRootObject function is really intended to call buildSMDObject. However, instead of calling the protected method in question, it creates SMD object right there.
>  if (enableSMD) {
>             return new SMDGenerator(root, excludeProperties, ignoreInterfaces).generate(invocation);
>         }
> Fixing line 180 to call buildSMDObject should fix the issue. We had to significantly re-write our subclass for JSONResult to work around the deficiency. Hope this can be fixed in a future release.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (WW-3694) JSONResult - buildSMDObject method is never called internally

Posted by "Maurizio Cucchiara (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WW-3694?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Maurizio Cucchiara resolved WW-3694.
------------------------------------

       Resolution: Fixed
    Fix Version/s: 2.3
         Assignee: Maurizio Cucchiara

Patch applied!
Thanks to Alex for the submission and  thanks to Lukasz for his feedback.

                
> JSONResult - buildSMDObject method is never called internally
> -------------------------------------------------------------
>
>                 Key: WW-3694
>                 URL: https://issues.apache.org/jira/browse/WW-3694
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - JSON
>    Affects Versions: 2.2.3.1
>         Environment: Tomcat on windows, JDK1.5
>            Reporter: Alex Yavorskiy
>            Assignee: Maurizio Cucchiara
>             Fix For: 2.3
>
>         Attachments: WW-3694.patch
>
>
> Pre version 2.2.3.1 JSONResult object used to have a protected method that allowed us to have a subclass that could modify URL of the SMD command being sent in the response right before it was sent. That method was "writeSMD". In version 2.2.3.1 of Struts there is no more method named "writeSMD", but there appears to be equivalent protected method named "buildSMDObject". However, we observed that buildSMDObject is never called by the infrastructure, so there is no use overriding it.
> After inspecting source for JSONResult, it looks like line 180 in the readRootObject function is really intended to call buildSMDObject. However, instead of calling the protected method in question, it creates SMD object right there.
>  if (enableSMD) {
>             return new SMDGenerator(root, excludeProperties, ignoreInterfaces).generate(invocation);
>         }
> Fixing line 180 to call buildSMDObject should fix the issue. We had to significantly re-write our subclass for JSONResult to work around the deficiency. Hope this can be fixed in a future release.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (WW-3694) JSONResult - buildSMDObject method is never called internally

Posted by "Hudson (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WW-3694?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13136035#comment-13136035 ] 

Hudson commented on WW-3694:
----------------------------

Integrated in Struts2 #367 (See [https://builds.apache.org/job/Struts2/367/])
    WW-3694 - JSONResult - buildSMDObject method is never called internally

mcucchiara : 
Files : 
* /struts/struts2/trunk/plugins/json/src/main/java/org/apache/struts2/json/JSONResult.java

                
> JSONResult - buildSMDObject method is never called internally
> -------------------------------------------------------------
>
>                 Key: WW-3694
>                 URL: https://issues.apache.org/jira/browse/WW-3694
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - JSON
>    Affects Versions: 2.2.3.1
>         Environment: Tomcat on windows, JDK1.5
>            Reporter: Alex Yavorskiy
>            Assignee: Maurizio Cucchiara
>             Fix For: 2.3
>
>         Attachments: WW-3694.patch
>
>
> Pre version 2.2.3.1 JSONResult object used to have a protected method that allowed us to have a subclass that could modify URL of the SMD command being sent in the response right before it was sent. That method was "writeSMD". In version 2.2.3.1 of Struts there is no more method named "writeSMD", but there appears to be equivalent protected method named "buildSMDObject". However, we observed that buildSMDObject is never called by the infrastructure, so there is no use overriding it.
> After inspecting source for JSONResult, it looks like line 180 in the readRootObject function is really intended to call buildSMDObject. However, instead of calling the protected method in question, it creates SMD object right there.
>  if (enableSMD) {
>             return new SMDGenerator(root, excludeProperties, ignoreInterfaces).generate(invocation);
>         }
> Fixing line 180 to call buildSMDObject should fix the issue. We had to significantly re-write our subclass for JSONResult to work around the deficiency. Hope this can be fixed in a future release.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (WW-3694) JSONResult - buildSMDObject method is never called internally

Posted by "Alex Yavorskiy (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WW-3694?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13135654#comment-13135654 ] 

Alex Yavorskiy commented on WW-3694:
------------------------------------

I think that looks good. 

Sent from my iPad



                
> JSONResult - buildSMDObject method is never called internally
> -------------------------------------------------------------
>
>                 Key: WW-3694
>                 URL: https://issues.apache.org/jira/browse/WW-3694
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - JSON
>    Affects Versions: 2.2.3.1
>         Environment: Tomcat on windows, JDK1.5
>            Reporter: Alex Yavorskiy
>         Attachments: WW-3694.patch
>
>
> Pre version 2.2.3.1 JSONResult object used to have a protected method that allowed us to have a subclass that could modify URL of the SMD command being sent in the response right before it was sent. That method was "writeSMD". In version 2.2.3.1 of Struts there is no more method named "writeSMD", but there appears to be equivalent protected method named "buildSMDObject". However, we observed that buildSMDObject is never called by the infrastructure, so there is no use overriding it.
> After inspecting source for JSONResult, it looks like line 180 in the readRootObject function is really intended to call buildSMDObject. However, instead of calling the protected method in question, it creates SMD object right there.
>  if (enableSMD) {
>             return new SMDGenerator(root, excludeProperties, ignoreInterfaces).generate(invocation);
>         }
> Fixing line 180 to call buildSMDObject should fix the issue. We had to significantly re-write our subclass for JSONResult to work around the deficiency. Hope this can be fixed in a future release.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (WW-3694) JSONResult - buildSMDObject method is never called internally

Posted by "Alex Yavorskiy (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WW-3694?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13136220#comment-13136220 ] 

Alex Yavorskiy commented on WW-3694:
------------------------------------

Thanks for such quick turnaround.




                
> JSONResult - buildSMDObject method is never called internally
> -------------------------------------------------------------
>
>                 Key: WW-3694
>                 URL: https://issues.apache.org/jira/browse/WW-3694
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - JSON
>    Affects Versions: 2.2.3.1
>         Environment: Tomcat on windows, JDK1.5
>            Reporter: Alex Yavorskiy
>            Assignee: Maurizio Cucchiara
>             Fix For: 2.3
>
>         Attachments: WW-3694.patch
>
>
> Pre version 2.2.3.1 JSONResult object used to have a protected method that allowed us to have a subclass that could modify URL of the SMD command being sent in the response right before it was sent. That method was "writeSMD". In version 2.2.3.1 of Struts there is no more method named "writeSMD", but there appears to be equivalent protected method named "buildSMDObject". However, we observed that buildSMDObject is never called by the infrastructure, so there is no use overriding it.
> After inspecting source for JSONResult, it looks like line 180 in the readRootObject function is really intended to call buildSMDObject. However, instead of calling the protected method in question, it creates SMD object right there.
>  if (enableSMD) {
>             return new SMDGenerator(root, excludeProperties, ignoreInterfaces).generate(invocation);
>         }
> Fixing line 180 to call buildSMDObject should fix the issue. We had to significantly re-write our subclass for JSONResult to work around the deficiency. Hope this can be fixed in a future release.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira