Return-Path: Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: (qmail 4913 invoked from network); 28 Jan 2011 16:35:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 28 Jan 2011 16:35:41 -0000 Received: (qmail 1104 invoked by uid 500); 28 Jan 2011 16:35:41 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 1076 invoked by uid 500); 28 Jan 2011 16:35:40 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 1069 invoked by uid 99); 28 Jan 2011 16:35:39 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Jan 2011 16:35:39 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Jan 2011 16:35:39 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id DCFCC2388A39; Fri, 28 Jan 2011 16:35:18 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1064767 - /activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/NetTxConnectionFactory.cs Date: Fri, 28 Jan 2011 16:35:18 -0000 To: commits@activemq.apache.org From: tabish@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110128163518.DCFCC2388A39@eris.apache.org> 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; } } } }