directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r819185 - /directory/apacheds/branches/apacheds-schema/core-integ/src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java
Date Sat, 26 Sep 2009 18:10:16 GMT
Author: elecharny
Date: Sat Sep 26 18:10:16 2009
New Revision: 819185

URL: http://svn.apache.org/viewvc?rev=819185&view=rev
Log:
Fixed the isEnabled method

Modified:
    directory/apacheds/branches/apacheds-schema/core-integ/src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java

Modified: directory/apacheds/branches/apacheds-schema/core-integ/src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-integ/src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java?rev=819185&r1=819184&r2=819185&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-integ/src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core-integ/src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java
Sat Sep 26 18:10:16 2009
@@ -322,23 +322,18 @@
     {
         Schema schema = service.getRegistries().getLoadedSchema( schemaName );
         
-        if ( schema != null )
-        {
-            return schema.isDisabled();
-        }
-        else
-        {
-            // If the schema is not loaded, it's disabled
-            return false;
-        }
+        return ( schema == null ) || schema.isDisabled();
     }
     
     
     /**
-     * A helper method which tells if a schema is enabled
+     * A helper method which tells if a schema is enabled. A shema must be
+     * loaded and enabled.
      */
     public static boolean isEnabled( DirectoryService service, String schemaName )
     {
-    	return service.getRegistries().isSchemaLoaded( schemaName );
+        Schema schema = service.getRegistries().getLoadedSchema( schemaName );
+        
+        return ( schema != null ) && schema.isEnabled();
     }
 }



Mime
View raw message