db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DERBY-5420) Regression suite is locale sensitive: failed in TableLockBasicTest with Norwegian locale on Windows.
Date Sat, 24 Sep 2011 07:53:26 GMT

    [ https://issues.apache.org/jira/browse/DERBY-5420?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13113928#comment-13113928
] 

Knut Anders Hatlen commented on DERBY-5420:
-------------------------------------------

As to the renaming of the issue, isn't it rather RealBasicNoPutResultSetStatistics that's
locale insensitive than the regression test suite being locale sensitive? :)

The patch looks fine to me. Two possible improvements:

- Should we append ": {0,number,###########0.00}" to the localized versions of these messages?

- In MessageBuilder, it might be easier to clear the format specifier using MessageFormat.setFormatByArgumentIndex().
Something like:


--- a/java/build/org/apache/derbyBuild/MessageBuilder.java
+++ b/java/build/org/apache/derbyBuild/MessageBuilder.java
@@ -659,14 +659,16 @@ public class MessageBuilder extends Task
     {
         int             count = rawArgs.length;
         String[]    cookedArgs = new String[ count ];
+        MessageFormat format = new MessageFormat(message);
 
         // add xml angle brackets around the args
         for ( int i = 0; i < count; i++ )
         {
             cookedArgs[ i ] = "<varname>&lt;" + rawArgs[ i ] + "&gt;</varname>";
+            format.setFormatByArgumentIndex(i, null);
         }
 
-        return MessageFormat.format( message, cookedArgs );
+        return format.format(cookedArgs);
     }
 
     /////////////////////////////////////////////////////////////////////////

> Regression suite is locale sensitive: failed in TableLockBasicTest  with Norwegian locale
on Windows.
> -----------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-5420
>                 URL: https://issues.apache.org/jira/browse/DERBY-5420
>             Project: Derby
>          Issue Type: Bug
>          Components: Localization, Store, Test
>    Affects Versions: 10.8.1.2
>         Environment: Windows Vista SP2, Norwegian locale, JDK 7.
>            Reporter: Dag H. Wanvik
>            Assignee: Dag H. Wanvik
>            Priority: Minor
>         Attachments: derby-5420-1.diff, derby-5420-1.stat
>
>
> TableLockBasicTest failed due to unexpected locale in the runtime statistics.
> The execution plans are asserted in this test and I saw this diff:
> Expected:
>         :
> 	optimizer estimated row count:            6.00
> 	optimizer estimated cost:          100.40<
> Found:
>         :
>         optimizer estimated row count:            6,00
> 	optimizer estimated cost:          100,40<
> the latter using a decimal comma whereas a decimal point is expected.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message