You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2009/09/26 19:02:08 UTC
svn commit: r819175 - in /directory:
apacheds/branches/apacheds-schema/core-entry/src/test/java/org/apache/directory/server/core/entry/
shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/
Author: elecharny
Date: Sat Sep 26 17:02:08 2009
New Revision: 819175
URL: http://svn.apache.org/viewvc?rev=819175&view=rev
Log:
As some method does not anymore throw an exception, removed the useless try {} catch code
Modified:
directory/apacheds/branches/apacheds-schema/core-entry/src/test/java/org/apache/directory/server/core/entry/ServerStringValueTest.java
directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/AttributeTypeRegistry.java
Modified: directory/apacheds/branches/apacheds-schema/core-entry/src/test/java/org/apache/directory/server/core/entry/ServerStringValueTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-entry/src/test/java/org/apache/directory/server/core/entry/ServerStringValueTest.java?rev=819175&r1=819174&r2=819175&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-entry/src/test/java/org/apache/directory/server/core/entry/ServerStringValueTest.java (original)
+++ directory/apacheds/branches/apacheds-schema/core-entry/src/test/java/org/apache/directory/server/core/entry/ServerStringValueTest.java Sat Sep 26 17:02:08 2009
@@ -20,6 +20,13 @@
package org.apache.directory.server.core.entry;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotSame;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
@@ -41,14 +48,6 @@
import org.apache.directory.shared.ldap.schema.normalizers.DeepTrimToLowerNormalizer;
import org.apache.directory.shared.ldap.schema.normalizers.NoOpNormalizer;
import org.apache.directory.shared.ldap.schema.syntaxCheckers.AcceptAllSyntaxChecker;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotSame;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
import org.junit.Before;
import org.junit.Test;
@@ -656,14 +655,7 @@
return 1;
}
- try
- {
- return mr.getLdapComparator().compare( n1, n2 );
- }
- catch ( NamingException ne )
- {
- throw new IllegalStateException( "Normalization and comparison should succeed!", ne );
- }
+ return mr.getLdapComparator().compare( n1, n2 );
}
};
Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/AttributeTypeRegistry.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/AttributeTypeRegistry.java?rev=819175&r1=819174&r2=819175&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/AttributeTypeRegistry.java (original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/AttributeTypeRegistry.java Sat Sep 26 17:02:08 2009
@@ -291,33 +291,26 @@
*/
private void addMappingFor( AttributeType attributeType ) throws NamingException
{
- try
+ MatchingRule matchingRule = attributeType.getEquality();
+ OidNormalizer oidNormalizer;
+ String oid = attributeType.getOid();
+
+ if ( matchingRule == null )
{
- MatchingRule matchingRule = attributeType.getEquality();
- OidNormalizer oidNormalizer;
- String oid = attributeType.getOid();
-
- if ( matchingRule == null )
- {
- LOG.debug( "Attribute {} does not have normalizer : using NoopNormalizer", attributeType.getName() );
- oidNormalizer = new OidNormalizer( oid, new NoOpNormalizer( attributeType.getOid() ) );
- }
- else
- {
- oidNormalizer = new OidNormalizer( oid, matchingRule.getNormalizer() );
- }
-
- oidNormalizerMap.put( oid, oidNormalizer );
-
- // Also inject the attributeType's short names in the map
- for ( String name : attributeType.getNames() )
- {
- oidNormalizerMap.put( name.toLowerCase(), oidNormalizer );
- }
+ LOG.debug( "Attribute {} does not have normalizer : using NoopNormalizer", attributeType.getName() );
+ oidNormalizer = new OidNormalizer( oid, new NoOpNormalizer( attributeType.getOid() ) );
}
- catch ( NamingException ne )
+ else
{
- throw new NoSuchAttributeException( ne.getMessage() );
+ oidNormalizer = new OidNormalizer( oid, matchingRule.getNormalizer() );
+ }
+
+ oidNormalizerMap.put( oid, oidNormalizer );
+
+ // Also inject the attributeType's short names in the map
+ for ( String name : attributeType.getNames() )
+ {
+ oidNormalizerMap.put( name.toLowerCase(), oidNormalizer );
}
}