Skip to content

Commit 8b7a104

Browse files
committed
ConvertService: use LinkedHashSet
When collecting input candidates, use a LinkedHashSet instead of a HashSet. This will preserve the ordering of the candidates.
1 parent 853fd2e commit 8b7a104

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/org/scijava/convert/DefaultConvertService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
import java.lang.reflect.Type;
3535
import java.util.ArrayList;
3636
import java.util.Collection;
37-
import java.util.HashSet;
37+
import java.util.LinkedHashSet;
3838
import java.util.Set;
3939

4040
import org.scijava.plugin.Plugin;
@@ -103,7 +103,7 @@ public boolean supports(final Class<?> src, final Type dest) {
103103

104104
@Override
105105
public Collection<Object> getCompatibleInputs(Class<?> dest) {
106-
Set<Object> objects = new HashSet<Object>();
106+
Set<Object> objects = new LinkedHashSet<Object>();
107107

108108
for (final Converter c : getInstances()) {
109109
if (dest.isAssignableFrom(c.getOutputType())) {

0 commit comments

Comments
 (0)