From 5146591106517e91320526ac8897a93ed27b1ab7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Manuel=20Carrasco=20Mo=C3=B1ino?= Date: Tue, 9 Apr 2013 02:48:28 +0200 Subject: [PATCH] Constants --- .../gwt/query/client/plugins/deferred/Deferred.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/deferred/Deferred.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/deferred/Deferred.java index 6c9cf95a..1e3b2ae6 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/deferred/Deferred.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/deferred/Deferred.java @@ -34,8 +34,7 @@ public class Deferred extends GQuery implements Promise.Deferred { * Deferred. */ static class DeferredPromiseImpl implements Promise { - - // Using 'int' instead of 'enum' because we use type as array index as well + // Using 'int' instead of 'enum' because we use them as indexes as well private static final int DONE = 0, FAIL = 1, PROGRESS = 2; // Private class used to handle `Promise.then()` @@ -55,7 +54,7 @@ public class Deferred extends GQuery implements Promise.Deferred { // Original filter function private final Function filter; - // Type of action (0 = done, 1 = fail, 2 = progress) + // Type of action (DONE/FAIL/PROGRESS) private final int type; // Original deferred object private final Deferred dfd; @@ -131,9 +130,9 @@ public class Deferred extends GQuery implements Promise.Deferred { public Promise then(final Function... f) { final Deferred newDfd = new com.google.gwt.query.client.plugins.deferred.Deferred(); - done(new ThenFunction(newDfd, f, 0)); - fail(new ThenFunction(newDfd, f, 1)); - progress(new ThenFunction(newDfd, f, 2)); + done(new ThenFunction(newDfd, f, DONE)); + fail(new ThenFunction(newDfd, f, FAIL)); + progress(new ThenFunction(newDfd, f, PROGRESS)); return newDfd.promise(); } -- 2.39.5