Uploaded image for project: 'Crowd Data Center'
  1. Crowd Data Center
  2. CWD-2103

Case-insensitive String comparison is not tied to a locale

      Crowd performs case-insensitive comparisons of user/group name by:
      1) String.toLowerCase and comparing the lowercase values
      2) String.compareToIgnoreCase

      This is inconsistent and produces an ordering/equality based on the system locale.

      We should to using a single form of normalising user/group names for case-insensitive comparison, for a specific locale:

      String.toLowerCase(FIXED_LOCALE)
      

      This method should be available on a util class. The FIXED_LOCALE should default to Locale.ENGLISH.

      This affects equals, hashcode, compareTo and comparators for domain objects with case-insensitive/case-preserving name schemes.

      If Crowd 2.1 users are on a system locale that's not compatible with Locale.ENGLISH, then:
      1) They would be able to export their data to XML and re-import it, so the normalisation process happens in Locale.ENGLISH for Crowd 2.2
      2) We could allow them to specify an override for the FIXED_LOCALE via a system property

            [CWD-2103] Case-insensitive String comparison is not tied to a locale

            Monique Khairuliana (Inactive) made changes -
            Workflow Original: Simplified Crowd Development Workflow v2 - restricted [ 1511010 ] New: JAC Bug Workflow v3 [ 3365386 ]
            Status Original: Resolved [ 5 ] New: Closed [ 6 ]
            Owen made changes -
            Workflow Original: Simplified Crowd Development Workflow v2 [ 1392861 ] New: Simplified Crowd Development Workflow v2 - restricted [ 1511010 ]
            Owen made changes -
            Workflow Original: Crowd Development Workflow v2 [ 273856 ] New: Simplified Crowd Development Workflow v2 [ 1392861 ]
            joe made changes -
            Link New: This issue causes CWD-2804 [ CWD-2804 ]
            Piyawoot Songsiritat [Atlassian] made changes -
            Resolution New: Fixed [ 1 ]
            Status Original: Technical Review [ 10028 ] New: Resolved [ 5 ]
            Piyawoot Songsiritat [Atlassian] made changes -
            Status Original: In Progress [ 3 ] New: Technical Review [ 10028 ]
            James Wong made changes -
            Fix Version/s New: 2.2 Iteration 2 [ 15835 ]
            Fix Version/s Original: 2.2 Iteration 1 [ 15782 ]
            James Wong made changes -
            Fix Version/s New: 2.2 Iteration 1 [ 15782 ]

            Note:
            1) String.toLowerCase() and then equals() is always locale-sensitive
            2) String.compareToIgnoreCase() does not take locale into account (from javadoc)

            Piyawoot Songsiritat [Atlassian] added a comment - Note: 1) String.toLowerCase() and then equals() is always locale-sensitive 2) String.compareToIgnoreCase() does not take locale into account (from javadoc)
            Piyawoot Songsiritat [Atlassian] made changes -
            Worklog Id Original: 93881 [ 93881 ]
            Remaining Estimate Original: 16h [ 57600 ] New: 8h [ 28800 ]
            Time Spent New: 8h [ 28800 ]

              psongsiritat Piyawoot Songsiritat [Atlassian]
              shamid@atlassian.com shihab
              Affected customers:
              0 This affects my team
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Estimated:
                  Original Estimate - 16h
                  16h
                  Remaining:
                  Time Spent - 8h Remaining Estimate - 8h
                  8h
                  Logged:
                  Time Spent - 8h Remaining Estimate - 8h
                  8h