Browse Source

Remove a load of deprecated methods.

Change-Id: I06531664f45d26298d989b9ac82d614c67da8c55
Depends-On: Ia4cf947dd33272021b10d2dc4093f383277eefd2
Reviewed-on: http://gerrit.dmdirc.com/2773
Automatic-Compile: DMDirc Build Manager
Reviewed-by: Greg Holmes <greg@dmdirc.com>
tags/0.8rc1
Chris Smith 10 years ago
parent
commit
aceab94801

+ 1
- 1
src/com/dmdirc/actions/Action.java View File

@@ -481,7 +481,7 @@ public class Action extends ActionModel implements ConfigChangeListener {
481 481
         } else {
482 482
             try {
483 483
                 component = new ActionComponentChain(triggers[0].getType().getArgTypes()[arg],
484
-                        componentName);
484
+                        componentName, ActionManager.getActionManager());
485 485
             } catch (IllegalArgumentException iae) {
486 486
                 error(ActionErrorType.CONDITIONS, iae.getMessage());
487 487
                 return null;

+ 0
- 13
src/com/dmdirc/actions/ActionComponentChain.java View File

@@ -41,19 +41,6 @@ public class ActionComponentChain implements ActionComponent {
41 41
      */
42 42
     private final List<ActionComponent> components = new ArrayList<>();
43 43
 
44
-    /**
45
-     * Creates a new component chain from the specified text representation.
46
-     * Chains are separated with full stops (.).
47
-     *
48
-     * @param source The class that this chain needs to start with
49
-     * @param chain The textual representation of the chain
50
-     * @deprecated Should specify an action controller.
51
-     */
52
-    @Deprecated
53
-    public ActionComponentChain(final Class<?> source, final String chain) {
54
-        this(source, chain, ActionManager.getActionManager());
55
-    }
56
-
57 44
     /**
58 45
      * Creates a new component chain from the specified text representation.
59 46
      * Chains are separated with full stops (.).

+ 1
- 1
src/com/dmdirc/actions/ActionModel.java View File

@@ -136,7 +136,7 @@ public class ActionModel {
136 136
             return false;
137 137
         }
138 138
 
139
-        final ActionSubstitutor sub = new ActionSubstitutor(triggers[0]);
139
+        final ActionSubstitutor sub = new ActionSubstitutor(ActionManager.getActionManager(), triggers[0]);
140 140
 
141 141
         if (!test(sub, arguments)) {
142 142
             return false;

+ 0
- 11
src/com/dmdirc/actions/ActionSubstitutor.java View File

@@ -87,17 +87,6 @@ public class ActionSubstitutor {
87 87
         this.type = type;
88 88
     }
89 89
 
90
-    /**
91
-     * Creates a new substitutor for the specified action type.
92
-     *
93
-     * @param type The action type this substitutor is for
94
-     * @deprecated Should use {@link #ActionSubstitutor(ActionController, ActionType)}.
95
-     */
96
-    @Deprecated
97
-    public ActionSubstitutor(final ActionType type) {
98
-        this(ActionManager.getActionManager(), type);
99
-    }
100
-
101 90
     /**
102 91
      * Retrieves a list of global config variables that will be substituted.
103 92
      * Note: does not include initial $.

+ 2
- 1
src/com/dmdirc/actions/wrappers/PerformWrapper.java View File

@@ -28,6 +28,7 @@ import com.dmdirc.actions.ActionComponentChain;
28 28
 import com.dmdirc.actions.ActionCondition;
29 29
 import com.dmdirc.actions.ActionFactory;
30 30
 import com.dmdirc.actions.ActionGroup;
31
+import com.dmdirc.actions.ActionManager;
31 32
 import com.dmdirc.actions.CoreActionComparison;
32 33
 import com.dmdirc.actions.CoreActionComponent;
33 34
 import com.dmdirc.actions.CoreActionType;
@@ -228,7 +229,7 @@ public class PerformWrapper extends ActionGroup {
228 229
 
229 230
         if (profile != null) {
230 231
             conditions.add(new ActionCondition(0,
231
-                    new ActionComponentChain(Server.class, PP_COMP_NAME),
232
+                    new ActionComponentChain(Server.class, PP_COMP_NAME, ActionManager.getActionManager()),
232 233
                     CoreActionComparison.STRING_EQUALS, profile));
233 234
         }
234 235
 

+ 0
- 11
src/com/dmdirc/config/validators/URLProtocolValidator.java View File

@@ -22,7 +22,6 @@
22 22
 
23 23
 package com.dmdirc.config.validators;
24 24
 
25
-import com.dmdirc.config.IdentityManager;
26 25
 import com.dmdirc.interfaces.config.AggregateConfigProvider;
27 26
 import com.dmdirc.util.validators.ValidationResponse;
28 27
 import com.dmdirc.util.validators.Validator;
@@ -45,16 +44,6 @@ public class URLProtocolValidator implements Validator<String> {
45 44
         this.globalConfig = globalConfig;
46 45
     }
47 46
 
48
-    /**
49
-     * Creates a {@link URLProtocolValidator} with the default global config.
50
-     *
51
-     * @deprecated Specify a global config
52
-     */
53
-    @Deprecated
54
-    public URLProtocolValidator() {
55
-        this(IdentityManager.getIdentityManager().getGlobalConfiguration());
56
-    }
57
-
58 47
     /** {@inheritDoc} */
59 48
     @Override
60 49
     public ValidationResponse validate(final String object) {

+ 0
- 13
src/com/dmdirc/ui/messages/ColourManager.java View File

@@ -166,19 +166,6 @@ public class ColourManager {
166 166
         return instance.getColourFromString(spec, Colour.WHITE);
167 167
     }
168 168
 
169
-    /**
170
-     * Returns a Colour object that corresponds to the specified 6-digit hex
171
-     * string. If the string is invalid, logs a warning and returns white.
172
-     *
173
-     * @param hex The hex string to convert into a Colour
174
-     * @return A Colour object corresponding to the hex input
175
-     * @deprecated Use non-static methods
176
-     */
177
-    @Deprecated
178
-    public static Colour getColour(final String hex) {
179
-        return getColourManager().getColourFromHex(hex);
180
-    }
181
-
182 169
     /**
183 170
      * Returns a Colour object that corresponds to the specified 6-digit hex
184 171
      * string. If the string is invalid, logs a warning and returns white.

+ 0
- 64
src/com/dmdirc/util/URLBuilder.java View File

@@ -67,18 +67,6 @@ public class URLBuilder {
67 67
         this.themeManagerProvider = themeManagerProvider;
68 68
     }
69 69
 
70
-    /**
71
-     * Constructs an URL pointing to the specified resource on the file system.
72
-     *
73
-     * @param path The path that the URL is for
74
-     * @return An URL corresponding to the specified path, or null on failure
75
-     * @deprecated Use non-static methods
76
-     */
77
-    @Deprecated
78
-    public static URL buildFileURL(final String path) {
79
-        return instance.getUrlForFile(path);
80
-    }
81
-
82 70
     /**
83 71
      * Constructs an URL pointing to the specified resource on the file system.
84 72
      *
@@ -96,19 +84,6 @@ public class URLBuilder {
96 84
         }
97 85
     }
98 86
 
99
-    /**
100
-     * Constructs an URL pointing to the specified resource within a jar file.
101
-     *
102
-     * @param jarFile Path to the jar file (including scheme)
103
-     * @param path Path to the resource within the jar file
104
-     * @return An URL corresponding to the specified resource, or null on failure
105
-     * @deprecated Use non-static methods.
106
-     */
107
-    @Deprecated
108
-    public static URL buildJarURL(final String jarFile, final String path) {
109
-        return instance.getUrlForJarFile(jarFile, path);
110
-    }
111
-
112 87
     /**
113 88
      * Constructs an URL pointing to the specified resource within a jar file.
114 89
      *
@@ -129,19 +104,6 @@ public class URLBuilder {
129 104
         }
130 105
     }
131 106
 
132
-    /**
133
-     * Constructs an URL pointing to the specified resource within the DMDirc
134
-     * project.
135
-     *
136
-     * @param resource The path to the resource
137
-     * @return An URL corresponding to the specified resource
138
-     * @deprecated Use non-static methods
139
-     */
140
-    @Deprecated
141
-    public static URL buildDMDircURL(final String resource) {
142
-        return instance.getUrlForDMDircResource(resource);
143
-    }
144
-
145 107
     /**
146 108
      * Constructs an URL pointing to the specified resource within the DMDirc
147 109
      * project.
@@ -153,19 +115,6 @@ public class URLBuilder {
153 115
         return Thread.currentThread().getContextClassLoader().getResource(resource);
154 116
     }
155 117
 
156
-    /**
157
-     * Builds an URL pointing to a resource within a DMDirc theme.
158
-     *
159
-     * @param theme The theme which the resource is located in
160
-     * @param path The path within the theme of the resource
161
-     * @return An URL corresponding to the specified resource, or null on failure
162
-     * @deprecated Use non-static methods
163
-     */
164
-    @Deprecated
165
-    public static URL buildThemeURL(final String theme, final String path) {
166
-        return instance.getUrlForThemeResource(theme, path);
167
-    }
168
-
169 118
     /**
170 119
      * Builds an URL pointing to a resource within a DMDirc theme.
171 120
      *
@@ -178,19 +127,6 @@ public class URLBuilder {
178 127
                 + theme + ".zip", path);
179 128
     }
180 129
 
181
-    /**
182
-     * Builds an URL pointing to a resource within a DMDirc plugin.
183
-     *
184
-     * @param plugin The plugin which the resource is located in
185
-     * @param path The path within the theme of the resource
186
-     * @return An URL corresponding to the specified resource, or null on failure
187
-     * @deprecated Use non-static methods
188
-     */
189
-    @Deprecated
190
-    public static URL buildPluginURL(final String plugin, final String path) {
191
-        return instance.getUrlForPluginResource(plugin, path);
192
-    }
193
-
194 130
     /**
195 131
      * Builds an URL pointing to a resource within a DMDirc plugin.
196 132
      *

+ 10
- 2
test/com/dmdirc/actions/ActionConditionTest.java View File

@@ -22,12 +22,20 @@
22 22
 
23 23
 package com.dmdirc.actions;
24 24
 
25
+import com.dmdirc.interfaces.ActionController;
26
+
25 27
 import org.junit.Test;
28
+import org.junit.runner.RunWith;
29
+import org.mockito.Mock;
30
+import org.mockito.runners.MockitoJUnitRunner;
26 31
 
27 32
 import static org.junit.Assert.*;
28 33
 
34
+@RunWith(MockitoJUnitRunner.class)
29 35
 public class ActionConditionTest {
30 36
 
37
+    @Mock private ActionController actionController;
38
+
31 39
     @Test
32 40
     public void testConstructor1() {
33 41
         final ActionCondition ac = new ActionCondition(1, CoreActionComponent.STRING_STRING,
@@ -51,14 +59,14 @@ public class ActionConditionTest {
51 59
     public void testTest1() {
52 60
         final ActionCondition ac = new ActionCondition(1, CoreActionComponent.STRING_STRING,
53 61
             CoreActionComparison.STRING_STARTSWITH, "foo");
54
-        assertTrue(ac.test(new ActionSubstitutor(CoreActionType.CLIENT_USER_INPUT), null, "foo bar"));
62
+        assertTrue(ac.test(new ActionSubstitutor(actionController, CoreActionType.CLIENT_USER_INPUT), null, "foo bar"));
55 63
     }
56 64
 
57 65
     @Test
58 66
     public void testTest2() {
59 67
         final ActionCondition ac = new ActionCondition("foobarbaz",
60 68
             CoreActionComparison.STRING_STARTSWITH, "foo");
61
-        assertTrue(ac.test(new ActionSubstitutor(CoreActionType.CLIENT_CLOSED)));
69
+        assertTrue(ac.test(new ActionSubstitutor(actionController, CoreActionType.CLIENT_CLOSED)));
62 70
     }
63 71
 
64 72
     @Test

+ 9
- 2
test/com/dmdirc/actions/ActionModelTest.java View File

@@ -22,6 +22,7 @@
22 22
 
23 23
 package com.dmdirc.actions;
24 24
 
25
+import com.dmdirc.interfaces.ActionController;
25 26
 import com.dmdirc.interfaces.actions.ActionType;
26 27
 
27 28
 import java.util.ArrayList;
@@ -29,11 +30,17 @@ import java.util.Arrays;
29 30
 import java.util.List;
30 31
 
31 32
 import org.junit.Test;
33
+import org.junit.runner.RunWith;
34
+import org.mockito.Mock;
35
+import org.mockito.runners.MockitoJUnitRunner;
32 36
 
33 37
 import static org.junit.Assert.*;
34 38
 
39
+@RunWith(MockitoJUnitRunner.class)
35 40
 public class ActionModelTest {
36 41
 
42
+    @Mock private ActionController actionController;
43
+
37 44
     @Test
38 45
     public void testConditions() {
39 46
         final ActionModel model = new ActionModel("group", "name");
@@ -133,7 +140,7 @@ public class ActionModelTest {
133 140
                     new ActionCondition(2, CoreActionComponent.STRING_STRING,
134 141
                             CoreActionComparison.STRING_STARTSWITH, "abc"),
135 142
                 }), ConditionTree.parseString("0|1"), null);
136
-        final ActionSubstitutor sub = new ActionSubstitutor(CoreActionType.CHANNEL_ACTION);
143
+        final ActionSubstitutor sub = new ActionSubstitutor(actionController, CoreActionType.CHANNEL_ACTION);
137 144
 
138 145
         assertTrue("test must pass if one condition in disjunction passes (cond 1)",
139 146
                 model.test(sub, null, null, "abcdef"));
@@ -153,7 +160,7 @@ public class ActionModelTest {
153 160
                     new ActionCondition(2, CoreActionComponent.STRING_STRING,
154 161
                             CoreActionComparison.STRING_STARTSWITH, "abc"),
155 162
                 }), null, null);
156
-        final ActionSubstitutor sub = new ActionSubstitutor(CoreActionType.CHANNEL_ACTION);
163
+        final ActionSubstitutor sub = new ActionSubstitutor(actionController, CoreActionType.CHANNEL_ACTION);
157 164
 
158 165
         assertFalse("test must fail if one condition in conjunction fails (cond 1)",
159 166
                 model.test(sub, null, null, "abcdef"));

Loading…
Cancel
Save