directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1671507 - in /directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/model: OlcConfig.java OlcDatabaseConfig.java OlcGlobal.java OlcMdbConfig.java
Date Mon, 06 Apr 2015 10:38:03 GMT
Author: elecharny
Date: Mon Apr  6 10:38:02 2015
New Revision: 1671507

URL: http://svn.apache.org/r1671507
Log:
All the List<String> attribute are now copied instead of simply stored, to avoid a modification
of a shared list.

Modified:
    directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/model/OlcConfig.java
    directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/model/OlcDatabaseConfig.java
    directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/model/OlcGlobal.java
    directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/model/OlcMdbConfig.java

Modified: directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/model/OlcConfig.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/model/OlcConfig.java?rev=1671507&r1=1671506&r2=1671507&view=diff
==============================================================================
--- directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/model/OlcConfig.java
(original)
+++ directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/model/OlcConfig.java
Mon Apr  6 10:38:02 2015
@@ -94,4 +94,19 @@ public class OlcConfig
     {
         this.parentDn = parentDn;
     }
+
+
+    /**
+     * Copy a List of Strings into a new List of strings.
+     * 
+     * @param original The list to copy
+     * @return The copied list
+     */
+    protected List<String> copyListString( List<String> original )
+    {
+        List<String> copy = new ArrayList<String>( original.size() );
+        copy.addAll( original );
+
+        return copy;
+    }
 }

Modified: directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/model/OlcDatabaseConfig.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/model/OlcDatabaseConfig.java?rev=1671507&r1=1671506&r2=1671507&view=diff
==============================================================================
--- directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/model/OlcDatabaseConfig.java
(original)
+++ directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/model/OlcDatabaseConfig.java
Mon Apr  6 10:38:02 2015
@@ -465,7 +465,7 @@ public class OlcDatabaseConfig extends O
      */
     public List<String> getOlcAccess()
     {
-        return olcAccess;
+        return copyListString( olcAccess );
     }
 
 
@@ -501,7 +501,7 @@ public class OlcDatabaseConfig extends O
      */
     public List<String> getOlcExtraAttrs()
     {
-        return olcExtraAttrs;
+        return copyListString( olcExtraAttrs );
     }
 
 
@@ -528,7 +528,7 @@ public class OlcDatabaseConfig extends O
      */
     public List<String> getOlcLimits()
     {
-        return olcLimits;
+        return copyListString( olcLimits );
     }
 
 
@@ -564,7 +564,7 @@ public class OlcDatabaseConfig extends O
      */
     public List<String> getOlcPlugin()
     {
-        return olcPlugin;
+        return copyListString( olcPlugin );
     }
 
 
@@ -582,7 +582,7 @@ public class OlcDatabaseConfig extends O
      */
     public List<String> getOlcReplica()
     {
-        return olcReplica;
+        return copyListString( olcReplica );
     }
 
 
@@ -627,7 +627,7 @@ public class OlcDatabaseConfig extends O
      */
     public List<String> getOlcRequires()
     {
-        return olcRequires;
+        return copyListString( olcRequires );
     }
 
 
@@ -636,7 +636,7 @@ public class OlcDatabaseConfig extends O
      */
     public List<String> getOlcRestrict()
     {
-        return olcRestrict;
+        return copyListString( olcRestrict );
     }
 
 
@@ -672,7 +672,7 @@ public class OlcDatabaseConfig extends O
      */
     public List<String> getOlcSecurity()
     {
-        return olcSecurity;
+        return copyListString( olcSecurity );
     }
 
 
@@ -708,7 +708,7 @@ public class OlcDatabaseConfig extends O
      */
     public List<String> getOlcSyncrepl()
     {
-        return olcSyncrepl;
+        return copyListString( olcSyncrepl );
     }
 
 
@@ -726,7 +726,7 @@ public class OlcDatabaseConfig extends O
      */
     public List<String> getOlcTimeLimit()
     {
-        return olcTimeLimit;
+        return copyListString( olcTimeLimit );
     }
 
 
