瀏覽代碼

Remove some dead code.

Change-Id: Ib3f12415ce518c7f2c735667c8a00a3970e75ad3
Reviewed-on: http://gerrit.dmdirc.com/2903
Reviewed-by: Greg Holmes <greg@dmdirc.com>
Automatic-Compile: DMDirc Build Manager
tags/0.8rc1
Chris Smith 10 年之前
父節點
當前提交
ecbc8cb4a3

+ 0
- 1
src/com/dmdirc/Invite.java 查看文件

33
 public class Invite {
33
 public class Invite {
34
 
34
 
35
     /** The server this invite was on. */
35
     /** The server this invite was on. */
36
-    @Getter
37
     private final Server server;
36
     private final Server server;
38
 
37
 
39
     /** The channel this invite is for. */
38
     /** The channel this invite is for. */

+ 0
- 7
src/com/dmdirc/Server.java 查看文件

27
 import com.dmdirc.commandparser.CommandType;
27
 import com.dmdirc.commandparser.CommandType;
28
 import com.dmdirc.commandparser.parsers.CommandParser;
28
 import com.dmdirc.commandparser.parsers.CommandParser;
29
 import com.dmdirc.interfaces.AwayStateListener;
29
 import com.dmdirc.interfaces.AwayStateListener;
30
-import com.dmdirc.interfaces.CommandController;
31
 import com.dmdirc.interfaces.Connection;
30
 import com.dmdirc.interfaces.Connection;
32
 import com.dmdirc.interfaces.InviteListener;
31
 import com.dmdirc.interfaces.InviteListener;
33
 import com.dmdirc.interfaces.config.ConfigChangeListener;
32
 import com.dmdirc.interfaces.config.ConfigChangeListener;
608
         }
607
         }
609
     }
608
     }
610
 
609
 
611
-    /** {@inheritDoc} */
612
-    @Override
613
-    public Raw getRaw() {
614
-        return raw;
615
-    }
616
-
617
     /** {@inheritDoc} */
610
     /** {@inheritDoc} */
618
     @Override
611
     @Override
619
     public void delRaw() {
612
     public void delRaw() {

+ 0
- 18
src/com/dmdirc/ServerManager.java 查看文件

197
         return res;
197
         return res;
198
     }
198
     }
199
 
199
 
200
-    /**
201
-     * Retrieves a list of servers connected to the specified address.
202
-     *
203
-     * @param address The address to search for
204
-     * @return A list of servers connected to the network
205
-     */
206
-    public List<Server> getServersByAddress(final String address) {
207
-        final List<Server> res = new ArrayList<>();
208
-
209
-        for (Server server : servers) {
210
-            if (server.getAddress().equalsIgnoreCase(address)) {
211
-                res.add(server);
212
-            }
213
-        }
214
-
215
-        return res;
216
-    }
217
-
218
     /**
200
     /**
219
      * Creates a new server which will connect to the specified URI with the
201
      * Creates a new server which will connect to the specified URI with the
220
      * default profile.
202
      * default profile.

+ 0
- 29
src/com/dmdirc/actions/ActionGroup.java 查看文件

170
         this.component = component;
170
         this.component = component;
171
     }
171
     }
172
 
172
 
173
-    /**
174
-     * Determines the size of this group.
175
-     *
176
-     * @return The size of this group
177
-     */
178
-    public int size() {
179
-        return actions.size();
180
-    }
181
-
182
     /**
173
     /**
183
      * Removes the specified action from this group.
174
      * Removes the specified action from this group.
184
      *
175
      *
194
         return actions.iterator();
185
         return actions.iterator();
195
     }
186
     }
196
 
187
 
197
-    /**
198
-     * Retrieves the action at the specified index.
199
-     *
200
-     * @param index The index of the action to return
201
-     * @return The action at the specified index
202
-     */
203
-    public Action get(final int index) {
204
-        return actions.get(index);
205
-    }
206
-
207
-    /**
208
-     * Determines if this group contains the specified action.
209
-     *
210
-     * @param action The action to search for
211
-     * @return True if the action is contained in this list, false otherwise
212
-     */
213
-    public boolean contains(final Action action) {
214
-        return actions.contains(action);
215
-    }
216
-
217
     /**
188
     /**
218
      * Removes all actions from this group, and removes all meta-data.
189
      * Removes all actions from this group, and removes all meta-data.
219
      */
