>From 0e708eb63173588a10c866d6a910a53b2f9d5efd Mon Sep 17 00:00:00 2001 From: Fraser Tweedale Date: Mon, 13 Apr 2015 00:29:09 -0400 Subject: [PATCH 31/33] Remove unneeded collection from profile subsystems Caveat: This changes the order in which profiles are listed, but the previous order doesn't seem very logical and there doesn't appear to be any contract for a particular order. --- .../src/com/netscape/cmscore/profile/AbstractProfileSubsystem.java | 3 +-- .../src/com/netscape/cmscore/profile/LDAPProfileSubsystem.java | 5 ----- .../cmscore/src/com/netscape/cmscore/profile/ProfileSubsystem.java | 4 ---- 3 files changed, 1 insertion(+), 11 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 b7cd503a142fc0c3065c7d19de5229c7490613f4..642f60232806eaadc68398bd21d2912dc920cda9 100644 --- a/base/server/cmscore/src/com/netscape/cmscore/profile/AbstractProfileSubsystem.java +++ b/base/server/cmscore/src/com/netscape/cmscore/profile/AbstractProfileSubsystem.java @@ -36,7 +36,6 @@ public abstract class AbstractProfileSubsystem implements IProfileSubsystem { protected IConfigStore mConfig = null; @SuppressWarnings("unused") protected ISubsystem mOwner; - protected Vector mProfileIds; protected Hashtable mProfiles; protected Hashtable mProfileClassIds; @@ -133,7 +132,7 @@ public abstract class AbstractProfileSubsystem implements IProfileSubsystem { * list is of type String. */ public Enumeration getProfileIds() { - return mProfileIds.elements(); + return mProfiles.keys(); } /** 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 92aa827b1bcb348ed0b5a5df355c8ef98f265a6c..c7963498dfffe90ec6b9cd83d351385a8686f913 100644 --- a/base/server/cmscore/src/com/netscape/cmscore/profile/LDAPProfileSubsystem.java +++ b/base/server/cmscore/src/com/netscape/cmscore/profile/LDAPProfileSubsystem.java @@ -73,7 +73,6 @@ public class LDAPProfileSubsystem CMS.debug("LDAPProfileSubsystem: start init"); // (re)init member collections - mProfileIds = new Vector(); mProfiles = new Hashtable(); mProfileClassIds = new Hashtable(); @@ -163,8 +162,6 @@ public class LDAPProfileSubsystem IProfile profile = (IProfile) Class.forName(className).newInstance(); profile.setId(id); profile.init(this, subStoreConfig); - if (!mProfiles.containsKey(id)) - mProfileIds.addElement(id); mProfiles.put(id, profile); mProfileClassIds.put(id, classid); return profile; @@ -216,7 +213,6 @@ public class LDAPProfileSubsystem * notification that a profile was deleted. */ private void forgetProfile(String id) { - mProfileIds.removeElement(id); mProfiles.remove(id); mProfileClassIds.remove(id); } @@ -250,7 +246,6 @@ public class LDAPProfileSubsystem } private void forgetAllProfiles() { - mProfileIds.clear(); mProfiles.clear(); mProfileClassIds.clear(); } 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 9a7292f2cbe03d2a9cc06d47e8bd52552dec94d7..b2b4b30f22926c0e4e00b106115e1818402e59e6 100644 --- a/base/server/cmscore/src/com/netscape/cmscore/profile/ProfileSubsystem.java +++ b/base/server/cmscore/src/com/netscape/cmscore/profile/ProfileSubsystem.java @@ -55,7 +55,6 @@ public class ProfileSubsystem IPluginRegistry registry = (IPluginRegistry) CMS.getSubsystem(CMS.SUBSYSTEM_REGISTRY); - mProfileIds = new Vector(); mProfiles = new Hashtable(); mProfileClassIds = new Hashtable(); @@ -126,7 +125,6 @@ public class ProfileSubsystem CMS.debug("ProfileSubsystem: initing " + className); profile.setId(id); profile.init(this, subStoreConfig); - mProfileIds.addElement(id); mProfiles.put(id, profile); mProfileClassIds.put(id, classid); if (isNew) @@ -179,7 +177,6 @@ public class ProfileSubsystem if (!file1.delete()) { CMS.debug("ProfileSubsystem: deleteProfile: Cannot delete the configuration file : " + configPath); } - mProfileIds.removeElement(id); mProfiles.remove(id); mProfileClassIds.remove(id); try { @@ -226,7 +223,6 @@ public class ProfileSubsystem *

*/ public void shutdown() { - mProfileIds.clear(); mProfiles.clear(); mProfileClassIds.clear(); } -- 2.1.0