Uploaded image for project: 'Application Server 7'
  1. Application Server 7
  2. AS7-4126

double values cannot be read from dmr response

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 7.1.2.Final (EAP)
    • 7.1.0.Final
    • Console
    • None

      This appears to be a bug in the GWT compiler. The compiler turns the following:

      DataInput.readDouble()
      return IEEE754.toDouble(bytes[pos++], bytes[pos++], bytes[pos++], bytes[pos++], bytes[pos++], bytes[pos++], bytes[pos++], bytes[pos++]);
      

      into: (effectively; the GWT compiler is adding a set of parentheses around the parameters passed to the native function)

      DataInput.readDouble() compiled
      return IEEE754.toDouble(new byte[] {bytes[pos++], bytes[pos++], bytes[pos++], bytes[pos++], bytes[pos++], bytes[pos++], bytes[pos++], bytes[pos++]});
      

      This results in all double values in the model being interpreted as NaN.

      I've patched the code I'm using in SwitchYard as follows:

      DataInput.java
      public double readDouble() throws IOException {
          byte doubleBytes[] = new byte[8];
          readFully(doubleBytes);
          return IEEE754.toDouble(doubleBytes);
      }
      
      IEEE754.java
      public static native double toDouble(byte[] bytes) /*-{
          var ebits = 11;
          var fbits = 52;
      
          // Bytes to bits
          var bits = [];
          //snip...
      }
      

              rhn-support-hbraun Heiko Braun
              rcernich1 Rob Cernich
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: