JDK-8146147 : Java linker indexed property getter does not work for computed nashorn string
  • Type: Bug
  • Component: core-libs
  • Sub-Component: jdk.nashorn
  • Affected Version: 9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2015-12-24
  • Updated: 2016-04-27
  • Resolved: 2015-12-24
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 JDK 9
8u101Fixed 9 b100Fixed
Related Reports
Duplicate :  
Description
This issue was reported by Axel Faust via a tweet (https://twitter.com/ReluctantBird83/status/679754932094930944)

Link to test is as follows: http://fpaste.org/304445/90077614/

The test case cut-pasted here for convenience:



    var locale = new Packages.java.util.Locale('de', 'DE');
    var prop = 'ISO3Language';
    var prop1 = 'ISO3';
    var prop2 = prop1 + 'Language';
    var prop3 = String(prop2);
    print(locale.ISO3Language);
    // prints: deu
    print(locale['ISO3Language']);
    // prints: deu
    print(locale[prop]);
    // prints: deu
    print(locale[prop1 + 'Language']);
    // prints: null
    print(locale[prop2]);
    // prints: null
    print(locale[prop3]);
    // prints: deu
    print(locale[String(prop1 + 'Language')]);
    // prints: deu