ソースを参照

Remove lombok

Change-Id: I90a6dd3137244f5edc63ce846b07b4720d098194
Reviewed-on: http://gerrit.dmdirc.com/2986
Automatic-Compile: DMDirc Build Manager
Reviewed-by: Chris Smith <chris@dmdirc.com>
tags/0.8rc1
Greg Holmes 10年前
コミット
2a277dafbf

+ 4
- 3
src/com/dmdirc/commandparser/parsers/CommandParser.java ファイルの表示

@@ -43,8 +43,6 @@ import java.io.Serializable;
43 43
 import java.util.HashMap;
44 44
 import java.util.Map;
45 45
 
46
-import lombok.Getter;
47
-
48 46
 /**
49 47
  * Represents a generic command parser. A command parser takes a line of input
50 48
  * from the user, determines if it is an attempt at executing a command (based
@@ -70,7 +68,6 @@ public abstract class CommandParser implements Serializable {
70 68
     private final RollingList<PreviousCommand> history;
71 69
 
72 70
     /** Command manager to use. */
73
-    @Getter
74 71
     protected final CommandController commandManager;
75 72
 
76 73
     /**
@@ -87,6 +84,10 @@ public abstract class CommandParser implements Serializable {
87 84
         loadCommands();
88 85
     }
89 86
 
87
+    public CommandController getCommandManager() {
88
+        return commandManager;
89
+    }
90
+
90 91
     /**
91 92
      * Sets the owner of this command parser.
92 93
      *

+ 13
- 11
src/com/dmdirc/config/ConfigBinder.java ファイルの表示

@@ -38,14 +38,10 @@ import java.util.Arrays;
38 38
 import java.util.Collection;
39 39
 import java.util.List;
40 40
 
41
-import lombok.AllArgsConstructor;
42
-import lombok.Synchronized;
43
-
44 41
 /**
45 42
  * Facilitates automatically binding fields or methods annotated with a
46 43
  * {@link ConfigBinding} element to a configuration value.
47 44
  */
