[jira] Created: (OFBIZ-3916) method writeObject(StringBuilder sb, Object value, boolean allowJsonResolve) in UtilIO always throw an IOException

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] Created: (OFBIZ-3916) method writeObject(StringBuilder sb, Object value, boolean allowJsonResolve) in UtilIO always throw an IOException

Nicolas Malin (Jira)
method writeObject(StringBuilder sb, Object value, boolean allowJsonResolve) in UtilIO always throw an IOException
------------------------------------------------------------------------------------------------------------------

                 Key: OFBIZ-3916
                 URL: https://issues.apache.org/jira/browse/OFBIZ-3916
             Project: OFBiz
          Issue Type: Bug
          Components: framework
    Affects Versions: Release Branch 10.04
         Environment: Server side: Mac OSX 10.6.4
Client: Safari 5.0.1
            Reporter: Liu Xiangqian


Tried to invoke method UtilIO.writeObject(StringBuilder sb, Object value, boolean allowJsonResolve) but found the follow code

   try {
            StringWriter writer = new StringWriter();
            if (encodeObject(writer, value, allowJsonResolve)) {
                sb.append(writer.toString());
                return;
            }
        } catch (Exception e) {
        }
        throw new IOException("Can't write (" + value + ")");

These codes casued the method always throw an IOException.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (OFBIZ-3916) method writeObject(StringBuilder sb, Object value, boolean allowJsonResolve) in UtilIO always throw an IOException

