diff -r 89e3d8869c94 -r e747d3193ef2 jdk/src/share/classes/javax/management/openmbean/TabularDataSupport.java --- a/jdk/src/share/classes/javax/management/openmbean/TabularDataSupport.java Fri Oct 24 20:47:23 2008 -0700 +++ b/jdk/src/share/classes/javax/management/openmbean/TabularDataSupport.java Mon Oct 27 14:02:40 2008 +0100 @@ -30,6 +30,7 @@ // java import // import com.sun.jmx.mbeanserver.GetPropertyAction; +import com.sun.jmx.mbeanserver.Util; import java.io.IOException; import java.io.ObjectInputStream; import java.io.Serializable; @@ -611,7 +612,7 @@ @SuppressWarnings("unchecked") // historical confusion about the return type public Collection values() { - return (Collection) dataMap.values() ; + return Util.cast(dataMap.values()); } @@ -647,7 +648,7 @@ @SuppressWarnings("unchecked") // historical confusion about the return type public Set> entrySet() { - return (Set) dataMap.entrySet(); + return Util.cast(dataMap.entrySet()); } @@ -725,8 +726,7 @@ if (this.size() != other.size()) { return false; } - for (Iterator iter = this.values().iterator(); iter.hasNext(); ) { - CompositeData value = (CompositeData) iter.next(); + for (CompositeData value : dataMap.values()) { if ( ! other.containsValue(value) ) { return false; } @@ -760,9 +760,8 @@ int result = 0; result += this.tabularType.hashCode(); - for (Iterator iter = this.values().iterator(); iter.hasNext(); ) { - result += ((CompositeData)iter.next()).hashCode(); - } + for (Object value : values()) + result += value.hashCode(); return result;