qpid-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tomas Restrepo (JIRA)" <qpid-...@incubator.apache.org>
Subject [jira] Created: (QPID-238) Wrong call to string.Split() in AbstractQmsMessage.GetExchangeName()
Date Wed, 03 Jan 2007 01:24:27 GMT
Wrong call to string.Split() in AbstractQmsMessage.GetExchangeName()
--------------------------------------------------------------------

                 Key: QPID-238
                 URL: https://issues.apache.org/jira/browse/QPID-238
             Project: Qpid
          Issue Type: Bug
          Components: Dot Net Client
         Environment: .NET 1.1 and 2.0
            Reporter: Tomas Restrepo
            Priority: Trivial


AbstractQmsMessage::GetExchangeName() implements a "workaround" to a supposed bug in string.Split().
From the comments in the file:
Using an alternative split implementation here since it appears that string.Split
is broken in .NET. It doesn't split when the first character is the delimiter.
Here we check for the first character being the delimiter. This handles the case
where ExchangeName is empty (i.e. sends will be to the default exchange).

This is actually a non-issue; the problem is an invalid argument getting passed to string.Split.
The current call is:

string[] split = replyToEncoding.Split(new char[':']);

Notice the char array argument is wrong and should've been: new char[] { ';'}.
To avoid issues like this I propose to avoid creating explicit parameter arrays for string.Split()
calls (which are used in several places in the code base) and instead let the compiler generate
them instead (since it is a params array):

string[] split = replyToEncoding.Split(';');

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message