From 9c88e7e8be7dde117ada9ae483d535b99c6c11dc Mon Sep 17 00:00:00 2001
From: Violette Roche-Montane <violette.roche-montane@forgerock.com>
Date: Tue, 25 Feb 2014 10:35:48 +0000
Subject: [PATCH] Checkpoint OPENDJ-1343 Migrate dsconfig - Code cleanup. Thanks to AutoRefactor ;)
---
opendj3-server-dev/src/server/org/opends/server/tools/dsconfig/PropertyValuePrinter.java | 46 +++++++++++++++++++---------------------------
1 files changed, 19 insertions(+), 27 deletions(-)
diff --git a/opendj3-server-dev/src/server/org/opends/server/tools/dsconfig/PropertyValuePrinter.java b/opendj3-server-dev/src/server/org/opends/server/tools/dsconfig/PropertyValuePrinter.java
index 1b51ec7..f2cab67 100644
--- a/opendj3-server-dev/src/server/org/opends/server/tools/dsconfig/PropertyValuePrinter.java
+++ b/opendj3-server-dev/src/server/org/opends/server/tools/dsconfig/PropertyValuePrinter.java
@@ -56,24 +56,27 @@
private static class MyPropertyValueVisitor extends
PropertyValueVisitor<LocalizableMessage, Void> {
- // The requested size unit (null if the property's unit should be
- // used).
+ /**
+ * The requested size unit (null if the property's unit should be used).
+ */
private final SizeUnit sizeUnit;
- // The requested time unit (null if the property's unit should be
- // used).
+ /**
+ * The requested time unit (null if the property's unit should be used).
+ */
private final DurationUnit timeUnit;
- // Whether or not values should be displayed in a script-friendly
- // manner.
+ /**
+ * Whether or not values should be displayed in a script-friendly manner.
+ */
private final boolean isScriptFriendly;
- // The formatter to use for numeric values.
+ /** The formatter to use for numeric values. */
private final NumberFormat numberFormat;
- // Private constructor.
+ /** Private constructor. */
private MyPropertyValueVisitor(SizeUnit sizeUnit, DurationUnit timeUnit,
boolean isScriptFriendly) {
this.sizeUnit = sizeUnit;
@@ -81,24 +84,19 @@
this.isScriptFriendly = isScriptFriendly;
this.numberFormat = NumberFormat.getNumberInstance();
- if (this.isScriptFriendly) {
- numberFormat.setGroupingUsed(false);
- numberFormat.setMaximumFractionDigits(2);
- } else {
- numberFormat.setGroupingUsed(true);
+ {
+ numberFormat.setGroupingUsed(!this.isScriptFriendly);
numberFormat.setMaximumFractionDigits(2);
}
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
@Override
public LocalizableMessage visitBoolean(BooleanPropertyDefinition pd, Boolean v,
Void p) {
- if (v == false) {
+ if (!v) {
return INFO_VALUE_FALSE.get();
} else {
return INFO_VALUE_TRUE.get();
@@ -107,9 +105,7 @@
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
@Override
public LocalizableMessage visitDuration(DurationPropertyDefinition pd, Long v,
Void p) {
@@ -141,9 +137,7 @@
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
@Override
public LocalizableMessage visitSize(SizePropertyDefinition pd, Long v, Void p) {
if (pd.isAllowUnlimited() && v < 0) {
@@ -170,9 +164,7 @@
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
@Override
public <T> LocalizableMessage visitUnknown(PropertyDefinition<T> pd, T v, Void p) {
// For all other property definition types the default encoding
@@ -191,7 +183,7 @@
}
- // The property value printer implementation.
+ /** The property value printer implementation. */
private final MyPropertyValueVisitor pimpl;
--
Gitblit v1.10.0