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: Klaus Treichel
Subject: [Pnet-developers] [bugs #10411] String.Compare throws invalid exception
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.2) Gecko/20040906

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

/**************************************************************************/
[bugs #10411] Latest Modifications:

Changes by: 
                Klaus Treichel <address@hidden>
'Date: 
                Mon 11/22/2004 at 12:53 (GMT)

            What     | Removed                   | Added
---------------------------------------------------------------------------
          Resolution | None                      | Fixed
              Status | Open                      | Closed


------------------ Additional Follow-up Comments ----------------------------
Fixed in cvs 11/22/2004.






/**************************************************************************/
[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 09:20

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


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).


Follow-up Comments
------------------


-------------------------------------------------------
Date: Mon 11/22/2004 at 12:53       By: Klaus Treichel <ktreichel>
Fixed in cvs 11/22/2004.






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

-------------------------------------------------------
Date: Thu 09/16/2004 at 09: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]