Skip to content

Commit

Permalink
Fix storage of original project data in NetworkBuilder
Browse files Browse the repository at this point in the history
The ProjectData objects are handled as references in the NetworkBuilder
objects, therefore, we need to clone the original data for the case of
data cutting. Otherwise, we would just store the very same reference in
two attributes.

Signed-off-by: Claus Hunsen <[email protected]>
Signed-off-by: Thomas Bock <[email protected]>
  • Loading branch information
clhunsen committed Mar 22, 2018
1 parent 1bed431 commit 2b327a9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions util-networks.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
## with this program; if not, write to the Free Software Foundation, Inc.,
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
##
## Copyright 2016-2017 by Claus Hunsen <[email protected]>
## Copyright 2016-2018 by Claus Hunsen <[email protected]>
## Copyright 2017 by Raphael Nömmer <[email protected]>
## Copyright 2017 by Christian Hechtl <[email protected]>
## Copyright 2017 by Thomas Bock <[email protected]>
## Copyright 2017-2018 by Thomas Bock <[email protected]>
## All Rights Reserved.


Expand Down Expand Up @@ -406,8 +406,8 @@ NetworkBuilder = R6::R6Class("NetworkBuilder",
initialize = function(project.data, network.conf) {

## check arguments
private$proj.data = verify.argument.for.parameter(project.data, "ProjectData", class(self)[1])
private$proj.data.original = project.data
private$proj.data.original = verify.argument.for.parameter(project.data, "ProjectData", class(self)[1])
private$proj.data = project.data$clone()
private$network.conf = verify.argument.for.parameter(network.conf, "NetworkConf", class(self)[1])

## cut data if needed
Expand Down

0 comments on commit 2b327a9

Please sign in to comment.