directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r951408 - in /directory: apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/ apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/ apacheds/trunk/core/src/main/java/org/apache/direct...
Date Fri, 04 Jun 2010 13:41:18 GMT
Author: elecharny
Date: Fri Jun  4 13:41:17 2010
New Revision: 951408

URL: http://svn.apache.org/viewvc?rev=951408&view=rev
Log:
Replaced the throw new NullPointerException by throw new IllegalArgumentException

Modified:
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java
    directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/SingletonOrOrderedSet.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/ACDFEngine.java
    directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTable.java
    directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/MarshallerSerializerBridge.java
    directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTableWithDuplicatesTest.java
    directory/apacheds/trunk/jdbm/src/main/java/jdbm/helper/SoftCache.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/LdapRequestHandler.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchAbandonListener.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/ntlm/NtlmSaslServer.java
    directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
    directory/shared/trunk/cursor/src/main/java/org/apache/directory/shared/ldap/cursor/AbstractCursor.java
    directory/shared/trunk/cursor/src/main/java/org/apache/directory/shared/ldap/cursor/AbstractTupleCursor.java
    directory/shared/trunk/ldap-convert/src/main/java/org/apache/directory/shared/converter/schema/SchemaToLdif.java
    directory/shared/trunk/ldap-ldif/src/main/java/org/apache/directory/shared/ldap/ldif/LdifRevertor.java
    directory/shared/trunk/ldap-schema-loader/src/main/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaEntityFactory.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ACIItem.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ACITuple.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ProtectedItem.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/AbstractSchemaLoader.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/DefaultSchema.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/AttributeUtils.java

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java?rev=951408&r1=951407&r2=951408&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java
Fri Jun  4 13:41:17 2010
@@ -1017,7 +1017,7 @@ public class InterceptorChain
 
             if ( interceptor == null )
             {
-                throw new NullPointerException( "interceptor" );
+                throw new IllegalArgumentException( "interceptor" );
             }
 
             this.prevEntry = prevEntry;

Modified: directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/SingletonOrOrderedSet.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/SingletonOrOrderedSet.java?rev=951408&r1=951407&r2=951408&view=diff
==============================================================================
--- directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/SingletonOrOrderedSet.java
(original)
+++ directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/SingletonOrOrderedSet.java
Fri Jun  4 13:41:17 2010
@@ -43,7 +43,7 @@ public class SingletonOrOrderedSet<V>
     {
         if ( singleton == null )
         {
-            throw new NullPointerException( I18n.err( I18n.ERR_447 ) );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_447 ) );
         }
         
         this.singleton = singleton;
@@ -60,7 +60,7 @@ public class SingletonOrOrderedSet<V>
     {
         if ( orderedSet == null )
         {
-            throw new NullPointerException( I18n.err( I18n.ERR_448 ) );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_448 ) );
         }
         
         this.orderedSet = orderedSet;
@@ -116,7 +116,7 @@ public class SingletonOrOrderedSet<V>
     {
         if ( singleton == null )
         {
-            throw new NullPointerException( I18n.err( I18n.ERR_447 ) );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_447 ) );
         }
         
         if ( this.orderedSet != null )
@@ -142,7 +142,7 @@ public class SingletonOrOrderedSet<V>
     {
         if ( singleton == null )
         {
-            throw new NullPointerException( I18n.err( I18n.ERR_447 ) );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_447 ) );
         }
         
         if ( this.singleton != null )
@@ -185,7 +185,7 @@ public class SingletonOrOrderedSet<V>
     {
         if ( orderedSet == null )
         {
-            throw new NullPointerException( I18n.err( I18n.ERR_448 ) );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_448 ) );
         }
         
         if ( this.singleton != null )
