From f406ebfc42d7ec27992cf9b122d2225a43ed96cf Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <fwinkl@cern>
Date: Fri, 11 Dec 2020 09:53:13 +0100
Subject: [PATCH] AthenaBaseComps: replace deprecated setProperties calls

Replace deprecated setProperties calls with bindPropertiesTo.
---
 Control/AthenaBaseComps/src/AthFilterAlgorithm.cxx       | 6 +++---
 Control/AthenaBaseComps/src/AthHistogramAlgorithm.cxx    | 6 +++---
 Control/AthenaBaseComps/test/AthAlgTool_test.cxx         | 9 ++++-----
 Control/AthenaBaseComps/test/AthAlgorithm_test.cxx       | 3 +--
 .../AthenaBaseComps/test/AthReentrantAlgorithm_test.cxx  | 3 +--
 Control/AthenaBaseComps/test/propertyHandling_test.cxx   | 5 ++---
 6 files changed, 14 insertions(+), 18 deletions(-)

diff --git a/Control/AthenaBaseComps/src/AthFilterAlgorithm.cxx b/Control/AthenaBaseComps/src/AthFilterAlgorithm.cxx
index 73e0009f1e1..07a2196ae92 100644
--- a/Control/AthenaBaseComps/src/AthFilterAlgorithm.cxx
+++ b/Control/AthenaBaseComps/src/AthFilterAlgorithm.cxx
@@ -1,7 +1,7 @@
 ///////////////////////// -*- C++ -*- /////////////////////////////
 
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 // AthFilterAlgorithm.cxx
@@ -74,10 +74,10 @@ AthFilterAlgorithm::sysInitialize()
   if ( Gaudi::StateMachine::INITIALIZED <= FSMState() ) return StatusCode::SUCCESS;
 
   // Set the Algorithm's properties
-  ATH_CHECK(setProperties());
+  bindPropertiesTo( serviceLocator()->getOptsSvc() );
 
   // Bypass the initialization if the algorithm is disabled.
-  // Need to do this after setProperties.
+  // Need to do this after bindPropertiesTo.
   if ( !isEnabled( ) ) return StatusCode::SUCCESS;
 
   // ---- stolen from GaudiKernel/Algorithm::sysInitialize ------- END ---
diff --git a/Control/AthenaBaseComps/src/AthHistogramAlgorithm.cxx b/Control/AthenaBaseComps/src/AthHistogramAlgorithm.cxx
index dbdb3798d05..6fff2f3b478 100644
--- a/Control/AthenaBaseComps/src/AthHistogramAlgorithm.cxx
+++ b/Control/AthenaBaseComps/src/AthHistogramAlgorithm.cxx
@@ -1,7 +1,7 @@
 ///////////////////////// -*- C++ -*- /////////////////////////////
 
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 /// @class AthHistogramAlgorithm.h 
@@ -80,10 +80,10 @@ StatusCode AthHistogramAlgorithm::sysInitialize()
   if ( Gaudi::StateMachine::INITIALIZED <= FSMState() ) return StatusCode::SUCCESS;
 
   // Set the Algorithm's properties
-  ATH_CHECK(setProperties());
+  bindPropertiesTo( serviceLocator()->getOptsSvc() );
 
   // Bypass the initialization if the algorithm is disabled.
-  // Need to do this after setProperties.
+  // Need to do this after bindPropertiesTo.
   if ( !isEnabled( ) ) return StatusCode::SUCCESS;
   
   // ---- stolen from GaudiKernel/Algorithm::sysInitialize ------- END ---
diff --git a/Control/AthenaBaseComps/test/AthAlgTool_test.cxx b/Control/AthenaBaseComps/test/AthAlgTool_test.cxx
index 681a9368d14..bbf45192f95 100644
--- a/Control/AthenaBaseComps/test/AthAlgTool_test.cxx
+++ b/Control/AthenaBaseComps/test/AthAlgTool_test.cxx
@@ -1,8 +1,7 @@
 /*
- * Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration.
+ * Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration.
  */
 
