Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 325060

Summary: RAP fails with Turkish Locale...
Product: [RT] RAP Reporter: Hasan Ceylan <hceylan>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: critical    
Priority: P3 CC: artur.kronenberg, ruediger.herrmann
Version: unspecified   
Target Milestone: 1.4 M3   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Patch for turkish locale
none
Test case
none
Test cases and patch ivan: iplog+

Description Hasan Ceylan CLA 2010-09-12 16:40:17 EDT
Build Identifier: 

"The Turkish I case" and how it affects applications that use toUpper() and toLower()  is explained here, http://java.sys-con.com/node/46241

In this incident the problem was in LifeCycleAdapterFactory.
In loadWidgetLCA(..) method RAP uses simpleClassName.toLowerCase(). then for 'MenuItem', it becomes 'menu&#305;tem'.

Hope you can spot (bugzilla deals properly with Turkish Charset) the Turkish i withOUT the dot in small menu&#305;tem

the solution to use toUpper(Locale.EN) and toLower(Locale.EN) to ensure it works in Turkish Environment

Regards,
Hasan Ceylan

Reproducible: Always

Steps to Reproduce:
1. user tr_TR locale
2. try any RAP demo
Comment 1 Ralf Sternberg CLA 2010-09-13 04:25:10 EDT
Here's a short version of the problem: http://jukkaz.wordpress.com/2010/04/12/simple-tolowercase-is-simple-right/

Running the RWT test suites with a turkish locale leads to one failure and a lot of errors. Add this to the beginning of the test suite:

//    Locale.setDefault( new Locale( "fr", "FR" ) ); // french works fine
    Locale.setDefault( new Locale( "tr", "TR" ) );
Comment 2 Artur Kronenberg CLA 2010-09-27 09:28:33 EDT
Created attachment 179636 [details]
Patch for turkish locale

All the test cases run with this patch. I also ran the business examples demo and had no problems with the Turkish locale.
Comment 3 RĂ¼diger Herrmann CLA 2010-09-27 13:38:34 EDT
Created attachment 179669 [details]
Test case

This test case uses HtmlResponseWriterUtil#isEmptyEntity() with a turkish locale.
It should be possible to write a similar test case for the LifeCycleAdapterFactory case.
Comment 4 Artur Kronenberg CLA 2010-09-28 07:07:56 EDT
Created attachment 179726 [details]
Test cases and patch

I added a test case to your patch that checks the LifeCycleAdapterFactory case and the patch itself.
Comment 5 Hasan Ceylan CLA 2010-09-28 07:24:45 EDT
glad that it helped...
Comment 6 Ivan Furnadjiev CLA 2010-10-07 04:37:14 EDT
Applied last patch to CVS HEAD.
Comment 7 Ralf Sternberg CLA 2010-10-07 12:29:03 EDT
We still have some String.toLowerCase()'s in our code which potentially have similar problems. As an example, finding a ThemeAdapter for a widget with uppercase "I" in its name will not work with a Turkish locale. I think we should come up with some more tests and fix this issue entirely.
Comment 8 Ivan Furnadjiev CLA 2010-10-08 09:24:03 EDT
Also fixed:
QxColor
ThemeAdapterUtil
ThemeManager
PropertyResolver
FontDialog