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
         } else {
481
         } else {
482
             try {
482
             try {
483
                 component = new ActionComponentChain(triggers[0].getType().getArgTypes()[arg],
483
                 component = new ActionComponentChain(triggers[0].getType().getArgTypes()[arg],
484
-                        componentName);
484
+                        componentName, ActionManager.getActionManager());
485
             } catch (IllegalArgumentException iae) {
485
             } catch (IllegalArgumentException iae) {
486
                 error(ActionErrorType.CONDITIONS, iae.getMessage());
486
                 error(ActionErrorType.CONDITIONS, iae.getMessage());
487
                 return null;
487
                 return null;

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

41
      */
41
      */
42
     private final List<ActionComponent> components = new ArrayList<>();
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
      * Creates a new component chain from the specified text representation.
45
      * Creates a new component chain from the specified text representation.
59
      * Chains are separated with full stops (.).
46
      * Chains are separated with full stops (.).

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

136
             return false;
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
         if (!test(sub, arguments)) {
141
         if (!test(sub, arguments)) {
142
             return false;
142
             return false;

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

87
         this.type = type;
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
      * Retrieves a list of global config variables that will be substituted.
91
      * Retrieves a list of global config variables that will be substituted.
103
      * Note: does not include initial $.
92
      * Note: does not include initial $.

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

28
 import com.dmdirc.actions.ActionCondition;
28
 import com.dmdirc.actions.ActionCondition;
29
 import com.dmdirc.actions.ActionFactory;
29
 import com.dmdirc.actions.ActionFactory;
30
 import com.dmdirc.actions.ActionGroup;
30
 import com.dmdirc.actions.ActionGroup;
31
+import com.dmdirc.actions.ActionManager;
31
 import com.dmdirc.actions.CoreActionComparison;
32
 import com.dmdirc.actions.CoreActionComparison;
32
 import com.dmdirc.actions.CoreActionComponent;
33
 import com.dmdirc.actions.CoreActionComponent;
33
 import com.dmdirc.actions.CoreActionType;
34
 import com.dmdirc.actions.CoreActionType;
228
 
229
 
229
         if (profile != null) {
230
         if (profile != null) {
230
             conditions.add(new ActionCondition(0,
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
                     CoreActionComparison.STRING_EQUALS, profile));
233
                     CoreActionComparison.STRING_EQUALS, profile));
233
         }
234
         }
234
 
235
 

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

22
 
22
 
23
 package com.dmdirc.config.validators;
23
 package com.dmdirc.config.validators;
24
 
24
 
25
-import com.dmdirc.config.IdentityManager;
26
 import com.dmdirc.interfaces.config.AggregateConfigProvider;
25
 import com.dmdirc.interfaces.config.AggregateConfigProvider;
27
 import com.dmdirc.util.validators.ValidationResponse;
26
 import com.dmdirc.util.validators.ValidationResponse;
28
 import com.dmdirc.util.validators.Validator;
27
 import com.dmdirc.util.validators.Validator;
45
         this.globalConfig = globalConfig;
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
     /** {@inheritDoc} */
47
     /** {@inheritDoc} */
59
     @Override
48
     @Override
60
     public ValidationResponse validate(final String object) {
49
     public ValidationResponse validate(final String object) {

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

166
         return instance.getColourFromString(spec, Colour.WHITE);
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
      * Returns a Colour object that corresponds to the specified 6-digit hex
170
      * Returns a Colour object that corresponds to the specified 6-digit hex
184
      * string. If the string is invalid, logs a warning and returns white.
171
      * string. If the string is invalid, logs a warning and returns white.

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

67
         this.themeManagerProvider = themeManagerProvider;
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
      * Constructs an URL pointing to the specified resource on the file system.
71
      * Constructs an URL pointing to the specified resource on the file system.
84
      *
72
      *
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
      * Constructs an URL pointing to the specified resource within a jar file.
88
      * Constructs an URL pointing to the specified resource within a jar file.
114
      *
89
      *
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
      * Constructs an URL pointing to the specified resource within the DMDirc
108
      * Constructs an URL pointing to the specified resource within the DMDirc
147
      * project.
109
      * project.
153
         return Thread.currentThread().getContextClassLoader().getResource(resource);
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
      * Builds an URL pointing to a resource within a DMDirc theme.
119
      * Builds an URL pointing to a resource within a DMDirc theme.
171
      *
120
      *
178
                 + theme + ".zip", path);
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
      * Builds an URL pointing to a resource within a DMDirc plugin.
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
 
22
 
23
 package com.dmdirc.actions;
23
 package com.dmdirc.actions;
24
 
24
 
25
+import com.dmdirc.interfaces.ActionController;
26
+
25
 import org.junit.Test;
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
 import static org.junit.Assert.*;
32
 import static org.junit.Assert.*;
28
 
33
 
34
+@RunWith(MockitoJUnitRunner.class)
29
 public class ActionConditionTest {
35
 public class ActionConditionTest {
30
 
36
 
37
+    @Mock private ActionController actionController;
38
+
31
     @Test
39
     @Test
32
     public void testConstructor1() {
40
     public void testConstructor1() {
33
         final ActionCondition ac = new ActionCondition(1, CoreActionComponent.STRING_STRING,
41
         final ActionCondition ac = new ActionCondition(1, CoreActionComponent.STRING_STRING,
51
     public void testTest1() {
59
     public void testTest1() {
52
         final ActionCondition ac = new ActionCondition(1, CoreActionComponent.STRING_STRING,
60
         final ActionCondition ac = new ActionCondition(1, CoreActionComponent.STRING_STRING,
53
             CoreActionComparison.STRING_STARTSWITH, "foo");
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
     @Test
65
     @Test
58
     public void testTest2() {
66
     public void testTest2() {
59
         final ActionCondition ac = new ActionCondition("foobarbaz",
67
         final ActionCondition ac = new ActionCondition("foobarbaz",
60
             CoreActionComparison.STRING_STARTSWITH, "foo");
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
     @Test
72
     @Test

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

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

Loading…
Cancel
Save