summaryrefslogtreecommitdiff
path: root/TAO/tao/AnyTypeCode/Any_Dual_Impl_T.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/tao/AnyTypeCode/Any_Dual_Impl_T.cpp')
-rw-r--r--TAO/tao/AnyTypeCode/Any_Dual_Impl_T.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/TAO/tao/AnyTypeCode/Any_Dual_Impl_T.cpp b/TAO/tao/AnyTypeCode/Any_Dual_Impl_T.cpp
index 4fe6c209652..e43cfaffc26 100644
--- a/TAO/tao/AnyTypeCode/Any_Dual_Impl_T.cpp
+++ b/TAO/tao/AnyTypeCode/Any_Dual_Impl_T.cpp
@@ -8,12 +8,10 @@
#include "tao/AnyTypeCode/Any_Unknown_IDL_Type.h"
#include "tao/AnyTypeCode/Marshal.h"
#include "tao/CORBA_String.h"
-#include "tao/Environment.h"
#include "tao/SystemException.h"
#include "tao/CDR.h"
#include "tao/AnyTypeCode/TypeCode.h"
-#include "ace/CORBA_macros.h"
#include "ace/Auto_Ptr.h"
#include "ace/OS_Memory.h"
@@ -104,18 +102,18 @@ TAO::Any_Dual_Impl_T<T>::extract (const CORBA::Any & any,
try
{
CORBA::TypeCode_ptr any_tc = any._tao_get_typecode ();
- CORBA::Boolean _tao_equiv = any_tc->equivalent (tc);
+ CORBA::Boolean const _tao_equiv = any_tc->equivalent (tc);
if (_tao_equiv == false)
{
return false;
}
- TAO::Any_Impl *impl = any.impl ();
+ TAO::Any_Impl * const impl = any.impl ();
- if (!impl->encoded ())
+ if (impl && !impl->encoded ())
{
- TAO::Any_Dual_Impl_T<T> *narrow_impl =
+ TAO::Any_Dual_Impl_T<T> * const narrow_impl =
dynamic_cast <TAO::Any_Dual_Impl_T<T> *> (impl);
if (narrow_impl == 0)
@@ -141,9 +139,12 @@ TAO::Any_Dual_Impl_T<T>::extract (const CORBA::Any & any,
auto_ptr<TAO::Any_Dual_Impl_T<T> > replacement_safety (replacement);
// We know this will work since the unencoded case is covered above.
- TAO::Unknown_IDL_Type *unk =
+ TAO::Unknown_IDL_Type * const unk =
dynamic_cast<TAO::Unknown_IDL_Type *> (impl);
+ if (!unk)
+ return false;
+
// We don't want the rd_ptr of unk to move, in case it is
// shared by another Any. This copies the state, not the buffer.
TAO_InputCDR for_reading (unk->_tao_get_cdr ());
@@ -162,7 +163,7 @@ TAO::Any_Dual_Impl_T<T>::extract (const CORBA::Any & any,
// Duplicated by Any_Impl base class constructor.
::CORBA::release (any_tc);
}
- catch ( ::CORBA::Exception&)
+ catch (const ::CORBA::Exception&)
{
}