From ca13c0a44115216abc49c10c3328b809bde785ff Mon Sep 17 00:00:00 2001
From: Steven Hahn <hahnse@ornl.gov>
Date: Fri, 14 Dec 2018 18:06:43 -0500
Subject: [PATCH] Move IValidator_sptr.

---
 Framework/API/test/FakeAlgorithms.h           |  5 +-
 Framework/Algorithms/src/RadiusSum.cpp        | 19 +++----
 Framework/Algorithms/src/RingProfile.cpp      | 14 +++---
 Framework/Algorithms/src/SmoothData.cpp       |  7 ++-
 Framework/Crystal/src/IndexSXPeaks.cpp        | 27 +++++-----
 Framework/Crystal/src/PeaksInRegion.cpp       |  2 +-
 Framework/Crystal/src/PeaksOnSurface.cpp      |  2 +-
 Framework/Crystal/src/SetUB.cpp               | 49 +++++++++++--------
 Framework/Crystal/src/TransformHKL.cpp        |  6 +--
 Framework/DataHandling/src/SaveGSS.cpp        |  2 +-
 .../Kernel/inc/MantidKernel/ArrayProperty.h   |  8 +--
 Framework/Kernel/src/ArrayProperty.cpp        | 25 +++++-----
 Framework/Kernel/src/Property.cpp             |  2 +-
 .../MDAlgorithms/src/CalculateCoverageDGS.cpp |  8 +--
 .../src/IntegrateMDHistoWorkspace.cpp         | 31 ++++++------
 Framework/MDAlgorithms/src/LoadDNSSCD.cpp     | 41 +++++++++-------
 16 files changed, 129 insertions(+), 119 deletions(-)

diff --git a/Framework/API/test/FakeAlgorithms.h b/Framework/API/test/FakeAlgorithms.h
index 15022641f86..5c875ae8a8b 100644
--- a/Framework/API/test/FakeAlgorithms.h
+++ b/Framework/API/test/FakeAlgorithms.h
@@ -68,10 +68,7 @@ public:
     declareProperty("prop1", "value");
     declareProperty("prop2", 1);
     declareProperty("prop3", 10.5);
-    std::vector<double> binning;
-    binning.push_back(1.0);
-    binning.push_back(0.1);
-    binning.push_back(2.0);
+    std::vector<double> binning{1.0, 0.1, 2.0};
     declareProperty(Mantid::Kernel::make_unique<ArrayProperty<double>>(
         "Binning", std::move(binning),
         boost::make_shared<RebinParamsValidator>()));
