Przeglądaj źródła

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 lat temu
rodzic
commit
2a277dafbf

+ 4
- 3
src/com/dmdirc/commandparser/parsers/CommandParser.java Wyświetl plik

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

+ 13
- 11
src/com/dmdirc/config/ConfigBinder.java Wyświetl plik

38
 import java.util.Collection;
38
 import java.util.Collection;
39
 import java.util.List;
39
 import java.util.List;
40
 
40
 
41
-import lombok.AllArgsConstructor;
42
-import lombok.Synchronized;
43
-
44
 /**
41
 /**
45
  * Facilitates automatically binding fields or methods annotated with a
42
  * Facilitates automatically binding fields or methods annotated with a
46
  * {@link ConfigBinding} element to a configuration value.
43
  * {@link ConfigBinding} element to a configuration value.
47
  */
44
  */
48
-@AllArgsConstructor
49
 public class ConfigBinder {
45
 public class ConfigBinder {
50
 
46
 
51
     /** A map of instances to created listeners. */
47
     /** A map of instances to created listeners. */
54
     /** The configuration manager to use to retrieve settings. */
50
     /** The configuration manager to use to retrieve settings. */
55
     private final AggregateConfigProvider manager;
51
     private final AggregateConfigProvider manager;
56
 
52
 
53
+    public ConfigBinder(final AggregateConfigProvider manager) {
54
+        this.manager = manager;
55
+    }
56
+
57
     /**
57
     /**
58
      * Binds all annotated methods and fields of the given instance to this
58
      * Binds all annotated methods and fields of the given instance to this
59
      * binder's configuration manager.
59
      * binder's configuration manager.
208
      * @param instance The instance to add listeners for
208
      * @param instance The instance to add listeners for
209
      * @param newListeners The listeners to be added
209
      * @param newListeners The listeners to be added
210
      */
210
      */
211
-    @Synchronized
212
     private void addListeners(final Object instance,
211
     private void addListeners(final Object instance,
213
             final Collection<ConfigChangeListener> newListeners) {
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
      *
221
      *
221
      * @param instance The instance to be unbound
222
      * @param instance The instance to be unbound
222
      */
223
      */
223
-    @Synchronized
224
     public void unbind(final Object instance) {
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 Wyświetl plik

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

+ 7
- 5
src/com/dmdirc/config/ConfigManager.java Wyświetl plik

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

+ 3
- 2
src/com/dmdirc/config/IdentityManager.java Wyświetl plik

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

Ładowanie…
Anuluj
Zapisz