Quellcode durchsuchen

Start to remove lombok :(

Change-Id: I44b4eddde8126a89003e68653ac24c4d3527c6f8
Reviewed-on: http://gerrit.dmdirc.com/2983
Automatic-Compile: DMDirc Build Manager
Reviewed-by: Chris Smith <chris@dmdirc.com>
tags/0.8rc1
Greg Holmes vor 10 Jahren
Ursprung
Commit
eb9fc0d2eb

+ 1
- 0
ivy.xml Datei anzeigen

@@ -18,6 +18,7 @@
18 18
         <dependency org="ch.qos.logback" name="logback-classic" rev="1.+" conf="test->default" />
19 19
 
20 20
         <dependency org="org.projectlombok" name="lombok" rev="latest.integration" conf="main->default" />
21
+
21 22
         <dependency org="com.dmdirc" name="annotations" rev="[0.3.4,)" conf="main->default" />
22 23
         <dependency org="com.google.code.findbugs" name="jsr305" rev="2.+" conf="main->default" />
23 24
 

+ 2
- 0
nbproject/project.properties Datei anzeigen

@@ -14,6 +14,8 @@ auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.class
14 14
 auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.countForUsingStaticStarImport=1
15 15
 auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.importGroupsOrder=com.dmdirc;com.google;com.palantir;java;javax;lombok;net.miginfocom;org;*;static *
16 16
 auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.separateStaticImports=true
17
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.wrapOneLineComment=false
18
+auxiliary.org-netbeans-spi-editor-hints-projects.perProjectHintSettingsFile=nbproject/cfg_hints.xml
17 19
 endorsed.classpath=
18 20
 javac.classpath=
19 21
 javac.processorpath=\

+ 12
- 5
src/com/dmdirc/Channel.java Datei anzeigen

@@ -57,8 +57,6 @@ import java.util.Map;
57 57
 
58 58
 import javax.annotation.Nonnull;
59 59
 
60
-import lombok.Getter;
61
-
62 60
 /**
63 61
  * The Channel class represents the client's view of the channel. It handles
64 62
  * callbacks for channel events from the parser, maintains the corresponding
@@ -71,14 +69,12 @@ public class Channel extends MessageTarget implements ConfigChangeListener {
71 69
     private final ListenerList listenerList = new ListenerList();
72 70
 
73 71
     /** The parser's pChannel class. */
74
-    @Getter
75 72
     private ChannelInfo channelInfo;
76 73
 
77 74
     /** The server this channel is on. */
78 75
     private final Server server;
79 76
 
80 77
     /** The tabcompleter used for this channel. */
81
-    @Getter
82 78
     private final TabCompleter tabCompleter;
83 79
 
84 80
     /** A list of previous topics we've seen. */
@@ -91,7 +87,6 @@ public class Channel extends MessageTarget implements ConfigChangeListener {
91 87
     private final ConfigProviderMigrator configMigrator;
92 88
 
93 89
     /** Whether we're in this channel or not. */
94
-    @Getter
95 90
     private boolean isOnChannel;
96 91
 
97 92
     /** Whether we should send WHO requests for this channel. */
@@ -154,6 +149,18 @@ public class Channel extends MessageTarget implements ConfigChangeListener {
154 149
         selfJoin();
155 150
     }
156 151
 
152
+    public ChannelInfo getChannelInfo() {
153
+        return channelInfo;
154
+    }
155
+
156
+    public TabCompleter getTabCompleter() {
157
+        return tabCompleter;
158
+    }
159
+
160
+    public boolean isOnChannel() {
161
+        return isOnChannel;
162
+    }
163
+
157 164
     /**
158 165
      * Registers callbacks with the parser for this channel.
159 166
      */

+ 4
- 3
src/com/dmdirc/ChannelEventHandler.java Datei anzeigen

@@ -35,12 +35,9 @@ import com.dmdirc.parser.interfaces.callbacks.*; //NOPMD
35 35
 
36 36
 import java.util.Date;
37 37
 
38
-import lombok.AllArgsConstructor;
39
-
40 38
 /**
41 39
  * Handles events for channel objects.
42 40
  */
43
-@AllArgsConstructor
44 41
 public class ChannelEventHandler extends EventHandler implements
45 42
         ChannelMessageListener, ChannelNamesListener, ChannelTopicListener,
46 43
         ChannelJoinListener, ChannelPartListener, ChannelKickListener,
@@ -53,6 +50,10 @@ public class ChannelEventHandler extends EventHandler implements
53 50
     /** The channel that owns this event handler. */
54 51
     private final Channel owner;
55 52
 
53
+    public ChannelEventHandler(final Channel owner) {
54
+        this.owner = owner;
55
+    }
56
+
56 57
     /** {@inheritDoc} */
57 58
     @SuppressWarnings("unchecked")
58 59
     @Override

+ 24
- 9
src/com/dmdirc/FrameContainer.java Datei anzeigen

@@ -51,20 +51,16 @@ import java.util.Map;
51 51
 import java.util.Set;
52 52
 import java.util.concurrent.CopyOnWriteArrayList;
53 53
 
54
-import lombok.Getter;
55
-
56 54
 /**
57 55
  * The frame container implements basic methods that should be present in
58 56
  * all objects that handle a frame.
59 57
  */
60
-@SuppressWarnings("PMD.UnusedPrivateField")
61 58
 public abstract class FrameContainer {
62 59
 
63 60
     /** Listeners not yet using ListenerSupport. */
64 61
     protected final ListenerList listeners = new ListenerList();
65 62
 
66 63
     /** The colour of our frame's notifications. */
67
-    @Getter
68 64
     private Colour notification = Colour.BLACK;
69 65
 
70 66
     /** The document used to store this container's content. */
@@ -75,23 +71,18 @@ public abstract class FrameContainer {
75 71
             = new CopyOnWriteArrayList<>();
76 72
 
77 73
     /** The parent of this frame. */
78
-    @Getter
79 74
     private FrameContainer parent;
80 75
 
81 76
     /** The name of the icon being used for this container's frame. */
82
-    @Getter
83 77
     private String icon;
84 78
 
85 79
     /** The name of this container. */
86
-    @Getter
87 80
     private String name;
88 81
 
89 82
     /** The title of this container. */
90
-    @Getter
91 83
     private String title;
92 84
 
93 85
     /** The config manager for this container. */
94
-    @Getter
95 86
     private final AggregateConfigProvider configManager;
96 87
 
97 88
     /** The IconChanger for this container. */
@@ -134,6 +125,30 @@ public abstract class FrameContainer {
134 125
         setIcon(icon);
135 126
     }
136 127
 
128
+    public Colour getNotification() {
129
+        return notification;
130
+    }
131
+
132
+    public FrameContainer getParent() {
133
+        return parent;
134
+    }
135
+
136
+    public String getIcon() {
137
+        return icon;
138
+    }
139
+
140
+    public String getName() {
141
+        return name;
142
+    }
143
+
144
+    public String getTitle() {
145
+        return title;
146
+    }
147
+
148
+    public AggregateConfigProvider getConfigManager() {
149
+        return configManager;
150
+    }
151
+
137 152
     /**
138 153
      * Returns a collection of direct children of this frame.
139 154
      *

+ 4
- 4
src/com/dmdirc/GlobalWindow.java Datei anzeigen

@@ -41,8 +41,6 @@ import javax.inject.Inject;
41 41
 import javax.inject.Provider;
42 42
 import javax.inject.Singleton;
43 43
 
44
-import lombok.Getter;
45
-
46 44
 /**
47 45
  * A window which can be used to execute global commands.
48 46
  */
@@ -52,8 +50,6 @@ public class GlobalWindow extends WritableFrameContainer {
52 50
     private static GlobalWindow globalWindow;
53 51
 
54 52
     /** The tab completer we use. */
55
-    @Getter
56
-    @SuppressWarnings("PMD.UnusedPrivateField")
57 53
     private final TabCompleter tabCompleter;
58 54
 
59 55
     /**
@@ -77,6 +73,10 @@ public class GlobalWindow extends WritableFrameContainer {
77 73
         tabCompleter = tabCompleterFactory.getTabCompleter(config, CommandType.TYPE_GLOBAL);
78 74
     }
79 75
 
76
+    public TabCompleter getTabCompleter() {
77
+        return tabCompleter;
78
+    }
79
+
80 80
     /** {@inheritDoc} */
81 81
     @Override
82 82
     public void windowClosing() {

+ 8
- 5
src/com/dmdirc/Invite.java Datei anzeigen

@@ -26,23 +26,18 @@ import com.dmdirc.interfaces.Connection;
26 26
 
27 27
 import java.util.Date;
28 28
 
29
-import lombok.Getter;
30
-
31 29
 /**
32 30
  * Model for a channel invitation.
33 31
  */
34
-@SuppressWarnings("PMD.UnusedPrivateField")
35 32
 public class Invite {
36 33
 
37 34
     /** The connection this invite was on. */
38 35
     private final Connection connection;
39 36
 
40 37
     /** The channel this invite is for. */
41
-    @Getter
42 38
     private final String channel;
43 39
 
44 40
     /** The time this invite was created. */
45
-    @Getter
46 41
     private final long timestamp;
47 42
 
48 43
     /** The source of this invite. */
@@ -62,6 +57,14 @@ public class Invite {
62 57
         this.timestamp = new Date().getTime();
63 58
     }
64 59
 
60
+    public String getChannel() {
61
+        return channel;
62
+    }
63
+
64
+    public long getTimestamp() {
65
+        return timestamp;
66
+    }
67
+
65 68
     /**
66 69
      * Retrieves the source of this invite.
67 70
      *

+ 3
- 3
src/com/dmdirc/Server.java Datei anzeigen

@@ -85,8 +85,7 @@ import java.util.concurrent.locks.ReentrantReadWriteLock;
85 85
 
86 86
 import javax.net.ssl.TrustManager;
87 87
 
88
-import lombok.extern.slf4j.Slf4j;
89
-
88
+import org.slf4j.LoggerFactory;
90 89
 import static com.google.common.base.Preconditions.checkArgument;
91 90
 import static com.google.common.base.Preconditions.checkNotNull;
92 91
 
@@ -95,10 +94,11 @@ import static com.google.common.base.Preconditions.checkNotNull;
95 94
  * a list of all channels, queries, etc, and handles parser callbacks pertaining
96 95
  * to the server.
97 96
  */
98
-@Slf4j
99 97
 @Factory(inject = true, singleton = true, providers = true, name = "ServerFactoryImpl")
100 98
 public class Server extends WritableFrameContainer implements ConfigChangeListener,
101 99
         CertificateProblemListener, Connection {
100
+    
101
+    private static final org.slf4j.Logger log = LoggerFactory.getLogger(Server.class);
102 102
 
103 103
     /** The name of the general domain. */
104 104
     private static final String DOMAIN_GENERAL = "general";

+ 1
- 1
src/com/dmdirc/plugins/PluginInjectorInitialiser.java Datei anzeigen

@@ -53,7 +53,7 @@ import lombok.RequiredArgsConstructor;
53 53
  * Eventually this should be replaced by using the same DI framework for plugins
54 54
  * as for the client.
55 55
  */
56
-@RequiredArgsConstructor(onConstructor = @_(@Inject))
56
+@RequiredArgsConstructor(onConstructor = @__(@Inject))
57 57
 public class PluginInjectorInitialiser {
58 58
 
59 59
     private final ActionManager actionManager;

+ 8
- 6
src/com/dmdirc/util/URLBuilder.java Datei anzeigen

@@ -33,9 +33,6 @@ import java.net.URL;
33 33
 import javax.inject.Inject;
34 34
 import javax.inject.Provider;
35 35
 
36
-import lombok.Getter;
37
-import lombok.Setter;
38
-
39 36
 /**
40 37
  * Provides methods for building URLs to reference DMDirc resources.
41 38
  */
@@ -43,9 +40,6 @@ public class URLBuilder {
43 40
 
44 41
     /** Singleton instance. */
45 42
     @Deprecated
46
-    @Getter
47
-    @Setter
48
-    @SuppressWarnings("PMD.UnusedPrivateField")
49 43
     private static URLBuilder instance;
50 44
 
51 45
     /** Provider to retrieve a plugin manager instance when needed. */
@@ -68,6 +62,14 @@ public class URLBuilder {
68 62
         this.themeManagerProvider = themeManagerProvider;
69 63
     }
70 64
 
65
+    public static URLBuilder getInstance() {
66
+        return instance;
67
+    }
68
+
69
+    public static void setInstance(final URLBuilder instance) {
70
+        URLBuilder.instance = instance;
71
+    }
72
+
71 73
     /**
72 74
      * Constructs an URL pointing to the specified resource on the file system.
73 75
      *

Laden…
Abbrechen
Speichern