You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by ni...@apache.org on 2014/10/11 06:13:26 UTC

[40/50] [abbrv] git commit: Make getProperty method to use entry set instead of key set.

Make getProperty method to use entry set instead of key set.


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/9b7ec1f0
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/9b7ec1f0
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/9b7ec1f0

Branch: refs/heads/master
Commit: 9b7ec1f08ca33c80ca9cd829881886d2c3c72833
Parents: edc243e
Author: Nirmal Fernando <ni...@gmail.com>
Authored: Sat Oct 11 09:12:39 2014 +0530
Committer: Nirmal Fernando <ni...@gmail.com>
Committed: Sat Oct 11 09:30:58 2014 +0530

----------------------------------------------------------------------
 .../cloud/controller/util/CloudControllerUtil.java    | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/9b7ec1f0/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/util/CloudControllerUtil.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/util/CloudControllerUtil.java b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/util/CloudControllerUtil.java
index 6374cc9..fe2493d 100644
--- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/util/CloudControllerUtil.java
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/util/CloudControllerUtil.java
@@ -293,12 +293,14 @@ public class CloudControllerUtil {
 	
 	public static String getProperty(Properties properties, String key) {
     	if (key != null && properties != null) {
-    		for (Iterator<Object> iterator = properties.keySet().iterator(); iterator.hasNext();) {
-				String prop = (String) iterator.next();
-				if (key.equals(prop)) {
-					return properties.getProperty(prop);
-				}
-			}
+    	    for (Iterator<Entry<Object, Object>> iterator = properties.entrySet().iterator(); iterator.hasNext();) {
+                Entry<Object, Object> type = (Entry<Object, Object>) iterator.next();
+                String propName = type.getKey().toString();
+                String propValue = type.getValue().toString();
+                if (key.equals(propName)) {
+                    return propValue;
+                }
+            }
     	}
     	
     	return null;