diff options
Diffstat (limited to 'gerrit-gwtui/src/main/java/com/google/gerrit/client/rpc/RestApi.java')
-rw-r--r-- | gerrit-gwtui/src/main/java/com/google/gerrit/client/rpc/RestApi.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/rpc/RestApi.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/rpc/RestApi.java index 250bc6e8fa..e2a9ffbe0c 100644 --- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/rpc/RestApi.java +++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/rpc/RestApi.java @@ -116,7 +116,7 @@ public class RestApi { } @Override - public void onResponseReceived(Request req, final Response res) { + public void onResponseReceived(Request req, Response res) { int status = res.getStatusCode(); if (status == Response.SC_NO_CONTENT) { cb.onSuccess(new HttpResponse<T>(res, null, null)); @@ -179,7 +179,7 @@ public class RestApi { } }; - // Defer handling the response if the parse took a while. + // Defer handling the response if the create took a while. if ((System.currentTimeMillis() - start) > 75) { Scheduler.get().scheduleDeferred(cmd); } else { @@ -258,6 +258,10 @@ public class RestApi { return idRaw(URL.encodePathSegment(id)); } + public RestApi id(String project, int id) { + return idRaw(URL.encodePathSegment(project) + "~" + id); + } + public RestApi id(int id) { return idRaw(Integer.toString(id)); } @@ -499,7 +503,7 @@ public class RestApi { } } - private static <T extends JavaScriptObject> HttpCallback<T> wrap(final AsyncCallback<T> cb) { + private static <T extends JavaScriptObject> HttpCallback<T> wrap(AsyncCallback<T> cb) { return new HttpCallback<T>() { @Override public void onSuccess(HttpResponse<T> r) { |