From 8b0d4905e6bebd98df80d4e092113beb11548989 Mon Sep 17 00:00:00 2001
From: charles leggett <leggett@cern.ch>
Date: Fri, 2 Nov 2018 07:51:40 -0700
Subject: [PATCH] update Gaudi to v30r3.010

Former-commit-id: 5b5749ed5da8ea624b9b5f820329fe0fe6662f1c
---
 Control/AthLinks/AthLinks/DataLink.icc        | 20 +++++++++----------
 Control/AthLinks/AthLinks/DataLinkBase.icc    |  4 ++--
 Control/AthLinks/AthLinks/ElementLink.icc     | 20 +++++++++----------
 Control/AthViews/AthViews/ViewHelper.h        | 16 ++++++++++-----
 Control/AthViews/src/ViewDataVerifier.cxx     |  2 +-
 Control/AthViews/src/ViewTestAlg.cxx          |  2 +-
 .../AthViews/src_dflow/ConditionTestAlg.cxx   |  2 +-
 Control/AthViews/src_dflow/DFlowAlg3.cxx      |  2 +-
 .../src/AthReentrantAlgorithm.cxx             | 12 ++++++++++-
 .../test/AthReentrantAlgorithm_test.cxx       |  2 +-
 .../AthenaKernel/MetaContDataBucket.icc       |  2 +-
 .../src/AthenaHiveEventLoopMgr.cxx            |  2 +-
 Control/IOVSvc/src/CondInputLoader.cxx        |  2 +-
 Control/StoreGate/StoreGate/ReadCondHandle.h  |  2 +-
 Control/StoreGate/StoreGate/ReadMetaHandle.h  |  2 +-
 Control/StoreGate/src/VarHandleBase.cxx       | 12 +++++++----
 .../src/EventSelectorAthenaPool.cxx           |  5 ++---
 Database/IOVDbSvc/src/IOVDbSvc.cxx            |  2 +-
 Projects/AthSimulation/externals.txt          |  2 +-
 Projects/Athena/externals.txt                 |  2 +-
 .../src/T2CaloEgammaFastAlgo.cxx              |  2 +-
 .../src/TrigL2ElectronFexMT.cxx               |  2 +-
 .../TrigEgammaHypo/src/TrigL2PhotonFexMT.cxx  |  2 +-
 .../src/TrigCostDataStore.icc                 |  4 ++--
 .../TrigCostMonitorMT/src/TrigCostMTSvc.cxx   |  4 ++--
 .../src/EventViewCreatorAlgorithm.cxx         |  2 +-
 .../ViewAlgsTest/src/SchedulerProxy.h         |  6 +++---
 .../ViewAlgsTest/src/SchedulerProxyAlg.cxx    |  2 +-
 .../ViewAlgsTest/src/TestFEXAlgView.cxx       |  2 +-
 .../ViewAlgsTest/src/TestViewDriver.cxx       |  2 +-
 30 files changed, 81 insertions(+), 62 deletions(-)

diff --git a/Control/AthLinks/AthLinks/DataLink.icc b/Control/AthLinks/AthLinks/DataLink.icc
index c53496b937a..ae1fc6f582f 100644
--- a/Control/AthLinks/AthLinks/DataLink.icc
+++ b/Control/AthLinks/AthLinks/DataLink.icc
@@ -59,7 +59,7 @@ DataLink<STORABLE>::DataLink(const_reference data, IProxyDict* sg/*=0*/)
 template <typename STORABLE>
 inline
 DataLink<STORABLE>::DataLink(const_reference data, const EventContext& ctx)
-  : DataLinkBase (&data, classID(), ctx.getExtension<Atlas::ExtendedEventContext>()->proxy())
+  : DataLinkBase (&data, classID(), ctx.getExtension<Atlas::ExtendedEventContext>().proxy())
 {
 }
 
@@ -85,7 +85,7 @@ DataLink<STORABLE>::DataLink(const_pointer pdata, IProxyDict* sg/*=0*/)
 template <typename STORABLE>
 inline
 DataLink<STORABLE>::DataLink(const_pointer pdata, const EventContext& ctx)
-  : DataLinkBase (pdata, classID(), ctx.getExtension<Atlas::ExtendedEventContext>()->proxy())
+  : DataLinkBase (pdata, classID(), ctx.getExtension<Atlas::ExtendedEventContext>().proxy())
 {
 }
 
@@ -113,7 +113,7 @@ template <typename STORABLE>
 inline
 DataLink<STORABLE>::DataLink(const ID_type& dataID,
                              const EventContext& ctx)
-  : DataLinkBase (dataID, classID(), ctx.getExtension<Atlas::ExtendedEventContext>()->proxy())
+  : DataLinkBase (dataID, classID(), ctx.getExtension<Atlas::ExtendedEventContext>().proxy())
 {
 }
 
@@ -143,7 +143,7 @@ DataLink<STORABLE>::DataLink(sgkey_t key, IProxyDict* sg /*=0*/)
 template <typename STORABLE>
 inline
 DataLink<STORABLE>::DataLink(sgkey_t key, const EventContext& ctx)
-  : DataLinkBase (key, classID(), ctx.getExtension<Atlas::ExtendedEventContext>()->proxy())
+  : DataLinkBase (key, classID(), ctx.getExtension<Atlas::ExtendedEventContext>().proxy())
 {
 }
 
@@ -190,7 +190,7 @@ inline
 void DataLink<STORABLE>::toStorableObject(const_reference data,
                                           const EventContext& ctx)
 {
-  DataLinkBase::toStorableObject (&data, classID(), ctx.getExtension<Atlas::ExtendedEventContext>()->proxy());
+  DataLinkBase::toStorableObject (&data, classID(), ctx.getExtension<Atlas::ExtendedEventContext>().proxy());
 }
 
 