@@ -211,7 +211,7 @@ public class SingletonOrOrderedSet<V>
     {
         if ( orderedSet == null )
         {
-            throw new NullPointerException( I18n.err( I18n.ERR_448 ) );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_448 ) );
         }
         
         if ( this.orderedSet != null )

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/ACDFEngine.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/ACDFEngine.java?rev=951408&r1=951407&r2=951408&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/ACDFEngine.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/ACDFEngine.java
Fri Jun  4 13:41:17 2010
@@ -199,7 +199,7 @@ public class ACDFEngine
     {
         if ( entryName == null )
         {
-            throw new NullPointerException( "entryName" );
+            throw new IllegalArgumentException( "entryName" );
         }
 
         Entry userEntry = opContext.lookup( userName, USER_LOOKUP_BYPASS );

Modified: directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTable.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTable.java?rev=951408&r1=951407&r2=951408&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTable.java
(original)
+++ directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTable.java
Fri Jun  4 13:41:17 2010
@@ -141,7 +141,7 @@ public class JdbmTable<K,V> implements T
 
         if ( keyComparator == null )
         {
-            throw new NullPointerException( I18n.err( I18n.ERR_591 ) );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_591 ) );
         }
         else
         {
@@ -150,7 +150,7 @@ public class JdbmTable<K,V> implements T
 
         if ( valueComparator == null )
         {
-            throw new NullPointerException( I18n.err( I18n.ERR_592 ) );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_592 ) );
         }
         else
         {
@@ -217,7 +217,7 @@ public class JdbmTable<K,V> implements T
 
         if ( keyComparator == null )
         {
-            throw new NullPointerException( I18n.err( I18n.ERR_591 ) );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_591 ) );
         }
         else
         {
@@ -1000,7 +1000,7 @@ public class JdbmTable<K,V> implements T
     {
         if ( key == null )
         {
-            throw new NullPointerException( "key is null" );
+            throw new IllegalArgumentException( "key is null" );
         }
 
         if ( ! allowsDuplicates )

Modified: directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/MarshallerSerializerBridge.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/MarshallerSerializerBridge.java?rev=951408&r1=951407&r2=951408&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/MarshallerSerializerBridge.java
(original)
+++ directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/MarshallerSerializerBridge.java
Fri Jun  4 13:41:17 2010
@@ -20,12 +20,12 @@
 package org.apache.directory.server.core.partition.impl.btree.jdbm;
 
 
-import org.apache.directory.server.core.avltree.Marshaller;
-
 import java.io.IOException;
 
 import jdbm.helper.Serializer;
 
+import org.apache.directory.server.core.avltree.Marshaller;
+
 
 /**
  * A Marshaller which adapts a JDBM Serializer.
@@ -47,7 +47,7 @@ public class MarshallerSerializerBridge<
     {
         if ( serializer == null )
         {
-            throw new NullPointerException( "serializer" );
+            throw new IllegalArgumentException( "serializer" );
         }
         this.serializer = serializer;
     }

Modified: directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTableWithDuplicatesTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTableWithDuplicatesTest.java?rev=951408&r1=951407&r2=951408&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTableWithDuplicatesTest.java
(original)
+++ directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTableWithDuplicatesTest.java
Fri Jun  4 13:41:17 2010
@@ -174,7 +174,7 @@ public class JdbmTableWithDuplicatesTest
     }
 
 
-    @Test( expected = NullPointerException.class )
+    @Test( expected = IllegalArgumentException.class )
     public void testNullKeyComparator() throws Exception
     {
         assertNotNull( table.getKeyComparator() );
@@ -187,7 +187,7 @@ public class JdbmTableWithDuplicatesTest
     }
 
 
-    @Test( expected = NullPointerException.class )
+    @Test( expected = IllegalArgumentException.class )
     public void testNullValueComparator() throws Exception
     {
         assertNotNull( table.getValueComparator() );

Modified: directory/apacheds/trunk/jdbm/src/main/java/jdbm/helper/SoftCache.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm/src/main/java/jdbm/helper/SoftCache.java?rev=951408&r1=951407&r2=951408&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm/src/main/java/jdbm/helper/SoftCache.java (original)
+++ directory/apacheds/trunk/jdbm/src/main/java/jdbm/helper/SoftCache.java Fri Jun  4 13:41:17
2010
@@ -47,12 +47,12 @@
 package jdbm.helper;
 
 
+import java.lang.ref.Reference;
 import java.lang.ref.ReferenceQueue;
 import java.lang.ref.SoftReference;
-import java.lang.ref.Reference;
 import java.util.Enumeration;
-import java.util.Map;
 import java.util.HashMap;
+import java.util.Map;
 
 import org.apache.directory.server.i18n.I18n;
 
@@ -136,7 +136,7 @@ public class SoftCache implements CacheP
     {
         if ( internal == null )
         {
-            throw new NullPointerException( I18n.err( I18n.ERR_531 ) );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_531 ) );
         }
         
         this.internal = internal;

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/LdapRequestHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/LdapRequestHandler.java?rev=951408&r1=951407&r2=951408&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/LdapRequestHandler.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/LdapRequestHandler.java
Fri Jun  4 13:41:17 2010
@@ -168,7 +168,7 @@ public abstract class LdapRequestHandler
                 // Reject all extended operations except StartTls  
                 InternalExtendedRequest req = ( InternalExtendedRequest ) message;
                 
-                if ( ! req.getID().equals( StartTlsHandler.EXTENSION_OID ) )
+                if ( ! req.getOid().equals( StartTlsHandler.EXTENSION_OID ) )
                 {
                     rejectWithoutConfidentiality( session, req.getResultResponse() );
                     return;

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchAbandonListener.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchAbandonListener.java?rev=951408&r1=951407&r2=951408&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchAbandonListener.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchAbandonListener.java
Fri Jun  4 13:41:17 2010
@@ -50,7 +50,7 @@ public class SearchAbandonListener imple
     {
         if ( ldapServer == null )
         {
-            throw new NullPointerException( "ldapServer" );
+            throw new IllegalArgumentException( "ldapServer" );
         }
         
         this.ldapServer = ldapServer;

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/ntlm/NtlmSaslServer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/ntlm/NtlmSaslServer.java?rev=951408&r1=951407&r2=951408&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/ntlm/NtlmSaslServer.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/ntlm/NtlmSaslServer.java
Fri Jun  4 13:41:17 2010
@@ -127,7 +127,7 @@ public class NtlmSaslServer extends Abst
     {
         if ( response == null )
         {
-            throw new NullPointerException( I18n.err( I18n.ERR_666 ) );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_666 ) );
         }
 
         if ( response.length == 0 )

Modified: directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
URL: http://svn.apache.org/viewvc/directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java?rev=951408&r1=951407&r2=951408&view=diff
==============================================================================
--- directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
(original)
+++ directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
Fri Jun  4 13:41:17 2010
@@ -729,7 +729,7 @@ public class LdapNetworkConnection exten
         {
             String msg = "Cannot add empty entry";
             LOG.debug( msg );
-            throw new NullPointerException( msg );
+            throw new IllegalArgumentException( msg );
         }
 
         return add( new AddRequest( entry ) );
@@ -745,7 +745,7 @@ public class LdapNetworkConnection exten
         {
             String msg = "Cannot add null entry";
             LOG.debug( msg );
-            throw new NullPointerException( msg );
+            throw new IllegalArgumentException( msg );
         }
 
         return addAsync( new AddRequest( entry ) );
@@ -1880,7 +1880,7 @@ public class LdapNetworkConnection exten
         if ( entry == null )
         {
             LOG.debug( "received a null entry for modification" );
-            throw new NullPointerException( "Entry to be modified cannot be null" );
+            throw new IllegalArgumentException( "Entry to be modified cannot be null" );
         }
 
         ModifyRequest modReq = new ModifyRequest( entry.getDn() );

Modified: directory/shared/trunk/cursor/src/main/java/org/apache/directory/shared/ldap/cursor/AbstractCursor.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/cursor/src/main/java/org/apache/directory/shared/ldap/cursor/AbstractCursor.java?rev=951408&r1=951407&r2=951408&view=diff
==============================================================================
--- directory/shared/trunk/cursor/src/main/java/org/apache/directory/shared/ldap/cursor/AbstractCursor.java
(original)
+++ directory/shared/trunk/cursor/src/main/java/org/apache/directory/shared/ldap/cursor/AbstractCursor.java
Fri Jun  4 13:41:17 2010
@@ -42,7 +42,7 @@ public abstract class AbstractCursor<E> 
     {
         if ( monitor == null )
         {
-            throw new NullPointerException( I18n.err( I18n.ERR_02001 ) );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_02001 ) );
         }
         
         this.monitor = monitor;

Modified: directory/shared/trunk/cursor/src/main/java/org/apache/directory/shared/ldap/cursor/AbstractTupleCursor.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/cursor/src/main/java/org/apache/directory/shared/ldap/cursor/AbstractTupleCursor.java?rev=951408&r1=951407&r2=951408&view=diff
==============================================================================
--- directory/shared/trunk/cursor/src/main/java/org/apache/directory/shared/ldap/cursor/AbstractTupleCursor.java
(original)
+++ directory/shared/trunk/cursor/src/main/java/org/apache/directory/shared/ldap/cursor/AbstractTupleCursor.java
Fri Jun  4 13:41:17 2010
@@ -40,8 +40,9 @@ public abstract class AbstractTupleCurso
     {
         if ( monitor == null )
         {
-            throw new NullPointerException( "monitor" );
+            throw new IllegalArgumentException( "monitor" );
         }
+        
         this.monitor = monitor;
     }
 

Modified: directory/shared/trunk/ldap-convert/src/main/java/org/apache/directory/shared/converter/schema/SchemaToLdif.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-convert/src/main/java/org/apache/directory/shared/converter/schema/SchemaToLdif.java?rev=951408&r1=951407&r2=951408&view=diff
==============================================================================
--- directory/shared/trunk/ldap-convert/src/main/java/org/apache/directory/shared/converter/schema/SchemaToLdif.java
(original)
+++ directory/shared/trunk/ldap-convert/src/main/java/org/apache/directory/shared/converter/schema/SchemaToLdif.java
Fri Jun  4 13:41:17 2010
@@ -118,7 +118,7 @@ public class SchemaToLdif
         if ( schema == null )
         {
             log.error( I18n.err( I18n.ERR_06005 ) );
-            throw new NullPointerException( I18n.err( I18n.ERR_06006 ) );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_06006 ) );
         }
 
         InputStream in = schema.getInput();

Modified: directory/shared/trunk/ldap-ldif/src/main/java/org/apache/directory/shared/ldap/ldif/LdifRevertor.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-ldif/src/main/java/org/apache/directory/shared/ldap/ldif/LdifRevertor.java?rev=951408&r1=951407&r2=951408&view=diff
==============================================================================
--- directory/shared/trunk/ldap-ldif/src/main/java/org/apache/directory/shared/ldap/ldif/LdifRevertor.java
(original)
+++ directory/shared/trunk/ldap-ldif/src/main/java/org/apache/directory/shared/ldap/ldif/LdifRevertor.java
Fri Jun  4 13:41:17 2010
@@ -25,9 +25,11 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 
+import javax.naming.NamingException;
+
 import org.apache.directory.shared.i18n.I18n;
-import org.apache.directory.shared.ldap.entry.DefaultModification;
 import org.apache.directory.shared.ldap.entry.DefaultEntryAttribute;
+import org.apache.directory.shared.ldap.entry.DefaultModification;
 import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.entry.Modification;
@@ -256,12 +258,12 @@ public class LdifRevertor
 
         if ( newSuperiorDn == null )
         {
-            throw new NullPointerException( I18n.err( I18n.ERR_12074 ) );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_12074 ) );
         }
 
         if ( modifiedDn == null )
         {
-            throw new NullPointerException( I18n.err( I18n.ERR_12075 ) );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_12075 ) );
         }
 
         if ( modifiedDn.size() == 0 )
@@ -433,12 +435,12 @@ public class LdifRevertor
 
         if ( newRdn == null )
         {
-            throw new NullPointerException( I18n.err( I18n.ERR_12077 ) );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_12077 ) );
         }
 
         if ( parentDn == null )
         {
-            throw new NullPointerException( I18n.err( I18n.ERR_12078 ) );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_12078 ) );
         }
 
         if ( parentDn.size() == 0 )

Modified: directory/shared/trunk/ldap-schema-loader/src/main/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaEntityFactory.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-schema-loader/src/main/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaEntityFactory.java?rev=951408&r1=951407&r2=951408&view=diff
==============================================================================
--- directory/shared/trunk/ldap-schema-loader/src/main/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaEntityFactory.java
(original)
+++ directory/shared/trunk/ldap-schema-loader/src/main/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaEntityFactory.java
Fri Jun  4 13:41:17 2010
@@ -101,7 +101,7 @@ public class SchemaEntityFactory impleme
         {
             String msg = I18n.err( I18n.ERR_10005, objectType, MetaSchemaConstants.M_OID_AT
);
             LOG.warn( msg );
-            throw new NullPointerException( msg );
+            throw new IllegalArgumentException( msg );
         }
 
         String oid = mOid.getString();
@@ -130,7 +130,7 @@ public class SchemaEntityFactory impleme
         {
             String msg = I18n.err( I18n.ERR_10005, objectType, MetaSchemaConstants.M_OID_AT
);
             LOG.warn( msg );
-            throw new NullPointerException( msg );
+            throw new IllegalArgumentException( msg );
         }
 
         if ( !OID.isOID( oid ) )
@@ -153,7 +153,7 @@ public class SchemaEntityFactory impleme
         {
             String msg = I18n.err( I18n.ERR_10007, schemaEntity );
             LOG.warn( msg );
-            throw new NullPointerException( msg );
+            throw new IllegalArgumentException( msg );
         }
     }
 
@@ -167,7 +167,7 @@ public class SchemaEntityFactory impleme
         {
             String msg = I18n.err( I18n.ERR_10008, schemaEntity );
             LOG.warn( msg );
-            throw new NullPointerException( msg );
+            throw new IllegalArgumentException( msg );
         }
     }
 
@@ -993,7 +993,7 @@ public class SchemaEntityFactory impleme
         {
             String msg = I18n.err( I18n.ERR_10028, objectType, MetaSchemaConstants.M_FQCN_AT
);
             LOG.warn( msg );
-            throw new NullPointerException( msg );
+            throw new IllegalArgumentException( msg );
         }
 
         return mFqcn.getString();
@@ -1012,30 +1012,13 @@ public class SchemaEntityFactory impleme
         {
             String msg = I18n.err( I18n.ERR_10028, objectType, MetaSchemaConstants.M_FQCN_AT
);
             LOG.warn( msg );
-            throw new NullPointerException( msg );
+            throw new IllegalArgumentException( msg );
         }
 
         return mFqcn;
     }
 
-
-    /*
-     * Process the ByteCode attribute
-     */
-    //    private EntryAttribute getByteCode( Entry entry, String objectType )
-    //    {
-    //        EntryAttribute byteCode = entry.get( MetaSchemaConstants.M_BYTECODE_AT );
-    //
-    //        if ( byteCode == null )
-    //        {
-    //            String msg = I18n.err( I18n.ERR_10028, objectType, MetaSchemaConstants.M_BYTECODE_AT
);
-    //            LOG.warn( msg );
-    //            throw new NullPointerException( msg );
-    //        }
-    //
-    //        return byteCode;
-    //    }
-
+    
     /**
      * Process the ByteCode attribute
      */
@@ -1047,7 +1030,7 @@ public class SchemaEntityFactory impleme
         {
             String msg = I18n.err( I18n.ERR_10028, objectType, MetaSchemaConstants.M_BYTECODE_AT
);
             LOG.warn( msg );
-            throw new NullPointerException( msg );
+            throw new IllegalArgumentException( msg );
         }
 
         byte[] bytecode = Base64.decode( byteCodeString.toCharArray() );

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ACIItem.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ACIItem.java?rev=951408&r1=951407&r2=951408&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ACIItem.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ACIItem.java
Fri Jun  4 13:41:17 2010
@@ -61,15 +61,17 @@ public abstract class ACIItem implements
     {
         if ( identificationTag == null )
         {
-            throw new NullPointerException( I18n.err( I18n.ERR_04001 ) );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_04001 ) );
         }
