From 7028d9f1483d6f1e77bb0f5ebd0ecc6239e431c5 Mon Sep 17 00:00:00 2001
From: Jean-Noël Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Mon, 14 Nov 2016 15:38:45 +0000
Subject: [PATCH] AutoRefactor'ed use Map.entrySet() instead of Map.keySet() in a loop
---
opendj-config/src/main/java/org/forgerock/opendj/config/dsconfig/SetPropSubCommandHandler.java | 11 ++++-------
1 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/opendj-config/src/main/java/org/forgerock/opendj/config/dsconfig/SetPropSubCommandHandler.java b/opendj-config/src/main/java/org/forgerock/opendj/config/dsconfig/SetPropSubCommandHandler.java
index acf7917..af02f6e 100644
--- a/opendj-config/src/main/java/org/forgerock/opendj/config/dsconfig/SetPropSubCommandHandler.java
+++ b/opendj-config/src/main/java/org/forgerock/opendj/config/dsconfig/SetPropSubCommandHandler.java
@@ -73,9 +73,8 @@
* This sub-command implements the various set-xxx-prop sub-commands.
*/
final class SetPropSubCommandHandler extends SubCommandHandler {
-
/** Type of modification being performed. */
- private static enum ModificationType {
+ private enum ModificationType {
/** Append a single value to the property. */
ADD,
/** Remove a single value from the property. */
@@ -443,8 +442,7 @@
} else {
app.println();
if (app.confirmAction(INFO_DSCFG_PROMPT_EDIT_TO_ENABLE.get(rufn, name, ufn), true)) {
- MenuResult<Void> result = SetPropSubCommandHandler.modifyManagedObject(app,
- context, ref, handler);
+ MenuResult<Void> result = modifyManagedObject(app, context, ref, handler);
if (result.isQuit()) {
return result;
} else if (result.isSuccess()) {
@@ -641,7 +639,6 @@
// Reset properties.
for (String m : propertyResetArgument.getValues()) {
-
// Check one does not try to reset with a value
if (m.contains(":")) {
throw ArgumentExceptionFactory.unableToResetPropertyWithValue(m, OPTION_DSCFG_LONG_RESET);
@@ -714,9 +711,9 @@
}
// Apply the command line changes.
- for (PropertyDefinition<?> pd : changes.keySet()) {
+ for (Map.Entry<PropertyDefinition, Set> entry : changes.entrySet()) {
try {
- child.setPropertyValues(pd, changes.get(pd));
+ child.setPropertyValues(entry.getKey(), entry.getValue());
} catch (PropertyException e) {
throw ArgumentExceptionFactory.adaptPropertyException(e, d);
}
--
Gitblit v1.10.0