--- old/src/share/classes/com/sun/jndi/ldap/ServiceLocator.java 2011-07-27 17:21:42.133930200 -0700 +++ new/src/share/classes/com/sun/jndi/ldap/ServiceLocator.java 2011-07-27 17:21:41.382855100 -0700 @@ -26,9 +26,7 @@ package com.sun.jndi.ldap; import java.util.Arrays; -import java.util.Enumeration; import java.util.Hashtable; -import java.util.NoSuchElementException; import java.util.Random; import java.util.StringTokenizer; import java.util.List; @@ -39,8 +37,6 @@ import javax.naming.ldap.LdapName; import javax.naming.ldap.Rdn; -import com.sun.jndi.ldap.LdapURL; - /** * This class discovers the location of LDAP services by querying DNS. * See http://www.ietf.org/internet-drafts/draft-ietf-ldapext-locate-07.txt @@ -78,10 +74,10 @@ // process RDNs left-to-right //List rdnList = ldapName.getRdns(); - List rdnList = ldapName.getRdns(); + List rdnList = ldapName.getRdns(); for (int i = rdnList.size() - 1; i >= 0; i--) { //Rdn rdn = rdnList.get(i); - Rdn rdn = (Rdn) rdnList.get(i); + Rdn rdn = rdnList.get(i); // single-valued RDN with a DC attribute if ((rdn.size() == 1) && @@ -117,7 +113,7 @@ * @return An ordered list of hostports for the LDAP service or null if * the service has not been located. */ - static String[] getLdapService(String domainName, Hashtable environment) { + static String[] getLdapService(String domainName, Hashtable environment) { if (domainName == null || domainName.length() == 0) { return null; @@ -252,7 +248,7 @@ * See http://www.ietf.org/rfc/rfc2782.txt */ -static class SrvRecord implements Comparable { +static class SrvRecord implements Comparable { int priority; int weight; @@ -284,8 +280,7 @@ * Sort records in ascending order of priority value. For records with * equal priority move those with weight 0 to the top of the list. */ - public int compareTo(Object o) { - SrvRecord that = (SrvRecord) o; + public int compareTo(SrvRecord that) { if (priority > that.priority) { return 1; // this > that } else if (priority < that.priority) {