[ http://issues.apache.org/jira/browse/TAPESTRY-407?page=all ]
     
Paul Ferraro resolved TAPESTRY-407:
-----------------------------------

    Fix Version: 4.0
     Resolution: Fixed

Fixed and updated DateTranslator and NumberTranslator test cases to test for 
this condition.

> FormatTranslator overwrites the pattern specified in initializer with default 
> pattern
> -------------------------------------------------------------------------------------
>
>          Key: TAPESTRY-407
>          URL: http://issues.apache.org/jira/browse/TAPESTRY-407
>      Project: Tapestry
>         Type: Bug
>   Components: Framework
>     Versions: 4.0
>  Environment: WinXP
>     Reporter: Kent Tong
>     Assignee: Paul Ferraro
>      Fix For: 4.0

>
> The test case shows the problem. At the moment the test case fails:
> public class TestTranslator extends TestCase {
>       public void testPattern() throws Exception {
>               DateTranslator translator = new 
> DateTranslator("pattern=dd/MM/yyyy");
>               assertEquals(translator.getPattern(), "dd/MM/yyyy");
>       }
> }
> This is because FormatTranslator sets the pattern to default pattern AFTER 
> calling super(initializer):
> public abstract class FormatTranslator extends AbstractTranslator
> {
>     private String _pattern = defaultPattern(); //Step 2: the pattern is 
> overwritten by the default!
>     protected abstract String defaultPattern();
>     ...
>     public FormatTranslator(String initializer)
>     {
>         super(initializer); //Step 1: This is done first to set the pattern
>     }
> }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to