activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r512742 - in /activemq/activemq-dotnet/trunk/src/main/csharp: ActiveMQ/Commands/ActiveMQTextMessage.cs MSMQ/TextMessage.cs
Date Wed, 28 Feb 2007 13:02:51 GMT
Author: jstrachan
Date: Wed Feb 28 05:02:50 2007
New Revision: 512742

URL: http://svn.apache.org/viewvc?view=rev&rev=512742
Log:
fix for  AMQNET-40

Modified:
    activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/Commands/ActiveMQTextMessage.cs
    activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/TextMessage.cs

Modified: activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/Commands/ActiveMQTextMessage.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/Commands/ActiveMQTextMessage.cs?view=diff&rev=512742&r1=512741&r2=512742
==============================================================================
--- activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/Commands/ActiveMQTextMessage.cs
(original)
+++ activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/Commands/ActiveMQTextMessage.cs
Wed Feb 28 05:02:50 2007
@@ -23,6 +23,8 @@
 	public class ActiveMQTextMessage : ActiveMQMessage, ITextMessage
     {
         public const byte ID_ActiveMQTextMessage = 28;
+
+		public const int SIZE_OF_INT = 4; // sizeof(int) - though causes unsafe issues with net
1.1
         
         private String text;
         
@@ -58,10 +60,10 @@
                     if (data != null)
                     {
                         // TODO assume that the text is ASCII
-                        char[] chars = new char[data.Length-sizeof(int)];
+                        char[] chars = new char[data.Length - SIZE_OF_INT];
                         for (int i = 0; i < chars.Length; i++)
                         {
-                            chars[i] = (char) data[i+sizeof(int)];
+                            chars[i] = (char) data[i + SIZE_OF_INT];
                         }
                         text = new String(chars);
                     }

Modified: activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/TextMessage.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/TextMessage.cs?view=diff&rev=512742&r1=512741&r2=512742
==============================================================================
--- activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/TextMessage.cs (original)
+++ activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/TextMessage.cs Wed Feb 28 05:02:50
2007
@@ -22,6 +22,8 @@
 {
 	public class TextMessage : BaseMessage, ITextMessage
     {
+		public const int SIZE_OF_INT = 4; // sizeof(int) - though causes unsafe issues with net
1.1
+
         private String text;
         
         public TextMessage()
@@ -46,10 +48,10 @@
                     if (data != null)
                     {
                         // TODO assume that the text is ASCII
-                        char[] chars = new char[data.Length-sizeof(int)];
+                        char[] chars = new char[data.Length - SIZE_OF_INT];
                         for (int i = 0; i < chars.Length; i++)
                         {
-                            chars[i] = (char) data[i+sizeof(int)];
+                            chars[i] = (char) data[i + SIZE_OF_INT];
                         }
                         text = new String(chars);
                     }



Mime
View raw message