Skip to content

Commit 9caaf57

Browse files
committed
Resolve generics unambiguously
Apparently there is a JDT method ref/varargs resolution bug that was confused about the generic typing of this call.
1 parent 0938965 commit 9caaf57

1 file changed

Lines changed: 42 additions & 12 deletions

File tree

‎src/main/java/org/scijava/ui/swing/script/FileSystemTree.java‎

Lines changed: 42 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,30 +28,60 @@
2828
*/
2929
package org.scijava.ui.swing.script;
3030

31-
import com.formdev.flatlaf.icons.FlatAbstractIcon;
32-
import com.formdev.flatlaf.icons.FlatOptionPaneErrorIcon;
33-
import org.scijava.log.Logger;
34-
35-
import javax.swing.*;
36-
import javax.swing.event.TreeExpansionEvent;
37-
import javax.swing.event.TreeWillExpandListener;
38-
import javax.swing.tree.*;
39-
import java.awt.*;
31+
import java.awt.Component;
32+
import java.awt.Graphics;
4033
import java.awt.event.MouseAdapter;
4134
import java.awt.event.MouseEvent;
4235
import java.io.File;
4336
import java.io.FileFilter;
4437
import java.io.IOException;
45-
import java.nio.file.*;
38+
import java.nio.file.ClosedWatchServiceException;
39+
import java.nio.file.FileSystems;
40+
import java.nio.file.FileVisitOption;
41+
import java.nio.file.FileVisitResult;
42+
import java.nio.file.Files;
43+
import java.nio.file.Path;
44+
import java.nio.file.Paths;
45+
import java.nio.file.SimpleFileVisitor;
46+
import java.nio.file.StandardWatchEventKinds;
47+
import java.nio.file.WatchKey;
48+
import java.nio.file.WatchService;
4649
import java.nio.file.attribute.BasicFileAttributes;
47-
import java.util.*;
50+
import java.util.ArrayList;
51+
import java.util.Arrays;
52+
import java.util.Collection;
53+
import java.util.EnumSet;
54+
import java.util.Enumeration;
55+
import java.util.HashSet;
56+
import java.util.Iterator;
4857
import java.util.List;
58+
import java.util.Map;
59+
import java.util.Set;
60+
import java.util.TreeMap;
4961
import java.util.concurrent.ConcurrentHashMap;
5062
import java.util.concurrent.CopyOnWriteArrayList;
5163
import java.util.concurrent.CopyOnWriteArraySet;
5264
import java.util.function.BooleanSupplier;
5365
import java.util.function.Consumer;
5466

67+
import javax.swing.JTree;
68+
import javax.swing.SwingUtilities;
69+
import javax.swing.SwingWorker;
70+
import javax.swing.ToolTipManager;
71+
import javax.swing.UIManager;
72+
import javax.swing.event.TreeExpansionEvent;
73+
import javax.swing.event.TreeWillExpandListener;
74+
import javax.swing.tree.DefaultMutableTreeNode;
75+
import javax.swing.tree.DefaultTreeCellRenderer;
76+
import javax.swing.tree.DefaultTreeModel;
77+
import javax.swing.tree.TreePath;
78+
import javax.swing.tree.TreeSelectionModel;
79+
80+
import org.scijava.log.Logger;
81+
82+
import com.formdev.flatlaf.icons.FlatAbstractIcon;
83+
import com.formdev.flatlaf.icons.FlatOptionPaneErrorIcon;
84+
5585
/**
5686
* A tree listing the contents of one or more top-level folders. Folders are
5787
* listed when expanded, and kept in sync with the file system while expanded.
@@ -443,7 +473,7 @@ protected Prune doInBackground() {
443473
final long[] state = { 0, System.nanoTime() };
444474
for (final String top : tops) {
445475
if (isCancelled() || p.truncated || p.hitCap) break;
446-
walk(Paths.get(top), file_filter, p, onlyIn, state, this::isCancelled, this::publish);
476+
walk(Paths.get(top), file_filter, p, onlyIn, state, this::isCancelled, snapshot -> publish(snapshot));
447477
}
448478
return p;
449479
}

0 commit comments

Comments
 (0)