Browse Source

Tidy up parser debug command.

pull/412/head
Chris Smith 9 years ago
parent
commit
76506caf32

+ 5
- 11
parserdebug/src/com/dmdirc/addons/parserdebug/ParserDebugCommand.java View File

@@ -51,7 +51,7 @@ public final class ParserDebugCommand extends Command {
51 51
             + "onDebugInfo for the parser that owns this window",
52 52
             CommandType.TYPE_SERVER);
53 53
     /** Parser debug manager. */
54
-    final ParserDebugManager parserDebugManager;
54
+    private final ParserDebugManager parserDebugManager;
55 55
 
56 56
     /**
57 57
      * Creates a new instance of ParserDebugCommand.
@@ -86,17 +86,11 @@ public final class ParserDebugCommand extends Command {
86 86
             return;
87 87
         }
88 88
         if (parserDebugManager.containsParser(parser.get())) {
89
-            if (parserDebugManager.removeParser(parser.get(), false)) {
90
-                sendLine(origin, isSilent, FORMAT_OUTPUT, "Removing callback ok");
91
-            } else {
92
-                sendLine(origin, isSilent, FORMAT_ERROR, "Removing callback failed");
93
-            }
89
+            parserDebugManager.removeParser(parser.get(), false);
90
+            sendLine(origin, isSilent, FORMAT_OUTPUT, "Removed callback");
94 91
         } else {
95
-            if (parserDebugManager.addParser(parser.get(), connection)) {
96
-                sendLine(origin, isSilent, FORMAT_OUTPUT, "Adding callback ok");
97
-            } else {
98
-                sendLine(origin, isSilent, FORMAT_ERROR, "Adding callback failed");
99
-            }
92
+            parserDebugManager.addParser(parser.get(), connection);
93
+            sendLine(origin, isSilent, FORMAT_OUTPUT, "Added callback");
100 94
         }
101 95
     }
102 96
 

Loading…
Cancel
Save