Skip to Main Content

Berkeley DB Family

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Patch to fix time unit parsing in Turkish locale

762733Mar 25 2010 — edited May 3 2010
For BDB Java Edition (Oracle: Berkeley DB, Java Edition 4.0.92: January 29, 2010)

In src/com/sleepycat/je/utilint/PropUtil.java in the parseDuration method around line 80:

. . . . StringTokenizer tokens =
. . . . . . new StringTokenizer(property.toUpperCase(), " \t");

when the default locale is Turkish, this fails to parse "75 min" with the following exception.
java.lang.ExceptionInInitializerError
. . at com.sleepycat.je.EnvironmentConfig.setTransactional(EnvironmentConfig.java:2270)
. . at org.prebake.fs.FileHashesTest.setUp(FileHashesTest.java:40)
Caused by: java.lang.IllegalArgumentException: Duration argument has unknown unit name: 75 min
. . at com.sleepycat.je.utilint.PropUtil.parseDuration(PropUtil.java:108)
. . at com.sleepycat.je.config.DurationConfigParam.(DurationConfigParam.java:41)
. . at com.sleepycat.je.config.EnvironmentParams.(EnvironmentParams.java:402)
Possibly, the "i" in "min" is uppercased to a Turkish dotted uppercase I as described at http://www.i18nguy.com/unicode/turkish-i18n.html .

Changing those two lines to
. . . . StringTokenizer tokens =
. . . . . . new StringTokenizer(property.toUpperCase(java.util.Locale.ENGLISH), " \t");
fixes the problem.

This is not a major issue. I run unittests in the Turkish locale to avoid case folding issues that could cause whitelists to be misapplied.

Cheers,
mike
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 31 2010
Added on Mar 25 2010
4 comments
3,241 views