From 310df200f78f7d98cc52e4ab97d8a5feb744fa52 Mon Sep 17 00:00:00 2001
From: Jean-Noël Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Thu, 28 Apr 2016 09:04:35 +0000
Subject: [PATCH] UCDetector and AutoRefactor code cleanup
---
opendj-server-legacy/src/main/java/org/opends/server/tools/ManageTasks.java | 45 +++++++--------------------------------------
1 files changed, 7 insertions(+), 38 deletions(-)
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/ManageTasks.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/ManageTasks.java
index 2c8b75c..1c12462 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/ManageTasks.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/ManageTasks.java
@@ -43,7 +43,6 @@
import com.forgerock.opendj.cli.TextTablePrinter;
import java.io.IOException;
-import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintStream;
import java.io.StringWriter;
@@ -55,8 +54,8 @@
import static org.opends.messages.ToolMessages.*;
import static com.forgerock.opendj.cli.ArgumentConstants.*;
-import static com.forgerock.opendj.cli.Utils.*;
import static com.forgerock.opendj.cli.CommonArguments.*;
+import static com.forgerock.opendj.cli.Utils.*;
/** Tool for getting information and managing tasks in the Directory Server. */
public class ManageTasks extends ConsoleApplication {
@@ -69,29 +68,16 @@
* @param args The command-line arguments provided to this program.
*/
public static void main(String[] args) {
- int retCode = mainTaskInfo(args, System.in, System.out, System.err);
-
+ int retCode = mainTaskInfo(args, System.out, System.err);
if (retCode != 0) {
System.exit(filterExitCode(retCode));
}
}
/**
- * Processes the command-line arguments and invokes the process for
- * displaying task information.
- *
- * @param args The command-line arguments provided to this program.
- * @return int return code
- */
- public static int mainTaskInfo(String[] args) {
- return mainTaskInfo(args, System.in, System.out, System.err);
- }
-
- /**
* Processes the command-line arguments and invokes the export process.
*
* @param args The command-line arguments provided to this
- * @param in Input stream from which to solicit user input.
* @param out The output stream to use for standard output, or
* {@code null} if standard output is not needed.
* @param err The output stream to use for standard error, or
@@ -100,11 +86,10 @@
* @return int return code
*/
public static int mainTaskInfo(String[] args,
- InputStream in,
OutputStream out,
OutputStream err,
boolean initializeServer) {
- ManageTasks tool = new ManageTasks(in, out, err);
+ ManageTasks tool = new ManageTasks(out, err);
return tool.process(args, initializeServer);
}
@@ -112,18 +97,16 @@
* Processes the command-line arguments and invokes the export process.
*
* @param args The command-line arguments provided to this
- * @param in Input stream from which to solicit user input.
* @param out The output stream to use for standard output, or
* {@code null} if standard output is not needed.
* @param err The output stream to use for standard error, or
* {@code null} if standard error is not needed.
* @return int return code
*/
- public static int mainTaskInfo(String[] args,
- InputStream in,
+ private static int mainTaskInfo(String[] args,
OutputStream out,
OutputStream err) {
- return mainTaskInfo(args, in, out, err, true);
+ return mainTaskInfo(args, out, err, true);
}
private static final int INDENT = 2;
@@ -142,14 +125,12 @@
/**
* Constructs a parameterized instance.
- *
- * @param in Input stream from which to solicit user input.
* @param out The output stream to use for standard output, or
* {@code null} if standard output is not needed.
* @param err The output stream to use for standard error, or
* {@code null} if standard error is not needed.
*/
- public ManageTasks(InputStream in, OutputStream out, OutputStream err)
+ private ManageTasks(OutputStream out, OutputStream err)
{
super(new PrintStream(out), new PrintStream(err));
}
@@ -159,22 +140,10 @@
*
* @param args The command-line arguments provided to this
* program.
- * @return The error code.
- */
- public int process(String[] args)
- {
- return process(args, true);
- }
-
- /**
- * Processes the command-line arguments and invokes the export process.
- *
- * @param args The command-line arguments provided to this
- * program.
* @param initializeServer Indicates whether to initialize the server.
* @return The error code.
*/
- public int process(String[] args, boolean initializeServer)
+ private int process(String[] args, boolean initializeServer)
{
if (initializeServer)
{
--
Gitblit v1.10.0