lyb211314 / oauth

Automatically exported from code.google.com/p/oauth
0 stars 0 forks source link

Improper conversion of C# code breaks the signature calculation #189

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Us the VB.net library by Nicolas Tarzia
2. Code is commented out and it gives you an incorrect signature

What is the expected output? What do you see instead?
Expected is a good signature, result is an incorrect calculatoin

What version of the product are you using? On what operating system?
vb.net on windows 7

Please provide any additional information below.
2 sections of code need to be changed:
Change:
        Protected Class QueryParameterComparer
#Region "IComparer<QueryParameter> Members"
            Public Function Compare(ByVal x As QueryParameter, ByVal y As QueryParameter) As Integer
                If (x.Nome = y.Nome) Then
                    Return String.Compare(x.Valor, y.Valor)
                Else
                    Return String.Compare(x.Nome, y.Nome)
                End If
            End Function
#End Region
        End Class
to:
        Protected Class QueryParameterComparer
            Implements IComparer(Of QueryParameter)

#Region "IComparer<QueryParameter> Members"

            Public Overridable Overloads Function Compare(ByVal x As QueryParameter, ByVal y As QueryParameter) As Integer Implements IComparer(Of QueryParameter).Compare
                If x.Name = y.Name Then
                    Return x.Value.CompareTo(y.Value)
                Else
                    Return x.Name.CompareTo(y.Name)
                End If
            End Function

#End Region
        End Class

and uncomment:
'parameters.Sort(New QueryParameterComparer())

This appears to give a correct signature.

Original issue reported on code.google.com by wil.gl...@gmail.com on 14 Oct 2010 at 5:20

GoogleCodeExporter commented 8 years ago

Original comment by morten.f...@gmail.com on 29 Mar 2011 at 5:57