directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1096597 - /directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/registries/DefaultSchema.java
Date Mon, 25 Apr 2011 20:48:43 GMT
Author: elecharny
Date: Mon Apr 25 20:48:43 2011
New Revision: 1096597

URL: http://svn.apache.org/viewvc?rev=1096597&view=rev
Log:
Copied the parameters in the dependencies (instead of replacing it)

Modified:
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/registries/DefaultSchema.java

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/registries/DefaultSchema.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/registries/DefaultSchema.java?rev=1096597&r1=1096596&r2=1096597&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/registries/DefaultSchema.java
(original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/registries/DefaultSchema.java
Mon Apr 25 20:48:43 2011
@@ -119,7 +119,8 @@ public class DefaultSchema implements Sc
         
         if ( dependencies != null )
         {
-            this.dependencies = dependencies;
+            this.dependencies = new String[dependencies.length];
+            System.arraycopy( dependencies, 0, this.dependencies, 0, dependencies.length
);
         }
         else
         {
@@ -150,8 +151,21 @@ public class DefaultSchema implements Sc
     {
         if ( dependenciesToAdd != null )
         {
-            this.dependencies = new String[dependenciesToAdd.length];
-            System.arraycopy( dependenciesToAdd, 0, dependencies, 0, dependenciesToAdd.length
);
+            int start = 0;
+            
+            if ( dependencies == null )
+            {
+                dependencies = new String[dependenciesToAdd.length];
+            }
+            else
+            {
+                String[] tempDependencies = new String[ dependencies.length + dependenciesToAdd.length
];
+                System.arraycopy( tempDependencies, 0, dependencies, 0, dependencies.length
);
+                start = dependencies.length;
+                dependencies = tempDependencies;
+            }
+            
+            System.arraycopy( dependenciesToAdd, 0, dependenciesToAdd, start, dependenciesToAdd.length
);
         }
     }
 



Mime
View raw message