static void main() { Locale.setDefault(Locale.of("tr", "TR")); PersistenceManager persistenceManager = Utilities.getPersistenceManager("objectdb.mem"); Query<Test> query = persistenceManager.newQuery(Test.class); query.setOrdering("this.x descending"); query.execute(); } @Entity static class Test { int x = 0; }
Running main crashes with:
Exception in thread "main" [ObjectDB 2.9.5_05] this.x ==> descending <== javax.jdo.JDOUserException Unexpected query token 'descending' (error 752) (position 7) at com.objectdb.jdo.JdoQuery.execute0(JdoQuery.java:872) at com.objectdb.jdo.JdoQuery.execute(JdoQuery.java:747)
This is only happening in Turkish locale. I suspect that ObjectDB is converting strings to uppercase/lowercase with default locale instead of Locale.ROOT, so any word that contains "i" will get converted according to Turkish capitalization rules (i -> İ, I -> ı) and break parsing.
This is breaking every query that contains ordering, and possibly a lot more. I ran the query with breakpoints in java.lang.ConditionalSpecialCasing which handles Turkish and a few other locales, and there are a huge number of strings in ObjectDB classes that are being converted with Turkish locale.
