incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r1408176 - in /sling/trunk/contrib/extensions/tenant/src/main/java/org/apache/sling/tenant: TenantProvider.java internal/TenantProviderImpl.java
Date Mon, 12 Nov 2012 06:38:14 GMT
Author: fmeschbe
Date: Mon Nov 12 06:38:13 2012
New Revision: 1408176

URL: http://svn.apache.org/viewvc?rev=1408176&view=rev
Log:
SLING-2656 Throw IllegalArgumentException instead of InvalidSyntaxException from the getTenants(String)
method

Modified:
    sling/trunk/contrib/extensions/tenant/src/main/java/org/apache/sling/tenant/TenantProvider.java
    sling/trunk/contrib/extensions/tenant/src/main/java/org/apache/sling/tenant/internal/TenantProviderImpl.java

Modified: sling/trunk/contrib/extensions/tenant/src/main/java/org/apache/sling/tenant/TenantProvider.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/tenant/src/main/java/org/apache/sling/tenant/TenantProvider.java?rev=1408176&r1=1408175&r2=1408176&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/tenant/src/main/java/org/apache/sling/tenant/TenantProvider.java
(original)
+++ sling/trunk/contrib/extensions/tenant/src/main/java/org/apache/sling/tenant/TenantProvider.java
Mon Nov 12 06:38:13 2012
@@ -20,8 +20,6 @@ package org.apache.sling.tenant;
 
 import java.util.Iterator;
 
-import org.osgi.framework.InvalidSyntaxException;
-
 /**
  * The <code>TenantProvider</code> defines the service interface of for a sevice
  * which may be asked for {@link Tenant tenant instances}.
@@ -54,7 +52,8 @@ public interface TenantProvider {
      * <code>tenantFilter</code> is not a valid filter string the iterator is
      * empty.
      *
-     * @throws InvalidSyntaxException if filter syntax is invalid
+     * @throws IllegalArgumentException if filter syntax is invalid. A more
+     *      detailed exception may be wrapped by the exception.
      */
-    Iterator<Tenant> getTenants(String tenantFilter) throws InvalidSyntaxException;
+    Iterator<Tenant> getTenants(String tenantFilter);
 }

Modified: sling/trunk/contrib/extensions/tenant/src/main/java/org/apache/sling/tenant/internal/TenantProviderImpl.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/tenant/src/main/java/org/apache/sling/tenant/internal/TenantProviderImpl.java?rev=1408176&r1=1408175&r2=1408176&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/tenant/src/main/java/org/apache/sling/tenant/internal/TenantProviderImpl.java
(original)
+++ sling/trunk/contrib/extensions/tenant/src/main/java/org/apache/sling/tenant/internal/TenantProviderImpl.java
Mon Nov 12 06:38:13 2012
@@ -188,7 +188,7 @@ public class TenantProviderImpl implemen
         throw new PersistenceException("Cannot create the tenant");
     }
 
-    public Iterator<Tenant> getTenants(String tenantFilter) throws InvalidSyntaxException
{
+    public Iterator<Tenant> getTenants(String tenantFilter) {
         if (StringUtils.isBlank(tenantFilter)) {
             return null;
         }
@@ -211,6 +211,8 @@ public class TenantProviderImpl implemen
                     }
                 }
                 return tenantList.iterator();
+            } catch (InvalidSyntaxException e) {
+                throw new IllegalArgumentException(e.getMessage(), e);
             } finally {
                 adminResolver.close();
             }



Mime
View raw message