Free cookie consent management tool by TermsFeed Policy Generator

Changeset 889


Ignore:
Timestamp:
12/02/08 23:01:39 (15 years ago)
Author:
gkronber
Message:

fixed bugs

#285 (Cloning could be improved by creating objects at the bottom of the cloning chain with 'new' instead of the top with Activator.CreateInstance())

Location:
branches/CloningRefactorBranch
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/CloningRefactorBranch/HeuristicLab.Core/Scope.cs

    r885 r889  
    9191    protected Scope(Scope original, IDictionary<Guid, object> clonedObjects)
    9292      : base(original, clonedObjects) {
    93       this.myName = original.Name;
     93      myName = original.Name;
     94      myVariables = new Dictionary<string, IVariable>();
     95      myAliases = new Dictionary<string, string>();
     96      mySubScopes = new List<IScope>();
    9497      foreach (IVariable variable in original.myVariables.Values)
    9598        AddVariable((IVariable)Auxiliary.Clone(variable, clonedObjects));
  • branches/CloningRefactorBranch/HeuristicLab.Data/ItemList_T.cs

    r885 r889  
    5353    protected ItemList(ItemList<T> original, IDictionary<Guid, object> clonedObjects)
    5454      : base(original, clonedObjects) {
     55      list = new List<T>();
    5556      CloneElements(original, clonedObjects);
    5657    }
  • branches/CloningRefactorBranch/HeuristicLab.Data/ObjectData.cs

    r885 r889  
    6767    protected ObjectData(ObjectData original, IDictionary<Guid, object> clonedObjects)
    6868      : base(original, clonedObjects) {
    69       if (original.Data is IStorable)
     69      if (original.Data is ValueType)
     70        this.myData = original.Data;
     71      else if (original.Data is IStorable)
    7072        this.myData = Auxiliary.Clone((IStorable)original.Data, clonedObjects);
    7173      else if (original.Data is ICloneable)
Note: See TracChangeset for help on using the changeset viewer.