You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by "Valentin Grouès (Created JIRA)" <ji...@apache.org> on 2012/04/10 14:15:16 UTC

[jira] [Created] (JENA-233) Wrong returned value for INF and -INF floats

Wrong returned value for INF and -INF floats
--------------------------------------------

                 Key: JENA-233
                 URL: https://issues.apache.org/jira/browse/JENA-233
             Project: Apache Jena
          Issue Type: Bug
          Components: Jena
    Affects Versions: Jena 2.7.0
            Reporter: Valentin Grouès
            Priority: Critical
             Fix For: Jena 2.7.1, Jena 2.7.0


File: com/hp/hpl/jena/datatypes/xsd/impl/XSDFloat.java

Problem in the parsing of INF and -INF float value.
INF is transformed to NEGATIVE_INFINITY while -INF is transformed to POSITIVE_INFINITY. It should be the other way around.
 
current version:

 public Object parseValidated(String lex) {
        if (lex.equals("INF")) {
            return new Float(Float.NEGATIVE_INFINITY);
        } else if (lex.equals("-INF")) {
            return new Float(Float.POSITIVE_INFINITY);
        } else if (lex.equals("NaN")) {
            return new Float(Float.NaN);
        } else {
            return Float.valueOf(lex);
        }
    }
     

--
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] (JENA-233) Wrong returned value for INF and -INF floats

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

Andy Seaborne resolved JENA-233.
--------------------------------

    Resolution: Fixed
    
> Wrong returned value for INF and -INF floats
> --------------------------------------------
>
>                 Key: JENA-233
>                 URL: https://issues.apache.org/jira/browse/JENA-233
>             Project: Apache Jena
>          Issue Type: Bug
>          Components: Jena
>    Affects Versions: Jena 2.7.0
>            Reporter: Valentin Grouès
>            Assignee: Andy Seaborne
>            Priority: Minor
>             Fix For: Jena 2.7.1
>
>   Original Estimate: 10m
>  Remaining Estimate: 10m
>
> File: com/hp/hpl/jena/datatypes/xsd/impl/XSDFloat.java
> Problem in the parsing of INF and -INF float value.
> INF is transformed to NEGATIVE_INFINITY while -INF is transformed to POSITIVE_INFINITY. It should be the other way around.
>  
> current version:
>  public Object parseValidated(String lex) {
>         if (lex.equals("INF")) {
>             return new Float(Float.NEGATIVE_INFINITY);
>         } else if (lex.equals("-INF")) {
>             return new Float(Float.POSITIVE_INFINITY);
>         } else if (lex.equals("NaN")) {
>             return new Float(Float.NaN);
>         } else {
>             return Float.valueOf(lex);
>         }
>     }
>      

--
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] (JENA-233) Wrong returned value for INF and -INF floats

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

Younes Djaghloul commented on JENA-233:
---------------------------------------

I confirm that issue
                
> Wrong returned value for INF and -INF floats
> --------------------------------------------
>
>                 Key: JENA-233
>                 URL: https://issues.apache.org/jira/browse/JENA-233
>             Project: Apache Jena
>          Issue Type: Bug
>          Components: Jena
>    Affects Versions: Jena 2.7.0
>            Reporter: Valentin Grouès
>            Priority: Critical
>             Fix For: Jena 2.7.0, Jena 2.7.1
>
>   Original Estimate: 10m
>  Remaining Estimate: 10m
>
> File: com/hp/hpl/jena/datatypes/xsd/impl/XSDFloat.java
> Problem in the parsing of INF and -INF float value.
> INF is transformed to NEGATIVE_INFINITY while -INF is transformed to POSITIVE_INFINITY. It should be the other way around.
>  
> current version:
>  public Object parseValidated(String lex) {
>         if (lex.equals("INF")) {
>             return new Float(Float.NEGATIVE_INFINITY);
>         } else if (lex.equals("-INF")) {
>             return new Float(Float.POSITIVE_INFINITY);
>         } else if (lex.equals("NaN")) {
>             return new Float(Float.NaN);
>         } else {
>             return Float.valueOf(lex);
>         }
>     }
>      

--
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] (JENA-233) Wrong returned value for INF and -INF floats

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

Paolo Castagna commented on JENA-233:
-------------------------------------

Ack. 

However, giving people the opportunity to experience the process of checkout sources, generating a patch, run the tests and submitting the patch (even if trivial) is IMHO a good thing to do. I am happy to pay the overhead of the patch submission, if that is helping other developers to come closer to the project and, why not, in future become more active and perhaps new committers.

