directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r948711 [7/7] - in /directory: apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/entry/ apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/ apacheds/trunk/core-integ/src/test/java/org/apache/...
Date Thu, 27 May 2010 08:08:45 GMT
Modified: directory/shared/trunk/ldap-schema-loader/src/main/java/org/apache/directory/shared/ldap/schema/loader/ldif/JarLdifSchemaLoader.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-schema-loader/src/main/java/org/apache/directory/shared/ldap/schema/loader/ldif/JarLdifSchemaLoader.java?rev=948711&r1=948710&r2=948711&view=diff
==============================================================================
--- directory/shared/trunk/ldap-schema-loader/src/main/java/org/apache/directory/shared/ldap/schema/loader/ldif/JarLdifSchemaLoader.java (original)
+++ directory/shared/trunk/ldap-schema-loader/src/main/java/org/apache/directory/shared/ldap/schema/loader/ldif/JarLdifSchemaLoader.java Thu May 27 08:08:44 2010
@@ -33,8 +33,8 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.ldif.LdifEntry;
 import org.apache.directory.shared.ldap.ldif.LdifReader;
-import org.apache.directory.shared.ldap.schema.ldif.extractor.impl.ResourceMap;
 import org.apache.directory.shared.ldap.schema.ldif.extractor.impl.DefaultSchemaLdifExtractor;
+import org.apache.directory.shared.ldap.schema.ldif.extractor.impl.ResourceMap;
 import org.apache.directory.shared.ldap.schema.registries.AbstractSchemaLoader;
 import org.apache.directory.shared.ldap.schema.registries.Schema;
 import org.slf4j.Logger;
