equal
deleted
inserted
replaced
75 init(loader); |
75 init(loader); |
76 } |
76 } |
77 |
77 |
78 private void init(final ClassLoader loader) { |
78 private void init(final ClassLoader loader) { |
79 globalScope = new SimpleBindings(); |
79 globalScope = new SimpleBindings(); |
80 engineSpis = new HashSet<ScriptEngineFactory>(); |
80 engineSpis = new TreeSet<ScriptEngineFactory>(Comparator.comparing(ScriptEngineFactory::getEngineName)); |
81 nameAssociations = new HashMap<String, ScriptEngineFactory>(); |
81 nameAssociations = new HashMap<String, ScriptEngineFactory>(); |
82 extensionAssociations = new HashMap<String, ScriptEngineFactory>(); |
82 extensionAssociations = new HashMap<String, ScriptEngineFactory>(); |
83 mimeTypeAssociations = new HashMap<String, ScriptEngineFactory>(); |
83 mimeTypeAssociations = new HashMap<String, ScriptEngineFactory>(); |
84 initEngines(loader); |
84 initEngines(loader); |
85 } |
85 } |
398 if (extension == null || factory == null) throw new NullPointerException(); |
398 if (extension == null || factory == null) throw new NullPointerException(); |
399 extensionAssociations.put(extension, factory); |
399 extensionAssociations.put(extension, factory); |
400 } |
400 } |
401 |
401 |
402 /** Set of script engine factories discovered. */ |
402 /** Set of script engine factories discovered. */ |
403 private HashSet<ScriptEngineFactory> engineSpis; |
403 private TreeSet<ScriptEngineFactory> engineSpis; |
404 |
404 |
405 /** Map of engine name to script engine factory. */ |
405 /** Map of engine name to script engine factory. */ |
406 private HashMap<String, ScriptEngineFactory> nameAssociations; |
406 private HashMap<String, ScriptEngineFactory> nameAssociations; |
407 |
407 |
408 /** Map of script file extension to script engine factory. */ |
408 /** Map of script file extension to script engine factory. */ |