You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by bd...@apache.org on 2008/03/07 11:17:40 UTC

svn commit: r634601 - /incubator/sling/trunk/jcr/base/src/main/java/org/apache/sling/jcr/base/AbstractSlingRepository.java

Author: bdelacretaz
Date: Fri Mar  7 02:17:40 2008
New Revision: 634601

URL: http://svn.apache.org/viewvc?rev=634601&view=rev
Log:
SLING-256 code re-added, was lost in revision 633823

Modified:
    incubator/sling/trunk/jcr/base/src/main/java/org/apache/sling/jcr/base/AbstractSlingRepository.java

Modified: incubator/sling/trunk/jcr/base/src/main/java/org/apache/sling/jcr/base/AbstractSlingRepository.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/jcr/base/src/main/java/org/apache/sling/jcr/base/AbstractSlingRepository.java?rev=634601&r1=634600&r2=634601&view=diff
==============================================================================
--- incubator/sling/trunk/jcr/base/src/main/java/org/apache/sling/jcr/base/AbstractSlingRepository.java (original)
+++ incubator/sling/trunk/jcr/base/src/main/java/org/apache/sling/jcr/base/AbstractSlingRepository.java Fri Mar  7 02:17:40 2008
@@ -169,9 +169,13 @@
     /**
      * Returns the default workspace, which may be <code>null</code> meaning
      * to use the repository provided default workspace.
+     * Declared final to make sure the SLING-256 rule is enforced.
      */
     public final String getDefaultWorkspace() {
-        // Declared final to make sure the SLING-256 rule is enforced.
+        if(defaultWorkspace == null || defaultWorkspace.trim().length() == 0) {
+            // SLING-256
+            return null;
+        }
         return this.defaultWorkspace;
     }
 



Re: svn commit: r634601 - /incubator/sling/trunk/jcr/base/src/main/java/org/apache/sling/jcr/base/AbstractSlingRepository.java

Posted by Bertrand Delacretaz <bd...@apache.org>.
On Fri, Mar 7, 2008 at 1:11 PM, Felix Meschberger
<Fe...@day.com> wrote:
> Hi Betrand,
>
>  This code was not lost but removed by me ;-)
>
>  Point is, that the activate method makes sure, that either the property
>  has a non-empty value (e.g. default) or is null. An empty string should
>  not be set in the activator. Everything else is considered a bug ;-)

Ok, if that's taken care of somewhere else I'm fine - I thought my way
was foolproof.

-Bertrand

Re: svn commit: r634601 - /incubator/sling/trunk/jcr/base/src/main/java/org/apache/sling/jcr/base/AbstractSlingRepository.java

Posted by Felix Meschberger <Fe...@day.com>.
Hi Betrand,

This code was not lost but removed by me ;-)

Point is, that the activate method makes sure, that either the property
has a non-empty value (e.g. default) or is null. An empty string should
not be set in the activator. Everything else is considered a bug ;-)

Regards
Felix

Am Freitag, den 07.03.2008, 10:17 +0000 schrieb bdelacretaz@apache.org:
> Author: bdelacretaz
> Date: Fri Mar  7 02:17:40 2008
> New Revision: 634601
> 
> URL: http://svn.apache.org/viewvc?rev=634601&view=rev
> Log:
> SLING-256 code re-added, was lost in revision 633823
> 
> Modified:
>     incubator/sling/trunk/jcr/base/src/main/java/org/apache/sling/jcr/base/AbstractSlingRepository.java
> 
> Modified: incubator/sling/trunk/jcr/base/src/main/java/org/apache/sling/jcr/base/AbstractSlingRepository.java
> URL: http://svn.apache.org/viewvc/incubator/sling/trunk/jcr/base/src/main/java/org/apache/sling/jcr/base/AbstractSlingRepository.java?rev=634601&r1=634600&r2=634601&view=diff
> ==============================================================================
> --- incubator/sling/trunk/jcr/base/src/main/java/org/apache/sling/jcr/base/AbstractSlingRepository.java (original)
> +++ incubator/sling/trunk/jcr/base/src/main/java/org/apache/sling/jcr/base/AbstractSlingRepository.java Fri Mar  7 02:17:40 2008
> @@ -169,9 +169,13 @@
>      /**
>       * Returns the default workspace, which may be <code>null</code> meaning
>       * to use the repository provided default workspace.
> +     * Declared final to make sure the SLING-256 rule is enforced.
>       */
>      public final String getDefaultWorkspace() {
> -        // Declared final to make sure the SLING-256 rule is enforced.
> +        if(defaultWorkspace == null || defaultWorkspace.trim().length() == 0) {
> +            // SLING-256
> +            return null;
> +        }
>          return this.defaultWorkspace;
>      }
>  
> 
>