+        
         if ( precedence < 0 || precedence > 255 )
         {
             throw new IllegalArgumentException( I18n.err( I18n.ERR_04002, precedence ) );
         }
+        
         if ( authenticationLevel == null )
         {
-            throw new NullPointerException( I18n.err( I18n.ERR_04003 ) );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_04003 ) );
         }
 
         this.identificationTag = identificationTag;

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ACITuple.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ACITuple.java?rev=951408&r1=951407&r2=951408&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ACITuple.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ACITuple.java
Fri Jun  4 13:41:17 2010
@@ -81,7 +81,7 @@ public class ACITuple implements Seriali
     {
         if ( authenticationLevel == null )
         {
-            throw new NullPointerException( I18n.err( I18n.ERR_04003) );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_04003) );
         }
 
         if ( precedence < 0 || precedence > 255 )

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ProtectedItem.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ProtectedItem.java?rev=951408&r1=951407&r2=951408&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ProtectedItem.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ProtectedItem.java
Fri Jun  4 13:41:17 2010
@@ -623,7 +623,7 @@ public abstract class ProtectedItem impl
         {
             if ( filter == null )
             {
-                throw new NullPointerException( "filter" );
+                throw new IllegalArgumentException( "filter" );
             }
 
             this.filter = filter;

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/AbstractSchemaLoader.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/AbstractSchemaLoader.java?rev=951408&r1=951407&r2=951408&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/AbstractSchemaLoader.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/AbstractSchemaLoader.java
Fri Jun  4 13:41:17 2010
@@ -135,7 +135,7 @@ public abstract class AbstractSchemaLoad
     {
         if ( entry == null )
         {
-            throw new NullPointerException( I18n.err( I18n.ERR_04261 ) );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_04261 ) );
         }
 
         EntryAttribute objectClasses = entry.get( SchemaConstants.OBJECT_CLASS_AT );