@@ -744,7 +744,7 @@ public class OlcDatabaseConfig extends O
      */
     public List<String> getOlcUpdateRef()
     {
-        return olcUpdateRef;
+        return copyListString( olcUpdateRef );
     }
 
 
@@ -799,7 +799,7 @@ public class OlcDatabaseConfig extends O
      */
     public void setOlcAccess( List<String> olcAccess )
     {
-        this.olcAccess = olcAccess;
+        this.olcAccess = copyListString( olcAccess );
     }
 
 
@@ -835,7 +835,7 @@ public class OlcDatabaseConfig extends O
      */
     public void setOlcExtraAttrs( List<String> olcExtraAttrs )
     {
-        this.olcExtraAttrs = olcExtraAttrs;
+        this.olcExtraAttrs = copyListString( olcExtraAttrs );
     }
 
 
@@ -862,7 +862,7 @@ public class OlcDatabaseConfig extends O
      */
     public void setOlcLimits( List<String> olcLimits )
     {
-        this.olcLimits = olcLimits;
+        this.olcLimits = copyListString( olcLimits );
     }
 
 
@@ -898,7 +898,7 @@ public class OlcDatabaseConfig extends O
      */
     public void setOlcPlugin( List<String> olcPlugin )
     {
-        this.olcPlugin = olcPlugin;
+        this.olcPlugin = copyListString( olcPlugin );
     }
 
 
@@ -916,7 +916,7 @@ public class OlcDatabaseConfig extends O
      */
     public void setOlcReplica( List<String> olcReplica )
     {
-        this.olcReplica = olcReplica;
+        this.olcReplica = copyListString( olcReplica );
     }
 
 
@@ -961,7 +961,7 @@ public class OlcDatabaseConfig extends O
      */
     public void setOlcRequires( List<String> olcRequires )
     {
-        this.olcRequires = olcRequires;
+        this.olcRequires = copyListString( olcRequires );
     }
 
 
@@ -970,7 +970,7 @@ public class OlcDatabaseConfig extends O
      */
     public void setOlcRestrict( List<String> olcRestrict )
     {
-        this.olcRestrict = olcRestrict;
+        this.olcRestrict = copyListString( olcRestrict );
     }
 
 
@@ -1006,7 +1006,7 @@ public class OlcDatabaseConfig extends O
      */
     public void setOlcSecurity( List<String> olcSecurity )
     {
-        this.olcSecurity = olcSecurity;
+        this.olcSecurity = copyListString( olcSecurity );
     }
 
 
@@ -1042,7 +1042,7 @@ public class OlcDatabaseConfig extends O
      */
     public void setOlcSyncrepl( List<String> olcSyncrepl )
     {
-        this.olcSyncrepl = olcSyncrepl;
+        this.olcSyncrepl = copyListString( olcSyncrepl );
     }
 
 
@@ -1060,7 +1060,7 @@ public class OlcDatabaseConfig extends O
      */
     public void setOlcTimeLimit( List<String> olcTimeLimit )
     {
-        this.olcTimeLimit = olcTimeLimit;
+        this.olcTimeLimit = copyListString( olcTimeLimit );
     }
 
 
@@ -1078,7 +1078,7 @@ public class OlcDatabaseConfig extends O
      */
     public void setOlcUpdateRef( List<String> olcUpdateRef )
     {
-        this.olcUpdateRef = olcUpdateRef;
+        this.olcUpdateRef = copyListString( olcUpdateRef );
     }
 
 

Modified: directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/model/OlcGlobal.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/model/OlcGlobal.java?rev=1671507&r1=1671506&r2=1671507&view=diff
==============================================================================
--- directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/model/OlcGlobal.java
(original)
+++ directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/model/OlcGlobal.java
Mon Apr  6 10:38:02 2015
@@ -829,7 +829,7 @@ public class OlcGlobal extends OlcConfig
      */
     public List<String> getCn()
     {
-        return cn;
+        return copyListString( cn );
     }
 
 
@@ -838,7 +838,7 @@ public class OlcGlobal extends OlcConfig
      */
     public List<String> getOlcAllows()
     {
-        return olcAllows;
+        return copyListString( olcAllows );
     }
 
 