190
      */

+ 0
- 12
src/com/dmdirc/actions/ActionManager.java 查看文件

581
         return res;
581
         return res;
582
     }
582
     }
583
 
583
 
584
-    /** {@inheritDoc} */
585
-    @Override
586
-    public List<ActionType> getAllTypes() {
587
-        return Collections.unmodifiableList(types);
588
-    }
589
-
590
-    /** {@inheritDoc} */
591
-    @Override
592
-    public List<ActionComparison> getAllComparisons() {
593
-        return Collections.unmodifiableList(comparisons);
594
-    }
595
-
596
     /** {@inheritDoc} */
584
     /** {@inheritDoc} */
597
     @Override
585
     @Override
598
     public ActionComponent getComponent(final String type) {
586
     public ActionComponent getComponent(final String type) {

+ 0
- 14
src/com/dmdirc/interfaces/ActionController.java 查看文件

123
     @Precondition(value = "The specified type is not null")
123
     @Precondition(value = "The specified type is not null")
124
     List<ActionType> findCompatibleTypes(final ActionType type);
124
     List<ActionType> findCompatibleTypes(final ActionType type);
125
 
125
 
126
-    /**
127
-     * Returns a list of all the action types registered by this manager.
128
-     *
129
-     * @return A list of registered action comparisons
130
-     */
131
-    List<ActionComparison> getAllComparisons();
132
-
133
-    /**
134
-     * Returns a list of all the action types registered by this manager.
135
-     *
136
-     * @return A list of registered action types
137
-     */
138
-    List<ActionType> getAllTypes();
139
-
140
     /**
126
     /**
141
      * Returns the action type specified by the given string, or null if it
127
      * Returns the action type specified by the given string, or null if it
142
      * doesn't match a valid registered action type.
128
      * doesn't match a valid registered action type.

+ 0
- 8
src/com/dmdirc/interfaces/Connection.java 查看文件

25
 import com.dmdirc.Channel;
25
 import com.dmdirc.Channel;
26
 import com.dmdirc.Invite;
26
 import com.dmdirc.Invite;
27
 import com.dmdirc.Query;
27
 import com.dmdirc.Query;
28
-import com.dmdirc.Raw;
29
 import com.dmdirc.ServerState;
28
 import com.dmdirc.ServerState;
30
 import com.dmdirc.ServerStatus;
29
 import com.dmdirc.ServerStatus;
31
 import com.dmdirc.interfaces.config.ConfigProvider;
30
 import com.dmdirc.interfaces.config.ConfigProvider;
310
      */
309
      */
311
     Query getQuery(final String host, final boolean focus);
310
     Query getQuery(final String host, final boolean focus);
312
 
311
 
313
-    /**
314
-     * Retrieves the raw window associated with this server.
315
-     *
316
-     * @return The raw window associated with this server.
317
-     */
318
-    Raw getRaw();
319
-
320
     /**
312
     /**
321
      * Retrieves the identity for this server.
313
      * Retrieves the identity for this server.
322
      *
314
      *

+ 0
- 5
test/com/dmdirc/InviteTest.java 查看文件

47
         ts = new Date().getTime();
47
         ts = new Date().getTime();
48
     }
48
     }
49
 
49
 
50
-    @Test
51
-    public void testGetServer() {
52
-        assertSame(server, invite.getServer());
53
-    }
54
-
55
     @Test
50
     @Test
56
     public void testGetChannel() {
51
     public void testGetChannel() {
57
         assertEquals("#channel", invite.getChannel());
52
         assertEquals("#channel", invite.getChannel());

+ 0
- 17
test/com/dmdirc/ServerManagerTest.java 查看文件

25
 import com.dmdirc.interfaces.CommandController;
25
 import com.dmdirc.interfaces.CommandController;
26
 import com.dmdirc.interfaces.config.IdentityController;
26
 import com.dmdirc.interfaces.config.IdentityController;
27
 import com.dmdirc.interfaces.config.IdentityFactory;
27
 import com.dmdirc.interfaces.config.IdentityFactory;
28
-import com.dmdirc.messages.MessageSinkManager;
29
 import com.dmdirc.parser.common.ChannelJoinRequest;
28
 import com.dmdirc.parser.common.ChannelJoinRequest;
30
 import com.dmdirc.ui.WindowManager;
29
 import com.dmdirc.ui.WindowManager;
31
-import com.dmdirc.ui.input.TabCompleterFactory;
32
 
30
 
33
 import javax.inject.Provider;
31
 import javax.inject.Provider;
34
 
32
 
91
         assertEquals(serverManager.getServers().size(), serverManager.numServers());
89
         assertEquals(serverManager.getServers().size(), serverManager.numServers());
92
     }
90
     }
93
 
91
 
94
-    @Test
95
-    public void testGetServerByAddress() {
96
-        final Server serverA = mock(Server.class);
97
-        final Server serverB = mock(Server.class);
98
-        when(serverA.getAddress()).thenReturn("255.255.255.255");
99
-        when(serverB.getAddress()).thenReturn("255.255.255.254");
100
-
101
-        serverManager.registerServer(serverA);
102
-        serverManager.registerServer(serverB);
103
-
104
-        assertEquals(serverA, serverManager.getServersByAddress("255.255.255.255").get(0));
105
-        assertEquals(serverB, serverManager.getServersByAddress("255.255.255.254").get(0));
106
-        assertEquals(0, serverManager.getServersByAddress("255.255.255.253").size());
107
-    }
108
-
109
     @Test
92
     @Test
110
     public void testGetServerByNetwork() throws InterruptedException {
93
     public void testGetServerByNetwork() throws InterruptedException {
111
         final Server serverA = mock(Server.class);
94
         final Server serverA = mock(Server.class);

+ 4
- 13
test/com/dmdirc/actions/ActionGroupTest.java 查看文件

94
     public void testClear() {
94
     public void testClear() {
95
         ActionGroup instance = new ActionGroup("zzz");
95
         ActionGroup instance = new ActionGroup("zzz");
96
         instance.add(null);
96
         instance.add(null);
97
-        assertEquals(1, instance.size());
97
+        assertTrue(instance.iterator().hasNext());
98
         instance.clear();
98
         instance.clear();
99
-        assertEquals(0, instance.size());
99
+        assertFalse(instance.iterator().hasNext());
100
     }
100
     }
101
 
101
 
102
     @Test
102
     @Test
103
     public void testRemove() {
103
     public void testRemove() {
104
         ActionGroup instance = new ActionGroup("zzz");
104
         ActionGroup instance = new ActionGroup("zzz");
105
         instance.add(null);
105
         instance.add(null);
106
-        assertEquals(1, instance.size());
106
+        assertTrue(instance.iterator().hasNext());
107
         instance.remove(null);
107
         instance.remove(null);
108
-        assertEquals(0, instance.size());
109
-    }
110
-
111
-    @Test
112
-    public void testContains() {
113
-        ActionGroup instance = new ActionGroup("zzz");
114
-        instance.add(null);
115
-        assertTrue(instance.contains(null));
116
-        instance.remove(null);
117
-        assertFalse(instance.contains(null));
108
+        assertFalse(instance.iterator().hasNext());
118
     }
109
     }
119
 
110
 
120
     @Test
111
     @Test

Loading…
取消
儲存