directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1697311 - in /directory/shared/trunk/ldap: model/src/main/java/org/apache/directory/api/ldap/model/ldif/ model/src/main/java/org/apache/directory/api/ldap/model/schema/ model/src/main/java/org/apache/directory/api/ldap/model/schema/compara...
Date Mon, 24 Aug 2015 03:55:55 GMT
Author: elecharny
Date: Mon Aug 24 03:55:54 2015
New Revision: 1697311

URL: http://svn.apache.org/r1697311
Log:
o Minor fixes for SringBuilder usage
o Protected the ClassLoader creation into a doPriviledge block

Modified:
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/LdifUtils.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/DescriptionUtils.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/comparators/SerializableComparator.java
    directory/shared/trunk/ldap/schema/data/src/main/java/org/apache/directory/api/ldap/schema/loader/SchemaEntityFactory.java

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/LdifUtils.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/LdifUtils.java?rev=1697311&r1=1697310&r2=1697311&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/LdifUtils.java
(original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/LdifUtils.java
Mon Aug 24 03:55:54 2015
@@ -599,15 +599,15 @@ public final class LdifUtils
 
                 if ( !LdifUtils.isLDIFSafe( str ) )
                 {
-                    lineBuffer.append( ":: " + encodeBase64( str ) );
+                    lineBuffer.append( ":: " ).append( encodeBase64( str ) );
                 }
                 else
                 {
-                    lineBuffer.append( ":" );
+                    lineBuffer.append( ':' );
 
                     if ( str != null )
                     {
-                        lineBuffer.append( " " ).append( str );
+                        lineBuffer.append( ' ' ).append( str );
                     }
                 }
             }
@@ -619,7 +619,7 @@ public final class LdifUtils
                 lineBuffer.append( ":: " + new String( encoded ) );
             }
 
-            lineBuffer.append( "\n" );
+            lineBuffer.append( '\n' );
             sb.append( stripLineToNChars( lineBuffer.toString(), length ) );
         }
 

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/DescriptionUtils.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/DescriptionUtils.java?rev=1697311&r1=1697310&r2=1697311&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/DescriptionUtils.java
(original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/DescriptionUtils.java
Mon Aug 24 03:55:54 2015
@@ -134,7 +134,7 @@ public final class DescriptionUtils
     {
         for ( Map.Entry<String, List<String>> extension : extensions.entrySet()
)
         {
-            sb.append( " " + extension.getKey() ).append( " " );
+            sb.append( ' ' ).append( extension.getKey() ).append( ' ' );
 
             List<String> values = extension.getValue();
 
@@ -157,7 +157,7 @@ public final class DescriptionUtils
                         }
                         else
                         {
-                            sb.append( " " );
+                            sb.append( ' ' );
                         }
 
                         sb.append( value );

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/comparators/SerializableComparator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/comparators/SerializableComparator.java?rev=1697311&r1=1697310&r2=1697311&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/comparators/SerializableComparator.java
(original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/comparators/SerializableComparator.java
Mon Aug 24 03:55:54 2015
@@ -51,9 +51,11 @@ public class SerializableComparator<E> e
     private transient SchemaManager schemaManager;
 
 
-    // ------------------------------------------------------------------------
-    // C O N T R U C T O R S
-    // ------------------------------------------------------------------------
+    /**
+     * Creates a new instance of SerializableComparator.
+     *
+     * @param matchingRuleOid The MatchingRule OID
+     */
     public SerializableComparator( String matchingRuleOid )
     {
         super( matchingRuleOid );
@@ -109,7 +111,6 @@ public class SerializableComparator<E> e
         }
 
         ( ( LdapComparator<E> ) wrapped ).setSchemaManager( schemaManager );
-        super.setSchemaManager( schemaManager );
         this.schemaManager = schemaManager;
     }
 }

Modified: directory/shared/trunk/ldap/schema/data/src/main/java/org/apache/directory/api/ldap/schema/loader/SchemaEntityFactory.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/schema/data/src/main/java/org/apache/directory/api/ldap/schema/loader/SchemaEntityFactory.java?rev=1697311&r1=1697310&r2=1697311&view=diff
==============================================================================
--- directory/shared/trunk/ldap/schema/data/src/main/java/org/apache/directory/api/ldap/schema/loader/SchemaEntityFactory.java
(original)
+++ directory/shared/trunk/ldap/schema/data/src/main/java/org/apache/directory/api/ldap/schema/loader/SchemaEntityFactory.java
Mon Aug 24 03:55:54 2015
@@ -21,6 +21,8 @@ package org.apache.directory.api.ldap.sc
 
 
 import java.lang.reflect.Constructor;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 import java.util.ArrayList;
 import java.util.HashSet;
 import java.util.List;
@@ -93,7 +95,13 @@ public class SchemaEntityFactory impleme
      */
     public SchemaEntityFactory()
     {
-        this.classLoader = new AttributeClassLoader();
+        this.classLoader = AccessController.doPrivileged( new PrivilegedAction<AttributeClassLoader>()
+        {
+            public AttributeClassLoader run() 
+            {
+                return new AttributeClassLoader();
+            }
+        } );
     }
 
 



Mime
View raw message