Browse Source

Merge pull request #194 from csmith/master

Minor tidying.
pull/196/head
Greg Holmes 9 years ago
parent
commit
7f18b1da82

+ 4
- 4
src/com/dmdirc/actions/Action.java View File

@@ -357,22 +357,22 @@ public class Action extends ActionModel implements ConfigChangeListener {
357 357
         newConfig.addDomain(DOMAIN_RESPONSE, responseLines);
358 358
 
359 359
         if (conditionTree != null) {
360
-            newConfig.addDomain(DOMAIN_CONDITIONTREE, new ArrayList<String>());
360
+            newConfig.addDomain(DOMAIN_CONDITIONTREE, new ArrayList<>());
361 361
             newConfig.getFlatDomain(DOMAIN_CONDITIONTREE).add(conditionTree.toString());
362 362
         }
363 363
 
364 364
         if (newFormat != null) {
365
-            newConfig.addDomain(DOMAIN_FORMAT, new ArrayList<String>());
365
+            newConfig.addDomain(DOMAIN_FORMAT, new ArrayList<>());
366 366
             newConfig.getFlatDomain(DOMAIN_FORMAT).add(newFormat);
367 367
         }
368 368
 
369 369
         if (concurrencyGroup != null) {
370
-            newConfig.addDomain(DOMAIN_CONCURRENCY, new HashMap<String, String>());
370
+            newConfig.addDomain(DOMAIN_CONCURRENCY, new HashMap<>());
371 371
             newConfig.getKeyDomain(DOMAIN_CONCURRENCY).put("group", concurrencyGroup);
372 372
         }
373 373
 
374 374
         if (stop) {
375
-            newConfig.addDomain(DOMAIN_MISC, new HashMap<String, String>());
375
+            newConfig.addDomain(DOMAIN_MISC, new HashMap<>());
376 376
             newConfig.getKeyDomain(DOMAIN_MISC).put("stopping", "true");
377 377
         }
378 378
 

+ 1
- 1
src/com/dmdirc/lists/GroupListManager.java View File

@@ -47,7 +47,7 @@ public class GroupListManager implements GroupListStartListener,
47 47
     private final Connection connection;
48 48
     /** The cached groups. */
49 49
     private final ObservableList<GroupListEntry> groups = new ObservableListDecorator<>(
50
-            new LinkedList<GroupListEntry>());
50
+            new LinkedList<>());
51 51
 
52 52
     public GroupListManager(final Connection connection) {
53 53
         this.connection = connection;

+ 3
- 1
src/com/dmdirc/plugins/PluginManager.java View File

@@ -587,7 +587,9 @@ public class PluginManager implements ServiceManager {
587 587
 
588 588
     @Handler
589 589
     public void handlePrefsClosed(final ClientPrefsClosedEvent event) {
590
-        getPluginInfos().stream().filter(PluginInfo::isTempLoaded).forEach(pi -> pi.unloadPlugin());
590
+        getPluginInfos().stream()
591
+                .filter(PluginInfo::isTempLoaded)
592
+                .forEach(PluginInfo::unloadPlugin);
591 593
     }
592 594
 
593 595
 }

+ 12
- 25
src/com/dmdirc/ui/WarningDialog.java View File

@@ -27,8 +27,6 @@ import java.awt.Font;
27 27
 import java.awt.Insets;
28 28
 import java.awt.Toolkit;
29 29
 import java.awt.Window;
30
-import java.awt.event.ActionEvent;
31
-import java.awt.event.ActionListener;
32 30
 import java.awt.event.WindowAdapter;
33 31
 import java.awt.event.WindowEvent;
34 32
 import java.util.concurrent.Semaphore;
@@ -97,12 +95,7 @@ public class WarningDialog extends JDialog {
97 95
         final JPanel panel = new JPanel(new BorderLayout(5, 5));
98 96
 
99 97
         final JButton button = new JButton("OK");
100
-        button.addActionListener(new ActionListener() {
101
-            @Override
102
-            public void actionPerformed(final ActionEvent e) {
103
-                dispose();
104
-            }
105
-        });
98
+        button.addActionListener(e -> dispose());
106 99
 
107 100
         final JTextPane textArea = new JTextPane(new HTMLDocument());
108 101
         textArea.setEditorKit(new HTMLEditorKit());
@@ -135,13 +128,10 @@ public class WarningDialog extends JDialog {
135 128
      * Static method to instantiate and display the dialog.
136 129
      */
137 130
     public void display() {
138
-        SwingUtilities.invokeLater(new Runnable() {
139
-            @Override
140
-            public void run() {
141
-                setSize(400, 400);
142
-                CoreUIUtils.centreWindow(WarningDialog.this);
143
-                setVisible(true);
144
-            }
131
+        SwingUtilities.invokeLater(() -> {
132
+            setSize(400, 400);
133
+            CoreUIUtils.centreWindow(this);
134
+            setVisible(true);
145 135
         });
146 136
     }
147 137
 
@@ -150,16 +140,13 @@ public class WarningDialog extends JDialog {
150 140
      */
151 141
     public void displayBlocking() {
152 142
         final Semaphore semaphore = new Semaphore(0);
153
-        SwingUtilities.invokeLater(new Runnable() {
154
-            @Override
155
-            public void run() {
156
-                addWindowListener(new WindowAdapter() {
157
-                    @Override
158
-                    public void windowClosed(final WindowEvent e) {
159
-                        semaphore.release();
160
-                    }
161
-                });
162
-            }
143
+        SwingUtilities.invokeLater(() -> {
144
+            addWindowListener(new WindowAdapter() {
145
+                @Override
146
+                public void windowClosed(final WindowEvent e) {
147
+                    semaphore.release();
148
+                }
149
+            });
163 150
         });
164 151
         display();
165 152
         semaphore.acquireUninterruptibly();

+ 2
- 4
src/com/dmdirc/ui/messages/ColourManager.java View File

@@ -64,9 +64,7 @@ public class ColourManager {
64 64
         this.configManager = configManager;
65 65
         this.eventBus = eventBus;
66 66
 
67
-        configManager.addChangeListener("colour", (domain, key) -> {
68
-            initColours();
69
-        });
67
+        configManager.addChangeListener("colour", (domain, key) -> initColours());
70 68
 
71 69
         initColours();
72 70
     }
@@ -75,7 +73,7 @@ public class ColourManager {
75 73
      * Initialises the IRC_COLOURS array.
76 74
      */
77 75
     private void initColours() {
78
-        final Validator validator = new ColourValidator();
76
+        final Validator<String> validator = new ColourValidator();
79 77
         for (int i = 0; i < 16; i++) {
80 78
             if (configManager.hasOptionString("colour", String.valueOf(i), validator)) {
81 79
                 ircColours[i] = getColourFromHex(

+ 1
- 1
src/com/dmdirc/updater/manager/DMDircUpdateManager.java View File

@@ -67,7 +67,7 @@ public class DMDircUpdateManager extends CachingUpdateManagerImpl {
67 67
             final Set<UpdateInstallationStrategy> installationStrategies,
68 68
             final Set<UpdateComponent> components) {
69 69
         super(new ThreadPoolExecutor(THREAD_COUNT, THREAD_COUNT, 1, TimeUnit.MINUTES,
70
-                new LinkedBlockingQueue<Runnable>(), new NamedThreadFactory()),
70
+                new LinkedBlockingQueue<>(), new NamedThreadFactory()),
71 71
                 consolidator, updatePolicy);
72 72
 
73 73
         checkStrategies.forEach(DMDircUpdateManager.this::addCheckStrategy);

Loading…
Cancel
Save