axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christophe Denis (JIRA)" <j...@apache.org>
Subject [jira] Updated: (AXIS2-2740) [Eclipse Codegen Wizard] comparing NaN with == isn't permitted
Date Thu, 31 May 2007 13:40:15 GMT

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

Christophe Denis updated AXIS2-2740:
------------------------------------

    Description: 
Hello all,

The Eclipse Code Generator Plugin Version 1.2 generates some bad code when making a wsdl to
java. In generated types there is a pieces of code like that:

protected double localDoubleNumber ;
// [...]
protected boolean localDoubleNumberTracker = false ;
// [...]
public void setDoubleNumber(double param){
    // setting primitive attribute tracker to true
    if (param==java.lang.Double.NaN) {
        localDoubleNumberTracker = false;
    } else {
    localDoubleNumberTracker = true;
}
this.localDoubleNumber=param;
}

WRONG: param==java.lang.Double.NaN
isn't allowed because a compare (==) with NaN is everytime resulting FALSE (take a look here:
http://www.concentric.net/~Ttwang/tech/javafloat.htm)
The result of that bug is, that all elements are tracked, even if they have no value

RIGHT: java.lang.Double.isNAN(param)

Greetings, Christophe Denis

  was:
Hello all,

The Eclipse Code Generator Plugin Version 1.2 generates some bad code when making a wsdl to
java. In generated types there is a pieces of code like that:

protected double localDoubleNumber ;
// [...]
protected boolean localDoubleNumberTracker = false ;
// [...]
public void setDoubleNumber(double param){
    // setting primitive attribute tracker to true
    if (param==java.lang.Double.NaN) {
        localDoubleNumberTracker = false;
    } else {
    localDoubleNumberTracker = true;
}
this.localDoubleNumber=param;
}

WRONG: param==java.lang.Double.NaN
isn't allowed because a compare (==) with NaN results everytime with FALSE (take a look here:
http://www.concentric.net/~Ttwang/tech/javafloat.htm)
The result of that bug is, that all elements are tracked, even if they have no value

RIGHT: java.lang.Double.isNAN(param)

Greetings, Christophe Denis


> [Eclipse Codegen Wizard] comparing NaN with == isn't permitted
> --------------------------------------------------------------
>
>                 Key: AXIS2-2740
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2740
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: Tools
>         Environment: Java EE 5.0
>            Reporter: Christophe Denis
>
> Hello all,
> The Eclipse Code Generator Plugin Version 1.2 generates some bad code when making a wsdl
to java. In generated types there is a pieces of code like that:
> protected double localDoubleNumber ;
> // [...]
> protected boolean localDoubleNumberTracker = false ;
> // [...]
> public void setDoubleNumber(double param){
>     // setting primitive attribute tracker to true
>     if (param==java.lang.Double.NaN) {
>         localDoubleNumberTracker = false;
>     } else {
>     localDoubleNumberTracker = true;
> }
> this.localDoubleNumber=param;
> }
> WRONG: param==java.lang.Double.NaN
> isn't allowed because a compare (==) with NaN is everytime resulting FALSE (take a look
here: http://www.concentric.net/~Ttwang/tech/javafloat.htm)
> The result of that bug is, that all elements are tracked, even if they have no value
> RIGHT: java.lang.Double.isNAN(param)
> Greetings, Christophe Denis

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


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


Mime
View raw message