You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Camilo Azula (Created) (JIRA)" <ji...@apache.org> on 2011/11/10 16:48:51 UTC

[jira] [Created] (WW-3701) Wrong parsing of number with exponents

Wrong parsing of number with exponents
--------------------------------------

                 Key: WW-3701
                 URL: https://issues.apache.org/jira/browse/WW-3701
             Project: Struts 2
          Issue Type: Bug
          Components: Plugin - JSON
    Affects Versions: 2.2.3.1, 2.1.8
         Environment: UNIX, Windows
            Reporter: Camilo Azula
            Priority: Critical
             Fix For: 2.2.3.1


The json reader is not handling correctly the exponential numbers such as 5e-5. For example, 5e-5 is tried to be parsed as long which is incorrect check line 201 org.apache.struts2.json.JSONReader. The dot does not mean that the exponential is meaning an integer.


--
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-3701) Wrong parsing of number with exponents

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

Camilo Azula commented on WW-3701:
----------------------------------

Struts has detected an unhandled exception:
Messages:	
For input string: "5e-7"
File:	java/lang/NumberFormatException.java
Line number:	63
Stacktraces
java.lang.NumberFormatException: For input string: "5e-7"
    java.lang.NumberFormatException.forInputString(NumberFormatException.java:63
                
> Wrong parsing of number with exponents
> --------------------------------------
>
>                 Key: WW-3701
>                 URL: https://issues.apache.org/jira/browse/WW-3701
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - JSON
>    Affects Versions: 2.1.8, 2.2.3.1
>         Environment: UNIX, Windows
>            Reporter: Camilo Azula
>            Priority: Critical
>              Labels: json, number,exponents
>             Fix For: 2.2.3.1
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> The json reader is not handling correctly the exponential numbers such as 5e-5. For example, 5e-5 is tried to be parsed as long which is incorrect check line 201 org.apache.struts2.json.JSONReader. The dot does not mean that the exponential is meaning an integer.

--
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] [Closed] (WW-3701) Wrong parsing of number with exponents

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

Lukasz Lenart closed WW-3701.
-----------------------------

    
> Wrong parsing of number with exponents
> --------------------------------------
>
>                 Key: WW-3701
>                 URL: https://issues.apache.org/jira/browse/WW-3701
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - JSON
>    Affects Versions: 2.1.8, 2.2.3.1
>         Environment: UNIX, Windows
>            Reporter: Camilo Azula
>            Assignee: Maurizio Cucchiara
>            Priority: Critical
>              Labels: json, number,exponents
>             Fix For: 2.3.1
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> The json reader is not handling correctly the exponential numbers such as 5e-5. For example, 5e-5 is tried to be parsed as long which is incorrect check line 201 org.apache.struts2.json.JSONReader. The dot does not mean that the exponential is meaning an integer.

--
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-3701) Wrong parsing of number with exponents

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

Hudson commented on WW-3701:
----------------------------

Integrated in Struts2 #371 (See [https://builds.apache.org/job/Struts2/371/])
    WW-3701 - Wrong parsing of number with exponents

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

                
> Wrong parsing of number with exponents
> --------------------------------------
>
>                 Key: WW-3701
>                 URL: https://issues.apache.org/jira/browse/WW-3701
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - JSON
>    Affects Versions: 2.1.8, 2.2.3.1
>         Environment: UNIX, Windows
>            Reporter: Camilo Azula
>            Assignee: Maurizio Cucchiara
>            Priority: Critical
>              Labels: json, number,exponents
>             Fix For: 2.3
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> The json reader is not handling correctly the exponential numbers such as 5e-5. For example, 5e-5 is tried to be parsed as long which is incorrect check line 201 org.apache.struts2.json.JSONReader. The dot does not mean that the exponential is meaning an integer.

--
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-3701) Wrong parsing of number with exponents

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

Camilo Azula commented on WW-3701:
----------------------------------

original file  org.apache.struts2.json.JSONReader
..
 return (this.buf.indexOf(".") >= 0) ? (Object) Double.parseDouble(this.buf.toString())
                : (Object) Long.parseLong(this.buf.toString());
Fix
 return (this.buf.indexOf(".") >= 0 || this.buf.indexOf("e") >= 0 || this.buf.indexOf("E") >= 0) ? (Object) Double.parseDouble(this.buf.toString())
                : (Object) Long.parseLong(this.buf.toString());

                
> Wrong parsing of number with exponents
> --------------------------------------
>
>                 Key: WW-3701
>                 URL: https://issues.apache.org/jira/browse/WW-3701
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - JSON
>    Affects Versions: 2.1.8, 2.2.3.1
>         Environment: UNIX, Windows
>            Reporter: Camilo Azula
>            Priority: Critical
>              Labels: json, number,exponents
>             Fix For: 2.2.3.1
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> The json reader is not handling correctly the exponential numbers such as 5e-5. For example, 5e-5 is tried to be parsed as long which is incorrect check line 201 org.apache.struts2.json.JSONReader. The dot does not mean that the exponential is meaning an integer.

--
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-3701) Wrong parsing of number with exponents

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

Maurizio Cucchiara resolved WW-3701.
------------------------------------

       Resolution: Fixed
    Fix Version/s:     (was: 2.2.3.1)
                   2.3
         Assignee: Maurizio Cucchiara

Solved, 
Thanks for the issue submission.

                
> Wrong parsing of number with exponents
> --------------------------------------
>
>                 Key: WW-3701
>                 URL: https://issues.apache.org/jira/browse/WW-3701
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - JSON
>    Affects Versions: 2.1.8, 2.2.3.1
>         Environment: UNIX, Windows
>            Reporter: Camilo Azula
>            Assignee: Maurizio Cucchiara
>            Priority: Critical
>              Labels: json, number,exponents
>             Fix For: 2.3
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> The json reader is not handling correctly the exponential numbers such as 5e-5. For example, 5e-5 is tried to be parsed as long which is incorrect check line 201 org.apache.struts2.json.JSONReader. The dot does not mean that the exponential is meaning an integer.

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