File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
src/main/java/org/scijava/search Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 2929
3030package org .scijava .search ;
3131
32- import java .util .HashMap ;
32+ import java .util .HashSet ;
3333import java .util .List ;
34- import java .util .Map ;
34+ import java .util .Set ;
3535import java .util .stream .Collectors ;
3636
3737import org .scijava .plugin .SingletonService ;
@@ -68,12 +68,12 @@ default SearchOperation search(final SearchListener... callbacks) {
6868 */
6969 default List <SearchAction > actions (final SearchResult result ) {
7070 // Create a map used to track whether a name has been seen
71- final Map < Object , Boolean > seenLabels = new HashMap <>();
71+ final Set < String > seenLabels = new HashSet <>();
7272 return getInstances ().stream () //
7373 .filter (factory -> factory .supports (result )) //
7474 .map (factory -> factory .create (result )) //
7575 // NB The following line skip actions with duplicate labels
76- .filter (t -> seenLabels .putIfAbsent (t .toString (), Boolean . TRUE ) == null ) //
76+ .filter (t -> seenLabels .add (t .toString ()) ) //
7777 .collect (Collectors .toList ());
7878 }
7979
You can’t perform that action at this time.
0 commit comments