cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ko...@apache.org
Subject [1/2] git commit: updated refs/heads/master to 5f497b9
Date Sat, 12 Oct 2013 18:38:20 GMT
Updated Branches:
  refs/heads/master b344bb4cf -> 5f497b9a7


Removed unused methods from ApiResponseSerializer

getGetMethod and getGetMethodName were not used

Signed-off-by: Laszlo Hornyak <laszlo.hornyak@gmail.com>


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

Branch: refs/heads/master
Commit: 5f497b9a75d7185b34a29e06706bd7719aa2c61b
Parents: 6df77ec
Author: Laszlo Hornyak <laszlo.hornyak@gmail.com>
Authored: Sat Oct 12 18:01:27 2013 +0200
Committer: Laszlo Hornyak <laszlo.hornyak@gmail.com>
Committed: Sat Oct 12 19:42:50 2013 +0200

----------------------------------------------------------------------
 .../api/response/ApiResponseSerializer.java     | 44 +-------------------
 1 file changed, 1 insertion(+), 43 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5f497b9a/server/src/com/cloud/api/response/ApiResponseSerializer.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/response/ApiResponseSerializer.java b/server/src/com/cloud/api/response/ApiResponseSerializer.java
index d2e5130..fb32e7d 100644
--- a/server/src/com/cloud/api/response/ApiResponseSerializer.java
+++ b/server/src/com/cloud/api/response/ApiResponseSerializer.java
@@ -32,7 +32,6 @@ import org.apache.cloudstack.api.response.*;
 import org.apache.log4j.Logger;
 
 import java.lang.reflect.Field;
-import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
 import java.util.*;
 import java.util.regex.Matcher;
@@ -208,7 +207,7 @@ public class ApiResponseSerializer {
                         sb.append("</jobresult>");
                     }
                 } else if (fieldValue instanceof Collection<?>) {
-                    Collection<?> subResponseList = (Collection<Object>) fieldValue;
+                    Collection<?> subResponseList = (Collection<?>) fieldValue;
                     boolean usedUuidList = false;
                     for (Object value : subResponseList) {
                         if (value instanceof ResponseObject) {
@@ -254,47 +253,6 @@ public class ApiResponseSerializer {
         }
     }
 
-    private static Method getGetMethod(Object o, String propName) {
-        Method method = null;
-        String methodName = getGetMethodName("get", propName);
-        try {
-            method = o.getClass().getMethod(methodName);
-        } catch (SecurityException e1) {
-            s_logger.error("Security exception in getting ResponseObject " + o.getClass().getName()
+ " get method for property: " + propName);
-        } catch (NoSuchMethodException e1) {
-            if (s_logger.isTraceEnabled()) {
-                s_logger.trace("ResponseObject " + o.getClass().getName() + " does not have
" + methodName + "() method for property: " + propName
-                        + ", will check is-prefixed method to see if it is boolean property");
-            }
-        }
-
-        if (method != null)
-            return method;
-
-        methodName = getGetMethodName("is", propName);
-        try {
-            method = o.getClass().getMethod(methodName);
-        } catch (SecurityException e1) {
-            s_logger.error("Security exception in getting ResponseObject " + o.getClass().getName()
+ " get method for property: " + propName);
-        } catch (NoSuchMethodException e1) {
-            s_logger.warn("ResponseObject " + o.getClass().getName() + " does not have "
+ methodName + "() method for property: " + propName);
-        }
-        return method;
-    }
-
-    private static String getGetMethodName(String prefix, String fieldName) {
-        StringBuffer sb = new StringBuffer(prefix);
-
-        if (fieldName.length() >= prefix.length() && fieldName.substring(0, prefix.length()).equals(prefix))
{
-            return fieldName;
-        } else {
-            sb.append(fieldName.substring(0, 1).toUpperCase());
-            sb.append(fieldName.substring(1));
-        }
-
-        return sb.toString();
-    }
-
     private static String escapeSpecialXmlChars(String originalString) {
         char[] origChars = originalString.toCharArray();
         StringBuilder resultString = new StringBuilder();


Mime
View raw message