On Thu, Apr 23, 2015 at 11:55:25AM +1000, Fraser Tweedale wrote:
Attached patch restores original profile enumeration order.
Cheers,
Fraser
ACKed by Endi. Pushed to master (97e8608).
>From 1842fe67ec07d63e3aa3f3c01bd7758e7831d8b8 Mon Sep 17 00:00:00
2001
From: Fraser Tweedale <ftweedal(a)redhat.com>
Date: Wed, 22 Apr 2015 21:47:51 -0400
Subject: [PATCH] Enumerate profiles in order of discovery
Recent change (d83f688) changed the order of profile enumeration.
Track profiles using a LinkedHashMap to restore old behaviour where
profiles were enumerated in the order they were discovered.
---
.../src/com/netscape/cmscore/profile/AbstractProfileSubsystem.java | 6 ++++--
.../src/com/netscape/cmscore/profile/LDAPProfileSubsystem.java | 3 ++-
.../cmscore/src/com/netscape/cmscore/profile/ProfileSubsystem.java | 3 ++-
3 files changed, 8 insertions(+), 4 deletions(-)
diff --git
a/base/server/cmscore/src/com/netscape/cmscore/profile/AbstractProfileSubsystem.java
b/base/server/cmscore/src/com/netscape/cmscore/profile/AbstractProfileSubsystem.java
index 8125dfac9f7980f3be9e464c9091e00d267f02d1..238816ff0eeb9895961e09dc399f390d18296714
100644
--- a/base/server/cmscore/src/com/netscape/cmscore/profile/AbstractProfileSubsystem.java
+++ b/base/server/cmscore/src/com/netscape/cmscore/profile/AbstractProfileSubsystem.java
@@ -17,8 +17,10 @@
// --- END COPYRIGHT BLOCK ---
package com.netscape.cmscore.profile;
+import java.util.Collections;
import java.util.Enumeration;
import java.util.Hashtable;
+import java.util.LinkedHashMap;
import java.util.Vector;
import com.netscape.certsrv.base.EBaseException;
@@ -35,7 +37,7 @@ public abstract class AbstractProfileSubsystem implements
IProfileSubsystem {
protected IConfigStore mConfig = null;
protected ISubsystem mOwner;
- protected Hashtable<String, IProfile> mProfiles;
+ protected LinkedHashMap<String, IProfile> mProfiles;
protected Hashtable<String, String> mProfileClassIds;
/**
@@ -131,7 +133,7 @@ public abstract class AbstractProfileSubsystem implements
IProfileSubsystem {
* list is of type String.
*/
public Enumeration<String> getProfileIds() {
- return mProfiles.keys();
+ return Collections.enumeration(mProfiles.keySet());
}
/**
diff --git
a/base/server/cmscore/src/com/netscape/cmscore/profile/LDAPProfileSubsystem.java
b/base/server/cmscore/src/com/netscape/cmscore/profile/LDAPProfileSubsystem.java
index 0c390be581f12d8364c2ea95c62dd4ab8da93cbb..a7974430f397ac68f21c586b5d0dcf78bded2954
100644
--- a/base/server/cmscore/src/com/netscape/cmscore/profile/LDAPProfileSubsystem.java
+++ b/base/server/cmscore/src/com/netscape/cmscore/profile/LDAPProfileSubsystem.java
@@ -23,6 +23,7 @@ import java.io.InputStream;
import java.lang.Thread;
import java.util.Enumeration;
import java.util.Hashtable;
+import java.util.LinkedHashMap;
import java.util.Vector;
import netscape.ldap.LDAPAttribute;
@@ -73,7 +74,7 @@ public class LDAPProfileSubsystem
CMS.debug("LDAPProfileSubsystem: start init");
// (re)init member collections
- mProfiles = new Hashtable<String, IProfile>();
+ mProfiles = new LinkedHashMap<String, IProfile>();
mProfileClassIds = new Hashtable<String, String>();
IConfigStore cs = CMS.getConfigStore();
diff --git a/base/server/cmscore/src/com/netscape/cmscore/profile/ProfileSubsystem.java
b/base/server/cmscore/src/com/netscape/cmscore/profile/ProfileSubsystem.java
index b2b4b30f22926c0e4e00b106115e1818402e59e6..10bc50cda1da7d3f9bcfe878a29584e7eedb2e8f
100644
--- a/base/server/cmscore/src/com/netscape/cmscore/profile/ProfileSubsystem.java
+++ b/base/server/cmscore/src/com/netscape/cmscore/profile/ProfileSubsystem.java
@@ -20,6 +20,7 @@ package com.netscape.cmscore.profile;
import java.io.File;
import java.util.Enumeration;
import java.util.Hashtable;
+import java.util.LinkedHashMap;
import java.util.StringTokenizer;
import java.util.Vector;
@@ -55,7 +56,7 @@ public class ProfileSubsystem
IPluginRegistry registry = (IPluginRegistry)
CMS.getSubsystem(CMS.SUBSYSTEM_REGISTRY);
- mProfiles = new Hashtable<String, IProfile>();
+ mProfiles = new LinkedHashMap<String, IProfile>();
mProfileClassIds = new Hashtable<String, String>();
mConfig = config;
--
2.1.0
_______________________________________________
Pki-devel mailing list
Pki-devel(a)redhat.com
https://www.redhat.com/mailman/listinfo/pki-devel