bugDotGNU Portable.NET - Bugs: bug #2492, CompareInfo.Compare() throws...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #2492: CompareInfo.Compare() throws exception with an empty string

Submitted by:  Marcus Urban <mathpup>
Submitted on:  Fri 07 Feb 2003 09:08:23 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

Fri 07 Feb 2003 02:24:44 PM UTC, comment #3:

ok, applied that patch #1084

have fun :)

Gopal.V <t3rmin4t0r>
Project Administrator
Fri 07 Feb 2003 09:30:40 AM UTC, comment #2:

Ugh. The first test case was botched.

Marcus Urban <mathpup>
Fri 07 Feb 2003 09:23:48 AM UTC, comment #1:

In the test case, change the first statement to
CompareInfo compInfo = CompareInfo.GetCompareInfo("en-US");

PNet does not handle "" correctly at the culture name. Rotor's documentation indicates the "" is the name of the invariant culture.

Marcus Urban <mathpup>
Fri 07 Feb 2003 09:08:23 AM UTC, original submission:

When one of the strings passed to CompareInfo.Compare() is the empty string, an exception is thrown. The problem is that Compare() passes the string, a length, and an offset to DefaultCompare, and DefaultCompare throws an exception if
offset1 >= string1.Length or offset2 >= string2.Length. Throwing the exception is the right thing to do for non-empty strings, but the empty string needs to be a special case.

Marcus Urban <mathpup>

 

Attached Files
file #283:  namevalue.cs added by mathpup (262B - text/x-csharp - This test case works)
file #282:  namevalue.cs added by mathpup (258B - text/x-csharp - Test case)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 2 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Fri 07 Feb 2003 02:24:44 PM UTCt3rmin4t0rStatusNone=>(Error - Not Found)
  Open/ClosedOpen=>(Error - Not Found)

Back to the top


Powered by Savane 3.1-cleanup1