This commit is contained in:
rlk%trfenv.com 2004-11-30 01:45:19 +00:00
Родитель 6c3e142b09
Коммит af39eec4b0
9 изменённых файлов: 36 добавлений и 36 удалений

Просмотреть файл

@ -107,9 +107,9 @@ public class LDAPEntryChangeControl extends LDAPControl {
BERSequence s = (BERSequence)BERElement.getElement(decoder, inStream,
numRead);
BEREnumerated enum = (BEREnumerated)s.elementAt(0);
BEREnumerated itr = (BEREnumerated)s.elementAt(0);
_changeTypes = enum.getValue();
_changeTypes = itr.getValue();
if (s.size() > 1) {
if (s.elementAt(1) instanceof BEROctetString) {

Просмотреть файл

@ -263,9 +263,9 @@ public class LDAPPersistSearchControl extends LDAPControl {
BERSequence s = (BERSequence)BERElement.getElement(decoder, inStream,
numRead);
BEREnumerated enum = (BEREnumerated)s.elementAt(0);
BEREnumerated itr = (BEREnumerated)s.elementAt(0);
con.setChangeType(enum.getValue());
con.setChangeType(itr.getValue());
if (s.size() > 1) {
if (s.elementAt(1) instanceof BEROctetString) {

Просмотреть файл

@ -402,12 +402,12 @@ public final class RDN implements java.io.Serializable {
* @see org.ietf.ldap.util.RDN#getAttributeSyntax
*/
public static String[] getAttributesForSyntax( String oid ) {
Enumeration enum = m_attributehash.keys();
Enumeration itr = m_attributehash.keys();
Vector key_v = new Vector();
String tmp_str = null;
while ( enum.hasMoreElements() ) {
tmp_str = (String)enum.nextElement();
while ( itr.hasMoreElements() ) {
tmp_str = (String)itr.nextElement();
if ( oid.equals( (String)m_attributehash.get( tmp_str ) ) ) {
key_v.addElement( tmp_str );
}

Просмотреть файл

@ -2064,16 +2064,16 @@ public class LDAPConnection
*
* LDAPAttributeSet foundAttrs = foundEntry.getAttributeSet();
* int size = foundAttrs.size();
* Enumeration enumAttrs = foundAttrs.getAttributes();
* Enumeration itrAttrs = foundAttrs.getAttributes();
* System.out.println( "Attributes: " );
*
* while ( enumAttrs.hasMoreElements() ) {
* LDAPAttribute anAttr = ( LDAPAttribute )enumAttrs.nextElement();
* while ( itrAttrs.hasMoreElements() ) {
* LDAPAttribute anAttr = ( LDAPAttribute )itrAttrs.nextElement();
* String attrName = anAttr.getName();
* System.out.println( "\t" + attrName );
* Enumeration enumVals = anAttr.getStringValues();
* while ( enumVals.hasMoreElements() ) {
* String aVal = ( String )enumVals.nextElement();
* Enumeration itrVals = anAttr.getStringValues();
* while ( itrVals.hasMoreElements() ) {
* String aVal = ( String )itrVals.nextElement();
* System.out.println( "\t\t" + aVal );
* }
* }
@ -4519,9 +4519,9 @@ public class LDAPConnection
LDAPControl[] controls = null;
synchronized(m_responseControlTable) {
Enumeration enum = m_responseControlTable.keys();
while (enum.hasMoreElements()) {
Object client = enum.nextElement();
Enumeration itr = m_responseControlTable.keys();
while (itr.hasMoreElements()) {
Object client = itr.nextElement();
ResponseControls rspCtrls = (ResponseControls)m_responseControlTable.get(client);
if (msgID == rspCtrls.msgID) {

Просмотреть файл

@ -107,9 +107,9 @@ public class LDAPEntryChangeControl extends LDAPControl {
BERSequence s = (BERSequence)BERElement.getElement(decoder, inStream,
numRead);
BEREnumerated enum = (BEREnumerated)s.elementAt(0);
BEREnumerated itr = (BEREnumerated)s.elementAt(0);
m_changeTypes = enum.getValue();
m_changeTypes = itr.getValue();
if (s.size() > 1) {
if (s.elementAt(1) instanceof BEROctetString) {

Просмотреть файл

@ -263,9 +263,9 @@ public class LDAPPersistSearchControl extends LDAPControl {
BERSequence s = (BERSequence)BERElement.getElement(decoder, inStream,
numRead);
BEREnumerated enum = (BEREnumerated)s.elementAt(0);
BEREnumerated itr = (BEREnumerated)s.elementAt(0);
con.setChangeType(enum.getValue());
con.setChangeType(itr.getValue());
if (s.size() > 1) {
if (s.elementAt(1) instanceof BEROctetString) {

Просмотреть файл

@ -402,12 +402,12 @@ public final class RDN implements java.io.Serializable {
* @see netscape.ldap.util.RDN#getAttributeSyntax
*/
public static String[] getAttributesForSyntax( String oid ) {
Enumeration enum = m_attributehash.keys();
Enumeration itr = m_attributehash.keys();
Vector key_v = new Vector();
String tmp_str = null;
while ( enum.hasMoreElements() ) {
tmp_str = (String)enum.nextElement();
while ( itr.hasMoreElements() ) {
tmp_str = (String)itr.nextElement();
if ( oid.equals( (String)m_attributehash.get( tmp_str ) ) ) {
key_v.addElement( tmp_str );
}

Просмотреть файл

@ -152,8 +152,8 @@ class AttributesImpl implements Attributes {
*/
static LDAPAttributeSet jndiAttrsToLdapAttrSet(Attributes jndiAttrs) throws NamingException{
LDAPAttributeSet attrs = new LDAPAttributeSet();
for (Enumeration enum = jndiAttrs.getAll(); enum.hasMoreElements();) {
attrs.add(jndiAttrToLdapAttr((Attribute) enum.nextElement()));
for (Enumeration itr = jndiAttrs.getAll(); itr.hasMoreElements();) {
attrs.add(jndiAttrToLdapAttr((Attribute) itr.nextElement()));
}
return attrs;
}
@ -184,12 +184,12 @@ class AttributesImpl implements Attributes {
*/
static Attribute ldapAttrToJndiAttr(LDAPAttribute attr) {
BasicAttribute jndiAttr = new BasicAttribute(attr.getName());
Enumeration enumVals = null;
Enumeration itrVals = null;
if (isBinaryAttribute(attr.getName())) {
enumVals = attr.getByteValues();
itrVals = attr.getByteValues();
}
else {
enumVals = attr.getStringValues();
itrVals = attr.getStringValues();
}
/* Performance enhancement for an attribute with many values.
* If number of value over threshold, use TreeSet to quickly
@ -197,9 +197,9 @@ class AttributesImpl implements Attributes {
* to pass TreeSet directly to Vector of JNDI attribute.
*/
if (attr.size() < 50 ) {
if (enumVals != null) {
while ( enumVals.hasMoreElements() ) {
jndiAttr.add(enumVals.nextElement());
if (itrVals != null) {
while ( itrVals.hasMoreElements() ) {
jndiAttr.add(itrVals.nextElement());
}
}
}
@ -214,9 +214,9 @@ class AttributesImpl implements Attributes {
}
}
TreeSet valSet = new TreeSet();
if (enumVals != null) {
while ( enumVals.hasMoreElements() ) {
valSet.add(enumVals.nextElement());
if (itrVals != null) {
while ( itrVals.hasMoreElements() ) {
valSet.add(itrVals.nextElement());
}
}
jndiAttr = new BigAttribute(attr.getName(), valSet);

Просмотреть файл

@ -465,8 +465,8 @@ public class ObjectMapper {
*/
static Attributes encodeDirCtxObj(DirContext obj, Attributes attrs) throws NamingException{
Attributes ctxAttrs = obj.getAttributes("");
for (NamingEnumeration enum = ctxAttrs.getAll(); enum.hasMore();) {
attrs.put((Attribute)enum.next());
for (NamingEnumeration itr = ctxAttrs.getAll(); itr.hasMore();) {
attrs.put((Attribute)itr.next());
}
return attrs;
}