But, I agree with you, this was trivial.


                
> Wrong returned value for INF and -INF floats
> --------------------------------------------
>
>                 Key: JENA-233
>                 URL: https://issues.apache.org/jira/browse/JENA-233
>             Project: Apache Jena
>          Issue Type: Bug
>          Components: Jena
>    Affects Versions: Jena 2.7.0
>            Reporter: Valentin Grouès
>            Assignee: Andy Seaborne
>            Priority: Minor
>             Fix For: Jena 2.7.1
>
>   Original Estimate: 10m
>  Remaining Estimate: 10m
>
> File: com/hp/hpl/jena/datatypes/xsd/impl/XSDFloat.java
> Problem in the parsing of INF and -INF float value.
> INF is transformed to NEGATIVE_INFINITY while -INF is transformed to POSITIVE_INFINITY. It should be the other way around.
>  
> current version:
>  public Object parseValidated(String lex) {
>         if (lex.equals("INF")) {
>             return new Float(Float.NEGATIVE_INFINITY);
>         } else if (lex.equals("-INF")) {
>             return new Float(Float.POSITIVE_INFINITY);
>         } else if (lex.equals("NaN")) {
>             return new Float(Float.NaN);
>         } else {
>             return Float.valueOf(lex);
>         }
>     }
>      

--
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] (JENA-233) Wrong returned value for INF and -INF floats

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

Paolo Castagna commented on JENA-233:
-------------------------------------

Hi Valentin, hi Younes. First of all thanks for reporting the issue.
Do you want to try submitting a small patch for this? ;-)
The "Getting Involved" page has instructions on how you can produce a patch: http://incubator.apache.org/jena/getting_involved/index.html#submit-your-patches
Otherwise, one of the current committers, once confirmed, will quickly fix that for you.
                
> Wrong returned value for INF and -INF floats
> --------------------------------------------
>
>                 Key: JENA-233
>                 URL: https://issues.apache.org/jira/browse/JENA-233
>             Project: Apache Jena
>          Issue Type: Bug
>          Components: Jena
>    Affects Versions: Jena 2.7.0
>            Reporter: Valentin Grouès
>            Priority: Critical
>             Fix For: Jena 2.7.0, Jena 2.7.1
>
>   Original Estimate: 10m
>  Remaining Estimate: 10m
>
> File: com/hp/hpl/jena/datatypes/xsd/impl/XSDFloat.java
> Problem in the parsing of INF and -INF float value.
> INF is transformed to NEGATIVE_INFINITY while -INF is transformed to POSITIVE_INFINITY. It should be the other way around.
>  
> current version:
>  public Object parseValidated(String lex) {
>         if (lex.equals("INF")) {
>             return new Float(Float.NEGATIVE_INFINITY);
>         } else if (lex.equals("-INF")) {
>             return new Float(Float.POSITIVE_INFINITY);
>         } else if (lex.equals("NaN")) {
>             return new Float(Float.NaN);
>         } else {
>             return Float.valueOf(lex);
>         }
>     }
>      

--
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] (JENA-233) Wrong returned value for INF and -INF floats

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

Andy Seaborne updated JENA-233:
-------------------------------

         Priority: Minor  (was: Critical)
    Fix Version/s:     (was: Jena 2.7.0)
         Assignee: Andy Seaborne

It is easier to just fix it than deal with the overhead of patches.

Fixed in SVN for XSDFloat and XSDDouble.

Please confirm in 2.7.1 snapshot -- I have scheduled a development build which should complete within 30 mins.

                
> Wrong returned value for INF and -INF floats
> --------------------------------------------
>
>                 Key: JENA-233
>                 URL: https://issues.apache.org/jira/browse/JENA-233
>             Project: Apache Jena
>          Issue Type: Bug
>          Components: Jena
>    Affects Versions: Jena 2.7.0
>            Reporter: Valentin Grouès
>            Assignee: Andy Seaborne
>            Priority: Minor
>             Fix For: Jena 2.7.1
>
>   Original Estimate: 10m
>  Remaining Estimate: 10m
>
> File: com/hp/hpl/jena/datatypes/xsd/impl/XSDFloat.java
> Problem in the parsing of INF and -INF float value.
> INF is transformed to NEGATIVE_INFINITY while -INF is transformed to POSITIVE_INFINITY. It should be the other way around.
>  
> current version:
>  public Object parseValidated(String lex) {
>         if (lex.equals("INF")) {
>             return new Float(Float.NEGATIVE_INFINITY);
>         } else if (lex.equals("-INF")) {
>             return new Float(Float.POSITIVE_INFINITY);
>         } else if (lex.equals("NaN")) {
>             return new Float(Float.NaN);
>         } else {
>             return Float.valueOf(lex);
>         }
>     }
>      

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