@@ -856,7 +856,7 @@ public class OlcGlobal extends OlcConfig
      */
     public List<String> getOlcAttributeOptions()
     {
-        return olcAttributeOptions;
+        return copyListString( olcAttributeOptions );
     }
 
 
@@ -865,7 +865,7 @@ public class OlcGlobal extends OlcConfig
      */
     public List<String> getOlcAttributeTypes()
     {
-        return olcAttributeTypes;
+        return copyListString( olcAttributeTypes );
     }
 
 
@@ -874,7 +874,7 @@ public class OlcGlobal extends OlcConfig
      */
     public List<String> getOlcAuthIDRewrite()
     {
-        return olcAuthIDRewrite;
+        return copyListString( olcAuthIDRewrite );
     }
 
 
@@ -892,7 +892,7 @@ public class OlcGlobal extends OlcConfig
      */
     public List<String> getOlcAuthzRegexp()
     {
-        return olcAuthzRegexp;
+        return copyListString( olcAuthzRegexp );
     }
 
 
@@ -946,7 +946,7 @@ public class OlcGlobal extends OlcConfig
      */
     public List<String> getOlcDisallows()
     {
-        return olcDisallows;
+        return copyListString( olcDisallows );
     }
 
 
@@ -955,7 +955,7 @@ public class OlcGlobal extends OlcConfig
      */
     public List<String> getOlcDitContentRules()
     {
-        return olcDitContentRules;
+        return copyListString( olcDitContentRules );
     }
 
 
@@ -1036,7 +1036,7 @@ public class OlcGlobal extends OlcConfig
      */
     public List<String> getOlcLdapSyntaxes()
     {
-        return olcLdapSyntaxes;
+        return copyListString( olcLdapSyntaxes );
     }
 
 
@@ -1072,7 +1072,7 @@ public class OlcGlobal extends OlcConfig
      */
     public List<String> getOlcLogLevel()
     {
-        return olcLogLevel;
+        return copyListString( olcLogLevel );
     }
 
 
@@ -1081,7 +1081,7 @@ public class OlcGlobal extends OlcConfig
      */
     public List<String> getOlcObjectClasses()
     {
-        return olcObjectClasses;
+        return copyListString( olcObjectClasses );
     }
 
 
@@ -1090,7 +1090,7 @@ public class OlcGlobal extends OlcConfig
      */
     public List<String> getOlcObjectIdentifier()
     {
-        return olcObjectIdentifier;
+        return copyListString( olcObjectIdentifier );
     }
 
 
@@ -1108,7 +1108,7 @@ public class OlcGlobal extends OlcConfig
      */
     public List<String> getOlcPasswordHash()
     {
-        return olcPasswordHash;
+        return copyListString( olcPasswordHash );
     }
 
 
@@ -1162,7 +1162,7 @@ public class OlcGlobal extends OlcConfig
      */
     public List<String> getOlcRequires()
     {
-        return olcRequires;
+        return copyListString( olcRequires );
     }
 
 
@@ -1180,7 +1180,7 @@ public class OlcGlobal extends OlcConfig
      */
     public List<String> getOlcRestrict()
     {
-        return olcRestrict;
+        return copyListString( olcRestrict );
     }
 
 
@@ -1189,7 +1189,7 @@ public class OlcGlobal extends OlcConfig
      */
     public List<String> getOlcRootDSE()
     {
-        return olcRootDSE;
+        return copyListString( olcRootDSE );
     }
 
 
@@ -1252,7 +1252,7 @@ public class OlcGlobal extends OlcConfig
      */
     public List<String> getOlcSecurity()
     {
-        return olcSecurity;
+        return copyListString( olcSecurity );
     }
 
 
@@ -1261,7 +1261,7 @@ public class OlcGlobal extends OlcConfig
      */
     public List<String> getOlcServerID()
     {
-        return olcServerID;
+        return copyListString( olcServerID );
     }
 
 
@@ -1297,7 +1297,7 @@ public class OlcGlobal extends OlcConfig
      */
     public List<String> getOlcTCPBuffer()
     {
-        return olcTCPBuffer;
+        return copyListString( olcTCPBuffer );
     }
 
 
