[GLASSFISH-5627] Usage of toUpperCase and toLowerCase methods and Turkish Locale Created: 24/Aug/08  Updated: 20/Dec/16  Resolved: 07/Feb/13

Status: Resolved
Project: glassfish
Component/s: other
Affects Version/s: V3
Fix Version/s: 4.0_dev

Type: Bug Priority: Minor
Reporter: bilgehan Assignee: Tom Mueller
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: All
Platform: All

Issuezilla Id: 5,627
Status Whiteboard:



Most of the java applications, IDEs, application servers including Glassfish fail to run on Turkish locale machines.
There is a very simple reason for that. Turkish language has a unique characteristic. Unlike other languages:

i uppercase> Ä° (not I)
I lowercase> ı (not i)

as you can see, there are 4 possibilities in Turkish: ı (small letter i without a dot) - I - i - İ (capital letter I with a
dot above)

So when there is a character conversion in application code (strings that are invisible to user), applications fail. For
example id becomes Ä°D, interceptor becomes Ä°NTERCEPTOR and exceptions occur. This is happening because
toLowerCase and toUpperCase methods doesn't enforce a locale argument and most developers (who are unaware
of this issue and expect that uppercase of i same everywhere on the world) don't use these methods with locale
arguments. If you want a java programme to run on Turkish locale computers, you must use these two methods
with English locale (since java code is always English, this is not a problem) for user invisible strings.

From http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html#toUpperCase(java.util.Locale) :

Language Code of Locale – Lower Case – Upper Case – Description
tr (Turkish) – \u0069 – \u0130 – small letter i -> capital letter I with dot above
tr (Turkish) – \u0131 – \u0049 – small letter dotless i -> capital letter I

Issue https://glassfish.dev.java.net/issues/show_bug.cgi?id=3851 is related to this.

Comment by kumara [ 24/Aug/08 ]

Change to status whiteboard for v3 bug tracking

Comment by vince kraemer [ 29/Aug/08 ]

this is related to issue 3691 and issue 3851... since much of the code that had
this issue in V2 was added to the V3 codebase before these issues were resolved.

Comment by kumara [ 03/Sep/08 ]

v3 defect tracking

Comment by kumara [ 19/Sep/08 ]


Comment by kumara [ 19/Sep/08 ]

Should have added that the volume of change is too large for this to be
addressed in prelude release. Will be looked at after prelude.

Comment by kumara [ 24/Oct/08 ]

Reclassifying as P4 because these issues are not must fix for prelude release.
This issue will be scrubbed after prelude release and will be given the right
priority for v3 final release.

Comment by bilgehan [ 01/Mar/09 ]

Is there going to be a change for priority?

Comment by dochez [ 29/Oct/09 ]

I don't think we want to scrub the entire workspace for possible misuse of toLowerCase and toUpperCase.
Can the submitter try again with b70 and let us know the list of exceptions he is getting on startup or
deployment of a simple Java EE application

Comment by Tom Mueller [ 06/Mar/12 ]

Bulk update to change fix version to "not determined" for all issues still open but with a fix version for a released version.

Comment by Tom Mueller [ 04/Jan/13 ]

During the past year, the findbugs program has been used within the GlassFish project, and one of the bugs found by findbugs is DM_CONVERT_CASE, which is a use of the toUpperCase or toLowerCase without specifying the locale. As of today, only 15 of those usages remain. Once those are fixed, this issue can be marked as resolved.

Comment by Tom Mueller [ 07/Feb/13 ]

The remaining cases of the DM_CONVERT_CASE findbugs error have been fixed, so all uses of toUpperCase and toLowerCase pass in an appropriate Locale.
Fixed on the trunk in revision 59291.

Generated at Tue Feb 28 13:04:57 UTC 2017 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.