Free cookie consent management tool by TermsFeed Policy Generator

Opened 8 years ago

Closed 8 years ago

#2576 closed defect (done)

VariableCondition symbol is deserialized incorrectly

Reported by: pfleck Owned by: ascheibe
Priority: medium Milestone: HeuristicLab 3.3.14
Component: Problems.DataAnalysis.Symbolic Version: 3.3.13
Keywords: Cc:

Description (last modified by mkommend)

After deserializing a VariableCondition symbol, all variables are checked. This is caused because the storable property AllVariableNames resets the VariableNames.

Connected to #1865 in which the implementation of the Variable has been corrected, but the VariableCondition was overlooked.

private List<string> variableNames;
[Storable]
public IEnumerable<string> VariableNames {
  get { return variableNames; }
  set {
    if (value == null) throw new ArgumentNullException();
    variableNames.Clear();
    variableNames.AddRange(value);
    OnChanged(EventArgs.Empty);
  }
}

private List<string> allVariableNames;
[Storable]
public IEnumerable<string> AllVariableNames {
  get { return allVariableNames; }
  set {
    if (value == null) throw new ArgumentNullException();
    allVariableNames.Clear();
    allVariableNames.AddRange(value);
    VariableNames = value;
  }
}

Change History (7)

comment:1 Changed 8 years ago by mkommend

  • Owner set to mkommend
  • Status changed from new to accepted

comment:2 Changed 8 years ago by mkommend

  • Description modified (diff)

comment:3 Changed 8 years ago by mkommend

r13616: Quickfix for deserializing the VariableCondition symbol correctly.

TODO: fire changed events and handle cases if all variables and variables are out of sync.

Version 0, edited 8 years ago by mkommend (next)

comment:4 Changed 8 years ago by mkommend

  • Owner changed from mkommend to gkronber
  • Status changed from accepted to reviewing

comment:5 Changed 8 years ago by gkronber

Tested and reviewed r13616. Fine by me.

comment:6 Changed 8 years ago by gkronber

  • Owner changed from gkronber to ascheibe
  • Status changed from reviewing to readytorelease

comment:7 Changed 8 years ago by ascheibe

  • Resolution set to done
  • Status changed from readytorelease to closed

r13913 merged r13616 into stable

Note: See TracTickets for help on using tickets.