ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ivasilin...@apache.org
Subject [2/2] incubator-ignite git commit: #ignite-964: remove unused if.
Date Sun, 05 Jul 2015 18:46:10 GMT
#ignite-964: remove unused if.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/832bf779
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/832bf779
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/832bf779

Branch: refs/heads/ignite-964-1
Commit: 832bf7797204282f338b6f7c888941c0c222e11a
Parents: eb9c34f
Author: ivasilinets <ivasilinets@gridgain.com>
Authored: Sun Jul 5 21:46:00 2015 +0300
Committer: ivasilinets <ivasilinets@gridgain.com>
Committed: Sun Jul 5 21:46:00 2015 +0300

----------------------------------------------------------------------
 .../rest/protocols/http/jetty/GridJettyRestHandler.java | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/832bf779/modules/rest-http/src/main/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/GridJettyRestHandler.java
----------------------------------------------------------------------
diff --git a/modules/rest-http/src/main/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/GridJettyRestHandler.java
b/modules/rest-http/src/main/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/GridJettyRestHandler.java
index 01fb450..aecb79f 100644
--- a/modules/rest-http/src/main/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/GridJettyRestHandler.java
+++ b/modules/rest-http/src/main/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/GridJettyRestHandler.java
@@ -292,7 +292,7 @@ public class GridJettyRestHandler extends AbstractHandler {
         JSON json;
 
         try {
-            createResponse(cmd, cmdRes);
+            createResponse(req, cmd, cmdRes);
 
             json = JSONSerializer.toJSON(cmdRes, cfg);
         }
@@ -317,11 +317,13 @@ public class GridJettyRestHandler extends AbstractHandler {
     }
 
     /**
+     * @param req Request.
      * @param cmd Rest command.
      * @param cmdRes Rest response.
      */
-    private void createResponse(GridRestCommand cmd, GridRestResponse cmdRes) {
-        if (cmdRes.getResponse() == null)
+    private void createResponse(HttpServletRequest req, GridRestCommand cmd,
+        GridRestResponse cmdRes) {
+        if (cmdRes.getResponse() == null || req.getHeader("JSONObject") == null)
             return;
 
         if (cmd == CACHE_GET_ALL) {
@@ -335,9 +337,7 @@ public class GridJettyRestHandler extends AbstractHandler {
             cmdRes.setResponse(res);
 
         }
-        else if (cmd == CACHE_GET || cmd == CACHE_GET_AND_PUT ||
-                cmd == CACHE_GET_AND_PUT_IF_ABSENT || cmd == CACHE_GET_AND_REMOVE ||
-                cmd == CACHE_GET_AND_REPLACE) {
+        else {
             Object o = cmdRes.getResponse();
 
             if (o instanceof JSONCacheObject)


Mime
View raw message