--- a/jdk/src/share/classes/com/sun/tools/jdi/ReferenceTypeImpl.java Thu Dec 08 14:57:13 2011 -0800
+++ b/jdk/src/share/classes/com/sun/tools/jdi/ReferenceTypeImpl.java Fri Dec 09 12:56:22 2011 -0800
@@ -99,7 +99,7 @@
// Fetch all methods for the class, check performance impact
// Needs no synchronization now, since methods() returns
// unmodifiable local data
- Iterator it = methods().iterator();
+ Iterator<Method> it = methods().iterator();
while (it.hasNext()) {
MethodImpl method = (MethodImpl)it.next();
if (method.ref() == ref) {
@@ -113,7 +113,7 @@
// Fetch all fields for the class, check performance impact
// Needs no synchronization now, since fields() returns
// unmodifiable local data
- Iterator it = fields().iterator();
+ Iterator<Field>it = fields().iterator();
while (it.hasNext()) {
FieldImpl field = (FieldImpl)it.next();
if (field.ref() == ref) {
@@ -385,7 +385,7 @@
/* Add inherited, visible fields */
List<? extends ReferenceType> types = inheritedTypes();
- Iterator iter = types.iterator();
+ Iterator<? extends ReferenceType> iter = types.iterator();
while (iter.hasNext()) {
/*
* TO DO: Be defensive and check for cyclic interface inheritance
@@ -419,7 +419,7 @@
/* Add inherited fields */
List<? extends ReferenceType> types = inheritedTypes();
- Iterator iter = types.iterator();
+ Iterator<? extends ReferenceType> iter = types.iterator();
while (iter.hasNext()) {
ReferenceTypeImpl type = (ReferenceTypeImpl)iter.next();
type.addAllFields(fieldList, typeSet);
@@ -434,13 +434,10 @@
}
public Field fieldByName(String fieldName) {
- java.util.List searchList;
- Field f;
-
- searchList = visibleFields();
+ List<Field> searchList = visibleFields();
for (int i=0; i<searchList.size(); i++) {
- f = (Field)searchList.get(i);
+ Field f = searchList.get(i);
if (f.name().equals(fieldName)) {
return f;
@@ -575,13 +572,13 @@
}
public List<ReferenceType> nestedTypes() {
- List all = vm.allClasses();
+ List<ReferenceType> all = vm.allClasses();
List<ReferenceType> nested = new ArrayList<ReferenceType>();
String outername = name();
int outerlen = outername.length();
- Iterator iter = all.iterator();
+ Iterator<ReferenceType> iter = all.iterator();
while (iter.hasNext()) {
- ReferenceType refType = (ReferenceType)iter.next();
+ ReferenceType refType = iter.next();
String name = refType.name();
int len = name.length();
/* The separator is historically '$' but could also be '#' */
@@ -598,8 +595,8 @@
public Value getValue(Field sig) {
List<Field> list = new ArrayList<Field>(1);
list.add(sig);
- Map map = getValues(list);
- return(Value)map.get(sig);
+ Map<Field, Value> map = getValues(list);
+ return map.get(sig);
}
@@ -847,7 +844,7 @@
SDE.Stratum stratum = stratum(stratumID);
List<Location> list = new ArrayList<Location>(); // location list
- for (Iterator iter = methods().iterator(); iter.hasNext(); ) {
+ for (Iterator<Method> iter = methods().iterator(); iter.hasNext(); ) {
MethodImpl method = (MethodImpl)iter.next();
try {
list.addAll(
@@ -887,7 +884,7 @@
List<Location> list = new ArrayList<Location>();
- Iterator iter = methods.iterator();
+ Iterator<Method> iter = methods.iterator();
while(iter.hasNext()) {
MethodImpl method = (MethodImpl)iter.next();
// eliminate native and abstract to eliminate