Hi, Dmitry.
Probably we can reuse Java_sun_lwawt_macosx_CInputMethod_getNativeLocale?

And change the java code in the CInputMethodDescriptor to something like:

    static Object[] getAvailableLocalesInternal() {
        List<?> workList = nativeGetAvailableLocales();
        Locale nativeLocale = CIM.getNativeLocale()

        if (workList == null && nativeLocale == null)) {
                return new Object[] {
                    Locale.getDefault()
                };
        }
        if(workList != null && !workList.isEmpty() && nativeLocale == null) {
            return workList.toArray();
        }
        if((workList == null || workList.isEmpty()) && nativeLocale != null) {
                return new Object[] {
                    nativeLocale;
                };
        }
        if (!workList.contains(nativeLocale)){
                workList.add(nativeLocale);
        }
        return workList.toArray();
    }


> 
> I am sorry, I sent the incorrect version of the fix, (i.e. 
> http://cr.openjdk.java.net/~dmarkov/8163979/webrev.00/). It releases 
> currenLocale two times.
> The correct version is located at 
> http://cr.openjdk.java.net/~dmarkov/8163979/webrev.01/
> Could you review the updated fix, please?
> 
> Thanks,
> Dmitry
>> On 13 Feb 2017, at 16:58, Dmitry Markov <dmitry.mar...@oracle.com> wrote:
>> 
>> Hello,
>> 
>> Could you review a fix for jdk9, please?
>> 
>>      bug: https://bugs.openjdk.java.net/browse/JDK-8163979
>>      webrev: http://cr.openjdk.java.net/~dmarkov/8163979/webrev.00/
>> 
>> Problem description:
>> If the current keyboard layout is set to non-default value, (e.g. ABC, ABC 
>> Extended, etc) during Java launch, the input method functionality is not 
>> initialised correctly and may not work for some input methods, (e.g. 
>> OpenVanilla input method). The initialisation problems are caused by 
>> nativeGetAvailableLocales() function from CInputMethod.m. The function tries 
>> to obtain the list of available input method locales using platform API. If 
>> the retrieval is failed for some reason, nativeGetAvailableLocales() returns 
>> empty list or null.
>> 
>> Fix:
>> The function nativeGetAvailableLocales() should return the list contained 
>> the current input method locale, if it cannot retrieve the list of available 
>> locales from the platform.
>> 
>> 
>> Thanks,
>> Dmitry
> 

Reply via email to