diff options
| author | abranson <andrew.branson@cern.ch> | 2011-08-04 00:42:34 +0200 |
|---|---|---|
| committer | abranson <andrew.branson@cern.ch> | 2011-08-04 00:42:34 +0200 |
| commit | 0ec8481c10cd8277d84c7c1a785483a0a739e5a0 (patch) | |
| tree | 5f6e5d9ae75193e67e6f3b3dfa488960c5cde1d5 /source/com/c2kernel/lookup/LDAPPropertyManager.java | |
| parent | 036cbdba66f804743c4c838ed598d6972c4b3e17 (diff) | |
More code cleanup:
Refactored Entity Proxy Subscription to handle generics better
Rewrote RemoteMap to use TreeMap instead of the internal array for
order. It now sorts its keys by number if they parse, else as strings.
Removed a no-longer-in-progress outcome form class
Diffstat (limited to 'source/com/c2kernel/lookup/LDAPPropertyManager.java')
| -rw-r--r-- | source/com/c2kernel/lookup/LDAPPropertyManager.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source/com/c2kernel/lookup/LDAPPropertyManager.java b/source/com/c2kernel/lookup/LDAPPropertyManager.java index a1fd6af..57ed17d 100644 --- a/source/com/c2kernel/lookup/LDAPPropertyManager.java +++ b/source/com/c2kernel/lookup/LDAPPropertyManager.java @@ -49,13 +49,13 @@ public class LDAPPropertyManager { LDAPEntry entityEntry = LDAPLookupUtils.getEntry(ldap.getConnection(), thisEntity.getFullDN());
ArrayList<String> propbag = new ArrayList<String>();
LDAPAttribute props = entityEntry.getAttribute("cristalprop");
- for (Enumeration e = props.getStringValues(); e.hasMoreElements();) {
+ for (Enumeration<?> e = props.getStringValues(); e.hasMoreElements();) {
String thisProp = (String)e.nextElement();
propbag.add(thisProp.substring(0, thisProp.indexOf(':')));
}
-
+
String[] retArr = new String[props.size()];
- return (String[])propbag.toArray(retArr);
+ return propbag.toArray(retArr);
}
/**
@@ -101,13 +101,13 @@ public class LDAPPropertyManager { LDAPLookupUtils.addAttributeValue(ldap.getConnection(), entityEntry, "cristalprop", prop.getName()+":"+prop.getValue());
}
- private String getPropertyAttr(LDAPEntry myEntry, String propName) throws ObjectNotFoundException {
+ private static String getPropertyAttr(LDAPEntry myEntry, String propName) throws ObjectNotFoundException {
// delete existing props
LDAPAttribute props = myEntry.getAttribute("cristalprop");
if (props == null)
throw new ObjectNotFoundException("Property "+propName+" does not exist", "");
String propPrefix = propName+":";
- for (Enumeration e = props.getStringValues(); e.hasMoreElements();) {
+ for (Enumeration<?> e = props.getStringValues(); e.hasMoreElements();) {
String val = (String)e.nextElement();
if (val.toLowerCase().startsWith(propPrefix.toLowerCase()))
return val.substring(propPrefix.length());
|
