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

-- 
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to