Explorar el Código

Some more static removal/tidying/etc.

Change-Id: I90c3e916bd9510dcd0596e00139b0b48babd5347
Reviewed-on: http://gerrit.dmdirc.com/2865
Reviewed-by: Greg Holmes <greg@dmdirc.com>
Automatic-Compile: DMDirc Build Manager
tags/0.8rc1
Chris Smith hace 10 años
padre
commit
f45fca1fb7

+ 4
- 0
src/com/dmdirc/commandparser/CommandManager.java Ver fichero

@@ -291,7 +291,9 @@ public class CommandManager implements CommandController {
291 291
      * Initialise the singleton instance of the CommandManager.
292 292
      *
293 293
      * @param commandManager The new singleton command manager instance.
294
+     * @deprecated Don't use statically.
294 295
      */
296
+    @Deprecated
295 297
     public static void setCommandManager(final CommandManager commandManager) {
296 298
         instance = commandManager;
297 299
     }
@@ -300,7 +302,9 @@ public class CommandManager implements CommandController {
300 302
      * Retrieves a singleton instance of the CommandManager.
301 303
      *
302 304
      * @return A singleton instance of the CommandManager.
305
+     * @deprecated Don't use statically.
303 306
      */
307
+    @Deprecated
304 308
     public static synchronized CommandManager getCommandManager() {
305 309
         return instance;
306 310
     }

+ 0
- 12
src/com/dmdirc/commandparser/commands/Command.java Ver fichero

@@ -24,7 +24,6 @@ package com.dmdirc.commandparser.commands;
24 24
 
25 25
 import com.dmdirc.FrameContainer;
26 26
 import com.dmdirc.commandparser.CommandArguments;
27
-import com.dmdirc.commandparser.CommandManager;
28 27
 import com.dmdirc.commandparser.commands.context.CommandContext;
29 28
 import com.dmdirc.interfaces.CommandController;
30 29
 import com.dmdirc.ui.messages.Styliser;
@@ -49,17 +48,6 @@ public abstract class Command {
49 48
     @Getter(AccessLevel.PROTECTED)
50 49
     private final CommandController controller;
51 50
 
52
-    /**
53
-     * Creates a new instance of Command using the default CommandManager
54
-     * provided by {@link CommandManager#getCommandManager()}.
55
-     *
56
-     * @deprecated All commands should provide a command controller.
57
-     */
58
-    @Deprecated
59
-    public Command() {
60
-        this(CommandManager.getCommandManager());
61
-    }
62
-
63 51
     /**
64 52
      * Sends a line, if appropriate, to the specified target.
65 53
      * @param target The command window to send the line to

+ 2
- 4
src/com/dmdirc/commandparser/commands/global/Ifplugin.java Ver fichero

@@ -27,7 +27,6 @@ import com.dmdirc.WritableFrameContainer;
27 27
 import com.dmdirc.commandparser.BaseCommandInfo;
28 28
 import com.dmdirc.commandparser.CommandArguments;
29 29
 import com.dmdirc.commandparser.CommandInfo;
30
-import com.dmdirc.commandparser.CommandManager;
31 30
 import com.dmdirc.commandparser.CommandType;
32 31
 import com.dmdirc.commandparser.commands.Command;
33 32
 import com.dmdirc.commandparser.commands.IntelligentCommand;
@@ -91,9 +90,8 @@ public class Ifplugin extends Command implements IntelligentCommand {
91 90
 
92 91
         if (result != negative) {
93 92
             if (origin == null) {
94
-                new GlobalCommandParser(origin.getConfigManager(),
95
-                        CommandManager.getCommandManager()).parseCommand(
96
-                        null, args.getArgumentsAsString(1));
93
+                new GlobalCommandParser(origin.getConfigManager(), getController())
94
+                        .parseCommand(null, args.getArgumentsAsString(1));
97 95
             } else {
98 96
                 ((WritableFrameContainer) origin).getCommandParser()
99 97
                         .parseCommand(origin, args.getArgumentsAsString(1));

+ 3
- 0
src/com/dmdirc/commandparser/validators/CommandNameValidator.java Ver fichero

@@ -38,7 +38,10 @@ public class CommandNameValidator extends ValidatorChain<String> {
38 38
     /**
39 39
      * Instantiates a new command name validator, using the command char
40 40
      * provided by the default Command Manager.
41
+     *
42
+     * @deprecated Provide a command char.
41 43
      */
44
+    @Deprecated
42 45
     public CommandNameValidator() {
43 46
         this(CommandManager.getCommandManager().getCommandChar());
44 47
     }

+ 1
- 1
test/com/dmdirc/harness/TestWritableFrameContainer.java Ver fichero

@@ -73,6 +73,6 @@ public class TestWritableFrameContainer extends WritableFrameContainer {
73 73
 
74 74
     @Override
75 75
     public TabCompleter getTabCompleter() {
76
-        return new TabCompleter();
76
+        return new TabCompleter(getConfigManager());
77 77
     }
78 78
 }

Loading…
Cancelar
Guardar