You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2013/06/13 18:29:02 UTC

svn commit: r1492741 - in /activemq/activemq-cpp/branches/3.7.x: ./ activemq-cpp/src/main/activemq/core/ activemq-cpp/src/main/decaf/internal/net/tcp/ activemq-cpp/src/main/decaf/lang/ activemq-cpp/src/main/decaf/util/concurrent/

Author: tabish
Date: Thu Jun 13 16:29:02 2013
New Revision: 1492741

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

Modified:
    activemq/activemq-cpp/branches/3.7.x/   (props changed)
    activemq/activemq-cpp/branches/3.7.x/activemq-cpp/src/main/activemq/core/ActiveMQTransactionContext.cpp
    activemq/activemq-cpp/branches/3.7.x/activemq-cpp/src/main/decaf/internal/net/tcp/TcpSocket.cpp
    activemq/activemq-cpp/branches/3.7.x/activemq-cpp/src/main/decaf/lang/Exception.h
    activemq/activemq-cpp/branches/3.7.x/activemq-cpp/src/main/decaf/util/concurrent/FutureTask.h
    activemq/activemq-cpp/branches/3.7.x/activemq-cpp/src/main/decaf/util/concurrent/ThreadPoolExecutor.cpp

Propchange: activemq/activemq-cpp/branches/3.7.x/
------------------------------------------------------------------------------
  Merged /activemq/activemq-cpp/trunk:r1492740

Modified: activemq/activemq-cpp/branches/3.7.x/activemq-cpp/src/main/activemq/core/ActiveMQTransactionContext.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/branches/3.7.x/activemq-cpp/src/main/activemq/core/ActiveMQTransactionContext.cpp?rev=1492741&r1=1492740&r2=1492741&view=diff
==============================================================================
--- activemq/activemq-cpp/branches/3.7.x/activemq-cpp/src/main/activemq/core/ActiveMQTransactionContext.cpp (original)
+++ activemq/activemq-cpp/branches/3.7.x/activemq-cpp/src/main/activemq/core/ActiveMQTransactionContext.cpp Thu Jun 13 16:29:02 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/branches/3.7.x/activemq-cpp/src/main/decaf/internal/net/tcp/TcpSocket.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/branches/3.7.x/activemq-cpp/src/main/decaf/internal/net/tcp/TcpSocket.cpp?rev=1492741&r1=1492740&r2=1492741&view=diff
==============================================================================
--- activemq/activemq-cpp/branches/3.7.x/activemq-cpp/src/main/decaf/internal/net/tcp/TcpSocket.cpp (original)
+++ activemq/activemq-cpp/branches/3.7.x/activemq-cpp/src/main/decaf/internal/net/tcp/TcpSocket.cpp Thu Jun 13 16:29:02 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/branches/3.7.x/activemq-cpp/src/main/decaf/lang/Exception.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/branches/3.7.x/activemq-cpp/src/main/decaf/lang/Exception.h?rev=1492741&r1=1492740&r2=1492741&view=diff
==============================================================================
--- activemq/activemq-cpp/branches/3.7.x/activemq-cpp/src/main/decaf/lang/Exception.h (original)
+++ activemq/activemq-cpp/branches/3.7.x/activemq-cpp/src/main/decaf/lang/Exception.h Thu Jun 13 16:29:02 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/branches/3.7.x/activemq-cpp/src/main/decaf/util/concurrent/FutureTask.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/branches/3.7.x/activemq-cpp/src/main/decaf/util/concurrent/FutureTask.h?rev=1492741&r1=1492740&r2=1492741&view=diff
==============================================================================
--- activemq/activemq-cpp/branches/3.7.x/activemq-cpp/src/main/decaf/util/concurrent/FutureTask.h (original)
+++ activemq/activemq-cpp/branches/3.7.x/activemq-cpp/src/main/decaf/util/concurrent/FutureTask.h Thu Jun 13 16:29:02 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/branches/3.7.x/activemq-cpp/src/main/decaf/util/concurrent/ThreadPoolExecutor.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/branches/3.7.x/activemq-cpp/src/main/decaf/util/concurrent/ThreadPoolExecutor.cpp?rev=1492741&r1=1492740&r2=1492741&view=diff
==============================================================================
--- activemq/activemq-cpp/branches/3.7.x/activemq-cpp/src/main/decaf/util/concurrent/ThreadPoolExecutor.cpp (original)
+++ activemq/activemq-cpp/branches/3.7.x/activemq-cpp/src/main/decaf/util/concurrent/ThreadPoolExecutor.cpp Thu Jun 13 16:29:02 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 (...) {