48
-@AllArgsConstructor
49 45
 public class ConfigBinder {
50 46
 
51 47
     /** A map of instances to created listeners. */
@@ -54,6 +50,10 @@ public class ConfigBinder {
54 50
     /** The configuration manager to use to retrieve settings. */
55 51
     private final AggregateConfigProvider manager;
56 52
 
53
+    public ConfigBinder(final AggregateConfigProvider manager) {
54
+        this.manager = manager;
55
+    }
56
+
57 57
     /**
58 58
      * Binds all annotated methods and fields of the given instance to this
59 59
      * binder's configuration manager.
@@ -208,10 +208,11 @@ public class ConfigBinder {
208 208
      * @param instance The instance to add listeners for
209 209
      * @param newListeners The listeners to be added
210 210
      */
211
-    @Synchronized
212 211
     private void addListeners(final Object instance,
213 212
             final Collection<ConfigChangeListener> newListeners) {
214
-        listeners.add(instance, newListeners);
213
+        synchronized (listeners) {
214
+            listeners.add(instance, newListeners);
215
+        }
215 216
     }
216 217
 
217 218
     /**
@@ -220,12 +221,13 @@ public class ConfigBinder {
220 221
      *
221 222
      * @param instance The instance to be unbound
222 223
      */
223
-    @Synchronized
224 224
     public void unbind(final Object instance) {
225
-        for (ConfigChangeListener listener : listeners.safeGet(instance)) {
226
-            manager.removeListener(listener);
227
-        }
225
+        synchronized (listeners) {
226
+            for (ConfigChangeListener listener : listeners.safeGet(instance)) {
227
+                manager.removeListener(listener);
228
+            }
228 229
 
229
-        listeners.remove(instance);
230
+            listeners.remove(instance);
231
+        }
230 232
     }
231 233
 }

+ 3
- 2
src/com/dmdirc/config/ConfigFileBackedConfigProvider.java ファイルの表示

@@ -42,14 +42,15 @@ import java.util.List;
42 42
 import java.util.Map;
43 43
 import java.util.Set;
44 44
 
45
-import lombok.extern.slf4j.Slf4j;
45
+import org.slf4j.LoggerFactory;
46 46
 
47 47
 /**
48 48
  * Provides configuration settings from a {@link ConfigFile}.
49 49
  */
50
-@Slf4j
51 50
 public class ConfigFileBackedConfigProvider extends BaseConfigProvider implements ConfigProvider {
52 51
 
52
+    private static final org.slf4j.Logger log = LoggerFactory.getLogger(ConfigFileBackedConfigProvider.class);
53
+
53 54
     /** The domain used for identity settings. */
54 55
     private static final String DOMAIN = "identity";
55 56
 

+ 7
- 5
src/com/dmdirc/config/ConfigManager.java ファイルの表示

@@ -39,17 +39,16 @@ import java.util.Map;
39 39
 import java.util.Set;
40 40
 import java.util.TreeMap;
41 41
 
42
-import lombok.Getter;
43
-import lombok.extern.slf4j.Slf4j;
42
+import org.slf4j.LoggerFactory;
44 43
 
45 44
 /**
46 45
  * The config manager manages the various config sources for each entity.
47 46
  */
48
-@Slf4j
49
-@SuppressWarnings("PMD.UnusedPrivateField")
50 47
 public class ConfigManager extends BaseConfigProvider implements ConfigChangeListener,
51 48
         ConfigProviderListener, AggregateConfigProvider {
52 49
 
50
+    private static final org.slf4j.Logger log = LoggerFactory.getLogger(ConfigManager.class);
51
+
53 52
     /** Temporary map for lookup stats. */
54 53
     private static final Map<String, Integer> STATS = new TreeMap<>();
55 54
 
@@ -63,7 +62,6 @@ public class ConfigManager extends BaseConfigProvider implements ConfigChangeLis
63 62
     private final MapList<String, ConfigChangeListener> listeners = new MapList<>();
64 63
 
65 64
     /** The config binder to use for this manager. */
66
-    @Getter
67 65
     private final ConfigBinder binder = new ConfigBinder(this);
68 66
 
69 67
     /** The protocol this manager is for. */
@@ -124,6 +122,10 @@ public class ConfigManager extends BaseConfigProvider implements ConfigChangeLis
124 122
         IdentityManager.getIdentityManager().registerIdentityListener(this);
125 123
     }
126 124
 
125
+    public ConfigBinder getBinder() {
126
+        return binder;
127
+    }
128
+
127 129
     /** {@inheritDoc} */
128 130
     @Override
129 131
     public String getOption(final String domain, final String option,

+ 3
- 2
src/com/dmdirc/config/IdentityManager.java ファイルの表示

@@ -48,7 +48,7 @@ import java.util.List;
48 48
 import java.util.Map;
49 49
 import java.util.Set;
50 50
 
51
-import lombok.extern.slf4j.Slf4j;
51
+import org.slf4j.LoggerFactory;
52 52
 
53 53
 import static com.google.common.base.Preconditions.checkArgument;
54 54
 import static com.google.common.base.Preconditions.checkNotNull;
@@ -57,9 +57,10 @@ import static com.google.common.base.Preconditions.checkNotNull;
57 57
  * The identity manager manages all known identities, providing easy methods
58 58
  * to access them.
59 59
  */
60
-@Slf4j
61 60
 public class IdentityManager implements IdentityFactory, IdentityController {
62 61
 
62
+    private static final org.slf4j.Logger log = LoggerFactory.getLogger(IdentityManager.class);
63
+
63 64
     /** A regular expression that will match all characters illegal in file names. */
64 65
     private static final String ILLEGAL_CHARS = "[\\\\\"/:\\*\\?\"<>\\|]";
65 66
 

読み込み中…
キャンセル
保存