This is an automated email from the ASF dual-hosted git repository. rombert pushed a commit to annotated tag org.apache.sling.discovery.commons-1.0.10 in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-commons.git
commit 8cb48674e6e0e8589b93807ecf5785dd131098e5 Author: Stefan Egli <[email protected]> AuthorDate: Wed Jan 27 15:16:57 2016 +0000 SLING-5458 : id can now be null - return null in getViewId in that case git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/commons@1727084 13f79535-47bb-0310-9956-ffa450edef68 --- .../commons/providers/spi/base/DiscoveryLiteDescriptor.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/apache/sling/discovery/commons/providers/spi/base/DiscoveryLiteDescriptor.java b/src/main/java/org/apache/sling/discovery/commons/providers/spi/base/DiscoveryLiteDescriptor.java index 906ab27..9ec862d 100644 --- a/src/main/java/org/apache/sling/discovery/commons/providers/spi/base/DiscoveryLiteDescriptor.java +++ b/src/main/java/org/apache/sling/discovery/commons/providers/spi/base/DiscoveryLiteDescriptor.java @@ -110,9 +110,14 @@ public class DiscoveryLiteDescriptor { * @throws Exception if anything in the descriptor is wrongly formatted */ public String getViewId() throws Exception { + if (descriptor.isNull("id")) { + // SLING-5458 : id can now be null, + // so treat this separately and return null here too + return null; + } Object idObj = descriptor.get("id"); if (idObj == null || !(idObj instanceof String)) { - throw new Exception("getMe: 'me' value of descriptor not a String: "+idObj+" (descriptor: "+descriptor+")"); + throw new Exception("getViewId: 'id' value of descriptor not a String: "+idObj+" (descriptor: "+descriptor+")"); } return String.valueOf(idObj); } -- To stop receiving notification emails like this one, please contact "[email protected]" <[email protected]>.
