You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2017/10/20 14:44:55 UTC

[sling-org-apache-sling-testing-clients] 36/37: SLING-7116 [http.testing.clients] o.a.s.testing.clients.osgi.ComponentsInfo.findBy() does not honor the value parameter

This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-clients.git

commit 7ef662d711709c26faacf4fe5c1aa5dc10bd9e26
Author: Andrei Dulvac <du...@apache.org>
AuthorDate: Fri Sep 8 09:07:34 2017 +0000

    SLING-7116 [http.testing.clients] o.a.s.testing.clients.osgi.ComponentsInfo.findBy() does not honor the value parameter
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1807694 13f79535-47bb-0310-9956-ffa450edef68
---
 .../org/apache/sling/testing/clients/osgi/BundlesInfo.java     | 10 ++++------
 .../org/apache/sling/testing/clients/osgi/ComponentsInfo.java  |  6 +++---
 2 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/src/main/java/org/apache/sling/testing/clients/osgi/BundlesInfo.java b/src/main/java/org/apache/sling/testing/clients/osgi/BundlesInfo.java
index 7ada2da..b99fbf5 100644
--- a/src/main/java/org/apache/sling/testing/clients/osgi/BundlesInfo.java
+++ b/src/main/java/org/apache/sling/testing/clients/osgi/BundlesInfo.java
@@ -129,12 +129,10 @@ public class BundlesInfo {
         Iterator<JsonNode> nodes = root.get("data").getElements();
         while(nodes.hasNext()) {
             JsonNode node = nodes.next();
-            if(node.get(key) != null) {
-                if(node.get(key).isValueNode()) {
-                	String valueNode=node.get(key).getTextValue();
-                	if (valueNode.equals(value)){
-                		return node;
-                	}
+            if ((null != node.get(key)) && (node.get(key).isValueNode())) {
+                final String valueNode = node.get(key).getTextValue();
+                if (valueNode.equals(value)) {
+                    return node;
                 }
             }
         }
diff --git a/src/main/java/org/apache/sling/testing/clients/osgi/ComponentsInfo.java b/src/main/java/org/apache/sling/testing/clients/osgi/ComponentsInfo.java
index 174544e..49b7b14 100644
--- a/src/main/java/org/apache/sling/testing/clients/osgi/ComponentsInfo.java
+++ b/src/main/java/org/apache/sling/testing/clients/osgi/ComponentsInfo.java
@@ -83,13 +83,13 @@ public class ComponentsInfo {
         Iterator<JsonNode> nodes = root.get("data").getElements();
         while(nodes.hasNext()) {
             JsonNode node = nodes.next();
-            if(node.get(key) != null) {
-                if(node.get(key).isValueNode()) {
+            if ((null != node.get(key)) && (node.get(key).isValueNode())) {
+                final String valueNode = node.get(key).getTextValue();
+                if (valueNode.equals(value)) {
                     return node;
                 }
             }
         }
         return null;
     }
-
 }
\ No newline at end of file

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.