src/share/classes/com/sun/jndi/ldap/LdapSchemaParser.java
Print this page
*** 25,35 ****
package com.sun.jndi.ldap;
import javax.naming.*;
import javax.naming.directory.*;
- import java.util.Hashtable;
import java.util.Vector;
/**
* Netscape's 3.1 servers have some schema bugs:
* - It puts quotes around OIDs (such as those for SUP, SYNTAX).
--- 25,34 ----
*** 139,149 ****
final private static DirContext objectDescs2ClassDefs(Attribute objDescsAttr,
LdapSchemaCtx schemaRoot)
throws NamingException {
! NamingEnumeration objDescs;
Attributes objDef;
LdapSchemaCtx classDefTree;
// create the class def subtree
Attributes attrs = new BasicAttributes(LdapClient.caseIgnore);
--- 138,148 ----
final private static DirContext objectDescs2ClassDefs(Attribute objDescsAttr,
LdapSchemaCtx schemaRoot)
throws NamingException {
! NamingEnumeration<?> objDescs;
Attributes objDef;
LdapSchemaCtx classDefTree;
// create the class def subtree
Attributes attrs = new BasicAttributes(LdapClient.caseIgnore);
*** 171,181 ****
final private static DirContext attrDescs2AttrDefs(Attribute attributeDescAttr,
LdapSchemaCtx schemaRoot)
throws NamingException {
! NamingEnumeration attrDescs;
Attributes attrDef;
LdapSchemaCtx attrDefTree;
// create the AttributeDef subtree
Attributes attrs = new BasicAttributes(LdapClient.caseIgnore);
--- 170,180 ----
final private static DirContext attrDescs2AttrDefs(Attribute attributeDescAttr,
LdapSchemaCtx schemaRoot)
throws NamingException {
! NamingEnumeration<?> attrDescs;
Attributes attrDef;
LdapSchemaCtx attrDefTree;
// create the AttributeDef subtree
Attributes attrs = new BasicAttributes(LdapClient.caseIgnore);
*** 204,214 ****
final private static DirContext syntaxDescs2SyntaxDefs(
Attribute syntaxDescAttr,
LdapSchemaCtx schemaRoot)
throws NamingException {
! NamingEnumeration syntaxDescs;
Attributes syntaxDef;
LdapSchemaCtx syntaxDefTree;
// create the SyntaxDef subtree
Attributes attrs = new BasicAttributes(LdapClient.caseIgnore);
--- 203,213 ----
final private static DirContext syntaxDescs2SyntaxDefs(
Attribute syntaxDescAttr,
LdapSchemaCtx schemaRoot)
throws NamingException {
! NamingEnumeration<?> syntaxDescs;
Attributes syntaxDef;
LdapSchemaCtx syntaxDefTree;
// create the SyntaxDef subtree
Attributes attrs = new BasicAttributes(LdapClient.caseIgnore);
*** 237,247 ****
final private static DirContext matchRuleDescs2MatchRuleDefs(
Attribute matchRuleDescAttr,
LdapSchemaCtx schemaRoot)
throws NamingException {
! NamingEnumeration matchRuleDescs;
Attributes matchRuleDef;
LdapSchemaCtx matchRuleDefTree;
// create the MatchRuleDef subtree
Attributes attrs = new BasicAttributes(LdapClient.caseIgnore);
--- 236,246 ----
final private static DirContext matchRuleDescs2MatchRuleDefs(
Attribute matchRuleDescAttr,
LdapSchemaCtx schemaRoot)
throws NamingException {
! NamingEnumeration<?> matchRuleDescs;
Attributes matchRuleDef;
LdapSchemaCtx matchRuleDefTree;
// create the MatchRuleDef subtree
Attributes attrs = new BasicAttributes(LdapClient.caseIgnore);
*** 518,528 ****
*/
final private static String[] readQDescrList(String string, int[] pos)
throws NamingException {
int begin, end;
! Vector values = new Vector(5);
if (debug) {
System.err.println("ReadQDescrList: pos="+pos[0]);
}
--- 517,527 ----
*/
final private static String[] readQDescrList(String string, int[] pos)
throws NamingException {
int begin, end;
! Vector<String> values = new Vector<>(5);
if (debug) {
System.err.println("ReadQDescrList: pos="+pos[0]);
}
*** 551,561 ****
pos[0] = end+1; // skip ')'
String[] answer = new String[values.size()];
for (int i = 0; i < answer.length; i++) {
! answer[i] = (String)values.elementAt(i);
}
return answer;
}
final private static String[] readWOID(String string, int[] pos)
--- 550,560 ----
pos[0] = end+1; // skip ')'
String[] answer = new String[values.size()];
for (int i = 0; i < answer.length; i++) {
! answer[i] = values.elementAt(i);
}
return answer;
}
final private static String[] readWOID(String string, int[] pos)
*** 612,622 ****
// Multiple OIDs
int begin, cur, end;
String oidName = null;
! Vector values = new Vector(5);
if (debug) {
System.err.println("ReadOIDList: pos="+pos[0]);
}
--- 611,621 ----
// Multiple OIDs
int begin, cur, end;
String oidName = null;
! Vector<String> values = new Vector<>(5);
if (debug) {
System.err.println("ReadOIDList: pos="+pos[0]);
}
*** 661,671 ****
pos[0] = end+1;
String[] answer = new String[values.size()];
for (int i = 0; i < answer.length; i++) {
! answer[i] = (String)values.elementAt(i);
}
return answer;
}
// ----------------- "unparser" methods
--- 660,670 ----
pos[0] = end+1;
String[] answer = new String[values.size()];
for (int i = 0; i < answer.length; i++) {
! answer[i] = values.elementAt(i);
}
return answer;
}
// ----------------- "unparser" methods
*** 841,854 ****
// process any remaining attributes
if (count < attrs.size()) {
String attrId = null;
// use enumeration because attribute ID is not known
! for (NamingEnumeration ae = attrs.getAll();
ae.hasMoreElements(); ) {
! attr = (Attribute)ae.next();
attrId = attr.getID();
// skip those already processed
if (attrId.equals(NUMERICOID_ID) ||
attrId.equals(NAME_ID) ||
--- 840,853 ----
// process any remaining attributes
if (count < attrs.size()) {
String attrId = null;
// use enumeration because attribute ID is not known
! for (NamingEnumeration<? extends Attribute> ae = attrs.getAll();
ae.hasMoreElements(); ) {
! attr = ae.next();
attrId = attr.getID();
// skip those already processed
if (attrId.equals(NUMERICOID_ID) ||
attrId.equals(NAME_ID) ||
*** 971,984 ****
// process any remaining attributes
if (count < attrs.size()) {
String attrId = null;
// use enumeration because attribute ID is not known
! for (NamingEnumeration ae = attrs.getAll();
ae.hasMoreElements(); ) {
! attr = (Attribute)ae.next();
attrId = attr.getID();
// skip those already processed
if (attrId.equals(NUMERICOID_ID) ||
attrId.equals(NAME_ID) ||
--- 970,983 ----
// process any remaining attributes
if (count < attrs.size()) {
String attrId = null;
// use enumeration because attribute ID is not known
! for (NamingEnumeration<? extends Attribute> ae = attrs.getAll();
ae.hasMoreElements(); ) {
! attr = ae.next();
attrId = attr.getID();
// skip those already processed
if (attrId.equals(NUMERICOID_ID) ||
attrId.equals(NAME_ID) ||
*** 1038,1051 ****
// process any remaining attributes
if (count < attrs.size()) {
String attrId = null;
// use enumeration because attribute ID is not known
! for (NamingEnumeration ae = attrs.getAll();
ae.hasMoreElements(); ) {
! attr = (Attribute)ae.next();
attrId = attr.getID();
// skip those already processed
if (attrId.equals(NUMERICOID_ID) ||
attrId.equals(DESC_ID)) {
--- 1037,1050 ----
// process any remaining attributes
if (count < attrs.size()) {
String attrId = null;
// use enumeration because attribute ID is not known
! for (NamingEnumeration<? extends Attribute> ae = attrs.getAll();
ae.hasMoreElements(); ) {
! attr = ae.next();
attrId = attr.getID();
// skip those already processed
if (attrId.equals(NUMERICOID_ID) ||
attrId.equals(DESC_ID)) {
*** 1115,1128 ****
// process any remaining attributes
if (count < attrs.size()) {
String attrId = null;
// use enumeration because attribute ID is not known
! for (NamingEnumeration ae = attrs.getAll();
ae.hasMoreElements(); ) {
! attr = (Attribute)ae.next();
attrId = attr.getID();
// skip those already processed
if (attrId.equals(NUMERICOID_ID) ||
attrId.equals(NAME_ID) ||
--- 1114,1127 ----
// process any remaining attributes
if (count < attrs.size()) {
String attrId = null;
// use enumeration because attribute ID is not known
! for (NamingEnumeration<? extends Attribute> ae = attrs.getAll();
ae.hasMoreElements(); ) {
! attr = ae.next();
attrId = attr.getID();
// skip those already processed
if (attrId.equals(NUMERICOID_ID) ||
attrId.equals(NAME_ID) ||
*** 1199,1209 ****
StringBuffer qdList = new StringBuffer(attr.getID());
qdList.append(WHSP);
qdList.append(OID_LIST_BEGIN);
! NamingEnumeration values = attr.getAll();
while(values.hasMore()) {
qdList.append(WHSP);
qdList.append(SINGLE_QUOTE);
qdList.append((String)values.next());
--- 1198,1208 ----
StringBuffer qdList = new StringBuffer(attr.getID());
qdList.append(WHSP);
qdList.append(OID_LIST_BEGIN);
! NamingEnumeration<?> values = attr.getAll();
while(values.hasMore()) {
qdList.append(WHSP);
qdList.append(SINGLE_QUOTE);
qdList.append((String)values.next());
*** 1236,1246 ****
StringBuffer oidList = new StringBuffer(oidsAttr.getID());
oidList.append(WHSP);
oidList.append(OID_LIST_BEGIN);
! NamingEnumeration values = oidsAttr.getAll();
oidList.append(WHSP);
oidList.append(values.next());
while(values.hasMore()) {
oidList.append(WHSP);
--- 1235,1245 ----
StringBuffer oidList = new StringBuffer(oidsAttr.getID());
oidList.append(WHSP);
oidList.append(OID_LIST_BEGIN);
! NamingEnumeration<?> values = oidsAttr.getAll();
oidList.append(WHSP);
oidList.append(values.next());
while(values.hasMore()) {
oidList.append(WHSP);