@@ -222,7 +222,7 @@ inline
 void DataLink<STORABLE>::toIdentifiedObject(const ID_type& dataID,
                                             const EventContext& ctx)
 {
-  DataLinkBase::toIdentifiedObject (dataID, classID(), ctx.getExtension<Atlas::ExtendedEventContext>()->proxy());
+  DataLinkBase::toIdentifiedObject (dataID, classID(), ctx.getExtension<Atlas::ExtendedEventContext>().proxy());
 }
 
 
@@ -258,7 +258,7 @@ inline
 void DataLink<STORABLE>::toIdentifiedObject(sgkey_t key,
                                             const EventContext& ctx)
 {
-  DataLinkBase::toIdentifiedObject (key, classID(), ctx.getExtension<Atlas::ExtendedEventContext>()->proxy());
+  DataLinkBase::toIdentifiedObject (key, classID(), ctx.getExtension<Atlas::ExtendedEventContext>().proxy());
 }
 
 
@@ -298,7 +298,7 @@ template <typename STORABLE>
 inline
 void DataLink<STORABLE>::toDefaultObject (const EventContext& ctx)
 {
-  DataLinkBase::toIdentifiedObject (SG::DEFAULTKEY, classID(), ctx.getExtension<Atlas::ExtendedEventContext>()->proxy());
+  DataLinkBase::toIdentifiedObject (SG::DEFAULTKEY, classID(), ctx.getExtension<Atlas::ExtendedEventContext>().proxy());
 }
 
 
@@ -332,7 +332,7 @@ template <typename STORABLE>
 inline
 bool DataLink<STORABLE>::toTransient (const EventContext& ctx)
 {
-  return DataLinkBase::toTransient (ctx.getExtension<Atlas::ExtendedEventContext>()->proxy());
+  return DataLinkBase::toTransient (ctx.getExtension<Atlas::ExtendedEventContext>().proxy());
 }
 
 
@@ -370,7 +370,7 @@ inline
 bool DataLink<STORABLE>::toTransient (const ID_type& dataID,
                                       const EventContext& ctx)
 {
-  return DataLinkBase::toTransient (dataID, classID(), ctx.getExtension<Atlas::ExtendedEventContext>()->proxy());
+  return DataLinkBase::toTransient (dataID, classID(), ctx.getExtension<Atlas::ExtendedEventContext>().proxy());
 }
 
 
diff --git a/Control/AthLinks/AthLinks/DataLinkBase.icc b/Control/AthLinks/AthLinks/DataLinkBase.icc
index e7a30cdb5b4..72e9b4340fd 100644
--- a/Control/AthLinks/AthLinks/DataLinkBase.icc
+++ b/Control/AthLinks/AthLinks/DataLinkBase.icc
@@ -114,7 +114,7 @@ bool DataLinkBase::toTransient (IProxyDict* sg /*= 0*/)
 inline
 bool DataLinkBase::toTransient (const EventContext& ctx)
 {
-  m_proxy.toTransient (m_persKey, ctx.getExtension<Atlas::ExtendedEventContext>()->proxy());
+  m_proxy.toTransient (m_persKey, ctx.getExtension<Atlas::ExtendedEventContext>().proxy());
   return true;
 }
 
@@ -158,7 +158,7 @@ bool DataLinkBase::toTransient (const ID_type& dataID,
                                 const EventContext& ctx)
 {
   if (!isDefault()) SG::throwExcBadToTransient();
-  m_persKey = m_proxy.toTransient (dataID, link_clid, ctx.getExtension<Atlas::ExtendedEventContext>()->proxy());
+  m_persKey = m_proxy.toTransient (dataID, link_clid, ctx.getExtension<Atlas::ExtendedEventContext>().proxy());
   return true;
 }
 
diff --git a/Control/AthLinks/AthLinks/ElementLink.icc b/Control/AthLinks/AthLinks/ElementLink.icc
index e068411eb8f..95775414ef4 100644
--- a/Control/AthLinks/AthLinks/ElementLink.icc
+++ b/Control/AthLinks/AthLinks/ElementLink.icc
@@ -63,7 +63,7 @@ template <class STORABLE>
 inline
 ElementLink<STORABLE>::ElementLink(const ID_type& dataID, index_type elemID, 
                                    const EventContext& ctx)
-  : Base (dataID, classID(), elemID, ctx.getExtension<Atlas::ExtendedEventContext>()->proxy())
+  : Base (dataID, classID(), elemID, ctx.getExtension<Atlas::ExtendedEventContext>().proxy())
 {
 }
 
@@ -95,7 +95,7 @@ template <class STORABLE>
 inline
 ElementLink<STORABLE>::ElementLink(sgkey_t key, index_type elemID, 
                                    const EventContext& ctx)
-  : Base (key, classID(), elemID, ctx.getExtension<Atlas::ExtendedEventContext>()->proxy())
+  : Base (key, classID(), elemID, ctx.getExtension<Atlas::ExtendedEventContext>().proxy())
 {
 }
 
@@ -137,7 +137,7 @@ ElementLink<STORABLE>::ElementLink(const ID_type& dataID,
                                    index_type elemID,
                                    ElementType pEl,
                                    const EventContext& ctx)
-  : Base (dataID, classID(), elemID, pEl, ctx.getExtension<Atlas::ExtendedEventContext>()->proxy())
+  : Base (dataID, classID(), elemID, pEl, ctx.getExtension<Atlas::ExtendedEventContext>().proxy())
 {
 }
 
@@ -179,7 +179,7 @@ ElementLink<STORABLE>::ElementLink (sgkey_t key,
                                     index_type elemID,
                                     ElementType pEl,
                                     const EventContext& ctx)
