| Locale-Sensitive Java Methodjava.lang.String
public int compareTo(String anotherString)
 Internationalization (I18n) Method OverviewThis method compares two strings based on the UTF-16 Unicode
		numeric code points of each character in the strings. The result is a negative integer
		if this String object lexicographically precedes the argument string.
		The result is a positive integer if this String object lexicographically follows the argument string.
		The result is zero if the strings are equal; compareToreturns 0 exactly when theequals(Object)method would return true.  
 I18n IssuesWhen this method is being used to compare two strings for the purpose of
		collation (alphabetic sorting), it should be replaced with the appropriate call to the
		java.text.Collatorclass to 
		take advantage of locale-based character sorting. Globalyzer will not be able to determine whether you are calling this method 
			for purposes of determining equality or to perform locale-sensitive character 
			collation. In cases 
			where it is called to determine String equality and hence you know that 
			the call does 
			not pose an I18n problem, you can use Globalyzer's 
			Ignore Comment 
			functionality to ensure that it isn't picked up again in a subsequent scan. Suggested Replacementjava.text.Collator
 public int compare(Object o1,Object o2)
 Instead of:
 Use:int i = stringA.compareTo(stringB);
 
 
		//retrieve the runtime user's localeLocale locale = new Locale(getUserLocale());
 
 //pass the user's locale as an argument
 Collator myCollator = Collator.getInstance(locale);
 int i = myCollator.compare(stringA,stringB);
 
 Please see
              Java Collation
              for more information. Locale-Sensitive Java Methods    
 |