Author: tabish
Date: Mon Nov 16 15:18:03 2009
New Revision: 880790
URL: http://svn.apache.org/viewvc?rev=880790&view=rev
Log:
Make the ClassCastException's error message more descriptive.
Modified:
activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Pointer.h
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Pointer.h
URL:
http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Pointer.h?rev=880790&r1=880789&r2=880790&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Pointer.h
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Pointer.h Mon
Nov 16 15:18:03 2009
@@ -24,6 +24,7 @@
#include <decaf/util/concurrent/atomic/AtomicInteger.h>
#include <decaf/util/Comparator.h>
#include <memory>
+#include <typeinfo>
#include <algorithm>
namespace decaf {
@@ -168,7 +169,9 @@
// didn't actually create one as the dynamic cast failed..
this->release();
throw decaf::lang::exceptions::ClassCastException(
- __FILE__, __LINE__, "Failed to cast source pointer to this
type." );
+ __FILE__, __LINE__,
+ "Failed to cast source pointer of type %s to this type:
%s.",
+ typeid( T1 ).name(), typeid( T ).name() );
}
}