Skip to content

Commit e06750c

Browse files
committed
Use the diamond syntax
1 parent 1467153 commit e06750c

File tree

7 files changed

+15
-21
lines changed

7 files changed

+15
-21
lines changed

src/main/java/org/scijava/ui/swing/SwingIconService.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@ public class SwingIconService extends AbstractService implements IconService {
5454

5555
// -- instance variables --
5656

57-
private final HashMap<Tool, AbstractButton> buttonMap =
58-
new HashMap<Tool, AbstractButton>();
57+
private final HashMap<Tool, AbstractButton> buttonMap = new HashMap<>();
5958

6059
// -- IconService methods --
6160

src/main/java/org/scijava/ui/swing/SwingToolBar.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public class SwingToolBar extends JToolBar implements ToolBar {
9595
public SwingToolBar(final Context context) {
9696
context.inject(this);
9797

98-
toolButtons = new HashMap<String, AbstractButton>();
98+
toolButtons = new HashMap<>();
9999
populateToolBar();
100100
}
101101

src/main/java/org/scijava/ui/swing/commands/CommandFinderPanel.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ public void removeUpdate(final DocumentEvent arg0) {
244244

245245
/** Builds the master list of available commands. */
246246
private List<ModuleInfo> buildCommands(final ModuleService moduleService) {
247-
final List<ModuleInfo> list = new ArrayList<ModuleInfo>();
247+
final List<ModuleInfo> list = new ArrayList<>();
248248
list.addAll(moduleService.getModules());
249249
Collections.sort(list);
250250
return list;
@@ -255,7 +255,7 @@ private void updateCommands() {
255255
final ModuleInfo selected = commandsList.getSelectedRow() < 0 ? null : getCommand();
256256
int counter = 0, selectedRow = -1;
257257
final String regex = getRegex();
258-
final List<ModuleInfo> matches = new ArrayList<ModuleInfo>();
258+
final List<ModuleInfo> matches = new ArrayList<>();
259259
for (final ModuleInfo command : commands) {
260260
if (!command.getMenuPath().toString().toLowerCase().matches(regex)) continue; // no match
261261
matches.add(command);

src/main/java/org/scijava/ui/swing/commands/WatchEventsFrame.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,11 @@ public class WatchEventsFrame extends JFrame implements ActionListener,
8282

8383
/** Data structure storing event types that should be filtered out. */
8484
private final HashSet<Class<? extends SciJavaEvent>> filtered =
85-
new HashSet<Class<? extends SciJavaEvent>>();
85+
new HashSet<>();
8686

8787
/** Data structure storing event types that should be highlighted in bold. */
8888
private final HashSet<Class<? extends SciJavaEvent>> selected =
89-
new HashSet<Class<? extends SciJavaEvent>>();
89+
new HashSet<>();
9090

9191
private final DefaultTreeModel treeModel;
9292
private final DefaultMutableTreeNode root;
@@ -399,7 +399,7 @@ private Iterable<DefaultMutableTreeNode> children(
399399
{
400400
@SuppressWarnings("unchecked")
401401
final Enumeration<DefaultMutableTreeNode> en = node.children();
402-
return new IteratorPlus<DefaultMutableTreeNode>(en);
402+
return new IteratorPlus<>(en);
403403
}
404404

405405
}

src/main/java/org/scijava/ui/swing/mdi/SwingMdiDialogPrompt.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,10 @@ public Result prompt() {
7373

7474
// / Translate DialogPrompt types and results to JOptionPane types and
7575
// results.
76-
static final Map<DialogPrompt.MessageType, Integer> msgMap =
77-
new HashMap<DialogPrompt.MessageType, Integer>();
76+
static final Map<DialogPrompt.MessageType, Integer> msgMap = new HashMap<>();
7877
static final Map<DialogPrompt.OptionType, Integer> optionMap =
79-
new HashMap<DialogPrompt.OptionType, Integer>();
80-
static final Map<Integer, DialogPrompt.Result> resultMap =
81-
new HashMap<Integer, DialogPrompt.Result>();
78+
new HashMap<>();
79+
static final Map<Integer, DialogPrompt.Result> resultMap = new HashMap<>();
8280

8381
static {
8482
msgMap.put(DialogPrompt.MessageType.ERROR_MESSAGE,

src/main/java/org/scijava/ui/swing/menu/AbstractSwingMenuCreator.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,13 @@ public abstract class AbstractSwingMenuCreator<T> extends
6464
{
6565

6666
/** Table of button groups for radio button menu items. */
67-
private HashMap<String, ButtonGroup> buttonGroups =
68-
new HashMap<String, ButtonGroup>();
67+
private HashMap<String, ButtonGroup> buttonGroups = new HashMap<>();
6968

7069
// -- MenuCreator methods --
7170

7271
@Override
7372
public void createMenus(final ShadowMenu root, final T target) {
74-
buttonGroups = new HashMap<String, ButtonGroup>();
73+
buttonGroups = new HashMap<>();
7574
super.createMenus(root, target);
7675
}
7776

src/main/java/org/scijava/ui/swing/sdi/SwingDialogPrompt.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,10 @@ public Result prompt() {
7171
// / Translate DialogPrompt types and results to JOptionPane types and
7272
// results.
7373

74-
static final Map<DialogPrompt.MessageType, Integer> msgMap =
75-
new HashMap<DialogPrompt.MessageType, Integer>();
74+
static final Map<DialogPrompt.MessageType, Integer> msgMap = new HashMap<>();
7675
static final Map<DialogPrompt.OptionType, Integer> optionMap =
77-
new HashMap<DialogPrompt.OptionType, Integer>();
78-
static final Map<Integer, DialogPrompt.Result> resultMap =
79-
new HashMap<Integer, DialogPrompt.Result>();
76+
new HashMap<>();
77+
static final Map<Integer, DialogPrompt.Result> resultMap = new HashMap<>();
8078

8179
static {
8280
msgMap.put(DialogPrompt.MessageType.ERROR_MESSAGE,

0 commit comments

Comments
 (0)