cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kelv...@apache.org
Subject git commit: updated refs/heads/master-6-17-stable to 3ea5dea
Date Wed, 10 Jul 2013 01:46:04 GMT
Updated Branches:
  refs/heads/master-6-17-stable e1736bcca -> 3ea5dea41


CLOUDSTACK-3433: Relax the same package restriction for Command and its derived classes in
ArrayTypeAdaptor<T>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/3ea5dea4
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/3ea5dea4
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/3ea5dea4

Branch: refs/heads/master-6-17-stable
Commit: 3ea5dea41356a7cc83cd914d57484671179750bf
Parents: e1736bc
Author: Kelven Yang <kelveny@gmail.com>
Authored: Tue Jul 9 17:24:19 2013 -0700
Committer: Kelven Yang <kelveny@gmail.com>
Committed: Tue Jul 9 17:41:44 2013 -0700

----------------------------------------------------------------------
 core/src/com/cloud/agent/transport/ArrayTypeAdaptor.java | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3ea5dea4/core/src/com/cloud/agent/transport/ArrayTypeAdaptor.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/agent/transport/ArrayTypeAdaptor.java b/core/src/com/cloud/agent/transport/ArrayTypeAdaptor.java
index 8eddc03..ac9be93 100755
--- a/core/src/com/cloud/agent/transport/ArrayTypeAdaptor.java
+++ b/core/src/com/cloud/agent/transport/ArrayTypeAdaptor.java
@@ -22,7 +22,6 @@ import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.Map;
 
-import com.cloud.agent.api.Command;
 import com.cloud.utils.exception.CloudRuntimeException;
 import com.google.gson.Gson;
 import com.google.gson.JsonArray;
@@ -38,9 +37,6 @@ public class ArrayTypeAdaptor<T> implements JsonDeserializer<T[]>,
JsonSerialize
 
     protected Gson              _gson = null;
 
-
-    private static final String s_pkg = Command.class.getPackage().getName() + ".";
-
     public ArrayTypeAdaptor() {
     }
 
@@ -53,7 +49,7 @@ public class ArrayTypeAdaptor<T> implements JsonDeserializer<T[]>,
JsonSerialize
         JsonArray array = new JsonArray();
         for (T cmd : src) {
             JsonObject obj = new JsonObject();
-            obj.add(cmd.getClass().getName().substring(s_pkg.length()), _gson.toJsonTree(cmd));
+            obj.add(cmd.getClass().getName(), _gson.toJsonTree(cmd));
             array.add(obj);
         }
 
@@ -71,7 +67,7 @@ public class ArrayTypeAdaptor<T> implements JsonDeserializer<T[]>,
JsonSerialize
             JsonObject element = (JsonObject)it.next();
             Map.Entry<String, JsonElement> entry = element.entrySet().iterator().next();
 
-            String name = s_pkg + entry.getKey();
+            String name = entry.getKey();
             Class<?> clazz;
             try {
                 clazz = Class.forName(name);


Mime
View raw message