Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6753303

Request to specify the LiveConnect data conversion behavior from Number to String

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Duplicate
    • P3
    • None
    • 6u10
    • deploy
    • x86
    • windows

    Description

      This is discussed in forum:
      http://forums.java.net/jive/thread.jspa?messageID=301756

      In JavaScript, when passing a "Number" value to a Java method that is expecting a String value and returns a String (i.e. String foo(String arg)). The behavior is different. In 6u7, if Number value = 3, the returned String from Java method is "3", but in 6u10, the return value is "3.0". This is only reproducible with IE.

      jscript version is 5.7.0.16535

      If I set the value of a variable as:
      x=Number(3);
      then it is converted correctly as a java String to "3" in 1.6.0_10.

      But if set the value of a variable (with quotes around the 3) as:
      x=Number("3");
      then it is converted incorrectly as a java String to "3.0" in 1.6.0_10.

      Both result in "typeof x" to return "number" but the objects are obviously slightly different otherwise java would convert them to the same value.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              ryeung Roger Yeung (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: