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 2011/01/20 16:59:51 UTC

svn commit: r1061359 - in /activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands: BaseCommand.cs BaseDataStructure.cs PartialCommand.cs XATransactionId.cs

Author: tabish
Date: Thu Jan 20 15:59:50 2011
New Revision: 1061359

URL: http://svn.apache.org/viewvc?rev=1061359&view=rev
Log:
https://issues.apache.org/jira/browse/AMQNET-290

Regen the commands to add working comparison to the XATransactionId type for recovery use

Modified:
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/BaseCommand.cs
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/BaseDataStructure.cs
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/PartialCommand.cs
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/XATransactionId.cs

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/BaseCommand.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/BaseCommand.cs?rev=1061359&r1=1061358&r2=1061359&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/BaseCommand.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/BaseCommand.cs Thu Jan 20 15:59:50 2011
@@ -15,15 +15,6 @@
  * limitations under the License.
  */
 
-//
-// Marshalling code for Open Wire Format for BaseCommand
-//
-//
-// NOTE!: This file is autogenerated - do not modify!
-//        if you need to make a change, please see the Groovy scripts in the
-//        activemq-openwire module
-//
-
 using System;
 
 using Apache.NMS.ActiveMQ.State;
@@ -138,7 +129,6 @@ namespace Apache.NMS.ActiveMQ.Commands
             throw new ApplicationException("BaseCommand.Visit() not implemented");
         }
 
-
         public virtual bool IsBrokerInfo
         {
             get

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/BaseDataStructure.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/BaseDataStructure.cs?rev=1061359&r1=1061358&r2=1061359&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/BaseDataStructure.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/BaseDataStructure.cs Thu Jan 20 15:59:50 2011
@@ -15,6 +15,8 @@
  * limitations under the License.
  */
 using System;
+using System.Collections.Generic;
+
 using Apache.NMS.ActiveMQ.OpenWire;
 
 namespace Apache.NMS.ActiveMQ.Commands
@@ -81,5 +83,26 @@ namespace Apache.NMS.ActiveMQ.Commands
 			// if we had any.
 			return this.MemberwiseClone();
 		}
+
+
+        internal static bool ArrayEquals<T>(T[] a, T[] b) where T : IEquatable<T>
+        {
+            if(a.Length != b.Length)
+            {
+                return false;
+            }
+
+            EqualityComparer<T> comparer = EqualityComparer<T>.Default;
+
+            for(int i = 0; i < a.Length; i++)
+            {
+                if(!comparer.Equals(a[i], b[i]))
+                {
+                    return false;
+                }
+            }
+
+            return true;
+        }
 	}
 }

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/PartialCommand.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/PartialCommand.cs?rev=1061359&r1=1061358&r2=1061359&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/PartialCommand.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/PartialCommand.cs Thu Jan 20 15:59:50 2011
@@ -55,7 +55,7 @@ namespace Apache.NMS.ActiveMQ.Commands
         {
             return GetType().Name + "[ " + 
                 "CommandId = " + CommandId + ", " + 
-                "Data = " + Data + " ]";
+                "Data = " + System.Text.ASCIIEncoding.ASCII.GetString(Data) + " ]";
         }
 
         public int CommandId

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/XATransactionId.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/XATransactionId.cs?rev=1061359&r1=1061358&r2=1061359&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/XATransactionId.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/XATransactionId.cs Thu Jan 20 15:59:50 2011
@@ -56,8 +56,8 @@ namespace Apache.NMS.ActiveMQ.Commands
         {
             return GetType().Name + "[ " + 
                 "FormatId = " + FormatId + ", " + 
-                "GlobalTransactionId = " + GlobalTransactionId + ", " + 
-                "BranchQualifier = " + BranchQualifier + " ]";
+                "GlobalTransactionId = " + System.Text.ASCIIEncoding.ASCII.GetString(GlobalTransactionId) + ", " + 
+                "BranchQualifier = " + System.Text.ASCIIEncoding.ASCII.GetString(BranchQualifier) + " ]";
         }
 
         public int FormatId
@@ -105,11 +105,11 @@ namespace Apache.NMS.ActiveMQ.Commands
             {
                 return false;
             }
-            if(!Equals(this.GlobalTransactionId, that.GlobalTransactionId))
+            if(!ArrayEquals(this.GlobalTransactionId, that.GlobalTransactionId))
             {
                 return false;
             }
-            if(!Equals(this.BranchQualifier, that.BranchQualifier))
+            if(!ArrayEquals(this.BranchQualifier, that.BranchQualifier))
             {
                 return false;
             }