JDK-8078414 : Don't create impossible converters for ScriptObjectMirror
  • Type: Bug
  • Component: core-libs
  • Sub-Component: jdk.nashorn
  • Affected Version: 9
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2015-04-22
  • Updated: 2015-09-29
  • Resolved: 2015-05-15
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
8u60Fixed 9 b66Fixed
Description
Currently, NashornLinker will create a conditional ScriptObjectMirror converter for _any_ source type if the target type is something that a ScriptObjectMirror can be, e.g. Map. However, it'll do it even if the source type can never be a ScriptObject (e.g. java.lang.Double). This causes more matches in the "canConvert" too, which allows more candidates for overload resolution to pass. 

This has no significant effect, except for making more work for overload resolution, as well as causing a bunch of bogus converters to exist for (most notably) anything-to-Map.