@@ -1324,7 +1324,7 @@ public class OlcGlobal extends OlcConfig
      */
     public List<String> getOlcTimeLimit()
     {
-        return olcTimeLimit;
+        return copyListString( olcTimeLimit );
     }
 
 
@@ -1459,7 +1459,7 @@ public class OlcGlobal extends OlcConfig
      */
     public void setCn( List<String> cn )
     {
-        this.cn = cn;
+        this.cn = copyListString( cn );
     }
 
 
@@ -1468,7 +1468,7 @@ public class OlcGlobal extends OlcConfig
      */
     public void setOlcAllows( List<String> olcAllows )
     {
-        this.olcAllows = olcAllows;
+        this.olcAllows = copyListString( olcAllows );
     }
 
 
@@ -1486,7 +1486,7 @@ public class OlcGlobal extends OlcConfig
      */
     public void setOlcAttributeOptions( List<String> olcAttributeOptions )
     {
-        this.olcAttributeOptions = olcAttributeOptions;
+        this.olcAttributeOptions = copyListString( olcAttributeOptions );
     }
 
 
@@ -1495,7 +1495,7 @@ public class OlcGlobal extends OlcConfig
      */
     public void setOlcAttributeTypes( List<String> olcAttributeTypes )
     {
-        this.olcAttributeTypes = olcAttributeTypes;
+        this.olcAttributeTypes = copyListString( olcAttributeTypes );
     }
 
 
@@ -1504,7 +1504,7 @@ public class OlcGlobal extends OlcConfig
      */
     public void setOlcAuthIDRewrite( List<String> olcAuthIDRewrite )
     {
-        this.olcAuthIDRewrite = olcAuthIDRewrite;
+        this.olcAuthIDRewrite = copyListString( olcAuthIDRewrite );
     }
 
 
@@ -1522,7 +1522,7 @@ public class OlcGlobal extends OlcConfig
      */
     public void setOlcAuthzRegexp( List<String> olcAuthzRegexp )
     {
-        this.olcAuthzRegexp = olcAuthzRegexp;
+        this.olcAuthzRegexp = copyListString( olcAuthzRegexp );
     }
 
 
@@ -1576,7 +1576,7 @@ public class OlcGlobal extends OlcConfig
      */
     public void setOlcDisallows( List<String> olcDisallows )
     {
-        this.olcDisallows = olcDisallows;
+        this.olcDisallows = copyListString( olcDisallows );
     }
 
 
@@ -1585,7 +1585,7 @@ public class OlcGlobal extends OlcConfig
      */
     public void setOlcDitContentRules( List<String> olcDitContentRules )
     {
-        this.olcDitContentRules = olcDitContentRules;
+        this.olcDitContentRules = copyListString( olcDitContentRules );
     }
 
 
@@ -1666,7 +1666,7 @@ public class OlcGlobal extends OlcConfig
      */
     public void setOlcLdapSyntaxes( List<String> olcLdapSyntaxes )
     {
-        this.olcLdapSyntaxes = olcLdapSyntaxes;
+        this.olcLdapSyntaxes = copyListString( olcLdapSyntaxes );
     }
 
 
@@ -1702,7 +1702,7 @@ public class OlcGlobal extends OlcConfig
      */
     public void setOlcLogLevel( List<String> olcLogLevel )
     {
-        this.olcLogLevel = olcLogLevel;
+        this.olcLogLevel = copyListString( olcLogLevel );
     }
 
 
@@ -1711,7 +1711,7 @@ public class OlcGlobal extends OlcConfig
      */
     public void setOlcObjectClasses( List<String> olcObjectClasses )
     {
-        this.olcObjectClasses = olcObjectClasses;
+        this.olcObjectClasses = copyListString( olcObjectClasses );
     }
 
 
@@ -1720,7 +1720,7 @@ public class OlcGlobal extends OlcConfig
      */
     public void setOlcObjectIdentifier( List<String> olcObjectIdentifier )
     {
-        this.olcObjectIdentifier = olcObjectIdentifier;
+        this.olcObjectIdentifier = copyListString( olcObjectIdentifier );
     }
 
 
