-
Bug
-
Resolution: Fixed
-
Medium
-
2.1
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
- causes
-
CWD-2804 ApplicationServiceGeneric.searchUsers is slow with large numbers of users
- Closed
Note:
1) String.toLowerCase() and then equals() is always locale-sensitive
2) String.compareToIgnoreCase() does not take locale into account (from javadoc)