src/share/classes/javax/naming/Reference.java

Print this page

        

*** 118,128 **** * @param className The non-null class name of the object to which * this reference refers. */ public Reference(String className) { this.className = className; ! addrs = new Vector(); } /** * Constructs a new reference for an object with class name 'className' and * an address. --- 118,128 ---- * @param className The non-null class name of the object to which * this reference refers. */ public Reference(String className) { this.className = className; ! addrs = new Vector<>(); } /** * Constructs a new reference for an object with class name 'className' and * an address.
*** 132,142 **** * which this reference refers. * @param addr The non-null address of the object. */ public Reference(String className, RefAddr addr) { this.className = className; ! addrs = new Vector(); addrs.addElement(addr); } /** * Constructs a new reference for an object with class name 'className', --- 132,142 ---- * which this reference refers. * @param addr The non-null address of the object. */ public Reference(String className, RefAddr addr) { this.className = className; ! addrs = new Vector<>(); addrs.addElement(addr); } /** * Constructs a new reference for an object with class name 'className',
*** 223,233 **** */ public RefAddr get(String addrType) { int len = addrs.size(); RefAddr addr; for (int i = 0; i < len; i++) { ! addr = (RefAddr) addrs.elementAt(i); if (addr.getType().compareTo(addrType) == 0) return addr; } return null; } --- 223,233 ---- */ public RefAddr get(String addrType) { int len = addrs.size(); RefAddr addr; for (int i = 0; i < len; i++) { ! addr = addrs.elementAt(i); if (addr.getType().compareTo(addrType) == 0) return addr; } return null; }
*** 239,249 **** * range [0,getAddressCount()). * @exception ArrayIndexOutOfBoundsException If posn not in the specified * range. */ public RefAddr get(int posn) { ! return ((RefAddr) addrs.elementAt(posn)); } /** * Retrieves an enumeration of the addresses in this reference. * When addresses are added, changed or removed from this reference, --- 239,249 ---- * range [0,getAddressCount()). * @exception ArrayIndexOutOfBoundsException If posn not in the specified * range. */ public RefAddr get(int posn) { ! return addrs.elementAt(posn); } /** * Retrieves an enumeration of the addresses in this reference. * When addresses are added, changed or removed from this reference,
*** 329,340 **** if ((obj != null) && (obj instanceof Reference)) { Reference target = (Reference)obj; // ignore factory information if (target.className.equals(this.className) && target.size() == this.size()) { ! Enumeration mycomps = getAll(); ! Enumeration comps = target.getAll(); while (mycomps.hasMoreElements()) if (!(mycomps.nextElement().equals(comps.nextElement()))) return false; return true; } --- 329,340 ---- if ((obj != null) && (obj instanceof Reference)) { Reference target = (Reference)obj; // ignore factory information if (target.className.equals(this.className) && target.size() == this.size()) { ! Enumeration<RefAddr> mycomps = getAll(); ! Enumeration<RefAddr> comps = target.getAll(); while (mycomps.hasMoreElements()) if (!(mycomps.nextElement().equals(comps.nextElement()))) return false; return true; }
*** 348,358 **** * * @return A hash code of this reference as an int. */ public int hashCode() { int hash = className.hashCode(); ! for (Enumeration e = getAll(); e.hasMoreElements();) hash += e.nextElement().hashCode(); return hash; } /** --- 348,358 ---- * * @return A hash code of this reference as an int. */ public int hashCode() { int hash = className.hashCode(); ! for (Enumeration<RefAddr> e = getAll(); e.hasMoreElements();) hash += e.nextElement().hashCode(); return hash; } /**
*** 380,390 **** * and vice versa. */ public Object clone() { Reference r = new Reference(className, classFactory, classFactoryLocation); Enumeration<RefAddr> a = getAll(); ! r.addrs = new Vector(); while (a.hasMoreElements()) r.addrs.addElement(a.nextElement()); return r; } --- 380,390 ---- * and vice versa. */ public Object clone() { Reference r = new Reference(className, classFactory, classFactoryLocation); Enumeration<RefAddr> a = getAll(); ! r.addrs = new Vector<>(); while (a.hasMoreElements()) r.addrs.addElement(a.nextElement()); return r; }