directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r1060707 - /directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
Date Wed, 19 Jan 2011 08:10:29 GMT
Author: kayyagari
Date: Wed Jan 19 08:10:28 2011
New Revision: 1060707

URL: http://svn.apache.org/viewvc?rev=1060707&view=rev
Log:
o included attribute names for better understanding of the attributes present in the reported
error

Modified:
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java?rev=1060707&r1=1060706&r2=1060707&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
Wed Jan 19 08:10:28 2011
@@ -1627,11 +1627,28 @@ public class SchemaInterceptor extends B
 
         if ( must.size() != 0 )
         {
+            // include AT names for better error reporting
+            StringBuilder sb = new StringBuilder();
+            sb.append( '[' );
+            
+            for( String oid: must )
+            {
+                String name = schemaManager.getAttributeType( oid ).getName();
+                sb.append( name )
+                  .append( '(' )
+                  .append( oid )
+                  .append( "), " );
+            }
+            
+            int end = sb.length();
+            sb.replace( end - 2, end, "" ); // remove the trailing ', '
+            sb.append( ']' );
+            
             throw new LdapSchemaViolationException( ResultCodeEnum.OBJECT_CLASS_VIOLATION,
I18n.err( I18n.ERR_279,
-                must, dn.getName() ) );
+                sb, dn.getName() ) );
         }
     }
-
+    
 
     /**
      * Checck that OC does not conflict :



Mime
View raw message