@@ -162,14 +162,14 @@ public abstract class AbstractSchemaLoad
 
         if ( entry.get( SchemaConstants.CN_AT ) == null )
         {
-            throw new NullPointerException( I18n.err( I18n.ERR_04262 ) );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_04262 ) );
         }
 
         name = entry.get( SchemaConstants.CN_AT ).getString();
 
         if ( entry.get( SchemaConstants.CREATORS_NAME_AT ) == null )
         {
-            throw new NullPointerException( "entry must have a valid " + SchemaConstants.CREATORS_NAME_AT
+            throw new IllegalArgumentException( "entry must have a valid " + SchemaConstants.CREATORS_NAME_AT
                 + " attribute" );
         }
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/DefaultSchema.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/DefaultSchema.java?rev=951408&r1=951407&r2=951408&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/DefaultSchema.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/DefaultSchema.java
Fri Jun  4 13:41:17 2010
@@ -105,7 +105,7 @@ public class DefaultSchema implements Sc
     {
         if ( name == null )
         {
-            throw new NullPointerException( I18n.err( I18n.ERR_04266 ) );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_04266 ) );
         }
         
         this.name = name;

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/AttributeUtils.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/AttributeUtils.java?rev=951408&r1=951407&r2=951408&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/AttributeUtils.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/AttributeUtils.java
Fri Jun  4 13:41:17 2010
@@ -31,6 +31,9 @@ import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
 import javax.naming.directory.BasicAttribute;
 import javax.naming.directory.BasicAttributes;
