dotgnu-pnet
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pnet-developers] [bugs #10411] String.Compare throws invalid exception


From: anonymous
Subject: [Pnet-developers] [bugs #10411] String.Compare throws invalid exception
User-agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0; .NET CLR 1.1.4322)

This mail is an automated notification from the bugs tracker
 of the project: DotGNU Portable.NET.




/**************************************************************************/
[bugs #10411] Full Item Snapshot:

URL: <http://savannah.gnu.org/bugs/?func=detailitem&item_id=10411>
Project: DotGNU Portable.NET
Submitted by: 0
On: Thu 09/16/2004 at 05:20

Category:  None
Severity:  5 - Average
Item Group:  None
Resolution:  None
Privacy:  Public
Assigned to:  None
Status:  Open


Summary:  String.Compare throws invalid exception

Original Submission:  The following code should not throw any exceptions , but 
throws an exception in pnet.

  String.Compare("01234567890",1, "123",1, 7);

It throws the following exception 

Uncaught exception: System.ArgumentOutOfRangeException: String range is out of 
range
Parameter name: length2
        at System.Globalization.CompareInfo.DefaultCompare(String, Int32, 
Int32, String, Int32, Int32, CompareOptions) in 
./System/Globalization/CompareInfo.cs:234
        at System.Globalization.CompareInfo.Compare(String, Int32, Int32, 
String, Int32, Int32, CompareOptions) in 
./System/Globalization/CompareInfo.cs:170
        at System.String.Compare(String, Int32, String, Int32, Int32) in 
./System/String.cs:219
        at XYZ.Main()

It looks as though Compare should be doing a Math.Min(length, strA.Length - 
indexA) for the length1 and length2 . (But that wouldn't throw the right 
exceptions anyway).






File Attachments
-------------------

-------------------------------------------------------
Date: Thu 09/16/2004 at 05:20  Name: string.cs  Size: 116B   By: None
simple test case
http://savannah.gnu.org/bugs/download.php?item_id=10411&amp;item_file_id=1675






For detailed info, follow this link:
<http://savannah.gnu.org/bugs/?func=detailitem&item_id=10411>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]