Skip to content

Commit 271128e

Browse files
committed
ScriptLanguageIndex: use an ordered collection
The HashSet is not ordered, so iterating over it returns the ScriptLanguages in a random order. But we want them in priority order, which is the order they are added to the collection. This change arguably breaks backwards compatibility, but in 99% of the cases the API calls in practice will be the same (e.g., contains), so I'm going to fudge this one.
1 parent b9ec17e commit 271128e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/org/scijava/script/ScriptLanguageIndex.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
package org.scijava.script;
3333

3434
import java.io.File;
35+
import java.util.ArrayList;
3536
import java.util.HashMap;
36-
import java.util.HashSet;
3737
import java.util.List;
3838
import java.util.Map;
3939

@@ -48,7 +48,7 @@
4848
* @author Johannes Schindelin
4949
* @author Curtis Rueden
5050
*/
51-
public class ScriptLanguageIndex extends HashSet<ScriptLanguage> {
51+
public class ScriptLanguageIndex extends ArrayList<ScriptLanguage> {
5252

5353
private static final long serialVersionUID = 1L;
5454

0 commit comments

Comments
 (0)