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-server-legacy/src/main/java/org/opends/quicksetup/installer/ui/DataOptionsPanel.java | 16 ++++++++++------
1 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/opendj-server-legacy/src/main/java/org/opends/quicksetup/installer/ui/DataOptionsPanel.java b/opendj-server-legacy/src/main/java/org/opends/quicksetup/installer/ui/DataOptionsPanel.java
index fe3325f..5acccc7 100644
--- a/opendj-server-legacy/src/main/java/org/opends/quicksetup/installer/ui/DataOptionsPanel.java
+++ b/opendj-server-legacy/src/main/java/org/opends/quicksetup/installer/ui/DataOptionsPanel.java
@@ -27,6 +27,7 @@
import java.awt.event.FocusListener;
import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import javax.swing.Box;
import javax.swing.ButtonGroup;
@@ -92,9 +93,10 @@
{
if (fieldName == FieldName.DATA_OPTIONS)
{
- for (NewSuffixOptions.Type type : hmRadioButtons.keySet())
+ for (Map.Entry<NewSuffixOptions.Type, JRadioButton> entry : hmRadioButtons.entrySet())
{
- if (hmRadioButtons.get(type).isSelected())
+ NewSuffixOptions.Type type = entry.getKey();
+ if (entry.getValue().isSelected())
{
return type;
}
@@ -402,9 +404,10 @@
LabelFieldDescriptor.LabelType.SECONDARY, UIFactory.NUMBER_ENTRIES_FIELD_SIZE);
hm.put(FieldName.NUMBER_ENTRIES, entryNumberLabelDescriptor);
- for (final FieldName fieldName : hm.keySet())
+ for (Map.Entry<FieldName, LabelFieldDescriptor> entry : hm.entrySet())
{
- final LabelFieldDescriptor desc = hm.get(fieldName);
+ FieldName fieldName = entry.getKey();
+ final LabelFieldDescriptor desc = entry.getValue();
final String defaultValue = fieldName == FieldName.NUMBER_ENTRIES ?
Integer.toString(defaultUserData.getNewSuffixOptions().getNumberEntries())
: getDefaultValue(fieldName);
@@ -461,9 +464,10 @@
final NewSuffixOptions.Type defaultType = defaultUserData.getNewSuffixOptions().getType();
final ButtonGroup buttonGroup = new ButtonGroup();
- for (NewSuffixOptions.Type type : hmRadioButtons.keySet())
+ for (Map.Entry<NewSuffixOptions.Type, JRadioButton> entry : hmRadioButtons.entrySet())
{
- final JRadioButton radioButton = hmRadioButtons.get(type);
+ NewSuffixOptions.Type type = entry.getKey();
+ final JRadioButton radioButton = entry.getValue();
radioButton.setSelected(type == defaultType);
buttonGroup.add(radioButton);
}
--
Gitblit v1.10.0