[Swift-commit] r3646 - trunk/src/org/griphyn/vdl/type

noreply at svn.ci.uchicago.edu noreply at svn.ci.uchicago.edu
Mon Sep 27 11:32:10 CDT 2010


Author: wozniak
Date: 2010-09-27 11:32:09 -0500 (Mon, 27 Sep 2010)
New Revision: 3646

Modified:
   trunk/src/org/griphyn/vdl/type/Types.java
Log:
Use generics


Modified: trunk/src/org/griphyn/vdl/type/Types.java
===================================================================
--- trunk/src/org/griphyn/vdl/type/Types.java	2010-09-27 16:31:57 UTC (rev 3645)
+++ trunk/src/org/griphyn/vdl/type/Types.java	2010-09-27 16:32:09 UTC (rev 3646)
@@ -1,13 +1,13 @@
 package org.griphyn.vdl.type;
 
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.Map;
 
 public abstract class Types {
 
 	//TODO: check namespace references in type definitions
-	private static Map types = new HashMap();
+	private static Map<String, Type> types = 
+	    new HashMap<String, Type>();
 
 	public synchronized static Type getType(String name) throws NoSuchTypeException {
 		Type type = (Type) types.get(name);
@@ -61,14 +61,11 @@
 	}
 
 	public synchronized static void resolveTypes() throws NoSuchTypeException {
-		Map typesCopy = new HashMap(types);
-		Iterator i = typesCopy.entrySet().iterator();
-		while (i.hasNext()) {
-			Map.Entry e = (Map.Entry) i.next();
+		Map<String, Type> typesCopy = 
+		    new HashMap<String, Type>(types);
+		for (Map.Entry<String, Type> e : typesCopy.entrySet()) {
 			Type type = (Type) e.getValue();
-			Iterator j = type.getFields().iterator();
-			while (j.hasNext()) {
-				Field field = (Field) j.next();
+			for (Field field : type.getFields()) {
 				Type resolved = getType(field.getType().getName());
 				field.setType(resolved);
 			}




More information about the Swift-commit mailing list