cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r634207 - /cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/IncrementalFaultList.java
Date Thu, 06 Mar 2008 10:25:45 GMT
Author: aadamchik
Date: Thu Mar  6 02:25:41 2008
New Revision: 634207

URL: http://svn.apache.org/viewvc?rev=634207&view=rev
Log:
generics

Modified:
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/IncrementalFaultList.java

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/IncrementalFaultList.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/IncrementalFaultList.java?rev=634207&r1=634206&r2=634207&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/IncrementalFaultList.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/IncrementalFaultList.java
Thu Mar  6 02:25:41 2008
@@ -340,7 +340,7 @@
                 if (isUnresolved(obj)) {
                     ids.add(obj);
 
-                    Map map = (Map) obj;
+                    Map<String, ?> map = (Map<String, ?>) obj;
                     if (map.isEmpty()) {
                         throw new CayenneRuntimeException("Empty id map at index " + i);
                     }
@@ -819,7 +819,7 @@
                 return true;
             }
 
-            Map map = (Map) object;
+            Map<?, ?> map = (Map<?, ?>) object;
             return map.size() != rowWidth;
         }
 
@@ -831,14 +831,11 @@
 
             if (object != null && objectInTheList != null) {
 
-                Map id = (Map) objectInTheList;
-                Map map = (Map) object;
+                Map<?, ?> id = (Map<?, ?>) objectInTheList;
+                Map<?, ?> map = (Map<?, ?>) object;
 
                 // id must be a subset of this map
-                Iterator it = id.entrySet().iterator();
-
-                while (it.hasNext()) {
-                    Map.Entry entry = (Map.Entry) it.next();
+                for (Map.Entry<?, ?> entry : id.entrySet()) {
                     Object key = entry.getKey();
                     Object value = entry.getValue();
                     if (!Util.nullSafeEquals(value, map.get(key))) {
@@ -855,17 +852,14 @@
         @Override
         boolean replacesObject(Object object, Object objectInTheList) {
 
-            Map id = (Map) objectInTheList;
+            Map<?, ?> id = (Map<?, ?>) objectInTheList;
             if (id.size() == rowWidth) {
                 return false;
             }
 
             // id must be a subset of this map
-            Map map = (Map) object;
-            Iterator it = id.entrySet().iterator();
-
-            while (it.hasNext()) {
-                Map.Entry entry = (Map.Entry) it.next();
+            Map<?, ?> map = (Map<?, ?>) object;
+            for (Map.Entry<?, ?> entry : id.entrySet()) {
                 Object key = entry.getKey();
                 Object value = entry.getValue();
                 if (!Util.nullSafeEquals(value, map.get(key))) {



Mime
View raw message