Date: Monday, November 28, 2005 @ 11:10:23
Author: marc
Path: /cvsroot/carob/carob
Modified: include/CarobException.hpp (1.10 -> 1.11)
test/CarobProtector.hpp (1.3 -> 1.4)
stack trace accessors now return const references instead of copies.
----------------------------+
include/CarobException.hpp | 4 ++--
test/CarobProtector.hpp | 10 +++++-----
2 files changed, 7 insertions(+), 7 deletions(-)
Index: carob/include/CarobException.hpp
diff -u carob/include/CarobException.hpp:1.10
carob/include/CarobException.hpp:1.11
--- carob/include/CarobException.hpp:1.10 Fri Nov 25 16:10:58 2005
+++ carob/include/CarobException.hpp Mon Nov 28 11:10:23 2005
@@ -93,10 +93,10 @@
virtual wstring description() const { return message; }
/** Returns the remote java stack trace */
- const StackTrace getStackTrace() const { return stackTrace; }
+ const StackTrace& getStackTrace() const { return stackTrace; }
/** Returns the local stack trace */
- const BackTrace getBackTrace() const { return backTrace; }
+ const BackTrace& getBackTrace() const { return backTrace; }
/** Returns a reference to the next exception in the chain, NULL if tail */
const CarobException* getNext() const { return causePtr; }
Index: carob/test/CarobProtector.hpp
diff -u carob/test/CarobProtector.hpp:1.3 carob/test/CarobProtector.hpp:1.4
--- carob/test/CarobProtector.hpp:1.3 Fri Nov 25 16:21:45 2005
+++ carob/test/CarobProtector.hpp Mon Nov 28 11:10:23 2005
@@ -33,9 +33,9 @@
static void cerrStackTrace(const wstring& prefix, const CarobException& cex)
{
- StackTrace st = cex.getStackTrace();
- for (StackTrace::iterator s = st.begin(); s != st.end(); s++)
- std::wcerr << prefix << " : "
+ const StackTrace& st = cex.getStackTrace();
+ for (StackTrace::const_iterator s = st.begin(); s != st.end(); s++)
+ std::wcerr << prefix << " : " // TODO: need a toString() method
here
<< (*s)->declaringClass << ":" << (*s)->methodName << "(...)"
<< std::endl;;
}
@@ -43,8 +43,8 @@
static void cerrBackTrace(const wstring& prefix, const CarobException& cex)
{
#ifdef GLIB_BACKTRACE
- BackTrace stvect = cex.getBackTrace();
- for (BackTrace::iterator btframe = stvect.begin(); btframe != stvect.end();
btframe++) {
+ const BackTrace& stvect = cex.getBackTrace();
+ for (BackTrace::const_iterator btframe = stvect.begin(); btframe !=
stvect.end(); btframe++) {
std::wcerr << BEPREFIX; std::cerr << *btframe << std::endl;
}
#endif
_______________________________________________
Carob-commits mailing list
[email protected]
https://forge.continuent.org/mailman/listinfo/carob-commits