Uploaded image for project: 'Lucene.Net'
  1. Lucene.Net
  2. LUCENENET-285

Problem with "CurrentCulture"

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • None
    • None
    • None

    Description

      Hi Folks,

      There is a bug in utilizing Thread.CurrentThread.CurrentCulture.

      A float number such as 2.5 can be converted to string as "2.5" or "2,5" depending on the culture.
      if it is converted to "2,5", some of the tests(ex, TestAnalyzerReturningNull) under "QueryParser" fails
      (cause: buffer.Append(minimumSimilarity.ToString()) in FuzzyQuery.cs line 204)
      Since they make string comparison of the queries.

      There can be two solutions to this
      1- Changing, for ex,
      buffer.Append(minimumSimilarity.ToString())
      to
      buffer.Append(SupportClass.Single.ToString(minimumSimilarity)
      in Lucene.NET core (there may be many other places)
      or
      2- Changing the current-culture of the test cases to "en-US".

      Solution-2 is the simplest way, but what is the correct one?

      DIGY

      Attachments

        Activity

          People

            digydigy Digy
            digydigy Digy
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: