cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: [CXF-6165] Rows can be null if no records have been found
Date Tue, 16 Jun 2015 15:36:46 GMT
Repository: cxf
Updated Branches:
  refs/heads/master beb4af748 -> 5015c0c1c


[CXF-6165] Rows can be null if no records have been found


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/5015c0c1
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/5015c0c1
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/5015c0c1

Branch: refs/heads/master
Commit: 5015c0c1ccb3bda0d83570c8b0e9889900d68221
Parents: beb4af7
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Tue Jun 16 16:36:25 2015 +0100
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Tue Jun 16 16:36:25 2015 +0100

----------------------------------------------------------------------
 .../main/java/demo/jaxrs/server/BigQueryService.java    | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/5015c0c1/distribution/src/main/release/samples/jax_rs/big_query/src/main/java/demo/jaxrs/server/BigQueryService.java
----------------------------------------------------------------------
diff --git a/distribution/src/main/release/samples/jax_rs/big_query/src/main/java/demo/jaxrs/server/BigQueryService.java
b/distribution/src/main/release/samples/jax_rs/big_query/src/main/java/demo/jaxrs/server/BigQueryService.java
index b39c370..1937c20 100644
--- a/distribution/src/main/release/samples/jax_rs/big_query/src/main/java/demo/jaxrs/server/BigQueryService.java
+++ b/distribution/src/main/release/samples/jax_rs/big_query/src/main/java/demo/jaxrs/server/BigQueryService.java
@@ -64,11 +64,13 @@ public class BigQueryService {
                                                                  searchWord);
         
         List<Map<String, Object>> rows = CastUtils.cast((List<?>)jsonMap.getProperty("rows"));
-        for (Map<String, Object> row : rows) {
-            List<Map<String, Object>> fields = CastUtils.cast((List<?>)row.get("f"));
-            ShakespeareText text = new ShakespeareText((String)fields.get(0).get("v"),
-                                                       (String)fields.get(1).get("v"));
-            bigQueryResponse.getTexts().add(text);
+        if (rows != null) {
+            for (Map<String, Object> row : rows) {
+                List<Map<String, Object>> fields = CastUtils.cast((List<?>)row.get("f"));
+                ShakespeareText text = new ShakespeareText((String)fields.get(0).get("v"),
+                                                           (String)fields.get(1).get("v"));
+                bigQueryResponse.getTexts().add(text);
+            }
         }
         return bigQueryResponse;
     }


Mime
View raw message