activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1492740 - in /activemq/activemq-cpp/trunk/activemq-cpp/src/main: activemq/core/ decaf/internal/net/tcp/ decaf/lang/ decaf/util/concurrent/
Date Thu, 13 Jun 2013 16:25:49 GMT
Author: tabish
Date: Thu Jun 13 16:25:49 2013
New Revision: 1492740

URL: http://svn.apache.org/r1492740
Log:
fixes for: https://issues.apache.org/jira/browse/AMQCPP-490

Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQTransactionContext.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/net/tcp/TcpSocket.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Exception.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/concurrent/FutureTask.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/concurrent/ThreadPoolExecutor.cpp

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQTransactionContext.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQTransactionContext.cpp?rev=1492740&r1=1492739&r2=1492740&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQTransactionContext.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQTransactionContext.cpp
Thu Jun 13 16:25:49 2013
@@ -643,7 +643,7 @@ bool ActiveMQTransactionContext::isSameR
     } catch (Exception& ex) {
         throw toXAException(ex);
     } catch (CMSException& ex) {
-        throw XAException("Could not get the Resource Manager Id.", &ex);
+        throw XAException("Could not get the Resource Manager Id.", ex.clone());
     }
 }
 
@@ -754,7 +754,7 @@ XAException ActiveMQTransactionContext::
 
 ////////////////////////////////////////////////////////////////////////////////
 XAException ActiveMQTransactionContext::toXAException(cms::CMSException& ex) {
-    XAException xae(ex.getMessage(), &ex);
+    XAException xae(ex.getMessage(), ex.clone());
     xae.setErrorCode(XAException::XAER_RMFAIL);
     return xae;
 }

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/net/tcp/TcpSocket.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/net/tcp/TcpSocket.cpp?rev=1492740&r1=1492739&r2=1492740&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/net/tcp/TcpSocket.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/net/tcp/TcpSocket.cpp
Thu Jun 13 16:25:49 2013
@@ -358,7 +358,7 @@ void TcpSocket::connect(const std::strin
             close();
         } catch (lang::Exception& cx) { /* Absorb */
         }
-        throw SocketException(&ex);
+        throw SocketException(ex.clone());
     } catch (...) {
         try {
             close();

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Exception.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Exception.h?rev=1492740&r1=1492739&r2=1492740&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Exception.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Exception.h Thu Jun 13 16:25:49
2013
@@ -121,8 +121,10 @@ namespace lang {
         virtual const std::exception* getCause() const;
 
         /**
-         * Initializes the contained cause exception with the one given.  A copy
-         * is made to avoid ownership issues.
+         * Initializes the contained cause exception with the one given.  The caller should
+         * ensure that a valid copy of the causal exception is passed as this Exception object
+         * will take ownership of the passed pointer.  Do not pass a pointer to the address
of
+         * an exception allocated on the stack or from an exception in a catch block.
          *
          * @param cause
          *      The exception that was the cause of this one.

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/concurrent/FutureTask.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/concurrent/FutureTask.h?rev=1492740&r1=1492739&r2=1492740&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/concurrent/FutureTask.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/concurrent/FutureTask.h Thu
Jun 13 16:25:49 2013
@@ -269,7 +269,7 @@ namespace concurrent {
                         this->parent->setException(ex);
                         return;
                     } catch(std::exception& stdex) {
-                        this->parent->setException(decaf::lang::Exception(&stdex));
+                        this->parent->setException(decaf::lang::Exception(new std::exception(stdex)));
                         return;
                     } catch(...) {
                         this->parent->setException(decaf::lang::Exception(
@@ -298,7 +298,7 @@ namespace concurrent {
                     this->parent->setException(ex);
                     return false;
                 } catch(std::exception& stdex) {
-                    this->parent->setException(decaf::lang::Exception(&stdex));
+                    this->parent->setException(decaf::lang::Exception(new std::exception(stdex)));
                     return false;
                 } catch(...) {
                     this->parent->setException(decaf::lang::Exception(

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/concurrent/ThreadPoolExecutor.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/concurrent/ThreadPoolExecutor.cpp?rev=1492740&r1=1492739&r2=1492740&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/concurrent/ThreadPoolExecutor.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/concurrent/ThreadPoolExecutor.cpp
Thu Jun 13 16:25:49 2013
@@ -739,7 +739,8 @@ namespace concurrent{
                             this->parent->afterExecute(task, &e);
                             throw;
                         } catch (std::exception& stdex) {
-                            Exception ex(__FILE__, __LINE__, &stdex, "Caught unknown
exception while executing task.");
+                            Exception ex(__FILE__, __LINE__, new std::exception(stdex),
+                                "Caught unknown exception while executing task.");
                             this->parent->afterExecute(task, &ex);
                             throw ex;
                         } catch (...) {



Mime
View raw message