Page MenuHomePhabricator

DataNode uses itkCloneMacro(Self) but does not implement a clone method
Closed, ResolvedPublic

Description

DataNode uses itkCloneMacro(Self) but does not implement the InternalClone methods. Therefore using Clone() defaults to itk::LightObject::InternalClone, thus a nwe instance is created.

Either we should allow cloning but then implement it correctly (with a specific DataNode::InternalClone) or we should not allow it at all.

Revisions and Commits

rMITK MITK
Restricted Differential Revision
Restricted Differential Revision

Event Timeline

floca created this task.Mon, May 4, 8:25 PM
floca triaged this task as High priority.Fri, May 8, 11:48 AM
floca edited projects, added MITK (2020), Noteworthy, Cleared; removed Request for Discussion, MITK.

Discussion results: check in our code base of someone uses the method. If not: Just remove it. If Yes: Look how they used/need it.

floca claimed this task.Fri, May 22, 10:40 AM
floca added subscribers: franza, seitela.

I have now removed the dysfunctional Clone for now. See D303

The only usages that I have found in the code base where in IGT:

  • QmitkUltrasoundCalibration::OnStartCalibrationProcess()
  • mitk::NavigationTool::NavigationTool(const NavigationTool &other)

I have replaced them with new()/CreatAnother() because this it was Clone() currently was doing.
@seitela @franza : I think it would be good if some one from IGT would check somewhen if there is maybe slumbering an error for long, because you had realy expected a clone (e.g. copied properties, which was never done). If so this could cause new tasks to emerge.