activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1064767 - /activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/NetTxConnectionFactory.cs
Date Fri, 28 Jan 2011 16:35:18 GMT
Author: tabish
Date: Fri Jan 28 16:35:18 2011
New Revision: 1064767

URL: http://svn.apache.org/viewvc?rev=1064767&view=rev
Log:
Fix potential NPE

Modified:
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/NetTxConnectionFactory.cs

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/NetTxConnectionFactory.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/NetTxConnectionFactory.cs?rev=1064767&r1=1064766&r2=1064767&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/NetTxConnectionFactory.cs
(original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/NetTxConnectionFactory.cs
Fri Jan 28 16:35:18 2011
@@ -25,7 +25,7 @@ namespace Apache.NMS.ActiveMQ
 {
     public class NetTxConnectionFactory : ConnectionFactory, INetTxConnectionFactory
     {
-        private NetTxRecoveryPolicy txRecoveryPolicy;
+        private NetTxRecoveryPolicy recoveryPolicy = new NetTxRecoveryPolicy();
 
         public NetTxConnectionFactory() : base(GetDefaultBrokerUrl())
         {
@@ -72,16 +72,18 @@ namespace Apache.NMS.ActiveMQ
                 string query = brokerUri.Query.Substring(brokerUri.Query.LastIndexOf(")")
+ 1);
                 StringDictionary options = URISupport.ParseQuery(query);
                 options = URISupport.GetProperties(options, "nms.RecoveryPolicy.");
-                URISupport.SetProperties(this.txRecoveryPolicy, options);
+                URISupport.SetProperties(this.recoveryPolicy, options);
             }
 
+            connection.RecoveryPolicy = this.recoveryPolicy;
+
             return connection;
         }
 
-        public NetTxRecoveryPolicy TxRecoveryPolicy
+        public NetTxRecoveryPolicy RecoveryPolicy
         {
-            get { return this.txRecoveryPolicy; }
-            set { this.txRecoveryPolicy = value; }
+            get { return this.recoveryPolicy; }
+            set { this.recoveryPolicy = value; }
         }
     }
 }



Mime
View raw message