Переглянути джерело

Merge pull request #721 from csmith/master

Minor style fixes
pull/723/head
Greg Holmes 7 роки тому
джерело
коміт
6a2c14f786

+ 1
- 1
gradle/fatjar.gradle Переглянути файл

@@ -47,7 +47,7 @@ task createFatVersionConfig {
47 47
 
48 48
         targetFile << "\nbundledplugins_versions:\n"
49 49
         configurations.plugin.each { p ->
50
-            targetFile << " " + p.name.replaceFirst('-', '=').replaceAll('.jar$', '\n');
50
+            targetFile << " " + p.name.replaceFirst('-', '=').replaceAll('.jar$', '\n')
51 51
         }
52 52
     }
53 53
 }

+ 1
- 5
src/main/java/com/dmdirc/config/ConfigManager.java Переглянути файл

@@ -28,20 +28,16 @@ import com.dmdirc.interfaces.config.ConfigProvider;
28 28
 import com.dmdirc.interfaces.config.ConfigProviderMigrator;
29 29
 import com.dmdirc.util.ClientInfo;
30 30
 import com.dmdirc.util.validators.Validator;
31
-
32 31
 import com.google.common.collect.ArrayListMultimap;
33 32
 import com.google.common.collect.Multimap;
34
-
35 33
 import java.util.ArrayList;
36 34
 import java.util.Collection;
37
-import java.util.Collections;
38 35
 import java.util.HashMap;
39 36
 import java.util.HashSet;
40 37
 import java.util.List;
41 38
 import java.util.Map;
42 39
 import java.util.Set;
43 40
 import java.util.TreeMap;
44
-
45 41
 import org.slf4j.Logger;
46 42
 import org.slf4j.LoggerFactory;
47 43
 
@@ -319,7 +315,7 @@ class ConfigManager implements ConfigChangeListener, ConfigProviderListener,
319 315
             synchronized (sources) {
320 316
                 sources.add(identity);
321 317
                 identity.addListener(this);
322
-                Collections.sort(sources, new ConfigProviderTargetComparator());
318
+                sources.sort(new ConfigProviderTargetComparator());
323 319
             }
324 320
 
325 321
             // Determine which settings will have changed

+ 1
- 1
src/main/java/com/dmdirc/config/IdentityManager.java Переглянути файл

@@ -442,7 +442,7 @@ public class IdentityManager implements IdentityFactory, IdentityController {
442 442
                     .collect(Collectors.toList()));
443 443
         }
444 444
 
445
-        Collections.sort(sources, new ConfigProviderTargetComparator());
445
+        sources.sort(new ConfigProviderTargetComparator());
446 446
 
447 447
         LOG.debug("Found {} source(s) for {}", sources.size(), manager);
448 448
 

+ 1
- 1
src/main/java/com/dmdirc/config/prefs/reader/PreferencesReader.java Переглянути файл

@@ -118,7 +118,7 @@ public class PreferencesReader {
118 118
         readCategoriesList(asList(value));
119 119
     }
120 120
 
121
-    private void readCategoriesList(final List<Object> list) throws PreferencesReaderException {
121
+    private void readCategoriesList(final List<Object> list) {
122 122
         for (Object category : list) {
123 123
             LOG.debug("Found category entry: {}", category.getClass().getName());
124 124
             final CategoryReader reader = new CategoryReader(asMap(category));

+ 5
- 11
src/main/java/com/dmdirc/ui/core/profiles/CoreProfilesDialogModel.java Переглянути файл

@@ -143,9 +143,7 @@ public class CoreProfilesDialogModel implements ProfilesDialogModel {
143 143
     @Override
144 144
     public void setSelectedProfile(final Optional<MutableProfile> profile) {
145 145
         checkNotNull(profile, "profile cannot be null");
146
-        if (profile.isPresent()) {
147
-            checkArgument(profiles.containsValue(profile.get()), "Profile must exist in list");
148
-        }
146
+        profile.ifPresent(mutableProfile -> checkArgument(profiles.containsValue(mutableProfile), "Profile must exist in list"));
149 147
         if (!selectedProfile.equals(profile)) {
150 148
             selectedProfile = profile;
151 149
             listeners.getCallable(ProfilesDialogModelListener.class).profileSelectionChanged(profile);
@@ -273,10 +271,8 @@ public class CoreProfilesDialogModel implements ProfilesDialogModel {
273 271
     public void setSelectedProfileSelectedNickname(final Optional<String> selectedNickname) {
274 272
         checkNotNull(selectedNickname, "Nickname cannot be null");
275 273
         selectedProfile.ifPresent(p -> {
276
-            if (selectedNickname.isPresent()) {
277
-                checkArgument(p.getNicknames().contains(selectedNickname.get()),
278
-                    "Nickname must exist in nicknames list");
279
-            }
274
+            selectedNickname.ifPresent(s -> checkArgument(p.getNicknames().contains(s),
275
+                    "Nickname must exist in nicknames list"));
280 276
             if (this.selectedNickname != selectedNickname) {
281 277
                 this.selectedNickname = selectedNickname;
282 278
                 listeners.getCallable(ProfilesDialogModelListener.class)
@@ -289,10 +285,8 @@ public class CoreProfilesDialogModel implements ProfilesDialogModel {
289 285
     public void setSelectedProfileSelectedHighlight(final Optional<String> selectedHighlight) {
290 286
         checkNotNull(selectedHighlight, "Highlight cannot be null");
291 287
         selectedProfile.ifPresent(p -> {
292
-            if (selectedHighlight.isPresent()) {
293
-                checkArgument(p.getHighlights().contains(selectedHighlight.get()),
294
-                        "Nickname must exist in nicknames list");
295
-            }
288
+            selectedHighlight.ifPresent(s -> checkArgument(p.getHighlights().contains(s),
289
+                    "Nickname must exist in nicknames list"));
296 290
             if (this.selectedHighlight != selectedHighlight) {
297 291
                 this.selectedHighlight = selectedHighlight;
298 292
                 listeners.getCallable(ProfilesDialogModelListener.class)

+ 1
- 1
src/main/java/com/dmdirc/ui/messages/IRCLine.java Переглянути файл

@@ -105,7 +105,7 @@ public class IRCLine implements Line {
105 105
     @Override
106 106
     public <T> T getStyled(final StyledMessageMaker<T> maker) {
107 107
         maker.setDefaultFont(fontName, fontSize);
108
-        styliser.addStyledString(maker, getLineParts());;
108
+        styliser.addStyledString(maker, getLineParts());
109 109
         final T styledString = maker.getStyledMessage();
110 110
         fontSize = maker.getMaximumFontSize();
111 111
         maker.clear();

Завантаження…
Відмінити
Зберегти