Revision: 8584
Author: amitman...@google.com
Date: Thu Aug 19 14:35:19 2010
Log: Doing an important TODO in RecordEditActivity.

Patch by: amitmanjhi
Review by: rjrjr

http://code.google.com/p/google-web-toolkit/source/detail?r=8584

Modified:
 /trunk/user/src/com/google/gwt/app/place/AbstractRecordEditActivity.java

=======================================
--- /trunk/user/src/com/google/gwt/app/place/AbstractRecordEditActivity.java Thu Aug 19 14:03:46 2010 +++ /trunk/user/src/com/google/gwt/app/place/AbstractRecordEditActivity.java Thu Aug 19 14:35:19 2010
@@ -118,33 +118,23 @@
         }
         boolean hasViolations = false;

- // TODO(amit) at the moment we only get one response, and futures are - // buggy. So forcing the issue for now, but the more involved code may
-        // have to come back when bugs are fixed
-        assert response.size() == 1;
-        SyncResult syncResult = response.iterator().next();
-        record = cast(syncResult.getRecord());
-        if (syncResult.hasViolations()) {
-          hasViolations = true;
-          view.showErrors(syncResult.getViolations());
-        }
-        // for (SyncResult syncResult : response) {
-        // Record syncRecord = syncResult.getRecord();
-        // if (creating) {
- // if (futureId == null | | !futureId.equals(syncResult.getFutureId())) {
-        // continue;
-        // }
-        // record = cast(syncRecord);
-        // } else {
-        // if (!syncRecord.getId().equals(record.getId())) {
-        // continue;
-        // }
-        // }
-        // if (syncResult.hasViolations()) {
-        // hasViolations = true;
-        // view.showErrors(syncResult.getViolations());
-        // }
-        // }
+         for (SyncResult syncResult : response) {
+          Record syncRecord = syncResult.getRecord();
+          if (creating) {
+ if (futureId == null | | !futureId.equals(syncResult.getFutureId())) {
+              continue;
+            }
+            record = cast(syncRecord);
+          } else {
+            if (!syncRecord.getId().equals(record.getId())) {
+              continue;
+            }
+          }
+          if (syncResult.hasViolations()) {
+            hasViolations = true;
+            view.showErrors(syncResult.getViolations());
+          }
+        }
         if (!hasViolations) {
           exit(true);
         } else {

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to