-// $Id$
 /**
  * @file AthenaBaseComps/test/AthAlgTool_test.cxx
  * @author scott snyder <snyder@bnl.gov>
@@ -137,7 +136,7 @@ void test1 (ISvcLocator* svcloc)
 
   MyAlg alg ("toolalg", svcloc);  alg.addRef();
   MyAlgTool tool ("MyAlgTool", "tool2", &alg);  tool.addRef();
-  assert (tool.setProperties().isSuccess());
+  tool.bindPropertiesTo(svcloc->getOptsSvc());
   assert (tool.sysInitialize().isSuccess());
 
   assert (tool.rkey.clid() == 293847295);
@@ -210,14 +209,14 @@ void test2 (ISvcLocator* svcLoc)
 
   MyAlg alg ("arralg", svcLoc);  alg.addRef();
   MyArrAlgTool tool ("MyAlgTool", "arrtool", &alg);  tool.addRef();
-  assert (tool.setProperties().isSuccess());
+  tool.bindPropertiesTo(svcLoc->getOptsSvc());
   assert (tool.sysInitialize().isSuccess());
   comphandles (tool.inputHandles(),{"StoreGateSvc+raa", "StoreGateSvc+rbb", "StoreGateSvc+rcc", "StoreGateSvc+rdd", "StoreGateSvc+ree", "StoreGateSvc+rff", "StoreGateSvc+rrr"});
   comphandles (tool.outputHandles(),{"StoreGateSvc+waa", "StoreGateSvc+wbb", "StoreGateSvc+wcc", "StoreGateSvc+wdd", "StoreGateSvc+wee", "StoreGateSvc+wff", "StoreGateSvc+www"});
 
   // Test that circular dependency detection worksd.
   MyArrAlgTool tool2 ("MyArrAlgTool", "arrtool2", &alg);  tool2.addRef();
-  assert (tool2.setProperties().isSuccess());
+  tool2.bindPropertiesTo(svcLoc->getOptsSvc());
   assert (tool2.sysInitialize().isFailure());
 }
 
diff --git a/Control/AthenaBaseComps/test/AthAlgorithm_test.cxx b/Control/AthenaBaseComps/test/AthAlgorithm_test.cxx
index 9ae1da40c34..323fc190360 100644
--- a/Control/AthenaBaseComps/test/AthAlgorithm_test.cxx
+++ b/Control/AthenaBaseComps/test/AthAlgorithm_test.cxx
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration.
+ * Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration.
  */
 
 // $Id$
@@ -117,7 +117,6 @@ void test1 (ISvcLocator* svcLoc)
   std::cout << "test1\n";
 
   MyAlg alg ("ralg", svcLoc);  alg.addRef();
-  //assert (alg.setProperties().isSuccess());
   assert (alg.sysInitialize().isSuccess());
 
   assert (alg.rkey.clid() == 293847295);
diff --git a/Control/AthenaBaseComps/test/AthReentrantAlgorithm_test.cxx b/Control/AthenaBaseComps/test/AthReentrantAlgorithm_test.cxx
index a0489f7549f..19f881f05c4 100644
--- a/Control/AthenaBaseComps/test/AthReentrantAlgorithm_test.cxx
+++ b/Control/AthenaBaseComps/test/AthReentrantAlgorithm_test.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 // $Id$
@@ -114,7 +114,6 @@ void test1 (ISvcLocator* svcLoc)
   std::cout << "test1\n";
 
   MyAlg alg ("ralg", svcLoc);  alg.addRef();
-  //assert (alg.setProperties().isSuccess());
   assert (alg.sysInitialize().isSuccess());
 
   assert (alg.rkey.clid() == 293847295);
diff --git a/Control/AthenaBaseComps/test/propertyHandling_test.cxx b/Control/AthenaBaseComps/test/propertyHandling_test.cxx
index 82bb2e66550..05dbdebd037 100644
--- a/Control/AthenaBaseComps/test/propertyHandling_test.cxx
+++ b/Control/AthenaBaseComps/test/propertyHandling_test.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 // $Id$
@@ -218,7 +218,6 @@ void test1 (ISvcLocator* svcLoc)
   std::cout << "test1\n";
 
   MyAthAlgorithm alg ("alg", svcLoc);  alg.addRef();
-  //assert (alg.setProperties().isSuccess());
   assert (alg.sysInitialize().isSuccess());
 
   assert (alg.rkey.clid() == 293847295);
@@ -315,7 +314,7 @@ void test2 (ISvcLocator* svcLoc)
 
   MyAthAlgorithm alg ("alg", svcLoc);  alg.addRef();
   MyAthAlgTool tool ("MyAthAlgTool", "tool", &alg);   tool.addRef();
-  assert (tool.setProperties().isSuccess());
+  tool.bindPropertiesTo(svcLoc->getOptsSvc());
   assert (tool.sysInitialize().isSuccess());
 
   assert (tool.rkey.clid() == 293847295);
-- 
GitLab