sling-commits mailing list archives

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

URL: http://svn.apache.org/r1573739
Log:
SLING-3296 : more explicit exception messages, part 2

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=1573739&r1=1573738&r2=1573739&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 20:41:51 2014
@@ -52,11 +52,15 @@ public class EstablishedClusterView exte
             final String localId) {
         super(view.getViewId());
 
-        String leaderId = view.getResource().adaptTo(ValueMap.class).get("leaderId", String.class);
         final Resource viewRes = view.getResource();
         if (viewRes == null) {
             throw new IllegalStateException("viewRes must not be null");
         }
+        final ValueMap valueMap = viewRes.adaptTo(ValueMap.class);
+        if (valueMap == null) {
+            throw new IllegalStateException("valueMap must not be null");
+        }
+        String leaderId = valueMap.get("leaderId", String.class);
         final Resource members = viewRes.getChild("members");
         if (members == null) {
             throw new IllegalStateException("members must not be null");



Mime
View raw message