mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-15 16:44:36 +02:00
8011697: ScriptEngine "js" randomly means either "rhino" or "nashorn", but should instead select one
Sort ScriptEngineFactory by name so that same engine is retrieved across all OS Reviewed-by: alanb, sundar
This commit is contained in:
parent
94aa298a46
commit
1335ebada2
10 changed files with 511 additions and 2 deletions
|
@ -77,7 +77,7 @@ public class ScriptEngineManager {
|
|||
|
||||
private void init(final ClassLoader loader) {
|
||||
globalScope = new SimpleBindings();
|
||||
engineSpis = new HashSet<ScriptEngineFactory>();
|
||||
engineSpis = new TreeSet<ScriptEngineFactory>(Comparator.comparing(ScriptEngineFactory::getEngineName));
|
||||
nameAssociations = new HashMap<String, ScriptEngineFactory>();
|
||||
extensionAssociations = new HashMap<String, ScriptEngineFactory>();
|
||||
mimeTypeAssociations = new HashMap<String, ScriptEngineFactory>();
|
||||
|
@ -400,7 +400,7 @@ public class ScriptEngineManager {
|
|||
}
|
||||
|
||||
/** Set of script engine factories discovered. */
|
||||
private HashSet<ScriptEngineFactory> engineSpis;
|
||||
private TreeSet<ScriptEngineFactory> engineSpis;
|
||||
|
||||
/** Map of engine name to script engine factory. */
|
||||
private HashMap<String, ScriptEngineFactory> nameAssociations;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue