You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Rob Owen (JIRA)" <ji...@apache.org> on 2010/02/23 21:09:29 UTC

[jira] Created: (JCR-2515) ISO8601 uses default DecimalFormat constructor using locale specific digits

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


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.


[jira] Assigned: (JCR-2515) ISO8601 uses default DecimalFormat constructor using locale specific digits

Posted by "Stefan Guggisberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-2515?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stefan Guggisberg reassigned JCR-2515:
--------------------------------------

    Assignee: Stefan Guggisberg

> 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
>
> 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.


[jira] Resolved: (JCR-2515) ISO8601 uses default DecimalFormat constructor using locale specific digits

Posted by "Stefan Guggisberg (JIRA)" <ji...@apache.org>.
     [ 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.