Nicolas Malin (Jira)

     [ https://issues.apache.org/jira/browse/OFBIZ-3916?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Liu Xiangqian updated OFBIZ-3916:
---------------------------------

    Attachment: OFBIZ-3916.patch

This patch changes the code from orgianal version shown in the case description to the follow

 public static void writeObject(StringBuilder sb, Object value, boolean allowJsonResolve) throws IOException {
        try {
            StringWriter writer = new StringWriter();
            if (encodeObject(writer, value, allowJsonResolve)) {
                sb.append(writer.toString());
                return;
            }
        } catch (Exception e) {
            throw new IOException("Can't write (" + value + ")");            
        }
    }

> method writeObject(StringBuilder sb, Object value, boolean allowJsonResolve) in UtilIO always throw an IOException
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-3916
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-3916
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: Release Branch 10.04
>         Environment: Server side: Mac OSX 10.6.4
> Client: Safari 5.0.1
>            Reporter: Liu Xiangqian
>         Attachments: OFBIZ-3916.patch
>
>   Original Estimate: 0.08h
>  Remaining Estimate: 0.08h
>
> Tried to invoke method UtilIO.writeObject(StringBuilder sb, Object value, boolean allowJsonResolve) but found the follow code
>    try {
>             StringWriter writer = new StringWriter();
>             if (encodeObject(writer, value, allowJsonResolve)) {
>                 sb.append(writer.toString());
>                 return;
>             }
>         } catch (Exception e) {
>         }
>         throw new IOException("Can't write (" + value + ")");
> These codes casued the method always throw an IOException.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Issue Comment Edited: (OFBIZ-3916) method writeObject(StringBuilder sb, Object value, boolean allowJsonResolve) in UtilIO always throw an IOException

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-3916?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12904962#action_12904962 ]

Liu Xiangqian edited comment on OFBIZ-3916 at 9/1/10 3:41 AM:
--------------------------------------------------------------

This patch changes the code from orgianal version shown in the case description to the follow so the exception will only be thrown when any exception occurs.

 public static void writeObject(StringBuilder sb, Object value, boolean allowJsonResolve) throws IOException {
        try {
            StringWriter writer = new StringWriter();
            if (encodeObject(writer, value, allowJsonResolve)) {
                sb.append(writer.toString());
                return;
            }
        } catch (Exception e) {
            throw new IOException("Can't write (" + value + ")");            
        }
    }

      was (Author: redcamper):
    This patch changes the code from orgianal version shown in the case description to the follow

 public static void writeObject(StringBuilder sb, Object value, boolean allowJsonResolve) throws IOException {
        try {
            StringWriter writer = new StringWriter();
            if (encodeObject(writer, value, allowJsonResolve)) {
                sb.append(writer.toString());
                return;
            }
        } catch (Exception e) {
            throw new IOException("Can't write (" + value + ")");            
        }
    }
 

> method writeObject(StringBuilder sb, Object value, boolean allowJsonResolve) in UtilIO always throw an IOException
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-3916
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-3916
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: Release Branch 10.04
>         Environment: Server side: Mac OSX 10.6.4
> Client: Safari 5.0.1
>            Reporter: Liu Xiangqian
>         Attachments: OFBIZ-3916.patch
>
>   Original Estimate: 0.08h
>  Remaining Estimate: 0.08h
>
> Tried to invoke method UtilIO.writeObject(StringBuilder sb, Object value, boolean allowJsonResolve) but found the follow code
>    try {
>             StringWriter writer = new StringWriter();
>             if (encodeObject(writer, value, allowJsonResolve)) {
>                 sb.append(writer.toString());
>                 return;
>             }
>         } catch (Exception e) {
>         }
>         throw new IOException("Can't write (" + value + ")");
> These codes casued the method always throw an IOException.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Closed: (OFBIZ-3916) method writeObject(StringBuilder sb, Object value, boolean allowJsonResolve) in UtilIO always throw an IOException

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

     [ https://issues.apache.org/jira/browse/OFBIZ-3916?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jacques Le Roux closed OFBIZ-3916.
----------------------------------

         Assignee: Jacques Le Roux
    Fix Version/s: SVN trunk
       Resolution: Fixed

Thanks Xiangqian,

Your patch is in trunk at r991485, R10.04 at r991490  



> method writeObject(StringBuilder sb, Object value, boolean allowJsonResolve) in UtilIO always throw an IOException
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-3916
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-3916
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: Release Branch 10.04
>         Environment: Server side: Mac OSX 10.6.4
> Client: Safari 5.0.1
>            Reporter: Liu Xiangqian
>            Assignee: Jacques Le Roux
>             Fix For: SVN trunk
>
>         Attachments: OFBIZ-3916.patch
>
>   Original Estimate: 0.08h
>  Remaining Estimate: 0.08h
>
> Tried to invoke method UtilIO.writeObject(StringBuilder sb, Object value, boolean allowJsonResolve) but found the follow code
>    try {
>             StringWriter writer = new StringWriter();
>             if (encodeObject(writer, value, allowJsonResolve)) {
>                 sb.append(writer.toString());
>                 return;
>             }
>         } catch (Exception e) {
>         }
>         throw new IOException("Can't write (" + value + ")");
> These codes casued the method always throw an IOException.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-3916) method writeObject(StringBuilder sb, Object value, boolean allowJsonResolve) in UtilIO always throw an IOException

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-3916?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12909926#action_12909926 ]

Jacques Le Roux commented on OFBIZ-3916:
----------------------------------------

These commits have been reverted, please see the code for a short explanation and [this thread for more|http://markmail.org/message/vvyrlqefunj2idsv]

> method writeObject(StringBuilder sb, Object value, boolean allowJsonResolve) in UtilIO always throw an IOException
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-3916
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-3916
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: Release Branch 10.04
>         Environment: Server side: Mac OSX 10.6.4
> Client: Safari 5.0.1
>            Reporter: Liu Xiangqian
>            Assignee: Jacques Le Roux
>             Fix For: SVN trunk
>
>         Attachments: OFBIZ-3916.patch
>
>   Original Estimate: 0.08h
>  Remaining Estimate: 0.08h
>
> Tried to invoke method UtilIO.writeObject(StringBuilder sb, Object value, boolean allowJsonResolve) but found the follow code
>    try {
>             StringWriter writer = new StringWriter();
>             if (encodeObject(writer, value, allowJsonResolve)) {
>                 sb.append(writer.toString());
>                 return;
>             }
>         } catch (Exception e) {
>         }
>         throw new IOException("Can't write (" + value + ")");
> These codes casued the method always throw an IOException.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.