sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stefane...@apache.org
Subject svn commit: r1573597 - /sling/trunk/bundles/extensions/discovery/impl/src/main/java/org/apache/sling/discovery/impl/common/resource/EstablishedClusterView.java
Date Mon, 03 Mar 2014 16:27:51 GMT
Author: stefanegli
Date: Mon Mar  3 16:27:51 2014
New Revision: 1573597

URL: http://svn.apache.org/r1573597
Log:
SLING-3296 : more explicit exception message

Modified:
    sling/trunk/bundles/extensions/discovery/impl/src/main/java/org/apache/sling/discovery/impl/common/resource/EstablishedClusterView.java

Modified: sling/trunk/bundles/extensions/discovery/impl/src/main/java/org/apache/sling/discovery/impl/common/resource/EstablishedClusterView.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/discovery/impl/src/main/java/org/apache/sling/discovery/impl/common/resource/EstablishedClusterView.java?rev=1573597&r1=1573596&r2=1573597&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/discovery/impl/src/main/java/org/apache/sling/discovery/impl/common/resource/EstablishedClusterView.java
(original)
+++ sling/trunk/bundles/extensions/discovery/impl/src/main/java/org/apache/sling/discovery/impl/common/resource/EstablishedClusterView.java
Mon Mar  3 16:27:51 2014
@@ -53,7 +53,15 @@ public class EstablishedClusterView exte
         super(view.getViewId());
 
         String leaderId = view.getResource().adaptTo(ValueMap.class).get("leaderId", String.class);
-        final Iterator<Resource> it1 = view.getResource().getChild("members")
+        final Resource viewRes = view.getResource();
+        if (viewRes == null) {
+            throw new IllegalStateException("viewRes must not be null");
+        }
+        final Resource members = viewRes.getChild("members");
+        if (members == null) {
+            throw new IllegalStateException("members must not be null");
+        }
+        final Iterator<Resource> it1 = members
                 .getChildren().iterator();
         final List<Resource> instanceRess = new LinkedList<Resource>();
         while (it1.hasNext()) {



Mime
View raw message