jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefan Guggisberg (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (JCR-2515) ISO8601 uses default DecimalFormat constructor using locale specific digits
Date Wed, 24 Feb 2010 13:22:27 GMT

     [ https://issues.apache.org/jira/browse/JCR-2515?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Stefan Guggisberg resolved JCR-2515.
------------------------------------

       Resolution: Fixed
    Fix Version/s: 2.1.0

fixed in svn r915777 by getting rid of DecimalFormat altogether

thanks for reporting this issue!



> ISO8601 uses default DecimalFormat constructor using locale specific digits
> ---------------------------------------------------------------------------
>
>                 Key: JCR-2515
>                 URL: https://issues.apache.org/jira/browse/JCR-2515
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-jcr-commons
>    Affects Versions: 2.0.0
>            Reporter: Rob Owen
>            Assignee: Stefan Guggisberg
>             Fix For: 2.1.0
>
>
> ISO8601.java uses the default DecimalFormat constructor which uses locale specific DecimalFormatSymbols.
Runnning Jackrabbit in an Indian locale the format() produces a date using DEVANAGARI numeric
digits. The saved version (UTF-8) encoded is much longer than usual and is not transportable.
On parsing, DecimalFormat works, but TimeZone.getTimeZone("GMT+09:30") (with Indian numeric
digits) fails and null is returned from ISO8601. Later this traceback occurs.
> 2010-02-22 15:14:04,059[http-0.0.0.0-8080-16] ERROR org.apache.jackrabbit.core.persistence.bundle.BundleFsPersistenceManager
- failed to write bundle: ff629488-ebb9-4300-a63b-341553cc1140
> java.lang.IllegalArgumentException: argument can not be null
> 	at org.apache.jackrabbit.util.ISO8601.format(ISO8601.java:217)
> 	at org.apache.jackrabbit.core.value.InternalValue.toString(InternalValue.java:531)
> 	at org.apache.jackrabbit.core.persistence.bundle.util.BundleBinding.writeState(BundleBinding.java:689)
> 	at org.apache.jackrabbit.core.persistence.bundle.util.BundleBinding.writeBundle(BundleBinding.java:273)
> 	at org.apache.jackrabbit.core.persistence.bundle.BundleFsPersistenceManager.storeBundle(BundleFsPersistenceManager.java:664)
> 	at org.apache.jackrabbit.core.persistence.bundle.AbstractBundlePersistenceManager.putBundle(AbstractBundlePersistenceManager.java:703)
> 	at org.apache.jackrabbit.core.persistence.bundle.AbstractBundlePersistenceManager.store(AbstractBundlePersistenceManager.java:643)
> ISO8601 probably meant the chars to be ASCII, and so the constructor with a fixed locale
is more appropriate (and this doesn't encounter the TimeZone issue either).
>     private static final DecimalFormat XX_FORMAT = new DecimalFormat("00", new DecimalFormatSymbols(Locale.US));
>     private static final DecimalFormat XXX_FORMAT = new DecimalFormat("000", new DecimalFormatSymbols(Locale.US));
>     private static final DecimalFormat XXXX_FORMAT = new DecimalFormat("0000", new DecimalFormatSymbols(Locale.US));
>  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message