    View Javadoc
    1   ***************
    2   *** 323,333 ****
    3        * @return index on success, -1 otherwise
    4        */
    5       public int lookupFloat(float n) {
    6         for(int i=1; i < index; i++) {
    7           if(constants[i] instanceof ConstantFloat) {
    8            ConstantFloat c = (ConstantFloat)constants[i];
    9
    10  -        if(c.getBytes() == n)
    11             return i;
    12          }
    13        }
    14  --- 323,334 ----
    15       * @return index on success, -1 otherwise
    16       */
    17      public int lookupFloat(float n) {
    18  +     int bits = Float.floatToIntBits(n);
    19        for(int i=1; i < index; i++) {
    20          if(constants[i] instanceof ConstantFloat) {
    21           ConstantFloat c = (ConstantFloat)constants[i];
    22
    23  +        if(Float.floatToIntBits(c.getBytes()) == bits)
    24             return i;
    25          }
    26        }
    27  ***************
    28  *** 438,448 ****
    29       * @return index on success, -1 otherwise
    30       */
    31      public int lookupDouble(double n) {
    32        for(int i=1; i < index; i++) {
    33          if(constants[i] instanceof ConstantDouble) {
    34           ConstantDouble c = (ConstantDouble)constants[i];
    35
    36  -        if(c.getBytes() == n)
    37             return i;
    38          }
    39        }
    40  --- 439,450 ----
    41       * @return index on success, -1 otherwise
    42       */
    43      public int lookupDouble(double n) {
    44  +     long bits = Double.doubleToLongBits(n);
    45        for(int i=1; i < index; i++) {
    46          if(constants[i] instanceof ConstantDouble) {
    47           ConstantDouble c = (ConstantDouble)constants[i];
    48
    49  +        if(Double.doubleToLongBits(c.getBytes()) == bits)
    50             return i;
    51          }
    52        }

This page was automatically generated by Maven