Turkish locale system cannot build ChronicleMap
OguzhanOktayBuyuk opened this issue · comments
An error arose while attempting to utilize Chronicle Map as a client. The process involves generating Chronicle Map while configuring JVM parameters as "-Duser.language=tr -Dfile.encoding=UTF-8". During the build process, the program branches into the CachedCompiler class, located in the Chronicle-Values package, and attempts to read the VanillaGlobalMutableState$$Native.class file. However, the file contains characters which are inconsistent with Turkish conventions, as the lowercase letter "i" is converted to the uppercase character "İ". (example: writeİnt instead of writeInt)
Potential problematic place (diagnostic just gives the reason that it cannot read the file appropriately):
CompilerUtils.s_compiler.getTask(null, fileManager, diagnostic -> {
if (diagnostic.getKind() == Diagnostic.Kind.ERROR) {
errors = true;
System.err.println(diagnostic);
}
}, compilerOptions, null, compilationUnits).call();
In this code snippet there is a fileManager which is a custom file manager named MyJavaFileManager. I think there is a localization problem in this class.
I found a workaround for the problem but it is not a good solution (just for people who have a localization problem can try it). Before I build ChronicleMap, I read my location by Location.getDefault() and store it in a temporary variable. After ChronicleMap was built, I set my location Location.setDefault(temporaryVariable).
Example:
Locale locale = Locale.getDefault();
Locale.setDefault(Locale.ENGLISH);
---- ChronicleMapBuilder code ---
Locale.setDefault(locale);
Hi @OguzhanOktayBuyuk. Are you interested in trying to diagnose further and/or even come up with a patch to fix the problem?
Hi @JerryShea,
Yes, I am interested in trying to diagnose and finding a bugfix for this problem. I will try to find out.
@OguzhanOktayBuyuk any news on this?
@OguzhanOktayBuyuk please take a look at OpenHFT/Chronicle-Values#53 which @yevgenp has worked up. Are you able to test his PR against your use case to confirm everything works as expected?