+import javax.naming.directory.InvalidAttributeIdentifierException;
+import javax.naming.ldap.ExtendedRequest;
+import javax.naming.ldap.ExtendedResponse;
 
 import org.apache.commons.lang.ArrayUtils;
 import org.apache.directory.shared.i18n.I18n;
@@ -42,6 +45,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.entry.Value;
 import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeTypeException;
+import org.apache.directory.shared.ldap.message.internal.InternalExtendedRequest;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.MatchingRule;
@@ -1325,4 +1329,55 @@ public class AttributeUtils
             return null;
         }
     }
+    
+    
+    public static ExtendedRequest toJndiExtendedRequest( final InternalExtendedRequest request
)
+    {
+        class JndiExtendedRequest implements ExtendedRequest
+        {
+            public ExtendedResponse createExtendedResponse( String id, byte[] berValue, int
offset, int length )
+                throws NamingException
+            {
+                return toJndiExtendedResponse( request );
+            }
+
+            public byte[] getEncodedValue()
+            {
+                return request.getPayload();
+            }
+
+            public String getID()
+            {
+                return request.getOid();
+            }
+            
+        } 
+        
+        return new JndiExtendedRequest();
+    }
+    
+    
+    /**
+     * TODO toJndiExtendedResponse. This is NOT correct ATM
+     *
+     * @param request
+     * @return
+     */
+    public static ExtendedResponse toJndiExtendedResponse( final InternalExtendedRequest
request )
+    {
+        class JndiExtendedResponse implements ExtendedResponse
+        {
+            public byte[] getEncodedValue()
+            {
+                return request.getEncodedValue();
+            }
+
+            public String getID()
+            {
+                return request.getID();
+            }
+        } 
+        
+        return new JndiExtendedResponse();
+    }
 }



Mime
View raw message