JDK-8149075 : New method: public static Double.toES6String(double)
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.lang
  • Affected Version: 8u72
  • Priority: P4
  • Status: New
  • Resolution: Unresolved
  • OS: windows_7
  • CPU: x86_64
  • Submitted: 2016-02-04
  • Updated: 2016-03-07
Description
A DESCRIPTION OF THE REQUEST :
The most recent ECMAScript specification details how the "Number" data type should be formatted. Unfortunately they offer two alternatives.  The more advance alternative has been selected by Google for Chrome, as well as by Apple and Mozilla for Safari and Firefox respectively.

Java does not natively support any of these alternatives.

JUSTIFICATION :
The net effect of implementing this feature is that you can create normalized versions of JavaScript/JSON objects that can securely traverse through different systems even if they carry a digital signature.

An example of such a use:
https://cyberphone.github.io/openkeystore/resources/docs/jcs.html#ECMAScript_Compatibility_Mode

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
ES6 formatted doubles
ACTUAL -
A non-compatible format.

---------- BEGIN SOURCE ----------
Here you have 10 million values to test with:
http://webpki.org/ietf/es6testfile.txt
---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
There is open source code that does this conversion