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

ScriptEngine "js" randomly means either "rhino" or "nashorn", but should instead select one

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 11
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b01
    • CPU:
      generic
    • OS:
      generic
    1. ScriptEngineTest.java
      0.3 kB
      Aleksey Shipilev

      Issue Links

        Activity

        Hide
        alanb Alan Bateman added a comment - - edited
        The main source of randomness that we thought was the original issue is the HashMap iteration order but that issue should have been resolved. There may be something else that needs to be examined. One thought is ScriptEngineManager is using a HashSet so this means we are dependent on the hash code of the ScriptEngineFactory instance. It would be interesting to double check NashornScriptEngineFactory and DummyJSEngineFactory have hash codes.
        Show
        alanb Alan Bateman added a comment - - edited The main source of randomness that we thought was the original issue is the HashMap iteration order but that issue should have been resolved. There may be something else that needs to be examined. One thought is ScriptEngineManager is using a HashSet so this means we are dependent on the hash code of the ScriptEngineFactory instance. It would be interesting to double check NashornScriptEngineFactory and DummyJSEngineFactory have hash codes.
        Hide
        sundar Sundararajan Athijegannathan added a comment -
        We don't have Rhino in jdk8. We have only nashorn in jre extension directory. So for "nashorn" or "js" only one engine is matched. So won't affect jdk8 product.

        Given that this engine factory order has been there for many releases (from jdk 6 !), I am downgrading the priority on this issue and targeting to different release.
        Show
        sundar Sundararajan Athijegannathan added a comment - We don't have Rhino in jdk8. We have only nashorn in jre extension directory. So for "nashorn" or "js" only one engine is matched. So won't affect jdk8 product. Given that this engine factory order has been there for many releases (from jdk 6 !), I am downgrading the priority on this issue and targeting to different release.
        Hide
        arieber Andreas Rieber added a comment - - edited
        The issue caused some trouble when i was testing scriptpad and jconsole. Sure, rhino is gone (but easy to get back) and there is also jav8-jsr223. So i checked the ScriptEngineManager, the problem comes from the HashSet used there. I will prepare a patch.
        Show
        arieber Andreas Rieber added a comment - - edited The issue caused some trouble when i was testing scriptpad and jconsole. Sure, rhino is gone (but easy to get back) and there is also jav8-jsr223. So i checked the ScriptEngineManager, the problem comes from the HashSet used there. I will prepare a patch.
        Hide
        sdama Srinivas Dama added a comment -
        This is a behavior change that has to be specified. Current spec. does not say anything about order
        waiting for jsr-223 to merge with JDK JSR by ~sundar
        Show
        sdama Srinivas Dama added a comment - This is a behavior change that has to be specified. Current spec. does not say anything about order waiting for jsr-223 to merge with JDK JSR by ~sundar
        Hide
        hgupdate HG Updates added a comment -
        URL: http://hg.openjdk.java.net/jdk/jdk/rev/290b480df13e
        User: sdama
        Date: 2018-02-02 12:44:33 +0000
        Show
        hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk/jdk/rev/290b480df13e User: sdama Date: 2018-02-02 12:44:33 +0000

          People

          • Assignee:
            sdama Srinivas Dama
            Reporter:
            shade Aleksey Shipilev
          • Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: