From 3b230cd5af114fd8800f2aa56b7dc06db6cb0db6 Mon Sep 17 00:00:00 2001
From: Jean-Noël Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Tue, 02 Feb 2016 16:00:11 +0000
Subject: [PATCH] Simplified widespread use of OperatingSystem.isWindows() and duplication by using methods dedicated to a task
---
opendj-server-legacy/src/main/java/org/opends/server/util/cli/PointAdder.java | 35 ++++++++---------------------------
1 files changed, 8 insertions(+), 27 deletions(-)
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/util/cli/PointAdder.java b/opendj-server-legacy/src/main/java/org/opends/server/util/cli/PointAdder.java
index f1662c4..f1d4d0b 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/util/cli/PointAdder.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/util/cli/PointAdder.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2010 Sun Microsystems, Inc.
- * Portions Copyright 2014 ForgeRock AS
+ * Portions Copyright 2014-2016 ForgeRock AS
*/
package org.opends.server.util.cli;
@@ -32,9 +32,7 @@
import com.forgerock.opendj.cli.ConsoleApplication;
-/**
- * Class used to add points periodically to the end of the output.
- */
+/** Class used to add points periodically to the end of the output. */
public class PointAdder implements Runnable
{
private final ConsoleApplication app;
@@ -42,13 +40,9 @@
private boolean stopPointAdder;
private boolean pointAdderStopped;
private long periodTime = DEFAULT_PERIOD_TIME;
- private final boolean isError;
private final ProgressMessageFormatter formatter;
-
- /**
- * The default period time used to write points in the output.
- */
+ /** The default period time used to write points in the output. */
public static final long DEFAULT_PERIOD_TIME = 3000;
/**
@@ -60,8 +54,7 @@
*/
public PointAdder(ConsoleApplication app)
{
- this(app, DEFAULT_PERIOD_TIME, false,
- new PlainTextProgressMessageFormatter());
+ this(app, DEFAULT_PERIOD_TIME, new PlainTextProgressMessageFormatter());
}
/**
@@ -71,26 +64,17 @@
* The console application to be used.
* @param periodTime
* The time between printing two points.
- * @param isError
- * Whether the points must be printed in error stream or output
- * stream.
* @param formatter
* The text formatter.
*/
- public PointAdder(ConsoleApplication app,
- long periodTime, boolean isError,
- ProgressMessageFormatter formatter)
+ public PointAdder(ConsoleApplication app, long periodTime, ProgressMessageFormatter formatter)
{
this.app = app;
this.periodTime = periodTime;
- this.isError = isError;
this.formatter = formatter;
}
- /**
- * Starts the PointAdder: points are added at the end of the logs
- * periodically.
- */
+ /** Starts the PointAdder: points are added at the end of the logs periodically. */
public void start()
{
LocalizableMessageBuilder mb = new LocalizableMessageBuilder();
@@ -104,10 +88,7 @@
t.start();
}
- /**
- * Stops the PointAdder: points are no longer added at the end of the logs
- * periodically.
- */
+ /** Stops the PointAdder: points are no longer added at the end of the logs periodically. */
public synchronized void stop()
{
stopPointAdder = true;
@@ -125,7 +106,7 @@
}
}
- /** {@inheritDoc} */
+ @Override
public void run()
{
while (!stopPointAdder)
--
Gitblit v1.10.0