@@ -1738,7 +1738,7 @@ public class OlcGlobal extends OlcConfig
      */
     public void setOlcPasswordHash( List<String> olcPasswordHash )
     {
-        this.olcPasswordHash = olcPasswordHash;
+        this.olcPasswordHash = copyListString( olcPasswordHash );
     }
 
 
@@ -1792,7 +1792,7 @@ public class OlcGlobal extends OlcConfig
      */
     public void setOlcRequires( List<String> olcRequires )
     {
-        this.olcRequires = olcRequires;
+        this.olcRequires = copyListString( olcRequires );
     }
 
 
@@ -1810,7 +1810,7 @@ public class OlcGlobal extends OlcConfig
      */
     public void setOlcRestrict( List<String> olcRestrict )
     {
-        this.olcRestrict = olcRestrict;
+        this.olcRestrict = copyListString( olcRestrict );
     }
 
 
@@ -1819,7 +1819,7 @@ public class OlcGlobal extends OlcConfig
      */
     public void setOlcRootDSE( List<String> olcRootDSE )
     {
-        this.olcRootDSE = olcRootDSE;
+        this.olcRootDSE = copyListString( olcRootDSE );
     }
 
 
@@ -1882,7 +1882,7 @@ public class OlcGlobal extends OlcConfig
      */
     public void setOlcSecurity( List<String> olcSecurity )
     {
-        this.olcSecurity = olcSecurity;
+        this.olcSecurity = copyListString( olcSecurity );
     }
 
 
@@ -1891,7 +1891,7 @@ public class OlcGlobal extends OlcConfig
      */
     public void setOlcServerID( List<String> olcServerID )
     {
-        this.olcServerID = olcServerID;
+        this.olcServerID = copyListString( olcServerID );
     }
 
 
@@ -1927,7 +1927,7 @@ public class OlcGlobal extends OlcConfig
      */
     public void setOlcTCPBuffer( List<String> olcTCPBuffer )
     {
-        this.olcTCPBuffer = olcTCPBuffer;
+        this.olcTCPBuffer = copyListString( olcTCPBuffer );
     }
 
 
@@ -1954,7 +1954,7 @@ public class OlcGlobal extends OlcConfig
      */
     public void setOlcTimeLimit( List<String> olcTimeLimit )
     {
-        this.olcTimeLimit = olcTimeLimit;
+        this.olcTimeLimit = copyListString( olcTimeLimit );
     }
 
 

Modified: directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/model/OlcMdbConfig.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/model/OlcMdbConfig.java?rev=1671507&r1=1671506&r2=1671507&view=diff
==============================================================================
--- directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/model/OlcMdbConfig.java
(original)
+++ directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/model/OlcMdbConfig.java
Mon Apr  6 10:38:02 2015
@@ -169,7 +169,7 @@ public class OlcMdbConfig extends OlcDat
      */
     public List<String> getOlcDbIndex()
     {
-        return olcDbIndex;
+        return copyListString( olcDbIndex );
     }
 
 
@@ -178,7 +178,7 @@ public class OlcMdbConfig extends OlcDat
      */
     public List<String> getOlcDbEnvFlags()
     {
-        return olcDbEnvFlags;
+        return copyListString( olcDbEnvFlags );
     }
 
 
@@ -259,7 +259,7 @@ public class OlcMdbConfig extends OlcDat
      */
     public void setOlcDbIndex( List<String> olcDbIndex )
     {
-        this.olcDbIndex = olcDbIndex;
+        this.olcDbIndex = copyListString( olcDbIndex );
     }
 
 
@@ -268,7 +268,7 @@ public class OlcMdbConfig extends OlcDat
      */
     public void setOlcDbEnvFlagsx( List<String> olcDbEnvFlags )
     {
-        this.olcDbEnvFlags = olcDbEnvFlags;
+        this.olcDbEnvFlags = copyListString( olcDbEnvFlags );
     }
 
 



Mime
View raw message