activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r747383 - /activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/OpenWire/OpenWireBinaryWriter.cs
Date Tue, 24 Feb 2009 14:05:16 GMT
Author: tabish
Date: Tue Feb 24 14:05:15 2009
New Revision: 747383

URL: http://svn.apache.org/viewvc?rev=747383&view=rev
Log:
http://issues.apache.org/activemq/browse/AMQNET-128

Patch fixes regression in unit tests

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

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/OpenWire/OpenWireBinaryWriter.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/OpenWire/OpenWireBinaryWriter.cs?rev=747383&r1=747382&r2=747383&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/OpenWire/OpenWireBinaryWriter.cs
(original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/OpenWire/OpenWireBinaryWriter.cs
Tue Feb 24 14:05:15 2009
@@ -282,7 +282,21 @@
 
 			object IEnumerator.Current
 			{
-				get { return parent.value.Substring(Position, OpenWireBinaryWriter.MAXSTRINGLEN); }
+				get
+                {
+                    int delta;
+
+                    delta = parent.value.Length - Position;
+
+                    if (delta >= OpenWireBinaryWriter.MAXSTRINGLEN)
+                    {
+                        return parent.value.Substring(Position, OpenWireBinaryWriter.MAXSTRINGLEN);
+                    }
+                    else
+                    {
+                        return parent.value.Substring(Position, delta);
+                    }
+                }
 			}
 
 			public bool MoveNext()



Mime
View raw message