-  : Base (key, classID(), elemID, pEl, ctx.getExtension<Atlas::ExtendedEventContext>()->proxy())
+  : Base (key, classID(), elemID, pEl, ctx.getExtension<Atlas::ExtendedEventContext>().proxy())
 {
 }
 
@@ -213,7 +213,7 @@ inline
 ElementLink<STORABLE>::ElementLink (BaseConstReference data,
                                     index_type elemID, 
                                     const EventContext& ctx)
-  : Base (&data, classID(), elemID, ctx.getExtension<Atlas::ExtendedEventContext>()->proxy())
+  : Base (&data, classID(), elemID, ctx.getExtension<Atlas::ExtendedEventContext>().proxy())
 {
 }
 
@@ -516,7 +516,7 @@ ElementLink<STORABLE>::toIndexedElement(BaseConstReference data,
                                         index_type elemID,
                                         const EventContext& ctx)
 {
-  return Base::toIndexedElement (&data, classID(), elemID, ctx.getExtension<Atlas::ExtendedEventContext>()->proxy());
+  return Base::toIndexedElement (&data, classID(), elemID, ctx.getExtension<Atlas::ExtendedEventContext>().proxy());
 }
 
 
@@ -571,7 +571,7 @@ bool ElementLink<STORABLE>::toContainedElement(BaseConstReference data,
 {
   index_type index = this->index();
   IndexingPolicy::reverseLookup (data, element, index);
-  bool ret = Base::toIndexedElement (&data, classID(), index, ctx.getExtension<Atlas::ExtendedEventContext>()->proxy());
+  bool ret = Base::toIndexedElement (&data, classID(), index, ctx.getExtension<Atlas::ExtendedEventContext>().proxy());
   if (ret)
     this->storeCachedElement (element);
   return ret;
@@ -660,7 +660,7 @@ bool ElementLink<STORABLE>::setStorableObject(BaseConstReference data,
                                               bool replace,
                                               const EventContext& ctx)
 {
-  bool ret = Base::setStorableObject (&data, classID(), replace, ctx.getExtension<Atlas::ExtendedEventContext>()->proxy());
+  bool ret = Base::setStorableObject (&data, classID(), replace, ctx.getExtension<Atlas::ExtendedEventContext>().proxy());
   if (ret) {
     ElementConstPointer elt = 0;
     if (this->isDefaultIndex() && this->getCachedElement (elt)) {
@@ -706,7 +706,7 @@ void ElementLink<STORABLE>::resetWithKeyAndIndex(const ID_type& dataID,
                                                  index_type elemID,
                                                  const EventContext& ctx)
 {
-  Base::resetWithKeyAndIndex (dataID, classID(), elemID, ctx.getExtension<Atlas::ExtendedEventContext>()->proxy());
+  Base::resetWithKeyAndIndex (dataID, classID(), elemID, ctx.getExtension<Atlas::ExtendedEventContext>().proxy());
 }
 
 
@@ -742,7 +742,7 @@ void ElementLink<STORABLE>::resetWithKeyAndIndex(sgkey_t key,
                                                  index_type elemID, 
                                                  const EventContext& ctx)
 {
-  Base::resetWithKeyAndIndex (key, classID(), elemID, ctx.getExtension<Atlas::ExtendedEventContext>()->proxy());
+  Base::resetWithKeyAndIndex (key, classID(), elemID, ctx.getExtension<Atlas::ExtendedEventContext>().proxy());
 }
 
 
diff --git a/Control/AthViews/AthViews/ViewHelper.h b/Control/AthViews/AthViews/ViewHelper.h
index e60808e8425..0db05af03d4 100644
--- a/Control/AthViews/AthViews/ViewHelper.h
+++ b/Control/AthViews/AthViews/ViewHelper.h
@@ -80,11 +80,16 @@ namespace ViewHelper
                                    EventContext const& SourceContext, IScheduler * Scheduler )
   {
     //Prevent view nesting - test if source context has view attached
-    Atlas::ExtendedEventContext const* extendedContext = SourceContext.template getExtension<Atlas::ExtendedEventContext>();
-    if ( dynamic_cast< SG::View* >( extendedContext->proxy() ) )
-    {
-      return StatusCode::FAILURE;
+    if ( SourceContext.template hasExtension<Atlas::ExtendedEventContext>() ) {
+      if ( dynamic_cast< SG::View* >( SourceContext.template getExtension<Atlas::ExtendedEventContext>().proxy() ) ) {
+        return StatusCode::FAILURE;
+      }
     }
+    // Atlas::ExtendedEventContext const* extendedContext = SourceContext.template getExtension<Atlas::ExtendedEventContext>();
+    // if ( dynamic_cast< SG::View* >( extendedContext->proxy() ) )
+    // {
+    //   return StatusCode::FAILURE;
+    // }
 
     //Retrieve the scheduler
     if ( !Scheduler )
@@ -94,11 +99,12 @@ namespace ViewHelper
 
     if ( not ViewVector->empty() )
     {
+      Atlas::ExtendedEventContext const extendedContext = SourceContext.template getExtension<Atlas::ExtendedEventContext>();
       for ( SG::View* view : *ViewVector )
       {
         //Make a context with the view attached
         auto viewContext = std::make_unique< EventContext >( SourceContext );
-        viewContext->setExtension( Atlas::ExtendedEventContext( view, extendedContext->conditionsRun() ) );
+        viewContext->setExtension( Atlas::ExtendedEventContext( view, extendedContext.conditionsRun() ) );
 
         //Attach the view to the named node
         StatusCode sc = Scheduler->scheduleEventView( &SourceContext, NodeName, std::move( viewContext ) );
diff --git a/Control/AthViews/src/ViewDataVerifier.cxx b/Control/AthViews/src/ViewDataVerifier.cxx
index f19ed6d8598..3c87fda21b1 100644
--- a/Control/AthViews/src/ViewDataVerifier.cxx
+++ b/Control/AthViews/src/ViewDataVerifier.cxx
@@ -78,7 +78,7 @@ StatusCode ViewDataVerifier::execute()
   ATH_MSG_DEBUG ("Executing " << name() << "...");
 
   // Retrieve the current view from the EventContext
-  auto viewProxy = getContext().getExtension<Atlas::ExtendedEventContext>()->proxy();
+  auto viewProxy = getContext().getExtension<Atlas::ExtendedEventContext>().proxy();
 
   ATH_MSG_INFO( name() << " running with store " << viewProxy->name() );
 
diff --git a/Control/AthViews/src/ViewTestAlg.cxx b/Control/AthViews/src/ViewTestAlg.cxx
index 9f18161dc7d..6bfa9dcfca9 100644
--- a/Control/AthViews/src/ViewTestAlg.cxx
+++ b/Control/AthViews/src/ViewTestAlg.cxx
@@ -59,7 +59,7 @@ StatusCode ViewTestAlg::execute()
 {  
   ATH_MSG_DEBUG ("Executing " << name() << "...");
 
-  ATH_MSG_INFO( name() << " running with store " << getContext().getExtension<Atlas::ExtendedEventContext>()->proxy()->name() );
+  ATH_MSG_INFO( name() << " running with store " << getContext().getExtension<Atlas::ExtendedEventContext>().proxy()->name() );
 
   return StatusCode::SUCCESS;
 }
diff --git a/Control/AthViews/src_dflow/ConditionTestAlg.cxx b/Control/AthViews/src_dflow/ConditionTestAlg.cxx
index e019b1379fe..85d187c024f 100644
--- a/Control/AthViews/src_dflow/ConditionTestAlg.cxx
+++ b/Control/AthViews/src_dflow/ConditionTestAlg.cxx
@@ -73,7 +73,7 @@ StatusCode ConditionTestAlg::execute()
   const EventContext& ctx = *getContext();
 #endif
 
-  ATH_MSG_INFO( name() << " running with store " << ctx.getExtension<Atlas::ExtendedEventContext>()->proxy()->name() );
+  ATH_MSG_INFO( name() << " running with store " << ctx.getExtension<Atlas::ExtendedEventContext>().proxy()->name() );
 
   // Make a (large) validity range
   EventIDBase begin (0,
diff --git a/Control/AthViews/src_dflow/DFlowAlg3.cxx b/Control/AthViews/src_dflow/DFlowAlg3.cxx
index 9c0fac8c4dc..a60ad527659 100644
--- a/Control/AthViews/src_dflow/DFlowAlg3.cxx
+++ b/Control/AthViews/src_dflow/DFlowAlg3.cxx
@@ -114,7 +114,7 @@ StatusCode DFlowAlg3::execute()
 
   // create a temporary r-handle
   SG::ReadHandle< std::vector<int> > ints( inputVectorHandle.name() );
-  StatusCode sc = ints.setProxyDict( ctx.getExtension<Atlas::ExtendedEventContext>()->proxy() );
+  StatusCode sc = ints.setProxyDict( ctx.getExtension<Atlas::ExtendedEventContext>().proxy() );
   if ( !sc.isSuccess() ) ATH_MSG_INFO( "Failed to load view " );
   ATH_MSG_INFO( "temporary r-handle[ints] - size: " << ints->size() );
 
diff --git a/Control/AthenaBaseComps/src/AthReentrantAlgorithm.cxx b/Control/AthenaBaseComps/src/AthReentrantAlgorithm.cxx
index d658de0ea31..f60c8cd210d 100644
--- a/Control/AthenaBaseComps/src/AthReentrantAlgorithm.cxx
+++ b/Control/AthenaBaseComps/src/AthReentrantAlgorithm.cxx
@@ -95,7 +95,17 @@ StatusCode AthReentrantAlgorithm::sysExecute (const EventContext& ctx)
   // the algorithm.  If the context is referencing any dynamic memory,
   // then we can end up with a double-delete.  So clear out any extension ---
   // we won't actually use the context we pass to here for anything anyway.
-  ctx2.setExtension (boost::any());
+
+  if (ctx.hasExtension<Atlas::ExtendedEventContext>()) {
+    ctx2.setExtension( Atlas::ExtendedEventContext() );
+  } else if (ctx.hasExtension()) {
+    ATH_MSG_ERROR("EventContext " << ctx
+                  << " has an extended context of an unknown type: \""
+                  << System::typeinfoName( ctx.getExtensionType() )
+                  << "\". Can't progress.");
+    return StatusCode::FAILURE;
+  }
+
   return ::ReEntAlgorithm::sysExecute (ctx2);
 }
 
diff --git a/Control/AthenaBaseComps/test/AthReentrantAlgorithm_test.cxx b/Control/AthenaBaseComps/test/AthReentrantAlgorithm_test.cxx
index d126936415f..31df7275dcf 100644
--- a/Control/AthenaBaseComps/test/AthReentrantAlgorithm_test.cxx
+++ b/Control/AthenaBaseComps/test/AthReentrantAlgorithm_test.cxx
@@ -85,7 +85,7 @@ StatusCode MyAlg::initialize()
 
 StatusCode MyAlg::execute_r (const EventContext& ctx) const
 {
-  pdict = ctx.getExtension<Atlas::ExtendedEventContext>()->proxy();
+  pdict = ctx.getExtension<Atlas::ExtendedEventContext>().proxy();
   return StatusCode::SUCCESS;
 }
 
diff --git a/Control/AthenaKernel/AthenaKernel/MetaContDataBucket.icc b/Control/AthenaKernel/AthenaKernel/MetaContDataBucket.icc
index 3d8ad804e81..dc955792d5a 100644
--- a/Control/AthenaKernel/AthenaKernel/MetaContDataBucket.icc
+++ b/Control/AthenaKernel/AthenaKernel/MetaContDataBucket.icc
@@ -74,7 +74,7 @@ const SourceID MetaContDataBucket<T>::getSID() const
 {
   const EventContext& ctx = Gaudi::Hive::currentContext();
   const IProxyDict* store = 
-    ctx.getExtension<Atlas::ExtendedEventContext>()->proxy();
+    ctx.getExtension<Atlas::ExtendedEventContext>().proxy();
   return store->sourceID();
 }
 
diff --git a/Control/AthenaServices/src/AthenaHiveEventLoopMgr.cxx b/Control/AthenaServices/src/AthenaHiveEventLoopMgr.cxx
index 5faba8ad759..5eb6a92d667 100644
--- a/Control/AthenaServices/src/AthenaHiveEventLoopMgr.cxx
+++ b/Control/AthenaServices/src/AthenaHiveEventLoopMgr.cxx
@@ -688,7 +688,7 @@ StatusCode AthenaHiveEventLoopMgr::executeEvent(void* createdEvts_IntPtr )
       conditionsRun = (*attr)["ConditionsRun"].data<unsigned int>();
     }
   }
-  evtContext->template getExtension<Atlas::ExtendedEventContext>()->setConditionsRun (conditionsRun);
+  evtContext->template getExtension<Atlas::ExtendedEventContext>().setConditionsRun (conditionsRun);
 
   // Make sure context global context has event id
   Gaudi::Hive::setCurrentContext (*evtContext);
diff --git a/Control/IOVSvc/src/CondInputLoader.cxx b/Control/IOVSvc/src/CondInputLoader.cxx
index 162cbe6d716..a7b9a4b2386 100644
--- a/Control/IOVSvc/src/CondInputLoader.cxx
+++ b/Control/IOVSvc/src/CondInputLoader.cxx
@@ -336,7 +336,7 @@ CondInputLoader::execute()
   // number with the conditions run number from the event context,
   // if it is defined.
   EventIDBase::number_type conditionsRun =
-    getContext().template getExtension<Atlas::ExtendedEventContext>()->conditionsRun();
+    getContext().template getExtension<Atlas::ExtendedEventContext>().conditionsRun();
   if (conditionsRun != EventIDBase::UNDEFNUM) {
     now.set_run_number (conditionsRun);
   }
diff --git a/Control/StoreGate/StoreGate/ReadCondHandle.h b/Control/StoreGate/StoreGate/ReadCondHandle.h
index ab34f1c10e0..5aed8dc7b12 100644
--- a/Control/StoreGate/StoreGate/ReadCondHandle.h
+++ b/Control/StoreGate/StoreGate/ReadCondHandle.h
@@ -90,7 +90,7 @@ namespace SG {
     m_hkey(key)
   {
     EventIDBase::number_type conditionsRun =
-      ctx.template getExtension<Atlas::ExtendedEventContext>()->conditionsRun();
+      ctx.template getExtension<Atlas::ExtendedEventContext>().conditionsRun();
     if (conditionsRun != EventIDBase::UNDEFNUM) {
       m_eid.set_run_number (conditionsRun);
     }
diff --git a/Control/StoreGate/StoreGate/ReadMetaHandle.h b/Control/StoreGate/StoreGate/ReadMetaHandle.h
index 801eab14982..b30c901cdb2 100644
--- a/Control/StoreGate/StoreGate/ReadMetaHandle.h
+++ b/Control/StoreGate/StoreGate/ReadMetaHandle.h
@@ -80,7 +80,7 @@ namespace SG {
   ReadMetaHandle<T>::ReadMetaHandle(const SG::ReadMetaHandleKey<T>& key,
                                     const EventContext& ctx):
     SG::VarHandleBase( key, &ctx ),
-    m_sid( ctx.getExtension<Atlas::ExtendedEventContext>()->proxy()->sourceID() ),
+    m_sid( ctx.getExtension<Atlas::ExtendedEventContext>().proxy()->sourceID() ),
     m_cont( key.getContainer() ),
     m_hkey(key)
   {
diff --git a/Control/StoreGate/src/VarHandleBase.cxx b/Control/StoreGate/src/VarHandleBase.cxx
index 677dc83ac81..c5147c4d247 100644
--- a/Control/StoreGate/src/VarHandleBase.cxx
+++ b/Control/StoreGate/src/VarHandleBase.cxx
@@ -961,10 +961,14 @@ namespace SG {
   {
     if (m_key->isEventStore()) {
       if (ctx)
-        return ctx->getExtension<Atlas::ExtendedEventContext>()->proxy();
+        return ctx->getExtension<Atlas::ExtendedEventContext>().proxy();
       if (m_storeWasSet && m_store) return m_store;
-      const Atlas::ExtendedEventContext *eec = Gaudi::Hive::currentContext().getExtension<Atlas::ExtendedEventContext>();
-      return ( (eec == nullptr) ? nullptr : eec->proxy() );
+
+      if ( Gaudi::Hive::currentContext().hasExtension<Atlas::ExtendedEventContext>() ) {
+        return  Gaudi::Hive::currentContext().getExtension<Atlas::ExtendedEventContext>().proxy();
+      } else {
+        return nullptr;
+      }
     }
 
     if (m_storeWasSet && m_store) return m_store;
@@ -992,7 +996,7 @@ namespace SG {
     }
     m_store = storeFromHandle (ctx);
     m_storeWasSet = (ctx && m_store ==
-                     ctx->getExtension<Atlas::ExtendedEventContext>()->proxy());
+                     ctx->getExtension<Atlas::ExtendedEventContext>().proxy());
     return true;
   }
 
diff --git a/Database/AthenaPOOL/EventSelectorAthenaPool/src/EventSelectorAthenaPool.cxx b/Database/AthenaPOOL/EventSelectorAthenaPool/src/EventSelectorAthenaPool.cxx
index f321763ad90..04da228b2d1 100755
--- a/Database/AthenaPOOL/EventSelectorAthenaPool/src/EventSelectorAthenaPool.cxx
+++ b/Database/AthenaPOOL/EventSelectorAthenaPool/src/EventSelectorAthenaPool.cxx
@@ -1101,9 +1101,8 @@ StatusCode EventSelectorAthenaPool::io_finalize() {
 void EventSelectorAthenaPool::handle(const Incident& inc)
 {
    SG::SourceID fid;
-   Atlas::ExtendedEventContext *eec = inc.context().getExtension<Atlas::ExtendedEventContext>();
-   if( eec ) {
-      fid = eec->proxy()->sourceID();
+   if ( inc.context().hasExtension<Atlas::ExtendedEventContext>() ) {
+     fid = inc.context().getExtension<Atlas::ExtendedEventContext>().proxy()->sourceID();
    }
    if( fid.empty() ) {
       ATH_MSG_WARNING("could not read event source ID from incident event context");
diff --git a/Database/IOVDbSvc/src/IOVDbSvc.cxx b/Database/IOVDbSvc/src/IOVDbSvc.cxx
index c58b5c4626b..f8e4f09ea93 100644
--- a/Database/IOVDbSvc/src/IOVDbSvc.cxx
+++ b/Database/IOVDbSvc/src/IOVDbSvc.cxx
@@ -699,7 +699,7 @@ StatusCode IOVDbSvc::signalBeginRun(const IOVTime& beginRunTime,
   // number with the conditions run number from the event context,
   // if it is defined.
   EventIDBase::number_type conditionsRun =
-    ctx.template getExtension<Atlas::ExtendedEventContext>()->conditionsRun();
+    ctx.template getExtension<Atlas::ExtendedEventContext>().conditionsRun();
   if (conditionsRun != EventIDBase::UNDEFNUM) {
     m_iovTime.setRunEvent (conditionsRun, m_iovTime.event());
   }
diff --git a/Projects/AthSimulation/externals.txt b/Projects/AthSimulation/externals.txt
index d3dabb622d7..7e48fadf74c 100644
--- a/Projects/AthSimulation/externals.txt
+++ b/Projects/AthSimulation/externals.txt
@@ -9,4 +9,4 @@
 AthSimulationExternalsVersion = 2.0.13
 
 # The version of atlas/Gaudi to use:
-GaudiVersion = v30r3.008
+GaudiVersion = v30r3.010
diff --git a/Projects/Athena/externals.txt b/Projects/Athena/externals.txt
index 0191d770211..022395e5ad5 100644
--- a/Projects/Athena/externals.txt
+++ b/Projects/Athena/externals.txt
@@ -9,4 +9,4 @@
 AthenaExternalsVersion = 2.0.13
 
 # The version of atlas/Gaudi to use: 
-GaudiVersion = v30r3.008
+GaudiVersion = v30r3.010
diff --git a/Trigger/TrigAlgorithms/TrigT2CaloEgamma/src/T2CaloEgammaFastAlgo.cxx b/Trigger/TrigAlgorithms/TrigT2CaloEgamma/src/T2CaloEgammaFastAlgo.cxx
index 4a43de17b45..62814ae4a0c 100755
--- a/Trigger/TrigAlgorithms/TrigT2CaloEgamma/src/T2CaloEgammaFastAlgo.cxx
+++ b/Trigger/TrigAlgorithms/TrigT2CaloEgamma/src/T2CaloEgammaFastAlgo.cxx
@@ -91,7 +91,7 @@ StatusCode T2CaloEgammaFastAlgo::execute()
   m_trigEmClusterCollection = SG::WriteHandle<xAOD::TrigEMClusterContainer>( m_clusterContainerKey, getContext() );
   ATH_CHECK( m_trigEmClusterCollection.record( CxxUtils::make_unique<xAOD::TrigEMClusterContainer>(), CxxUtils::make_unique<xAOD::TrigEMClusterAuxContainer>() ) );
   ATH_MSG_DEBUG( "Made WriteHandle " << m_clusterContainerKey );
-  ATH_MSG_INFO( name() << " running with store " <<  getContext().getExtension<Atlas::ExtendedEventContext>()->proxy()->name() );
+  ATH_MSG_INFO( name() << " running with store " <<  getContext().getExtension<Atlas::ExtendedEventContext>().proxy()->name() );
  
   auto roisHandle = SG::makeHandle( m_roiCollectionKey );
   CHECK( roisHandle.isValid() );
diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2ElectronFexMT.cxx b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2ElectronFexMT.cxx
index ea55f54d1c6..5fd08ee4ea8 100644
--- a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2ElectronFexMT.cxx
+++ b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2ElectronFexMT.cxx
@@ -108,7 +108,7 @@ StatusCode TrigL2ElectronFexMT::execute() {
                            std::make_unique<xAOD::TrigEMClusterAuxContainer>()) );
 
   ATH_MSG_DEBUG( "Made WriteHandle " << m_outputElectronsKey );
-  ATH_MSG_INFO( name() << " running with store " <<  getContext().getExtension<Atlas::ExtendedEventContext>()->proxy()->name() );
+  ATH_MSG_INFO( name() << " running with store " <<  getContext().getExtension<Atlas::ExtendedEventContext>().proxy()->name() );
  
 
   auto roiCollection = SG::makeHandle(m_roiCollectionKey, ctx);
diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2PhotonFexMT.cxx b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2PhotonFexMT.cxx
index cced6a9addf..737099e4303 100755
--- a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2PhotonFexMT.cxx
+++ b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2PhotonFexMT.cxx
@@ -60,7 +60,7 @@ StatusCode TrigL2PhotonFexMT::execute()
 				   std::make_unique<xAOD::TrigEMClusterAuxContainer>()) );
 
   ATH_MSG_DEBUG( "Made WriteHandle " << m_outputPhotonsKey );
-  ATH_MSG_INFO( name() << " running with store " <<  getContext().getExtension<Atlas::ExtendedEventContext>()->proxy()->name() );
+  ATH_MSG_INFO( name() << " running with store " <<  getContext().getExtension<Atlas::ExtendedEventContext>().proxy()->name() );
 
 
   auto roiCollection = SG::makeHandle(m_roiCollectionKey, ctx);
diff --git a/Trigger/TrigMonitoring/TrigCostMonitorMT/src/TrigCostDataStore.icc b/Trigger/TrigMonitoring/TrigCostMonitorMT/src/TrigCostDataStore.icc
index 15df21ea8fe..0fc6c26ba54 100644
--- a/Trigger/TrigMonitoring/TrigCostMonitorMT/src/TrigCostDataStore.icc
+++ b/Trigger/TrigMonitoring/TrigCostMonitorMT/src/TrigCostDataStore.icc
@@ -18,7 +18,7 @@ StatusCode TrigCostDataStore<PAYLOAD>::initialize(size_t nSlots) {
 template<typename PAYLOAD>
 StatusCode TrigCostDataStore<PAYLOAD>::insert(const EventContext& context, const std::string& caller, MsgStream& msg, const PAYLOAD& payload) {
   ATH_CHECK( checkSlot(context.slot(), msg) );
-  const IProxyDict* proxy = context.getExtension<Atlas::ExtendedEventContext>()->proxy();
+  const IProxyDict* proxy = context.getExtension<Atlas::ExtendedEventContext>().proxy();
   if (proxy == nullptr) return StatusCode::FAILURE;
   const SG::View* view = dynamic_cast<const SG::View*>(proxy);
   const int16_t viewID = (view == nullptr ? -1 : view->viewID());
@@ -40,7 +40,7 @@ StatusCode TrigCostDataStore<PAYLOAD>::insert(const EventContext& context, const
 template<typename PAYLOAD>
 StatusCode TrigCostDataStore<PAYLOAD>::retrieve(const EventContext& context, const std::string& caller, MsgStream& msg, PAYLOAD& payload) const {
   // Use proxy from given context to get the store (the name of the IProxyDict)
-  const IProxyDict* proxy = context.getExtension<Atlas::ExtendedEventContext>()->proxy();
+  const IProxyDict* proxy = context.getExtension<Atlas::ExtendedEventContext>().proxy();
   if (proxy == nullptr) return StatusCode::FAILURE;
   return retrieve(context, proxy->name(), caller, msg, payload);
 }
diff --git a/Trigger/TrigMonitoring/TrigCostMonitorMT/src/TrigCostMTSvc.cxx b/Trigger/TrigMonitoring/TrigCostMonitorMT/src/TrigCostMTSvc.cxx
index ef4870bd5a0..8a4ab637e72 100644
--- a/Trigger/TrigMonitoring/TrigCostMonitorMT/src/TrigCostMTSvc.cxx
+++ b/Trigger/TrigMonitoring/TrigCostMonitorMT/src/TrigCostMTSvc.cxx
@@ -65,12 +65,12 @@ StatusCode TrigCostMTSvc::processAlg(const EventContext& context, const std::str
     ATH_CHECK( m_algStartTimes.insert(context, caller, msg(), TrigTimeStamp()) );
     ATH_CHECK( m_algThreadID.insert(context, caller, msg(), std::this_thread::get_id()) );
 
-    ATH_MSG_DEBUG("Caller '" << caller << "', '" << context.getExtension<Atlas::ExtendedEventContext>()->proxy()->name() << "' began");
+    ATH_MSG_DEBUG("Caller '" << caller << "', '" << context.getExtension<Atlas::ExtendedEventContext>().proxy()->name() << "' began");
 
   } else if (type == AuditType::After) {
 
     ATH_CHECK( m_algStopTimes.insert(context, caller, msg(), TrigTimeStamp()) );
-    ATH_MSG_DEBUG("Caller '" << caller << "', '" << context.getExtension<Atlas::ExtendedEventContext>()->proxy()->name() << "' ended");
+    ATH_MSG_DEBUG("Caller '" << caller << "', '" << context.getExtension<Atlas::ExtendedEventContext>().proxy()->name() << "' ended");
 
   }
 
diff --git a/Trigger/TrigSteer/ViewAlgs/src/EventViewCreatorAlgorithm.cxx b/Trigger/TrigSteer/ViewAlgs/src/EventViewCreatorAlgorithm.cxx
index ae5f341b775..c18021e98b7 100644
--- a/Trigger/TrigSteer/ViewAlgs/src/EventViewCreatorAlgorithm.cxx
+++ b/Trigger/TrigSteer/ViewAlgs/src/EventViewCreatorAlgorithm.cxx
@@ -31,7 +31,7 @@ StatusCode EventViewCreatorAlgorithm::execute_r( const EventContext& context ) c
   auto viewVector = std::make_unique< ViewContainer >();
   auto contexts = std::vector<EventContext>( );
   unsigned int viewCounter = 0;
-  unsigned int conditionsRun = getContext().getExtension<Atlas::ExtendedEventContext>()->conditionsRun();
+  unsigned int conditionsRun = getContext().getExtension<Atlas::ExtendedEventContext>().conditionsRun();
 
   //  const TrigRoiDescriptor* previousRoI = 0;
   // mapping RoI with index of the View in the vector
diff --git a/Trigger/TrigSteer/ViewAlgsTest/src/SchedulerProxy.h b/Trigger/TrigSteer/ViewAlgsTest/src/SchedulerProxy.h
index 0b8b7261bf8..cdf36718f76 100644
--- a/Trigger/TrigSteer/ViewAlgsTest/src/SchedulerProxy.h
+++ b/Trigger/TrigSteer/ViewAlgsTest/src/SchedulerProxy.h
@@ -30,14 +30,14 @@ namespace SchedulerProxy {
 
 	{
 	  SG::ReadHandle<ConstDataVector<TrigRoiDescriptorCollection> > rois("RegionOfReco");
-	  CHECK(rois.setProxyDict(context.getExtension<Atlas::ExtendedEventContext>()->proxy()));
+	  CHECK(rois.setProxyDict(context.getExtension<Atlas::ExtendedEventContext>().proxy()));
 	  
 	  SG::WriteHandle< TestClusterContainer > clusterContainer("Clusters");
-	  CHECK(clusterContainer.setProxyDict(context.getExtension<Atlas::ExtendedEventContext>()->proxy()));
+	  CHECK(clusterContainer.setProxyDict(context.getExtension<Atlas::ExtendedEventContext>().proxy()));
 	  ATH_CHECK (clusterContainer.record (CxxUtils::make_unique< TestClusterContainer >()) );
 	  
 	  SG::WriteHandle< TestClusterAuxContainer > clusterContainerAux("ClustersAux.");
-	  CHECK(clusterContainerAux.setProxyDict(context.getExtension<Atlas::ExtendedEventContext>()->proxy()));
+	  CHECK(clusterContainerAux.setProxyDict(context.getExtension<Atlas::ExtendedEventContext>().proxy()));
 	  ATH_CHECK( clusterContainerAux.record (CxxUtils::make_unique< TestClusterAuxContainer>()) );
 	  clusterContainer->setStore(clusterContainerAux.ptr());
 
diff --git a/Trigger/TrigSteer/ViewAlgsTest/src/SchedulerProxyAlg.cxx b/Trigger/TrigSteer/ViewAlgsTest/src/SchedulerProxyAlg.cxx
index 84dbddc03e6..4861b5a78e6 100644
--- a/Trigger/TrigSteer/ViewAlgsTest/src/SchedulerProxyAlg.cxx
+++ b/Trigger/TrigSteer/ViewAlgsTest/src/SchedulerProxyAlg.cxx
@@ -27,7 +27,7 @@ StatusCode SchedulerProxyAlg::initialize()
 
 StatusCode SchedulerProxyAlg::execute() {
   
-  auto proxyPtr = getContext().getExtension<Atlas::ExtendedEventContext>()->proxy();
+  auto proxyPtr = getContext().getExtension<Atlas::ExtendedEventContext>().proxy();
   auto viewPtr = dynamic_cast<SG::View*>(proxyPtr);
   if ( viewPtr != nullptr ) {
     ATH_MSG_DEBUG( ".. The alg operates on the view " << viewPtr->impl()->name() );
diff --git a/Trigger/TrigSteer/ViewAlgsTest/src/TestFEXAlgView.cxx b/Trigger/TrigSteer/ViewAlgsTest/src/TestFEXAlgView.cxx
index ecd9f37f6ec..8cee76304aa 100644
--- a/Trigger/TrigSteer/ViewAlgsTest/src/TestFEXAlgView.cxx
+++ b/Trigger/TrigSteer/ViewAlgsTest/src/TestFEXAlgView.cxx
@@ -71,7 +71,7 @@ StatusCode TestFEXAlgView::execute() {
       m_outputProxyContainer->push_back(proxy);
 
       // This retrieval and cast could use some protection, but do we actually need this alg?
-      SG::View * myView = dynamic_cast< SG::View * >( ctx.getExtension<Atlas::ExtendedEventContext>()->proxy() );
+      SG::View * myView = dynamic_cast< SG::View * >( ctx.getExtension<Atlas::ExtendedEventContext>().proxy() );
       proxy->setObjectLink("cluster", ElementLink<TestClusterContainer>(m_outputClusterContainer.name(), nRoI, myView ) );
       proxy->setObjectLink("seed", ElementLink<xAOD::TrigCompositeContainer>(m_inputContainer.name(), nRoI, myView ) );
     } else {
diff --git a/Trigger/TrigSteer/ViewAlgsTest/src/TestViewDriver.cxx b/Trigger/TrigSteer/ViewAlgsTest/src/TestViewDriver.cxx
index a7a8692ae20..63434d9a4cc 100644
--- a/Trigger/TrigSteer/ViewAlgsTest/src/TestViewDriver.cxx
+++ b/Trigger/TrigSteer/ViewAlgsTest/src/TestViewDriver.cxx
@@ -37,7 +37,7 @@ StatusCode TestViewDriver::execute( ) {
   auto contexts = std::vector<EventContext>( );
   auto viewVector = std::make_unique< ViewContainer >( );
   unsigned int viewCounter = 0;
-  unsigned int conditionsRun = getContext().getExtension<Atlas::ExtendedEventContext>()->conditionsRun();
+  unsigned int conditionsRun = getContext().getExtension<Atlas::ExtendedEventContext>().conditionsRun();
   for ( const auto roi: *roisContainer.cptr( ) ) {
 
     contexts.push_back( getContext( ) );
-- 
GitLab