diff --git a/Framework/Algorithms/src/RadiusSum.cpp b/Framework/Algorithms/src/RadiusSum.cpp
index 62a24cc0c7a..a01ae49d45d 100644
--- a/Framework/Algorithms/src/RadiusSum.cpp
+++ b/Framework/Algorithms/src/RadiusSum.cpp
@@ -57,22 +57,23 @@ void RadiusSum::init() {
   auto twoOrThreeElements =
       boost::make_shared<ArrayLengthValidator<double>>(2, 3);
   std::vector<double> myInput(3, 0);
-  declareProperty(Kernel::make_unique<ArrayProperty<double>>(
-                      "Centre", std::move(myInput), twoOrThreeElements),
-                  "Coordinate of the centre of the ring");
+  declareProperty(
+      Kernel::make_unique<ArrayProperty<double>>("Centre", std::move(myInput),
+                                                 std::move(twoOrThreeElements)),
+      "Coordinate of the centre of the ring");
 
   auto nonNegative = boost::make_shared<BoundedValidator<double>>();
   nonNegative->setLower(0);
-  declareProperty("MinRadius", 0.0, nonNegative,
+  declareProperty("MinRadius", 0.0, nonNegative->clone(),
                   "Length of the inner ring. Default=0");
-  declareProperty(
-      make_unique<PropertyWithValue<double>>(
-          "MaxRadius", std::numeric_limits<double>::max(), nonNegative),
-      "Length of the outer ring. Default=ImageSize.");
+  declareProperty(make_unique<PropertyWithValue<double>>(
+                      "MaxRadius", std::numeric_limits<double>::max(),
+                      std::move(nonNegative)),
+                  "Length of the outer ring. Default=ImageSize.");
 
   auto nonNegativeInt = boost::make_shared<BoundedValidator<int>>();
   nonNegativeInt->setLower(1);
-  declareProperty("NumBins", 100, nonNegativeInt,
+  declareProperty("NumBins", 100, std::move(nonNegativeInt),
                   "Number of slice bins for the output. Default=100");
 
   const char *normBy = "NormalizeByRadius";
diff --git a/Framework/Algorithms/src/RingProfile.cpp b/Framework/Algorithms/src/RingProfile.cpp
index f6c1bec3f4d..990c54ac9cb 100644
--- a/Framework/Algorithms/src/RingProfile.cpp
+++ b/Framework/Algorithms/src/RingProfile.cpp
@@ -56,20 +56,20 @@ void RingProfile::init() {
       boost::make_shared<Kernel::ArrayLengthValidator<double>>(2, 3);
   std::vector<double> myInput(3, 0);
   declareProperty(Kernel::make_unique<Kernel::ArrayProperty<double>>(
-                      "Centre", std::move(myInput), twoOrThree),
+                      "Centre", std::move(myInput), std::move(twoOrThree)),
                   "Coordinate of the centre of the ring");
   auto nonNegative = boost::make_shared<Kernel::BoundedValidator<double>>();
   nonNegative->setLower(0);
 
-  declareProperty<double>("MinRadius", 0, nonNegative,
+  declareProperty<double>("MinRadius", 0, nonNegative->clone(),
                           "Radius of the inner ring(m)");
-  declareProperty(
-      Kernel::make_unique<Kernel::PropertyWithValue<double>>(
-          "MaxRadius", std::numeric_limits<double>::max(), nonNegative),
-      "Radius of the outer ring(m)");
+  declareProperty(Kernel::make_unique<Kernel::PropertyWithValue<double>>(
+                      "MaxRadius", std::numeric_limits<double>::max(),
+                      std::move(nonNegative)),
+                  "Radius of the outer ring(m)");
   auto nonNegativeInt = boost::make_shared<Kernel::BoundedValidator<int>>();
   nonNegativeInt->setLower(1);
-  declareProperty<int>("NumBins", 100, nonNegativeInt,
+  declareProperty<int>("NumBins", 100, std::move(nonNegativeInt),
                        "Number of slice bins for the output");
   auto degreesLimits = boost::make_shared<Kernel::BoundedValidator<double>>();
   degreesLimits->setLower(-360);
diff --git a/Framework/Algorithms/src/SmoothData.cpp b/Framework/Algorithms/src/SmoothData.cpp
index c07afb47f8d..45d1433d13e 100644
--- a/Framework/Algorithms/src/SmoothData.cpp
+++ b/Framework/Algorithms/src/SmoothData.cpp
@@ -28,14 +28,13 @@ void SmoothData::init() {
       make_unique<WorkspaceProperty<>>("OutputWorkspace", "",
                                        Direction::Output),
       "The name of the workspace to be created as the output of the algorithm");
-  std::vector<int> npts0;
-  npts0.push_back(3);
+  std::vector<int> npts0{3};
   auto min = boost::make_shared<Kernel::ArrayBoundedValidator<int>>();
   min->setLower(3);
   // The number of points to use in the smoothing.
   declareProperty(
-      Kernel::make_unique<ArrayProperty<int>>("NPoints", std::move(npts0), min,
-                                              Direction::Input),
+      Kernel::make_unique<ArrayProperty<int>>("NPoints", std::move(npts0),
+                                              std::move(min), Direction::Input),
       "The number of points to average over (minimum 3). If an even number is\n"
       "given, it will be incremented by 1 to make it odd (default value 3)");
   declareProperty(
diff --git a/Framework/Crystal/src/IndexSXPeaks.cpp b/Framework/Crystal/src/IndexSXPeaks.cpp
index 7175b24ca92..da346697dce 100644
--- a/Framework/Crystal/src/IndexSXPeaks.cpp
+++ b/Framework/Crystal/src/IndexSXPeaks.cpp
@@ -41,28 +41,31 @@ void IndexSXPeaks::init() {
       "Input Peaks Workspace");
 
   declareProperty(make_unique<PropertyWithValue<double>>(
-                      "a", -1.0, mustBePositive, Direction::Input),
+                      "a", -1.0, mustBePositive->clone(), Direction::Input),
                   "Lattice parameter a");
 
   declareProperty(make_unique<PropertyWithValue<double>>(
-                      "b", -1.0, mustBePositive, Direction::Input),
+                      "b", -1.0, mustBePositive->clone(), Direction::Input),
                   "Lattice parameter b");
 
   declareProperty(make_unique<PropertyWithValue<double>>(
-                      "c", -1.0, mustBePositive, Direction::Input),
+                      "c", -1.0, std::move(mustBePositive), Direction::Input),
                   "Lattice parameter c");
 
-  declareProperty(make_unique<PropertyWithValue<double>>(
-                      "alpha", -1.0, reasonable_angle, Direction::Input),
-                  "Lattice parameter alpha");
+  declareProperty(
+      make_unique<PropertyWithValue<double>>(
+          "alpha", -1.0, reasonable_angle->clone(), Direction::Input),
+      "Lattice parameter alpha");
 
-  declareProperty(make_unique<PropertyWithValue<double>>(
-                      "beta", -1.0, reasonable_angle, Direction::Input),
-                  "Lattice parameter beta");
+  declareProperty(
+      make_unique<PropertyWithValue<double>>(
+          "beta", -1.0, reasonable_angle->clone(), Direction::Input),
+      "Lattice parameter beta");
 
-  declareProperty(make_unique<PropertyWithValue<double>>(
-                      "gamma", -1.0, reasonable_angle, Direction::Input),
-                  "Lattice parameter gamma");
+  declareProperty(
+      make_unique<PropertyWithValue<double>>(
+          "gamma", -1.0, std::move(reasonable_angle), Direction::Input),
+      "Lattice parameter gamma");
 
   declareProperty(make_unique<ArrayProperty<int>>("PeakIndices"),
                   "Index of the peaks in the table workspace to be used. If no "
diff --git a/Framework/Crystal/src/PeaksInRegion.cpp b/Framework/Crystal/src/PeaksInRegion.cpp
index 9d1d705a32b..3e20d5c899f 100644
--- a/Framework/Crystal/src/PeaksInRegion.cpp
+++ b/Framework/Crystal/src/PeaksInRegion.cpp
@@ -49,7 +49,7 @@ void PeaksInRegion::init() {
   extents[1] = +50;
   declareProperty(
       Kernel::make_unique<ArrayProperty<double>>("Extents", std::move(extents),
-                                                 mandatoryExtents),
+                                                 std::move(mandatoryExtents)),
       "A comma separated list of min, max for each dimension,\n"
       "specifying the extents of each dimension. Optional, default +-50 in "
       "each dimension.");
diff --git a/Framework/Crystal/src/PeaksOnSurface.cpp b/Framework/Crystal/src/PeaksOnSurface.cpp
index 80ecae1c9ed..769b96e5a14 100644
--- a/Framework/Crystal/src/PeaksOnSurface.cpp
+++ b/Framework/Crystal/src/PeaksOnSurface.cpp
@@ -66,7 +66,7 @@ void PeaksOnSurface::init() {
 
   declareProperty(
       Kernel::make_unique<ArrayProperty<double>>(
-          "Vertex4", std::vector<double>(), manditoryExtents->clone()),
+          "Vertex4", std::vector<double>(), std::move(manditoryExtents)),
       "A comma separated list of cartesian coordinates for the "
       "lower right vertex of the surface. Values to be specified "
       "in the CoordinateFrame choosen.");
diff --git a/Framework/Crystal/src/SetUB.cpp b/Framework/Crystal/src/SetUB.cpp
index 48bc7fea2b6..eca4e8ced02 100644
--- a/Framework/Crystal/src/SetUB.cpp
+++ b/Framework/Crystal/src/SetUB.cpp
@@ -49,29 +49,36 @@ void SetUB::init() {
   this->declareProperty(make_unique<WorkspaceProperty<Workspace>>(
                             "Workspace", "", Direction::InOut),
                         "An input workspace.");
-  this->declareProperty(make_unique<PropertyWithValue<double>>(
-                            "a", 1.0, mustBePositive, Direction::Input),
-                        "Lattice parameter a");
-  this->declareProperty(make_unique<PropertyWithValue<double>>(
-                            "b", 1.0, mustBePositive, Direction::Input),
-                        "Lattice parameter b");
-  this->declareProperty(make_unique<PropertyWithValue<double>>(
-                            "c", 1.0, mustBePositive, Direction::Input),
-                        "Lattice parameter c");
-  this->declareProperty(make_unique<PropertyWithValue<double>>(
-                            "alpha", 90.0, reasonableAngle, Direction::Input),
-                        "Lattice parameter alpha (degrees)");
-  this->declareProperty(make_unique<PropertyWithValue<double>>(
-                            "beta", 90.0, reasonableAngle, Direction::Input),
-                        "Lattice parameter beta (degrees)");
-  this->declareProperty(make_unique<PropertyWithValue<double>>(
-                            "gamma", 90.0, reasonableAngle, Direction::Input),
-                        "Lattice parameter gamma(degrees) ");
   this->declareProperty(
-      Kernel::make_unique<ArrayProperty<double>>("u", std::move(u0), mustBe3D),
-      "Vector along k_i, when goniometer is at 0");
+      make_unique<PropertyWithValue<double>>("a", 1.0, mustBePositive->clone(),
+                                             Direction::Input),
+      "Lattice parameter a");
   this->declareProperty(
-      Kernel::make_unique<ArrayProperty<double>>("v", std::move(v0), mustBe3D),
+      make_unique<PropertyWithValue<double>>("b", 1.0, mustBePositive->clone(),
+                                             Direction::Input),
+      "Lattice parameter b");
+  this->declareProperty(
+      make_unique<PropertyWithValue<double>>(
+          "c", 1.0, std::move(mustBePositive), Direction::Input),
+      "Lattice parameter c");
+  this->declareProperty(
+      make_unique<PropertyWithValue<double>>(
+          "alpha", 90.0, reasonableAngle->clone(), Direction::Input),
+      "Lattice parameter alpha (degrees)");
+  this->declareProperty(
+      make_unique<PropertyWithValue<double>>(
+          "beta", 90.0, reasonableAngle->clone(), Direction::Input),
+      "Lattice parameter beta (degrees)");
+  this->declareProperty(
+      make_unique<PropertyWithValue<double>>(
+          "gamma", 90.0, std::move(reasonableAngle), Direction::Input),
+      "Lattice parameter gamma(degrees) ");
+  this->declareProperty(Kernel::make_unique<ArrayProperty<double>>(
+                            "u", std::move(u0), mustBe3D->clone()),
+                        "Vector along k_i, when goniometer is at 0");
+  this->declareProperty(
+      Kernel::make_unique<ArrayProperty<double>>("v", std::move(v0),
+                                                 std::move(mustBe3D)),
       "In plane vector perpendicular to k_i, when goniometer is at 0");
   this->declareProperty(Kernel::make_unique<ArrayProperty<double>>(
                             "UB", std::move(zeroes), threeVthree),
diff --git a/Framework/Crystal/src/TransformHKL.cpp b/Framework/Crystal/src/TransformHKL.cpp
index b4bbcaecb27..20ecdabbe91 100644
--- a/Framework/Crystal/src/TransformHKL.cpp
+++ b/Framework/Crystal/src/TransformHKL.cpp
@@ -41,8 +41,8 @@ void TransformHKL::init() {
   mustBePositive->setLower(0.0);
 
   this->declareProperty(
-      make_unique<PropertyWithValue<double>>("Tolerance", 0.15, mustBePositive,
-                                             Direction::Input),
+      make_unique<PropertyWithValue<double>>(
+          "Tolerance", 0.15, std::move(mustBePositive), Direction::Input),
       "Indexing Tolerance (0.15)");
 
   std::vector<double> identity_matrix(9, 0.0);
@@ -54,7 +54,7 @@ void TransformHKL::init() {
   // clang-format on
   this->declareProperty(
       Kernel::make_unique<ArrayProperty<double>>(
-          "HKLTransform", std::move(identity_matrix), threeBythree),
+          "HKLTransform", std::move(identity_matrix), std::move(threeBythree)),
       "Specify 3x3 HKL transform matrix as a comma separated list of 9 "
       "numbers");
 
diff --git a/Framework/DataHandling/src/SaveGSS.cpp b/Framework/DataHandling/src/SaveGSS.cpp
index ff0caaedfa0..c60683ad036 100644
--- a/Framework/DataHandling/src/SaveGSS.cpp
+++ b/Framework/DataHandling/src/SaveGSS.cpp
@@ -202,7 +202,7 @@ void SaveGSS::init() {
   declareProperty(
       Kernel::make_unique<Kernel::ArrayProperty<int>>(
           "SLOGXYEPrecision", std::move(default_precision),
-          precision_validator),
+          std::move(precision_validator)),
       "Enter 3 integers as the precisions of output X, Y and E for SLOG data "
       "only."
       "Default is (9, 9, 9) if it is left empty.  Otherwise it is not "
diff --git a/Framework/Kernel/inc/MantidKernel/ArrayProperty.h b/Framework/Kernel/inc/MantidKernel/ArrayProperty.h
index bb393bbb51e..17da6e6dd46 100644
--- a/Framework/Kernel/inc/MantidKernel/ArrayProperty.h
+++ b/Framework/Kernel/inc/MantidKernel/ArrayProperty.h
@@ -29,14 +29,14 @@ namespace Kernel {
 template <typename T>
 class DLLExport ArrayProperty : public PropertyWithValue<std::vector<T>> {
 public:
-  ArrayProperty(const std::string &name, std::vector<T> &&vec,
+  ArrayProperty(std::string name, std::vector<T> vec,
                 IValidator_sptr validator = IValidator_sptr(new NullValidator),
                 const unsigned int direction = Direction::Input);
-  ArrayProperty(const std::string &name, IValidator_sptr validator,
+  ArrayProperty(std::string name, IValidator_sptr validator,
                 const unsigned int direction = Direction::Input);
-  ArrayProperty(const std::string &name,
+  ArrayProperty(std::string name,
                 const unsigned int direction = Direction::Input);
-  ArrayProperty(const std::string &name, const std::string &values,
+  ArrayProperty(std::string name, const std::string &values,
                 IValidator_sptr validator = IValidator_sptr(new NullValidator),
                 const unsigned int direction = Direction::Input);
 
diff --git a/Framework/Kernel/src/ArrayProperty.cpp b/Framework/Kernel/src/ArrayProperty.cpp
index eb052d95b4f..936dc6cc5b0 100644
--- a/Framework/Kernel/src/ArrayProperty.cpp
+++ b/Framework/Kernel/src/ArrayProperty.cpp
@@ -18,10 +18,11 @@ namespace Kernel {
  *  @param direction :: The direction (Input/Output/InOut) of this property
  */
 template <typename T>
-ArrayProperty<T>::ArrayProperty(const std::string &name, std::vector<T> &&vec,
+ArrayProperty<T>::ArrayProperty(std::string name, std::vector<T> vec,
                                 IValidator_sptr validator,
                                 const unsigned int direction)
-    : PropertyWithValue<std::vector<T>>(name, vec, validator, direction) {}
+    : PropertyWithValue<std::vector<T>>(std::move(name), std::move(vec),
+                                        std::move(validator), direction) {}
 
 /** Constructor
  *  Will lead to the property having a default-constructed (i.e. empty) vector
@@ -32,11 +33,10 @@ ArrayProperty<T>::ArrayProperty(const std::string &name, std::vector<T> &&vec,
  */
 
 template <typename T>
-ArrayProperty<T>::ArrayProperty(const std::string &name,
-                                IValidator_sptr validator,
+ArrayProperty<T>::ArrayProperty(std::string name, IValidator_sptr validator,
                                 const unsigned int direction)
-    : PropertyWithValue<std::vector<T>>(name, std::vector<T>(), validator,
-                                        direction) {}
+    : PropertyWithValue<std::vector<T>>(std::move(name), std::vector<T>(),
+                                        std::move(validator), direction) {}
 
 /** Constructor that's useful for output properties or inputs with an empty
  * default and no validator.
@@ -46,9 +46,8 @@ ArrayProperty<T>::ArrayProperty(const std::string &name,
  *  @param direction :: The direction (Input/Output/InOut) of this property
  */
 template <typename T>
-ArrayProperty<T>::ArrayProperty(const std::string &name,
-                                const unsigned int direction)
-    : PropertyWithValue<std::vector<T>>(name, std::vector<T>(),
+ArrayProperty<T>::ArrayProperty(std::string name, const unsigned int direction)
+    : PropertyWithValue<std::vector<T>>(std::move(name), std::vector<T>(),
                                         IValidator_sptr(new NullValidator),
                                         direction) {}
 
@@ -68,12 +67,12 @@ ArrayProperty<T>::ArrayProperty(const std::string &name,
  * the array type
  */
 template <typename T>
-ArrayProperty<T>::ArrayProperty(const std::string &name,
-                                const std::string &values,
+ArrayProperty<T>::ArrayProperty(std::string name, const std::string &values,
                                 IValidator_sptr validator,
                                 const unsigned int direction)
-    : PropertyWithValue<std::vector<T>>(name, std::vector<T>(), values,
-                                        validator, direction) {}
+    : PropertyWithValue<std::vector<T>>(std::move(name), std::vector<T>(),
+                                        values, std::move(validator),
+                                        direction) {}
 
 /// 'Virtual copy constructor'
 template <typename T> ArrayProperty<T> *ArrayProperty<T>::clone() const {
diff --git a/Framework/Kernel/src/Property.cpp b/Framework/Kernel/src/Property.cpp
index 4e645c6682c..c8c02da9eb8 100644
--- a/Framework/Kernel/src/Property.cpp
+++ b/Framework/Kernel/src/Property.cpp
@@ -27,7 +27,7 @@ namespace Kernel {
  */
 Property::Property(std::string name, const std::type_info &type,
                    const unsigned int direction)
-    : m_name(name), m_documentation(""), m_typeinfo(&type),
+    : m_name(std::move(name)), m_documentation(""), m_typeinfo(&type),
       m_direction(direction), m_units(""), m_group(""), m_remember(true),
       m_autotrim(true) {
   // Make sure a random int hasn't been passed in for the direction
diff --git a/Framework/MDAlgorithms/src/CalculateCoverageDGS.cpp b/Framework/MDAlgorithms/src/CalculateCoverageDGS.cpp
index ea718b8ae55..2646753f573 100644
--- a/Framework/MDAlgorithms/src/CalculateCoverageDGS.cpp
+++ b/Framework/MDAlgorithms/src/CalculateCoverageDGS.cpp
@@ -121,20 +121,20 @@ void CalculateCoverageDGS::init() {
   Q2[1] = 1.;
   Q3[2] = 1.;
   declareProperty(Kernel::make_unique<ArrayProperty<double>>(
-                      "Q1Basis", std::move(Q1), mustBe3D),
+                      "Q1Basis", std::move(Q1), mustBe3D->clone()),
                   "Q1 projection direction in the x,y,z format. Q1, Q2, Q3 "
                   "must not be coplanar");
   declareProperty(Kernel::make_unique<ArrayProperty<double>>(
-                      "Q2Basis", std::move(Q2), mustBe3D),
+                      "Q2Basis", std::move(Q2), mustBe3D->clone()),
                   "Q2 projection direction in the x,y,z format. Q1, Q2, Q3 "
                   "must not be coplanar");
   declareProperty(Kernel::make_unique<ArrayProperty<double>>(
-                      "Q3Basis", std::move(Q3), mustBe3D),
+                      "Q3Basis", std::move(Q3), std::move(mustBe3D)),
                   "Q3 projection direction in the x,y,z format. Q1, Q2, Q3 "
                   "must not be coplanar");
   declareProperty(
       make_unique<PropertyWithValue<double>>("IncidentEnergy", EMPTY_DBL(),
-                                             mustBePositive,
+                                             std::move(mustBePositive),
                                              Mantid::Kernel::Direction::Input),
       "Incident energy. If set, will override Ei in the input workspace");
 
diff --git a/Framework/MDAlgorithms/src/IntegrateMDHistoWorkspace.cpp b/Framework/MDAlgorithms/src/IntegrateMDHistoWorkspace.cpp
index be78410aa90..4a18a25597e 100644
--- a/Framework/MDAlgorithms/src/IntegrateMDHistoWorkspace.cpp
+++ b/Framework/MDAlgorithms/src/IntegrateMDHistoWorkspace.cpp
@@ -279,21 +279,22 @@ void IntegrateMDHistoWorkspace::init() {
                       "InputWorkspace", "", Direction::Input),
                   "An input workspace.");
 
-  declareProperty(Kernel::make_unique<ArrayProperty<double>>(
-                      "P1Bin", std::vector<double>()),
-                  "Projection 1 binning.");
-  declareProperty(Kernel::make_unique<ArrayProperty<double>>(
-                      "P2Bin", std::vector<double>()),
-                  "Projection 2 binning.");
-  declareProperty(Kernel::make_unique<ArrayProperty<double>>(
-                      "P3Bin", std::vector<double>()),
-                  "Projection 3 binning.");
-  declareProperty(Kernel::make_unique<ArrayProperty<double>>(
-                      "P4Bin", std::vector<double>()),
-                  "Projection 4 binning.");
-  declareProperty(Kernel::make_unique<ArrayProperty<double>>(
-                      "P5Bin", std::vector<double>()),
-                  "Projection 5 binning.");
+  const std::vector<double> defaultBinning;
+  declareProperty(
+      Kernel::make_unique<ArrayProperty<double>>("P1Bin", defaultBinning),
+      "Projection 1 binning.");
+  declareProperty(
+      Kernel::make_unique<ArrayProperty<double>>("P2Bin", defaultBinning),
+      "Projection 2 binning.");
+  declareProperty(
+      Kernel::make_unique<ArrayProperty<double>>("P3Bin", defaultBinning),
+      "Projection 3 binning.");
+  declareProperty(
+      Kernel::make_unique<ArrayProperty<double>>("P4Bin", defaultBinning),
+      "Projection 4 binning.");
+  declareProperty(
+      Kernel::make_unique<ArrayProperty<double>>("P5Bin", defaultBinning),
+      "Projection 5 binning.");
 
   declareProperty(make_unique<WorkspaceProperty<IMDHistoWorkspace>>(
                       "OutputWorkspace", "", Direction::Output),
diff --git a/Framework/MDAlgorithms/src/LoadDNSSCD.cpp b/Framework/MDAlgorithms/src/LoadDNSSCD.cpp
index dc469a296d8..42125b531cb 100644
--- a/Framework/MDAlgorithms/src/LoadDNSSCD.cpp
+++ b/Framework/MDAlgorithms/src/LoadDNSSCD.cpp
@@ -156,23 +156,25 @@ void LoadDNSSCD::init() {
   v0[2] = 1.;
 
   declareProperty(make_unique<PropertyWithValue<double>>(
-                      "a", 1.0, mustBePositive, Direction::Input),
+                      "a", 1.0, mustBePositive->clone(), Direction::Input),
                   "Lattice parameter a in Angstrom");
   declareProperty(make_unique<PropertyWithValue<double>>(
-                      "b", 1.0, mustBePositive, Direction::Input),
+                      "b", 1.0, mustBePositive->clone(), Direction::Input),
                   "Lattice parameter b in Angstrom");
   declareProperty(make_unique<PropertyWithValue<double>>(
-                      "c", 1.0, mustBePositive, Direction::Input),
+                      "c", 1.0, std::move(mustBePositive), Direction::Input),
                   "Lattice parameter c in Angstrom");
+  declareProperty(
+      make_unique<PropertyWithValue<double>>(
+          "alpha", 90.0, reasonableAngle->clone(), Direction::Input),
+      "Angle between b and c in degrees");
   declareProperty(make_unique<PropertyWithValue<double>>(
-                      "alpha", 90.0, reasonableAngle, Direction::Input),
-                  "Angle between b and c in degrees");
-  declareProperty(make_unique<PropertyWithValue<double>>(
-                      "beta", 90.0, reasonableAngle, Direction::Input),
+                      "beta", 90.0, reasonableAngle->clone(), Direction::Input),
                   "Angle between a and c in degrees");
-  declareProperty(make_unique<PropertyWithValue<double>>(
-                      "gamma", 90.0, reasonableAngle, Direction::Input),
-                  "Angle between a and b in degrees");
+  declareProperty(
+      make_unique<PropertyWithValue<double>>(
+          "gamma", 90.0, std::move(reasonableAngle), Direction::Input),
+      "Angle between a and b in degrees");
 
   declareProperty(make_unique<PropertyWithValue<double>>(
                       "OmegaOffset", 0.0,
@@ -182,22 +184,22 @@ void LoadDNSSCD::init() {
                   "if the goniometer is at zero.");
   declareProperty(
       Kernel::make_unique<ArrayProperty<double>>("HKL1", std::move(u0),
-                                                 mustBe3D),
+                                                 mustBe3D->clone()),
       "Indices of the vector in reciprocal space in the horizontal plane at "
       "angle Omegaoffset, "
       "if the goniometer is at zero.");
 
   declareProperty(
       Kernel::make_unique<ArrayProperty<double>>("HKL2", std::move(v0),
-                                                 mustBe3D),
+                                                 std::move(mustBe3D)),
       "Indices of a second vector in reciprocal space in the horizontal plane "
       "not parallel to HKL1");
 
   std::vector<double> ttl(2, 0);
   ttl[1] = 180.0;
   declareProperty(
-      Kernel::make_unique<ArrayProperty<double>>("TwoThetaLimits",
-                                                 std::move(ttl), mustBe2D),
+      Kernel::make_unique<ArrayProperty<double>>(
+          "TwoThetaLimits", std::move(ttl), std::move(mustBe2D)),
       "Range (min, max) of scattering angles (2theta, in degrees) to consider. "
       "Everything out of this range will be cut.");
 
@@ -214,15 +216,16 @@ void LoadDNSSCD::init() {
 
   auto mustBeIntPositive = boost::make_shared<BoundedValidator<int>>();
   mustBeIntPositive->setLower(0);
-  declareProperty(make_unique<PropertyWithValue<int>>(
-                      "ElasticChannel", 0, mustBeIntPositive, Direction::Input),
-                  "Elastic channel number. Only for TOF data.");
+  declareProperty(
+      make_unique<PropertyWithValue<int>>(
+          "ElasticChannel", 0, std::move(mustBeIntPositive), Direction::Input),
+      "Elastic channel number. Only for TOF data.");
 
   auto mustBeNegative = boost::make_shared<BoundedValidator<double>>();
   mustBeNegative->setUpper(0.0);
   declareProperty(
-      make_unique<PropertyWithValue<double>>("DeltaEmin", -10.0, mustBeNegative,
-                                             Direction::Input),
+      make_unique<PropertyWithValue<double>>(
+          "DeltaEmin", -10.0, std::move(mustBeNegative), Direction::Input),
       "Minimal energy transfer to consider. Should be <=0. Only for TOF data.");
 }
 
-- 
GitLab