Uploaded image for project: 'James Server'
  1. James Server
  2. JAMES-323

using toUppercase, toLowerCase, equalsIgnoreCase without specifying the locale is a bug

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.3.0
    • Component/s: None
    • Labels:
      None
    • Environment:
      turkish locale

      Description

      Subject tells all, converting case in a server application without specifying an explicit locale is almost always a bug. People may assume that this works for ASCII characters, and usually does, but not in all locale. All such code were fixed about two years ago, but I read the JDJ newsletter article and wondered what is the current status of James, and indeed I found a few new places, where the same bug reappeared:
      toUppercase():
      -MBoxMailRepository.java

      toLowercase():
      -CommandListservManager.java
      -RemoteDelivery.java
      -SenderHostIs.java

      I didn't find equalsIgnoreCase calls.

      All of the above should be replaced with toLowercase(Locale.ENGLISH) or toUppercase(Locale.ENGLISH)

        Activity

        Hide
        bago Stefano Bagnara added a comment -

        Used Locale.US (as it was already used instead of Locale.ENGLISH).

        Show
        bago Stefano Bagnara added a comment - Used Locale.US (as it was already used instead of Locale.ENGLISH).
        Hide
        danny@apache.org Danny Angus added a comment -

        Closing issue fixed in released version.

        Show
        danny@apache.org Danny Angus added a comment - Closing issue fixed in released version.

          People

          • Assignee:
            bago Stefano Bagnara
            Reporter:
            hontvari Hontvári József Levente
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development