[ARVADOS] updated: 7ca1a382f7c59e29a03c765a6542f95a31ecdd07

git at public.curoverse.com git at public.curoverse.com
Tue May 27 13:21:23 EDT 2014


Summary of changes:
 .../main/java/org/arvados/sdk/java/Arvados.java    | 111 +++++++++++++++------
 .../java/org/arvados/sdk/java/ArvadosTest.java     |  72 ++++++++++---
 2 files changed, 139 insertions(+), 44 deletions(-)

       via  7ca1a382f7c59e29a03c765a6542f95a31ecdd07 (commit)
       via  1113b89204db5201806d03ecedaa99f177a91a2d (commit)
       via  f60b9d7057fef32a7b61ea4de55b3d95b5b28f6c (commit)
       via  8e60aa5c834a1a2a741a87a8155b8db9b4c46da3 (commit)
       via  a84be631958ac0bb45b5e06efdb2782f02fdb2af (commit)
      from  037ec427df8bb32953f5158d0cd9d074ace776e8 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 7ca1a382f7c59e29a03c765a6542f95a31ecdd07
Author: radhika <radhika at curoverse.com>
Date:   Tue May 27 13:19:53 2014 -0400

    2525: add some javadoc comments

diff --git a/sdk/java/src/main/java/org/arvados/sdk/java/Arvados.java b/sdk/java/src/main/java/org/arvados/sdk/java/Arvados.java
index b9b7a8f..2c03639 100644
--- a/sdk/java/src/main/java/org/arvados/sdk/java/Arvados.java
+++ b/sdk/java/src/main/java/org/arvados/sdk/java/Arvados.java
@@ -337,6 +337,16 @@ public class Arvados {
     }
   }
 
+  /**
+   * Convert the input parameter into its equivalent json string.
+   * Add this json string value to the parameters map to be sent to server.
+   * @param argName
+   * @param parameters
+   * @param parameterName
+   * @param parameter
+   * @param parameterValue
+   * @throws Exception
+   */
   private void putParameter(String argName, Map<String, Object> parameters,
       String parameterName, JsonSchema parameter, Object parameterValue)
           throws Exception {
@@ -376,23 +386,28 @@ public class Arvados {
     parameters.put(parameterName, value);
   }
 
+  /**
+   * Convert the given input array into json string before sending to server.
+   * @param parameterValue
+   * @return
+   */
   private String getJsonValueFromArrayType (Object parameterValue) {
     String arrayStr = Arrays.deepToString((Object[])parameterValue);
 
     // we can expect either an array of array objects or an array of objects
-    if (arrayStr.startsWith("[[")) {
+    if (arrayStr.startsWith("[[") && arrayStr.endsWith("]]")) {
       Object[][] array = new Object[1][];
       arrayStr = arrayStr.substring(2, arrayStr.length()-2);
-      String jsonStr = getJsonStringForArray(arrayStr);
+      String jsonStr = getJsonStringForArrayStr(arrayStr);
       String value = "[" + jsonStr + "]";
       return value;
     } else {
       arrayStr = arrayStr.substring(1, arrayStr.length()-1);
-      return (getJsonStringForArray(arrayStr));
+      return (getJsonStringForArrayStr(arrayStr));
     }
   }
 
-  private String getJsonStringForArray(String arrayStr) {
+  private String getJsonStringForArrayStr(String arrayStr) {
     Object[] array = arrayStr.split(",");
     Object[] trimmedArray = new Object[array.length];
     for (int i=0; i<array.length; i++){
@@ -402,6 +417,11 @@ public class Arvados {
     return value;
   }
 
+  /**
+   * Convert the given input List into json string before sending to server.
+   * @param parameterValue
+   * @return
+   */
   private String getJsonValueFromListType (Object parameterValue) {
     List paramList = (List)parameterValue;
     Object[] array = new Object[paramList.size()];
@@ -409,6 +429,11 @@ public class Arvados {
     return (getJsonValueFromArrayType(array));
   }
 
+  /**
+   * Convert the given input map into json string before sending to server.
+   * @param parameterValue
+   * @return
+   */
   private String getJsonValueFromMapType (Object parameterValue) {
     JSONObject json = new JSONObject((Map)parameterValue);
     return json.toString();

commit 1113b89204db5201806d03ecedaa99f177a91a2d
Merge: f60b9d7 037ec42
Author: radhika <radhika at curoverse.com>
Date:   Tue May 27 11:30:44 2014 -0400

    Merge branch 'master' into 2525-java-sdk


-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list