From 2dc104de03990454132bd41e3b9f4fe1a47f9ffd Mon Sep 17 00:00:00 2001
From: Jean-Noël Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Tue, 19 Apr 2016 16:44:22 +0000
Subject: [PATCH] Converted try/finally Closeable.close() (or Utils.closeSilently()) into try-with-resources
---
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/AbstractVLVIndexPanel.java | 15 +++++++--------
1 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/AbstractVLVIndexPanel.java b/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/AbstractVLVIndexPanel.java
index 1bb1fa8..7514b71 100644
--- a/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/AbstractVLVIndexPanel.java
+++ b/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/AbstractVLVIndexPanel.java
@@ -54,7 +54,6 @@
import org.forgerock.i18n.LocalizableMessage;
import org.forgerock.i18n.LocalizedIllegalArgumentException;
-import org.forgerock.opendj.config.LDAPProfile;
import org.forgerock.opendj.config.PropertyException;
import org.forgerock.opendj.config.client.ManagementContext;
import org.forgerock.opendj.config.client.ldap.LDAPManagementContext;
@@ -120,7 +119,7 @@
/** Name text field. */
protected final JTextField name = Utilities.createMediumTextField();
/** Base DNs combo box. */
- protected final JComboBox baseDNs = Utilities.createComboBox();
+ protected final JComboBox<CharSequence> baseDNs = Utilities.createComboBox();
/** Subtree text field. */
protected final JTextField baseDN = Utilities.createLongTextField();
@@ -153,7 +152,7 @@
protected final JButton remove = Utilities.createButton(INFO_CTRL_PANEL_VLV_INDEX_REMOVE_BUTTON_LABEL.get());
/** Ascending order combo box. */
- private final JComboBox ascendingOrder = Utilities.createComboBox();
+ private final JComboBox<LocalizableMessage> ascendingOrder = Utilities.createComboBox();
/** Combo box containing the sort order. */
protected DefaultListModel<VLVSortOrder> sortOrderModel;
@@ -780,8 +779,8 @@
c.add(p, gbc);
gbc.gridy++;
- DefaultComboBoxModel model = new DefaultComboBoxModel(new Object[] { COMBO_SEPARATOR, OTHER_BASE_DN });
- baseDNs.setModel(model);
+ baseDNs.setModel(new DefaultComboBoxModel<CharSequence>(
+ new CharSequence[] { COMBO_SEPARATOR, OTHER_BASE_DN }));
baseDNs.setRenderer(new CustomListCellRenderer(baseDNs));
ItemListener listener = new IgnoreItemListener(baseDNs);
baseDNs.addItemListener(listener);
@@ -851,7 +850,8 @@
c.add(attributes, gbc);
gbc.gridx++;
- ascendingOrder.setModel(new DefaultComboBoxModel(new Object[] { ASCENDING, DESCENDING }));
+ ascendingOrder.setModel(new DefaultComboBoxModel<LocalizableMessage>(
+ new LocalizableMessage[] { ASCENDING, DESCENDING }));
c.add(ascendingOrder, gbc);
gbc.gridy++;
@@ -1089,8 +1089,7 @@
{
getInfo().initializeConfigurationFramework();
final File configFile = Installation.getLocal().getCurrentConfigurationFile();
- final LDAPProfile ldapProfile = LDAPProfile.getInstance();
- try (ManagementContext context = LDAPManagementContext.newLDIFManagementContext(configFile, ldapProfile))
+ try (ManagementContext context = LDAPManagementContext.newLDIFManagementContext(configFile))
{
final PluggableBackendCfgClient backend =
(PluggableBackendCfgClient) context.getRootConfiguration().getBackend(backendName);
--
Gitblit v1.10.0