@@ -54,7 +54,7 @@ public class JarLdifSchemaLoader extends
 {
     /** ldif file extension used */
     private static final String LDIF_EXT = "ldif";
-    
+
     /** static class logger */
     private static final Logger LOG = LoggerFactory.getLogger( JarLdifSchemaLoader.class );
 
@@ -62,9 +62,10 @@ public class JarLdifSchemaLoader extends
     private static final boolean IS_DEBUG = LOG.isDebugEnabled();
 
     /** a map of all the resources in this jar */
-    private static final Map<String,Boolean> RESOURCE_MAP = ResourceMap.getResources( Pattern.compile( ".*schema/ou=schema.*" ) );
+    private static final Map<String, Boolean> RESOURCE_MAP = ResourceMap.getResources( Pattern
+        .compile( ".*schema/ou=schema.*" ) );
+
 
-    
     /**
      * Creates a new LDIF based SchemaLoader. The constructor checks to make
      * sure the supplied base directory exists and contains a schema.ldif file
@@ -78,7 +79,7 @@ public class JarLdifSchemaLoader extends
         initializeSchemas();
     }
 
-    
+
     private final URL getResource( String resource, String msg ) throws Exception
     {
         if ( RESOURCE_MAP.get( resource ) )
@@ -90,7 +91,7 @@ public class JarLdifSchemaLoader extends
             return new File( resource ).toURI().toURL();
         }
     }
-    
+
 
     /**
      * Scans for LDIF files just describing the various schema contained in
@@ -104,16 +105,16 @@ public class JarLdifSchemaLoader extends
         {
             LOG.debug( "Initializing schema" );
         }
-        
+
         for ( String file : RESOURCE_MAP.keySet() )
         {
             Pattern pat = Pattern.compile( ".*schema/ou=schema/cn=[a-z0-9-_]*\\." + LDIF_EXT );
-            
+
             if ( pat.matcher( file ).matches() )
             {
                 URL resource = getResource( file, "schema LDIF file" );
                 InputStream in = resource.openStream();
-                
+
                 try
                 {
                     LdifReader reader = new LdifReader( in );
@@ -121,7 +122,7 @@ public class JarLdifSchemaLoader extends
                     reader.close();
                     Schema schema = getSchema( entry.getEntry() );
                     schemaMap.put( schema.getSchemaName(), schema );
-                    
+
                     if ( IS_DEBUG )
                     {
                         LOG.debug( "Schema Initialized ... \n{}", schema );
@@ -151,193 +152,188 @@ public class JarLdifSchemaLoader extends
     {
         return "schema/ou=schema/cn=" + schema.getSchemaName();
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */
     public List<Entry> loadComparators( Schema... schemas ) throws Exception
     {
         List<Entry> comparatorList = new ArrayList<Entry>();
-        
+
         if ( schemas == null )
         {
             return comparatorList;
         }
-        
+
         for ( Schema schema : schemas )
         {
-            String comparatorsDirectory = getSchemaDirectory( schema ) 
-                + "/" + SchemaConstants.COMPARATORS_PATH;
-            
+            String comparatorsDirectory = getSchemaDirectory( schema ) + "/" + SchemaConstants.COMPARATORS_PATH;
+
             for ( String resourcePath : RESOURCE_MAP.keySet() )
             {
                 Pattern regex = Pattern.compile( ".*" + comparatorsDirectory + "/m-oid=.*\\." + LDIF_EXT );
-                
+
                 if ( regex.matcher( resourcePath ).matches() )
                 {
                     URL resource = getResource( resourcePath, "comparator LDIF file" );
                     LdifReader reader = new LdifReader( resource.openStream() );
                     LdifEntry entry = reader.next();
                     reader.close();
-    
+
                     comparatorList.add( entry.getEntry() );
                 }
             }
         }
-        
+
         return comparatorList;
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */
     public List<Entry> loadSyntaxCheckers( Schema... schemas ) throws Exception
     {
         List<Entry> syntaxCheckerList = new ArrayList<Entry>();
-        
+
         if ( schemas == null )
         {
             return syntaxCheckerList;
         }
-        
+
         for ( Schema schema : schemas )
         {
-            String syntaxCheckersDirectory = getSchemaDirectory( schema ) 
-                +  "/" + SchemaConstants.SYNTAX_CHECKERS_PATH;
-    
+            String syntaxCheckersDirectory = getSchemaDirectory( schema ) + "/" + SchemaConstants.SYNTAX_CHECKERS_PATH;
+
             for ( String resourcePath : RESOURCE_MAP.keySet() )
             {
                 Pattern regex = Pattern.compile( ".*" + syntaxCheckersDirectory + "/m-oid=.*\\." + LDIF_EXT );
-                
+
                 if ( regex.matcher( resourcePath ).matches() )
                 {
                     URL resource = getResource( resourcePath, "syntaxChecker LDIF file" );
                     LdifReader reader = new LdifReader( resource.openStream() );
                     LdifEntry entry = reader.next();
                     reader.close();
-                    
+
                     syntaxCheckerList.add( entry.getEntry() );
                 }
             }
         }
-        
+
         return syntaxCheckerList;
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */
     public List<Entry> loadNormalizers( Schema... schemas ) throws Exception
     {
         List<Entry> normalizerList = new ArrayList<Entry>();
-        
+
         if ( schemas == null )
         {
             return normalizerList;
         }
-        
+
         for ( Schema schema : schemas )
         {
-            String normalizersDirectory = getSchemaDirectory( schema )
-                + "/" + SchemaConstants.NORMALIZERS_PATH;
-    
+            String normalizersDirectory = getSchemaDirectory( schema ) + "/" + SchemaConstants.NORMALIZERS_PATH;
+
             for ( String resourcePath : RESOURCE_MAP.keySet() )
             {
                 Pattern regex = Pattern.compile( ".*" + normalizersDirectory + "/m-oid=.*\\." + LDIF_EXT );
-                
+
                 if ( regex.matcher( resourcePath ).matches() )
                 {
                     URL resource = getResource( resourcePath, "normalizer LDIF file" );
                     LdifReader reader = new LdifReader( resource.openStream() );
                     LdifEntry entry = reader.next();
                     reader.close();
-                    
+
                     normalizerList.add( entry.getEntry() );
                 }
             }
         }
-        
+
         return normalizerList;
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */
     public List<Entry> loadMatchingRules( Schema... schemas ) throws Exception
     {
         List<Entry> matchingRuleList = new ArrayList<Entry>();
-        
+
         if ( schemas == null )
         {
             return matchingRuleList;
         }
-        
+
         for ( Schema schema : schemas )
         {
-            String matchingRulesDirectory = getSchemaDirectory( schema )
-                + "/" + SchemaConstants.MATCHING_RULES_PATH;
-            
+            String matchingRulesDirectory = getSchemaDirectory( schema ) + "/" + SchemaConstants.MATCHING_RULES_PATH;
+
             for ( String resourcePath : RESOURCE_MAP.keySet() )
             {
                 Pattern regex = Pattern.compile( ".*" + matchingRulesDirectory + "/m-oid=.*\\." + LDIF_EXT );
-                
+
                 if ( regex.matcher( resourcePath ).matches() )
                 {
                     URL resource = getResource( resourcePath, "matchingRules LDIF file" );
                     LdifReader reader = new LdifReader( resource.openStream() );
                     LdifEntry entry = reader.next();
                     reader.close();
-    
+
                     matchingRuleList.add( entry.getEntry() );
                 }
             }
         }
-        
+
         return matchingRuleList;
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */
     public List<Entry> loadSyntaxes( Schema... schemas ) throws Exception
     {
         List<Entry> syntaxList = new ArrayList<Entry>();
-        
+
         if ( schemas == null )
         {
             return syntaxList;
         }
-        
+
         for ( Schema schema : schemas )
         {
-            String syntaxesDirectory = getSchemaDirectory( schema )
-                + "/" + SchemaConstants.SYNTAXES_PATH;
-    
+            String syntaxesDirectory = getSchemaDirectory( schema ) + "/" + SchemaConstants.SYNTAXES_PATH;
+
             for ( String resourcePath : RESOURCE_MAP.keySet() )
             {
                 Pattern regex = Pattern.compile( ".*" + syntaxesDirectory + "/m-oid=.*\\." + LDIF_EXT );
-                
+
                 if ( regex.matcher( resourcePath ).matches() )
                 {
                     URL resource = getResource( resourcePath, "syntax LDIF file" );
                     LdifReader reader = new LdifReader( resource.openStream() );
                     LdifEntry entry = reader.next();
                     reader.close();
-                    
+
                     syntaxList.add( entry.getEntry() );
                 }
             }
         }
-        
+
         return syntaxList;
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
@@ -349,30 +345,29 @@ public class JarLdifSchemaLoader extends
         {
             return attributeTypeList;
         }
-        
+
         for ( Schema schema : schemas )
         {
-        	// check that the attributeTypes directory exists for the schema
-            String attributeTypesDirectory = getSchemaDirectory( schema )
-                + "/" + SchemaConstants.ATTRIBUTES_TYPE_PATH;
-            
+            // check that the attributeTypes directory exists for the schema
+            String attributeTypesDirectory = getSchemaDirectory( schema ) + "/" + SchemaConstants.ATTRIBUTES_TYPE_PATH;
+
             // get list of attributeType LDIF schema files in attributeTypes
             for ( String resourcePath : RESOURCE_MAP.keySet() )
             {
                 Pattern regex = Pattern.compile( ".*" + attributeTypesDirectory + "/m-oid=.*\\." + LDIF_EXT );
-                
+
                 if ( regex.matcher( resourcePath ).matches() )
                 {
                     URL resource = getResource( resourcePath, "attributeType LDIF file" );
                     LdifReader reader = new LdifReader( resource.openStream() );
                     LdifEntry entry = reader.next();
                     reader.close();
-    
+
                     attributeTypeList.add( entry.getEntry() );
                 }
             }
         }
-        
+
         return attributeTypeList;
     }
 
@@ -383,33 +378,33 @@ public class JarLdifSchemaLoader extends
     public List<Entry> loadMatchingRuleUses( Schema... schemas ) throws Exception
     {
         List<Entry> matchingRuleUseList = new ArrayList<Entry>();
-        
+
         if ( schemas == null )
         {
             return matchingRuleUseList;
         }
-        
+
         for ( Schema schema : schemas )
         {
-            String matchingRuleUsesDirectory = getSchemaDirectory( schema )
-                + "/" + SchemaConstants.MATCHING_RULE_USE_PATH;
-            
+            String matchingRuleUsesDirectory = getSchemaDirectory( schema ) + "/"
+                + SchemaConstants.MATCHING_RULE_USE_PATH;
+
             for ( String resourcePath : RESOURCE_MAP.keySet() )
             {
                 Pattern regex = Pattern.compile( ".*" + matchingRuleUsesDirectory + "/m-oid=.*\\." + LDIF_EXT );
-                
+
                 if ( regex.matcher( resourcePath ).matches() )
                 {
                     URL resource = getResource( resourcePath, "matchingRuleUse LDIF file" );
                     LdifReader reader = new LdifReader( resource.openStream() );
                     LdifEntry entry = reader.next();
                     reader.close();
-    
+
                     matchingRuleUseList.add( entry.getEntry() );
                 }
             }
         }
-        
+
         return matchingRuleUseList;
     }
 
@@ -420,32 +415,32 @@ public class JarLdifSchemaLoader extends
     public List<Entry> loadNameForms( Schema... schemas ) throws Exception
     {
         List<Entry> nameFormList = new ArrayList<Entry>();
-        
+
         if ( schemas == null )
         {
             return nameFormList;
         }
-        
+
         for ( Schema schema : schemas )
         {
             String nameFormsDirectory = getSchemaDirectory( schema ) + "/" + SchemaConstants.NAME_FORMS_PATH;
-    
+
             for ( String resourcePath : RESOURCE_MAP.keySet() )
             {
                 Pattern regex = Pattern.compile( ".*" + nameFormsDirectory + "/m-oid=.*\\." + LDIF_EXT );
-                
+
                 if ( regex.matcher( resourcePath ).matches() )
                 {
                     URL resource = getResource( resourcePath, "nameForm LDIF file" );
                     LdifReader reader = new LdifReader( resource.openStream() );
                     LdifEntry entry = reader.next();
                     reader.close();
-    
+
                     nameFormList.add( entry.getEntry() );
                 }
             }
         }
-        
+
         return nameFormList;
     }
 
@@ -456,33 +451,33 @@ public class JarLdifSchemaLoader extends
     public List<Entry> loadDitContentRules( Schema... schemas ) throws Exception
     {
         List<Entry> ditContentRulesList = new ArrayList<Entry>();
-        
+
         if ( schemas == null )
         {
             return ditContentRulesList;
         }
-        
+
         for ( Schema schema : schemas )
         {
-            String ditContentRulesDirectory = getSchemaDirectory( schema ) + "/" + 
-                SchemaConstants.DIT_CONTENT_RULES_PATH;
-    
+            String ditContentRulesDirectory = getSchemaDirectory( schema ) + "/"
+                + SchemaConstants.DIT_CONTENT_RULES_PATH;
+
             for ( String resourcePath : RESOURCE_MAP.keySet() )
             {
                 Pattern regex = Pattern.compile( ".*" + ditContentRulesDirectory + "/m-oid=.*\\." + LDIF_EXT );
-                
+
                 if ( regex.matcher( resourcePath ).matches() )
                 {
                     URL resource = getResource( resourcePath, "ditContentRule LDIF file" );
                     LdifReader reader = new LdifReader( resource.openStream() );
                     LdifEntry entry = reader.next();
                     reader.close();
-                    
+
                     ditContentRulesList.add( entry.getEntry() );
                 }
             }
         }
-        
+
         return ditContentRulesList;
     }
 
@@ -493,33 +488,33 @@ public class JarLdifSchemaLoader extends
     public List<Entry> loadDitStructureRules( Schema... schemas ) throws Exception
     {
         List<Entry> ditStructureRuleList = new ArrayList<Entry>();
-        
+
         if ( schemas == null )
         {
             return ditStructureRuleList;
         }
-        
+
         for ( Schema schema : schemas )
         {
-            String ditStructureRulesDirectory = getSchemaDirectory( schema )
-                + "/" + SchemaConstants.DIT_STRUCTURE_RULES_PATH;
-    
+            String ditStructureRulesDirectory = getSchemaDirectory( schema ) + "/"
+                + SchemaConstants.DIT_STRUCTURE_RULES_PATH;
+
             for ( String resourcePath : RESOURCE_MAP.keySet() )
             {
                 Pattern regex = Pattern.compile( ".*" + ditStructureRulesDirectory + "/m-oid=.*\\." + LDIF_EXT );
-                
+
                 if ( regex.matcher( resourcePath ).matches() )
                 {
                     URL resource = getResource( resourcePath, "ditStructureRule LDIF file" );
                     LdifReader reader = new LdifReader( resource.openStream() );
                     LdifEntry entry = reader.next();
                     reader.close();
-                    
+
                     ditStructureRuleList.add( entry.getEntry() );
                 }
             }
         }
-        
+
         return ditStructureRuleList;
     }
 
@@ -530,33 +525,33 @@ public class JarLdifSchemaLoader extends
     public List<Entry> loadObjectClasses( Schema... schemas ) throws Exception
     {
         List<Entry> objectClassList = new ArrayList<Entry>();
-        
+
         if ( schemas == null )
         {
             return objectClassList;
         }
-        
+
         for ( Schema schema : schemas )
         {
-        	// get objectClasses directory, check if exists, return if not
-        	String objectClassesDirectory = getSchemaDirectory( schema ) + "/" + SchemaConstants.OBJECT_CLASSES_PATH;
-    
+            // get objectClasses directory, check if exists, return if not
+            String objectClassesDirectory = getSchemaDirectory( schema ) + "/" + SchemaConstants.OBJECT_CLASSES_PATH;
+
             for ( String resourcePath : RESOURCE_MAP.keySet() )
             {
                 Pattern regex = Pattern.compile( ".*" + objectClassesDirectory + "/m-oid=.*\\." + LDIF_EXT );
-                
+
                 if ( regex.matcher( resourcePath ).matches() )
                 {
                     URL resource = getResource( resourcePath, "objectClass LDIF file" );
                     LdifReader reader = new LdifReader( resource.openStream() );
                     LdifEntry entry = reader.next();
                     reader.close();
-    
+
                     objectClassList.add( entry.getEntry() );
                 }
             }
         }
-        
+
         return objectClassList;
     }
 }

Modified: directory/shared/trunk/ldap-schema-loader/src/main/java/org/apache/directory/shared/ldap/schema/loader/ldif/LdifSchemaLoader.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-schema-loader/src/main/java/org/apache/directory/shared/ldap/schema/loader/ldif/LdifSchemaLoader.java?rev=948711&r1=948710&r2=948711&view=diff
==============================================================================
--- directory/shared/trunk/ldap-schema-loader/src/main/java/org/apache/directory/shared/ldap/schema/loader/ldif/LdifSchemaLoader.java (original)
+++ directory/shared/trunk/ldap-schema-loader/src/main/java/org/apache/directory/shared/ldap/schema/loader/ldif/LdifSchemaLoader.java Thu May 27 08:08:44 2010
@@ -209,7 +209,7 @@ public class LdifSchemaLoader extends Ab
         if ( registries.isSchemaLoaded( schema.getSchemaName() ) )
         {
             LOG.info( "Will not attempt to load already loaded '{}' " +
-            		"schema: \n{}", schema.getSchemaName(), schema );
+                    "schema: \n{}", schema.getSchemaName(), schema );
             return;
         }
         

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageGrammar.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageGrammar.java?rev=948711&r1=948710&r2=948711&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageGrammar.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageGrammar.java Thu May 27 08:08:44 2010
@@ -20,8 +20,6 @@
 package org.apache.directory.shared.ldap.codec;
 
 
-import org.apache.directory.shared.ldap.exception.LdapException;
-
 import org.apache.directory.shared.asn1.ber.IAsn1Container;
 import org.apache.directory.shared.asn1.ber.grammar.AbstractGrammar;
 import org.apache.directory.shared.asn1.ber.grammar.GrammarAction;
@@ -98,6 +96,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.codec.search.SearchResultReferenceCodec;
 import org.apache.directory.shared.ldap.codec.search.SubstringFilter;
 import org.apache.directory.shared.ldap.codec.unbind.UnBindRequestCodec;
+import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
 import org.apache.directory.shared.ldap.filter.SearchScope;
 import org.apache.directory.shared.ldap.message.AddResponseImpl;
@@ -236,8 +235,8 @@ public class LdapMessageGrammar extends 
                     }
                     catch ( IntegerDecoderException ide )
                     {
-                        log.error( I18n.err( I18n.ERR_04070, StringTools.dumpBytes( value.getData() ), 
-                        		ide.getLocalizedMessage() ) );
+                        log.error( I18n.err( I18n.ERR_04070, StringTools.dumpBytes( value.getData() ), ide
+                            .getLocalizedMessage() ) );
 
                         // This will generate a PROTOCOL_ERROR                        
                         throw new DecoderException( ide.getMessage() );
@@ -285,7 +284,7 @@ public class LdapMessageGrammar extends 
                 {
 
                     LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
-                    
+
                     // Create the  UnbindRequest LdapMessage instance and store it in the container
                     UnBindRequestCodec unbindRequest = new UnBindRequestCodec();
                     unbindRequest.setMessageId( ldapMessageContainer.getMessageId() );
@@ -303,7 +302,6 @@ public class LdapMessageGrammar extends 
                         throw new DecoderException( I18n.err( I18n.ERR_04072 ) );
                     }
 
-                    
                     // We can quit now
                     ldapMessageContainer.grammarEndAllowed( true );
                 }
@@ -364,8 +362,8 @@ public class LdapMessageGrammar extends 
                         }
                         catch ( LdapInvalidDnException ine )
                         {
-                            String msg = I18n.err( I18n.ERR_04074, dnStr, StringTools.dumpBytes( dnBytes ),
-                            		ine.getLocalizedMessage() );
+                            String msg = I18n.err( I18n.ERR_04074, dnStr, StringTools.dumpBytes( dnBytes ), ine
+                                .getLocalizedMessage() );
                             log.error( msg );
 
                             DeleteResponseImpl response = new DeleteResponseImpl( delRequest.getMessageId() );
@@ -451,7 +449,8 @@ public class LdapMessageGrammar extends 
                     }
                     catch ( IntegerDecoderException ide )
                     {
-                        log.error( I18n.err( I18n.ERR_04076, StringTools.dumpBytes( value.getData() ), ide.getMessage() ) );
+                        log.error( I18n
+                            .err( I18n.ERR_04076, StringTools.dumpBytes( value.getData() ), ide.getMessage() ) );
 
                         // This will generate a PROTOCOL_ERROR
                         throw new DecoderException( ide.getMessage() );
@@ -541,7 +540,8 @@ public class LdapMessageGrammar extends 
                     }
                     catch ( IntegerDecoderException ide )
                     {
-                        log.error( I18n.err( I18n.ERR_04078, StringTools.dumpBytes( value.getData() ), ide.getMessage() ) );
+                        log.error( I18n
+                            .err( I18n.ERR_04078, StringTools.dumpBytes( value.getData() ), ide.getMessage() ) );
 
                         // This will generate a PROTOCOL_ERROR
                         throw new DecoderException( ide.getMessage() );
@@ -587,8 +587,8 @@ public class LdapMessageGrammar extends 
                         }
                         catch ( LdapInvalidDnException ine )
                         {
-                            String msg = "Incorrect DN given : " + dnStr + " ("
-                                + StringTools.dumpBytes( dnBytes ) + ") is invalid";
+                            String msg = "Incorrect DN given : " + dnStr + " (" + StringTools.dumpBytes( dnBytes )
+                                + ") is invalid";
                             log.error( "{} : {}", msg, ine.getMessage() );
 
                             BindResponseImpl response = new BindResponseImpl( bindRequestMessage.getMessageId() );
@@ -907,8 +907,7 @@ public class LdapMessageGrammar extends 
         //     referral   [3] Referral OPTIONNAL }
         //
         // Initialiaze the referrals list 
-        super.transitions[LdapStatesEnum.ERROR_MESSAGE_BR_STATE][LdapConstants.LDAP_RESULT_REFERRAL_SEQUENCE_TAG] = 
-            new GrammarTransition(
+        super.transitions[LdapStatesEnum.ERROR_MESSAGE_BR_STATE][LdapConstants.LDAP_RESULT_REFERRAL_SEQUENCE_TAG] = new GrammarTransition(
             LdapStatesEnum.ERROR_MESSAGE_BR_STATE, LdapStatesEnum.REFERRALS_BR_STATE,
             LdapConstants.LDAP_RESULT_REFERRAL_SEQUENCE_TAG, new InitReferralsAction() );
 
@@ -1014,8 +1013,7 @@ public class LdapMessageGrammar extends 
         //     referral   [3] Referral OPTIONNAL }
         //
         // Initialiaze the referrals list 
-        super.transitions[LdapStatesEnum.ERROR_MESSAGE_STATE][LdapConstants.LDAP_RESULT_REFERRAL_SEQUENCE_TAG] = 
-            new GrammarTransition(
+        super.transitions[LdapStatesEnum.ERROR_MESSAGE_STATE][LdapConstants.LDAP_RESULT_REFERRAL_SEQUENCE_TAG] = new GrammarTransition(
             LdapStatesEnum.ERROR_MESSAGE_STATE, LdapStatesEnum.REFERRALS_STATE,
             LdapConstants.LDAP_RESULT_REFERRAL_SEQUENCE_TAG, new GrammarAction( "Init referrals list" )
             {
@@ -1408,7 +1406,7 @@ public class LdapMessageGrammar extends 
                 public void action( IAsn1Container container )
                 {
                     LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
-                    
+
                     // Now, we can allocate the ModifyRequest Object
                     ModifyRequestCodec modifyRequest = new ModifyRequestCodec();
                     modifyRequest.setMessageId( ldapMessageContainer.getMessageId() );
@@ -1454,8 +1452,8 @@ public class LdapMessageGrammar extends 
                         }
                         catch ( LdapInvalidDnException ine )
                         {
-                            String msg = "Invalid DN given : " + dnStr + " ("
-                                + StringTools.dumpBytes( dnBytes ) + ") is invalid";
+                            String msg = "Invalid DN given : " + dnStr + " (" + StringTools.dumpBytes( dnBytes )
+                                + ") is invalid";
                             log.error( "{} : {}", msg, ine.getMessage() );
 
                             ModifyResponseImpl response = new ModifyResponseImpl( modifyRequest.getMessageId() );
@@ -1831,7 +1829,7 @@ public class LdapMessageGrammar extends 
                 {
 
                     LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
-                    
+
                     // Now, we can allocate the AddRequest Object
                     AddRequestCodec addRequest = new AddRequestCodec();
                     addRequest.setMessageId( ldapMessageContainer.getMessageId() );
@@ -1896,8 +1894,8 @@ public class LdapMessageGrammar extends 
                         }
                         catch ( LdapInvalidDnException ine )
                         {
-                            String msg = "Invalid DN given : " + dnStr + " ("
-                                + StringTools.dumpBytes( dnBytes ) + ") is invalid";
+                            String msg = "Invalid DN given : " + dnStr + " (" + StringTools.dumpBytes( dnBytes )
+                                + ") is invalid";
                             log.error( "{} : {}", msg, ine.getMessage() );
 
                             AddResponseImpl response = new AddResponseImpl( addRequest.getMessageId() );
@@ -2201,8 +2199,8 @@ public class LdapMessageGrammar extends 
                         }
                         catch ( LdapInvalidDnException ine )
                         {
-                            String msg = "Invalid DN given : " + dnStr + " ("
-                                + StringTools.dumpBytes( dnBytes ) + ") is invalid";
+                            String msg = "Invalid DN given : " + dnStr + " (" + StringTools.dumpBytes( dnBytes )
+                                + ") is invalid";
                             log.error( "{} : {}", msg, ine.getMessage() );
 
                             ModifyDnResponseImpl response = new ModifyDnResponseImpl( modifyDNRequest.getMessageId() );
@@ -2269,8 +2267,8 @@ public class LdapMessageGrammar extends 
                         }
                         catch ( LdapInvalidDnException ine )
                         {
-                            String msg = "Invalid new RDN given : " + dnStr + " ("
-                                + StringTools.dumpBytes( dnBytes ) + ") is invalid";
+                            String msg = "Invalid new RDN given : " + dnStr + " (" + StringTools.dumpBytes( dnBytes )
+                                + ") is invalid";
                             log.error( "{} : {}", msg, ine.getMessage() );
 
                             ModifyDnResponseImpl response = new ModifyDnResponseImpl( modifyDNRequest.getMessageId() );
@@ -2322,7 +2320,8 @@ public class LdapMessageGrammar extends 
                     }
                     catch ( BooleanDecoderException bde )
                     {
-                        log.error( I18n.err( I18n.ERR_04091, StringTools.dumpBytes( value.getData() ), bde.getMessage() ) );
+                        log.error( I18n
+                            .err( I18n.ERR_04091, StringTools.dumpBytes( value.getData() ), bde.getMessage() ) );
 
                         // This will generate a PROTOCOL_ERROR                        
                         throw new DecoderException( bde.getMessage() );
@@ -2353,8 +2352,7 @@ public class LdapMessageGrammar extends 
         //     newSuperior [0] LDAPDN OPTIONAL }
         //
         // Stores the new superior
-        super.transitions[LdapStatesEnum.DELETE_OLD_RDN_STATE][LdapConstants.MODIFY_DN_REQUEST_NEW_SUPERIOR_TAG] = 
-            new GrammarTransition(
+        super.transitions[LdapStatesEnum.DELETE_OLD_RDN_STATE][LdapConstants.MODIFY_DN_REQUEST_NEW_SUPERIOR_TAG] = new GrammarTransition(
             LdapStatesEnum.DELETE_OLD_RDN_STATE, LdapStatesEnum.NEW_SUPERIOR_STATE,
             LdapConstants.MODIFY_DN_REQUEST_NEW_SUPERIOR_TAG, new GrammarAction( "Store new superior" )
             {
@@ -2396,8 +2394,8 @@ public class LdapMessageGrammar extends 
                         }
                         catch ( LdapInvalidDnException ine )
                         {
-                            String msg = "Invalid new superior DN given : " + dnStr
-                                + " (" + StringTools.dumpBytes( dnBytes ) + ") is invalid";
+                            String msg = "Invalid new superior DN given : " + dnStr + " ("
+                                + StringTools.dumpBytes( dnBytes ) + ") is invalid";
                             log.error( "{} : {}", msg, ine.getMessage() );
 
                             ModifyDnResponseImpl response = new ModifyDnResponseImpl( modifyDNRequest.getMessageId() );
@@ -2457,7 +2455,7 @@ public class LdapMessageGrammar extends 
                 {
 
                     LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
-                    
+
                     // Now, we can allocate the ModifyDnResponse Object
                     ModifyDNResponseCodec modifyDnResponse = new ModifyDNResponseCodec();
                     modifyDnResponse.setMessageId( ldapMessageContainer.getMessageId() );
@@ -2550,8 +2548,8 @@ public class LdapMessageGrammar extends 
                         }
                         catch ( LdapInvalidDnException ine )
                         {
-                            String msg = "Invalid DN given : " + dnStr + " ("
-                                + StringTools.dumpBytes( dnBytes ) + ") is invalid";
+                            String msg = "Invalid DN given : " + dnStr + " (" + StringTools.dumpBytes( dnBytes )
+                                + ") is invalid";
                             log.error( "{} : {}", msg, ine.getMessage() );
 
                             CompareResponseImpl response = new CompareResponseImpl( compareRequest.getMessageId() );
@@ -2764,7 +2762,7 @@ public class LdapMessageGrammar extends 
                 public void action( IAsn1Container container ) throws DecoderException
                 {
                     LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
-                    
+
                     // Now, we can allocate the SearchResultReference Object
                     SearchResultReferenceCodec searchResultReference = new SearchResultReferenceCodec();
                     searchResultReference.setMessageId( ldapMessageContainer.getMessageId() );
@@ -2822,7 +2820,7 @@ public class LdapMessageGrammar extends 
                 public void action( IAsn1Container container ) throws DecoderException
                 {
                     LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
-                    
+
                     // Now, we can allocate the ExtendedRequest Object
                     ExtendedRequestCodec extendedRequest = new ExtendedRequestCodec();
                     extendedRequest.setMessageId( ldapMessageContainer.getMessageId() );
@@ -3032,8 +3030,7 @@ public class LdapMessageGrammar extends 
         //     ...
         //
         // 
-        super.transitions[LdapStatesEnum.ERROR_MESSAGE_ER_STATE][LdapConstants.LDAP_RESULT_REFERRAL_SEQUENCE_TAG] = 
-            new GrammarTransition(
+        super.transitions[LdapStatesEnum.ERROR_MESSAGE_ER_STATE][LdapConstants.LDAP_RESULT_REFERRAL_SEQUENCE_TAG] = new GrammarTransition(
             LdapStatesEnum.ERROR_MESSAGE_ER_STATE, LdapStatesEnum.REFERRALS_ER_STATE,
             LdapConstants.LDAP_RESULT_REFERRAL_SEQUENCE_TAG, new InitReferralsAction() );
 
@@ -3066,8 +3063,7 @@ public class LdapMessageGrammar extends 
         // URI ::= LDAPString
         //
         // Adda new Referral
-        super.transitions[LdapStatesEnum.REFERRAL_ER_STATE][LdapConstants.EXTENDED_RESPONSE_RESPONSE_NAME_TAG] = 
-            new GrammarTransition(
+        super.transitions[LdapStatesEnum.REFERRAL_ER_STATE][LdapConstants.EXTENDED_RESPONSE_RESPONSE_NAME_TAG] = new GrammarTransition(
             LdapStatesEnum.REFERRAL_ER_STATE, LdapStatesEnum.RESPONSE_NAME_STATE,
             LdapConstants.EXTENDED_RESPONSE_RESPONSE_NAME_TAG, new ResponseNameAction() );
 
@@ -3117,8 +3113,7 @@ public class LdapMessageGrammar extends 
         //     ...
         //
         // Stores the response name
-        super.transitions[LdapStatesEnum.ERROR_MESSAGE_ER_STATE][LdapConstants.EXTENDED_RESPONSE_RESPONSE_NAME_TAG] = 
-            new GrammarTransition(
+        super.transitions[LdapStatesEnum.ERROR_MESSAGE_ER_STATE][LdapConstants.EXTENDED_RESPONSE_RESPONSE_NAME_TAG] = new GrammarTransition(
             LdapStatesEnum.ERROR_MESSAGE_ER_STATE, LdapStatesEnum.RESPONSE_NAME_STATE,
             LdapConstants.EXTENDED_RESPONSE_RESPONSE_NAME_TAG, new ResponseNameAction() );
 
@@ -3158,8 +3153,7 @@ public class LdapMessageGrammar extends 
         //     response       [11] OCTET STRING OPTIONAL}
         //
         // Stores the response
-        super.transitions[LdapStatesEnum.ERROR_MESSAGE_ER_STATE][LdapConstants.EXTENDED_RESPONSE_RESPONSE_TAG] = 
-            new GrammarTransition(
+        super.transitions[LdapStatesEnum.ERROR_MESSAGE_ER_STATE][LdapConstants.EXTENDED_RESPONSE_RESPONSE_TAG] = new GrammarTransition(
             LdapStatesEnum.ERROR_MESSAGE_ER_STATE, LdapStatesEnum.RESPONSE_STATE,
             LdapConstants.EXTENDED_RESPONSE_RESPONSE_TAG, new ResponseAction() );
 
@@ -3175,7 +3169,6 @@ public class LdapMessageGrammar extends 
             LdapStatesEnum.RESPONSE_STATE, LdapStatesEnum.CONTROLS_STATE, LdapConstants.CONTROLS_TAG,
             new ControlsInitAction() );
 
-
         // --------------------------------------------------------------------------------------------
         // Transition from Message Id to IntermediateResponse Message
         // --------------------------------------------------------------------------------------------
@@ -3184,8 +3177,8 @@ public class LdapMessageGrammar extends 
         //
         // Creates the IntermediateResponse object
         super.transitions[LdapStatesEnum.MESSAGE_ID_STATE][LdapConstants.INTERMEDIATE_RESPONSE_TAG] = new GrammarTransition(
-            LdapStatesEnum.MESSAGE_ID_STATE, LdapStatesEnum.INTERMEDIATE_RESPONSE_STATE, LdapConstants.INTERMEDIATE_RESPONSE_TAG,
-            new GrammarAction( "Init Intermediate Response" )
+            LdapStatesEnum.MESSAGE_ID_STATE, LdapStatesEnum.INTERMEDIATE_RESPONSE_STATE,
+            LdapConstants.INTERMEDIATE_RESPONSE_TAG, new GrammarAction( "Init Intermediate Response" )
             {
                 public void action( IAsn1Container container ) throws DecoderException
                 {
@@ -3370,9 +3363,8 @@ public class LdapMessageGrammar extends 
         //
         // Stores the value
         super.transitions[LdapStatesEnum.INTERMEDIATE_RESPONSE_VALUE_STATE][LdapConstants.CONTROLS_TAG] = new GrammarTransition(
-            LdapStatesEnum.INTERMEDIATE_RESPONSE_VALUE_STATE, LdapStatesEnum.CONTROLS_STATE, LdapConstants.CONTROLS_TAG,
-            new ControlsInitAction() );
-
+            LdapStatesEnum.INTERMEDIATE_RESPONSE_VALUE_STATE, LdapStatesEnum.CONTROLS_STATE,
+            LdapConstants.CONTROLS_TAG, new ControlsInitAction() );
 
         // --------------------------------------------------------------------------------------------
         // Controls
@@ -3450,16 +3442,16 @@ public class LdapMessageGrammar extends 
                         // This will generate a PROTOCOL_ERROR
                         throw new DecoderException( I18n.err( I18n.ERR_04099, oidValue ) );
                     }
-                    
+
                     // get the Control for this OID
                     control = message.getCodecControl( oidValue );
-                    
+
                     if ( control == null )
                     {
                         // This control is unknown, we will create a neutral control
                         control = new ControlImpl( oidValue );
                     }
-                    
+
                     // The control may be null, if not known
                     message.addControl( control );
 
@@ -3511,7 +3503,8 @@ public class LdapMessageGrammar extends 
                     }
                     catch ( BooleanDecoderException bde )
                     {
-                        log.error( I18n.err( I18n.ERR_04100, StringTools.dumpBytes( value.getData() ), bde.getMessage() ) );
+                        log.error( I18n
+                            .err( I18n.ERR_04100, StringTools.dumpBytes( value.getData() ), bde.getMessage() ) );
 
                         // This will generate a PROTOCOL_ERROR
                         throw new DecoderException( bde.getMessage() );
@@ -3598,7 +3591,7 @@ public class LdapMessageGrammar extends 
                 public void action( IAsn1Container container )
                 {
                     LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
-                    
+
                     // Now, we can allocate the SearchRequest Object
                     SearchRequestCodec searchRequest = new SearchRequestCodec();
                     searchRequest.setMessageId( ldapMessageContainer.getMessageId() );
@@ -3645,8 +3638,8 @@ public class LdapMessageGrammar extends 
                         }
                         catch ( LdapInvalidDnException ine )
                         {
-                            String msg = "Invalid root DN given : " + dnStr + " ("
-                                + StringTools.dumpBytes( dnBytes ) + ") is invalid";
+                            String msg = "Invalid root DN given : " + dnStr + " (" + StringTools.dumpBytes( dnBytes )
+                                + ") is invalid";
                             log.error( "{} : {}", msg, ine.getMessage() );
 
                             SearchResponseDoneImpl response = new SearchResponseDoneImpl( searchRequest.getMessageId() );
@@ -3697,7 +3690,7 @@ public class LdapMessageGrammar extends 
                     catch ( IntegerDecoderException ide )
                     {
                         log.error( I18n.err( I18n.ERR_04101, value.toString() ) );
-                        throw new DecoderException( I18n.err( I18n.ERR_04101,  value.toString() ) );
+                        throw new DecoderException( I18n.err( I18n.ERR_04101, value.toString() ) );
                     }
 
                     searchRequest.setScope( SearchScope.getSearchScope( scope ) );
@@ -3914,7 +3907,8 @@ public class LdapMessageGrammar extends 
                     }
                     catch ( BooleanDecoderException bde )
                     {
-                        log.error( I18n.err( I18n.ERR_04105, StringTools.dumpBytes( value.getData() ), bde.getMessage() ) );
+                        log.error( I18n
+                            .err( I18n.ERR_04105, StringTools.dumpBytes( value.getData() ), bde.getMessage() ) );
 
                         throw new DecoderException( bde.getMessage() );
                     }
@@ -4799,8 +4793,7 @@ public class LdapMessageGrammar extends 
         //     ...
         //
         // Init NOT filter
-        super.transitions[LdapStatesEnum.ASSERTION_VALUE_FILTER_STATE][LdapConstants.EQUALITY_MATCH_FILTER_TAG] = 
-            new GrammarTransition(
+        super.transitions[LdapStatesEnum.ASSERTION_VALUE_FILTER_STATE][LdapConstants.EQUALITY_MATCH_FILTER_TAG] = new GrammarTransition(
             LdapStatesEnum.ASSERTION_VALUE_FILTER_STATE, LdapStatesEnum.EQUALITY_MATCH_STATE,
             LdapConstants.EQUALITY_MATCH_FILTER_TAG, new InitEqualityMatchFilterAction() );
 
@@ -4836,8 +4829,7 @@ public class LdapMessageGrammar extends 
         //     ...
         //
         // Init Greater Or Equal filter
-        super.transitions[LdapStatesEnum.ASSERTION_VALUE_FILTER_STATE][LdapConstants.GREATER_OR_EQUAL_FILTER_TAG] = 
-            new GrammarTransition(
+        super.transitions[LdapStatesEnum.ASSERTION_VALUE_FILTER_STATE][LdapConstants.GREATER_OR_EQUAL_FILTER_TAG] = new GrammarTransition(
             LdapStatesEnum.ASSERTION_VALUE_FILTER_STATE, LdapStatesEnum.GREATER_OR_EQUAL_STATE,
             LdapConstants.GREATER_OR_EQUAL_FILTER_TAG, new InitGreaterOrEqualFilterAction() );
 
@@ -4855,8 +4847,7 @@ public class LdapMessageGrammar extends 
         //     ...
         //
         // Init Less Or Equal filter
-        super.transitions[LdapStatesEnum.ASSERTION_VALUE_FILTER_STATE][LdapConstants.LESS_OR_EQUAL_FILTER_TAG] = 
-            new GrammarTransition(
+        super.transitions[LdapStatesEnum.ASSERTION_VALUE_FILTER_STATE][LdapConstants.LESS_OR_EQUAL_FILTER_TAG] = new GrammarTransition(
             LdapStatesEnum.ASSERTION_VALUE_FILTER_STATE, LdapStatesEnum.LESS_OR_EQUAL_STATE,
             LdapConstants.LESS_OR_EQUAL_FILTER_TAG, new InitLessOrEqualFilterAction() );
 
@@ -4892,8 +4883,7 @@ public class LdapMessageGrammar extends 
         //     ...
         //
         // Init Approx Match filter
-        super.transitions[LdapStatesEnum.ASSERTION_VALUE_FILTER_STATE][LdapConstants.APPROX_MATCH_FILTER_TAG] = 
-            new GrammarTransition(
+        super.transitions[LdapStatesEnum.ASSERTION_VALUE_FILTER_STATE][LdapConstants.APPROX_MATCH_FILTER_TAG] = new GrammarTransition(
             LdapStatesEnum.ASSERTION_VALUE_FILTER_STATE, LdapStatesEnum.APPROX_MATCH_STATE,
             LdapConstants.APPROX_MATCH_FILTER_TAG, new InitApproxMatchFilterAction() );
 
@@ -4911,8 +4901,7 @@ public class LdapMessageGrammar extends 
         //     ...
         //
         // Init Assertion Value Filter filter
-        super.transitions[LdapStatesEnum.ASSERTION_VALUE_FILTER_STATE][LdapConstants.EXTENSIBLE_MATCH_FILTER_TAG] = 
-            new GrammarTransition(
+        super.transitions[LdapStatesEnum.ASSERTION_VALUE_FILTER_STATE][LdapConstants.EXTENSIBLE_MATCH_FILTER_TAG] = new GrammarTransition(
             LdapStatesEnum.ASSERTION_VALUE_FILTER_STATE, LdapStatesEnum.EXTENSIBLE_MATCH_STATE,
             LdapConstants.EXTENSIBLE_MATCH_FILTER_TAG, new InitExtensibleMatchFilterAction() );
 
@@ -6182,7 +6171,8 @@ public class LdapMessageGrammar extends 
                     }
                     catch ( BooleanDecoderException bde )
                     {
-                        log.error( I18n.err( I18n.ERR_04110, StringTools.dumpBytes( value.getData() ), bde.getMessage() ) );
+                        log.error( I18n
+                            .err( I18n.ERR_04110, StringTools.dumpBytes( value.getData() ), bde.getMessage() ) );
 
                         throw new DecoderException( bde.getMessage() );
                     }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/AliasDerefMode.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/AliasDerefMode.java?rev=948711&r1=948710&r2=948711&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/AliasDerefMode.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/AliasDerefMode.java Thu May 27 08:08:44 2010
@@ -39,24 +39,23 @@ import org.apache.directory.shared.ldap.
 public enum AliasDerefMode
 {
     /** Alias handling mode value that treats aliases like entries */
-    NEVER_DEREF_ALIASES( 0, "never" ),
+    NEVER_DEREF_ALIASES(0, "never"),
 
     /** Alias handling mode value that dereferences only when searching */
-    DEREF_IN_SEARCHING( 1, "searching" ),
+    DEREF_IN_SEARCHING(1, "searching"),
 
     /** Alias handling mode value that dereferences only in finding the base */
-    DEREF_FINDING_BASE_OBJ( 2, "finding" ),
+    DEREF_FINDING_BASE_OBJ(2, "finding"),
 
     /** Alias handling mode value that dereferences always */
-    DEREF_ALWAYS( 3, "always" );
-
+    DEREF_ALWAYS(3, "always");
 
     /** Stores the integer value of each element of the enumeration */
     private int value;
     /** Stores the integer value of each element of the enumeration */
     private String jndiValue;
 
-    
+
     /**
      * Private constructor so no other instances can be created other than the
      * public static constants in this class.
@@ -65,11 +64,11 @@ public enum AliasDerefMode
      */
     private AliasDerefMode( int value, String jndiValue )
     {
-       this.value = value;
-       this.jndiValue = jndiValue;
+        this.value = value;
+        this.jndiValue = jndiValue;
     }
 
-    
+
     /**
      * @return The value associated with the current element.
      */
@@ -78,6 +77,7 @@ public enum AliasDerefMode
         return value;
     }
 
+
     /**
      * Gets the enumeration from by extracting the value for the JNDI LDAP
      * specific environment property, java.naming.ldap.derefAliases, from the
@@ -91,7 +91,7 @@ public enum AliasDerefMode
     public static AliasDerefMode getEnum( Map<String, Object> env )
     {
         String property = ( String ) env.get( JndiPropertyConstants.JNDI_LDAP_DAP_DEREF_ALIASES );
-        
+
         if ( null == property )
         {
             return DEREF_ALWAYS;
@@ -117,11 +117,12 @@ public enum AliasDerefMode
             else
             {
                 throw new IllegalArgumentException( I18n.err( I18n.ERR_04186, property,
-                		JndiPropertyConstants.JNDI_LDAP_DAP_DEREF_ALIASES ) );
+                    JndiPropertyConstants.JNDI_LDAP_DAP_DEREF_ALIASES ) );
             }
         }
     }
-    
+
+
     /**
      * Checks to see if we dereference while searching and finding the base.
      * 
@@ -154,18 +155,18 @@ public enum AliasDerefMode
     {
         switch ( this )
         {
-            case DEREF_ALWAYS :
+            case DEREF_ALWAYS:
                 return true;
-            
-            case DEREF_FINDING_BASE_OBJ :
+
+            case DEREF_FINDING_BASE_OBJ:
                 return false;
-            
-            case DEREF_IN_SEARCHING :
+
+            case DEREF_IN_SEARCHING:
                 return true;
-            
-            case NEVER_DEREF_ALIASES :
+
+            case NEVER_DEREF_ALIASES:
                 return false;
-            
+
             default:
                 throw new IllegalArgumentException( I18n.err( I18n.ERR_04187 ) );
         }
@@ -182,18 +183,18 @@ public enum AliasDerefMode
     {
         switch ( this )
         {
-            case DEREF_ALWAYS :
+            case DEREF_ALWAYS:
                 return true;
-            
-            case DEREF_FINDING_BASE_OBJ :
+
+            case DEREF_FINDING_BASE_OBJ:
                 return true;
-            
-            case DEREF_IN_SEARCHING :
+
+            case DEREF_IN_SEARCHING:
                 return false;
-            
-            case NEVER_DEREF_ALIASES :
+
+            case NEVER_DEREF_ALIASES:
                 return false;
-            
+
             default:
                 throw new IllegalArgumentException( "Class has bug: check for valid enumeration values" );
         }
@@ -208,21 +209,26 @@ public enum AliasDerefMode
      */
     public static AliasDerefMode getDerefMode( int val )
     {
-        switch( val )
+        switch ( val )
         {
-            case 0: return NEVER_DEREF_ALIASES;
-            
-            case 1: return DEREF_IN_SEARCHING;
-            
-            case 2: return DEREF_FINDING_BASE_OBJ;
-            
-            case 3: return DEREF_ALWAYS;
-            
-            default: throw new IllegalArgumentException( "Unknown derefmode " + val );
+            case 0:
+                return NEVER_DEREF_ALIASES;
+
+            case 1:
+                return DEREF_IN_SEARCHING;
+
+            case 2:
+                return DEREF_FINDING_BASE_OBJ;
+
+            case 3:
+                return DEREF_ALWAYS;
+
+            default:
+                throw new IllegalArgumentException( "Unknown derefmode " + val );
         }
     }
-    
-    
+
+
     public String getJndiValue()
     {
         return jndiValue;

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/comparators/NormalizingComparator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/comparators/NormalizingComparator.java?rev=948711&r1=948710&r2=948711&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/comparators/NormalizingComparator.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/comparators/NormalizingComparator.java Thu May 27 08:08:44 2010
@@ -23,7 +23,6 @@ package org.apache.directory.shared.ldap
 import java.util.Comparator;
 
 import org.apache.directory.shared.ldap.exception.LdapException;
-
 import org.apache.directory.shared.ldap.schema.LdapComparator;
 import org.apache.directory.shared.ldap.schema.Normalizer;
 import org.slf4j.Logger;
@@ -37,7 +36,7 @@ import org.slf4j.LoggerFactory;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-/* no qualifier*/ class NormalizingComparator extends LdapComparator<String>
+/* no qualifier*/class NormalizingComparator extends LdapComparator<String>
 {
     /** A logger for this class */
     private static final Logger LOG = LoggerFactory.getLogger( NormalizingComparator.class );
@@ -99,8 +98,8 @@ import org.slf4j.LoggerFactory;
 
         return comparator.compare( n1, n2 );
     }
-    
-    
+
+
     /**
      * Makes sure we update the oid property of the contained normalizer and 
      * comparator.
@@ -110,8 +109,8 @@ import org.slf4j.LoggerFactory;
     @Override
     public void setOid( String oid )
     {
-    	super.setOid( oid );
-    	normalizer.setOid( oid );
-    	comparator.setOid( oid );
-    }    
+        super.setOid( oid );
+        normalizer.setOid( oid );
+        comparator.setOid( oid );
+    }
 }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/NormalizerDescription.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/NormalizerDescription.java?rev=948711&r1=948710&r2=948711&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/NormalizerDescription.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/NormalizerDescription.java Thu May 27 08:08:44 2010
@@ -20,6 +20,7 @@
 
 package org.apache.directory.shared.ldap.schema.parsers;
 
+
 import org.apache.directory.shared.ldap.schema.LoadableSchemaObject;
 import org.apache.directory.shared.ldap.schema.SchemaObjectType;
 
@@ -32,19 +33,20 @@ import org.apache.directory.shared.ldap.
  */
 public class NormalizerDescription extends LoadableSchemaObject
 {
-	/** SerialVersionUID */
-	private static final long serialVersionUID = 1L;
+    /** SerialVersionUID */
+    private static final long serialVersionUID = 1L;
+
+
+    /**
+     * Default constructor for a NormalizerDecription
+     * @param oid The SyntaxChecker OID
+     */
+    public NormalizerDescription( String oid )
+    {
+        super( SchemaObjectType.NORMALIZER, oid );
+    }
 
-	/**
-	 * Default constructor for a NormalizerDecription
-	 * @param oid The SyntaxChecker OID
-	 */
-	public NormalizerDescription( String oid ) 
-	{
-		super( SchemaObjectType.NORMALIZER, oid );
-	}
 
-    
     /**
      * @see Object#toString()
      */

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/SyntaxCheckerDescription.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/SyntaxCheckerDescription.java?rev=948711&r1=948710&r2=948711&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/SyntaxCheckerDescription.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/SyntaxCheckerDescription.java Thu May 27 08:08:44 2010
@@ -20,6 +20,7 @@
 
 package org.apache.directory.shared.ldap.schema.parsers;
 
+
 import org.apache.directory.shared.ldap.schema.LoadableSchemaObject;
 import org.apache.directory.shared.ldap.schema.SchemaObjectType;
 
@@ -32,19 +33,20 @@ import org.apache.directory.shared.ldap.
  */
 public class SyntaxCheckerDescription extends LoadableSchemaObject
 {
-	/** SerialVersionUID */
-	private static final long serialVersionUID = 1L;
+    /** SerialVersionUID */
+    private static final long serialVersionUID = 1L;
+
+
+    /**
+     * Default constructor for a SyntaxCheckerDecription
+     * @param oid The SyntaxChecker OID
+     */
+    public SyntaxCheckerDescription( String oid )
+    {
+        super( SchemaObjectType.SYNTAX_CHECKER, oid );
+    }
 
-	/**
-	 * Default constructor for a SyntaxCheckerDecription
-	 * @param oid The SyntaxChecker OID
-	 */
-	public SyntaxCheckerDescription( String oid ) 
-	{
-		super( SchemaObjectType.SYNTAX_CHECKER, oid );
-	}
 
-    
     /**
      * @see Object#toString()
      */

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/SyntaxCheckerDescriptionSchemaParser.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/SyntaxCheckerDescriptionSchemaParser.java?rev=948711&r1=948710&r2=948711&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/SyntaxCheckerDescriptionSchemaParser.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/SyntaxCheckerDescriptionSchemaParser.java Thu May 27 08:08:44 2010
@@ -41,6 +41,7 @@ public class SyntaxCheckerDescriptionSch
     /** The LoggerFactory used by this class */
     protected static final Logger LOG = LoggerFactory.getLogger( SyntaxCheckerDescriptionSchemaParser.class );
 
+
     /**
      * Creates a schema parser instance.
      */
@@ -88,7 +89,7 @@ public class SyntaxCheckerDescriptionSch
 
         try
         {
-        	SyntaxCheckerDescription syntaxChecker = parser.syntaxCheckerDescription();
+            SyntaxCheckerDescription syntaxChecker = parser.syntaxCheckerDescription();
 
             // Update the schemaName
             setSchemaName( syntaxChecker );

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java?rev=948711&r1=948710&r2=948711&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java Thu May 27 08:08:44 2010
@@ -32,8 +32,8 @@ import org.apache.directory.shared.i18n.
 import org.apache.directory.shared.ldap.constants.MetaSchemaConstants;
 import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.exception.LdapProtocolErrorException;
-import org.apache.directory.shared.ldap.exception.LdapUnwillingToPerformException;
 import org.apache.directory.shared.ldap.exception.LdapSchemaViolationException;
+import org.apache.directory.shared.ldap.exception.LdapUnwillingToPerformException;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.DITContentRule;
@@ -134,7 +134,8 @@ public class Registries implements Schem
     protected Map<SchemaObjectWrapper, Set<SchemaObjectWrapper>> using;
 
     /** A reference on the schema Manager */
-    @SuppressWarnings("PMD.UnusedPrivateField") // False positive 
+    @SuppressWarnings("PMD.UnusedPrivateField")
+    // False positive 
     private SchemaManager schemaManager;
 
 
@@ -1010,8 +1011,7 @@ public class Registries implements Schem
         else
         {
             // This is an error. 
-            Throwable error = new LdapProtocolErrorException( 
-            		I18n.err( I18n.ERR_04294, matchingRule.getOid() ) );
+            Throwable error = new LdapProtocolErrorException( I18n.err( I18n.ERR_04294, matchingRule.getOid() ) );
             errors.add( error );
         }
 
@@ -1021,8 +1021,8 @@ public class Registries implements Schem
         if ( normalizer == null )
         {
             // Ok, no normalizer, this is an error
-            Throwable error = new LdapSchemaViolationException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX,
-            		I18n.err( I18n.ERR_04295, matchingRule.getOid() ) );
+            Throwable error = new LdapSchemaViolationException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, I18n.err(
+                I18n.ERR_04295, matchingRule.getOid() ) );
             errors.add( error );
         }
 
@@ -1032,8 +1032,8 @@ public class Registries implements Schem
         if ( comparator == null )
         {
             // Ok, no comparator, this is an error
-            Throwable error = new LdapSchemaViolationException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX,
-            		I18n.err( I18n.ERR_04296, matchingRule.getOid() ) );
+            Throwable error = new LdapSchemaViolationException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, I18n.err(
+                I18n.ERR_04296, matchingRule.getOid() ) );
             errors.add( error );
         }
     }
@@ -1077,8 +1077,8 @@ public class Registries implements Schem
                 else
                 {
                     // Not allowed : we have a cyle
-                    Throwable error = new LdapSchemaViolationException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX,
-                        I18n.err( I18n.ERR_04297, attributeType.getOid() ) );
+                    Throwable error = new LdapSchemaViolationException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, I18n
+                        .err( I18n.ERR_04297, attributeType.getOid() ) );
                     errors.add( error );
                     return;
                 }
@@ -1109,8 +1109,8 @@ public class Registries implements Schem
             {
                 // This is an error. if the AT does not have a Syntax,
                 // then it must have a superior, which syntax is get from.
-                Throwable error = new LdapSchemaViolationException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX,
-                    I18n.err( I18n.ERR_04298, attributeType.getOid() ) );
+                Throwable error = new LdapSchemaViolationException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, I18n.err(
+                    I18n.ERR_04298, attributeType.getOid() ) );
                 errors.add( error );
             }
         }
@@ -1289,7 +1289,8 @@ public class Registries implements Schem
                 else
                 {
                     // Not allowed : we have a cyle
-                    Throwable error = new LdapProtocolErrorException( I18n.err( I18n.ERR_04300, objectClass.getOid(), superior) );
+                    Throwable error = new LdapProtocolErrorException( I18n.err( I18n.ERR_04300, objectClass.getOid(),
+                        superior ) );
                     errors.add( error );
                     return;
                 }
@@ -1356,7 +1357,7 @@ public class Registries implements Schem
 
         // Build the SchemaObject references
         buildReference( errors, schemaObject );
-        
+
         // Lock the SchemaObject
         schemaObject.lock();
 
@@ -1828,19 +1829,19 @@ public class Registries implements Schem
         if ( content != null )
         {
             SchemaObjectWrapper schemaObjectWrapper = new SchemaObjectWrapper( schemaObject );
-    
+
             if ( content.contains( schemaObjectWrapper ) )
             {
                 // remove the schemaObject
                 content.remove( schemaObjectWrapper );
-    
+
                 // Update the global OidRegistry if the SchemaObject is not
                 // an instance of LoadableSchemaObject
                 if ( !( schemaObject instanceof LoadableSchemaObject ) )
                 {
                     globalOidRegistry.unregister( schemaObject.getOid() );
                 }
-    
+
                 LOG.debug( "Unregistered {}:{}", schemaObject.getObjectType(), schemaObject.getOid() );
             }
             else
@@ -2598,7 +2599,7 @@ public class Registries implements Schem
 
                 try
                 {
-                    if ( ! ( original instanceof LoadableSchemaObject ) )
+                    if ( !( original instanceof LoadableSchemaObject ) )
                     {
                         SchemaObject copy = clone.globalOidRegistry.getSchemaObject( original.getOid() );
                         SchemaObjectWrapper newWrapper = new SchemaObjectWrapper( copy );
@@ -2607,7 +2608,7 @@ public class Registries implements Schem
                     else
                     {
                         SchemaObjectWrapper newWrapper = new SchemaObjectWrapper( original );
-                        objects.add(  newWrapper );
+                        objects.add( newWrapper );
                     }
                 }
                 catch ( LdapException ne )

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/SchemaLoaderListener.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/SchemaLoaderListener.java?rev=948711&r1=948710&r2=948711&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/SchemaLoaderListener.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/SchemaLoaderListener.java Thu May 27 08:08:44 2010
@@ -30,14 +30,15 @@ package org.apache.directory.shared.ldap
  */
 public interface SchemaLoaderListener
 {
-	/**
-	 * Listener method called to indicate a loader or other agent finished 
-	 * loading the schema objects for a schema into the Registries.
-	 * 
-	 * @param schema the Schema that was loaded
-	 */
+    /**
+     * Listener method called to indicate a loader or other agent finished 
+     * loading the schema objects for a schema into the Registries.
+     * 
+     * @param schema the Schema that was loaded
+     */
     void schemaLoaded( Schema schema );
-    
+
+
     /**
      * Listener method called to indicate an agent finished loading the schema
      * objects for a schema into the Registries.

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/ComparatorDescriptionSchemaParserTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/ComparatorDescriptionSchemaParserTest.java?rev=948711&r1=948710&r2=948711&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/ComparatorDescriptionSchemaParserTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/ComparatorDescriptionSchemaParserTest.java Thu May 27 08:08:44 2010
@@ -20,15 +20,16 @@
 package org.apache.directory.shared.ldap.schema.syntax.parser;
 
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
 import java.text.ParseException;
 
-import org.apache.directory.shared.ldap.schema.parsers.LdapComparatorDescriptionSchemaParser;
 import org.apache.directory.shared.ldap.schema.parsers.LdapComparatorDescription;
+import org.apache.directory.shared.ldap.schema.parsers.LdapComparatorDescriptionSchemaParser;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
 
 
 /**
@@ -94,22 +95,22 @@ public class ComparatorDescriptionSchema
         value = "( 1.1 FQCN org.apache.directory.SimpleComparator BYTECODE ABCDEFGHIJKLMNOPQRSTUVWXYZ+/abcdefghijklmnopqrstuvwxyz0123456789==== )";
         ldapComparatorDescription = parser.parseComparatorDescription( value );
         assertNotNull( ldapComparatorDescription.getBytecode() );
-        assertEquals( "ABCDEFGHIJKLMNOPQRSTUVWXYZ+/abcdefghijklmnopqrstuvwxyz0123456789====", 
-        		ldapComparatorDescription.getBytecode() );
+        assertEquals( "ABCDEFGHIJKLMNOPQRSTUVWXYZ+/abcdefghijklmnopqrstuvwxyz0123456789====", ldapComparatorDescription
+            .getBytecode() );
 
         // FQCN simple, no spaces
         value = "(1.1 FQCNorg.apache.directory.SimpleComparator BYTECODEABCDEFGHIJKLMNOPQRSTUVWXYZ+/abcdefghijklmnopqrstuvwxyz0123456789====)";
         ldapComparatorDescription = parser.parseComparatorDescription( value );
         assertNotNull( ldapComparatorDescription.getBytecode() );
-        assertEquals( "ABCDEFGHIJKLMNOPQRSTUVWXYZ+/abcdefghijklmnopqrstuvwxyz0123456789====", 
-        		ldapComparatorDescription.getBytecode() );
+        assertEquals( "ABCDEFGHIJKLMNOPQRSTUVWXYZ+/abcdefghijklmnopqrstuvwxyz0123456789====", ldapComparatorDescription
+            .getBytecode() );
 
         // FQCN simple, tabs
         value = "\t(\t1.1\tFQCN\torg.apache.directory.SimpleComparator\tBYTECODE\tABCDEFGHIJKLMNOPQRSTUVWXYZ+/abcdefghijklmnopqrstuvwxyz0123456789====\t)\t";
         ldapComparatorDescription = parser.parseComparatorDescription( value );
         assertNotNull( ldapComparatorDescription.getBytecode() );
-        assertEquals( "ABCDEFGHIJKLMNOPQRSTUVWXYZ+/abcdefghijklmnopqrstuvwxyz0123456789====", 
-        		ldapComparatorDescription.getBytecode() );
+        assertEquals( "ABCDEFGHIJKLMNOPQRSTUVWXYZ+/abcdefghijklmnopqrstuvwxyz0123456789====", ldapComparatorDescription
+            .getBytecode() );
     }
 
 

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/SyntaxCheckerDescriptionSchemaParserTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/SyntaxCheckerDescriptionSchemaParserTest.java?rev=948711&r1=948710&r2=948711&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/SyntaxCheckerDescriptionSchemaParserTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/SyntaxCheckerDescriptionSchemaParserTest.java Thu May 27 08:08:44 2010
@@ -102,8 +102,8 @@ public class SyntaxCheckerDescriptionSch
         value = "( 1.1 FQCN org.apache.directory.SimpleSyntaxChecker BYTECODE ABCDEFGHIJKLMNOPQRSTUVWXYZ+/abcdefghijklmnopqrstuvwxyz0123456789==== )";
         syntaxCheckerDescription = parser.parseSyntaxCheckerDescription( value );
         assertNotNull( syntaxCheckerDescription.getBytecode() );
-        assertEquals( "ABCDEFGHIJKLMNOPQRSTUVWXYZ+/abcdefghijklmnopqrstuvwxyz0123456789====", 
-        		syntaxCheckerDescription.getBytecode() );
+        assertEquals( "ABCDEFGHIJKLMNOPQRSTUVWXYZ+/abcdefghijklmnopqrstuvwxyz0123456789====", syntaxCheckerDescription
+            .getBytecode() );
     }
 
 



Mime
View raw message