You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Kent Tong (JIRA)" <ta...@jakarta.apache.org> on 2005/07/16 11:53:10 UTC

[jira] Created: (TAPESTRY-407) FormatTranslator overwrites the pattern specified in initializer with default pattern

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


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: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org


[jira] Assigned: (TAPESTRY-407) FormatTranslator overwrites the pattern specified in initializer with default pattern

Posted by "Paul Ferraro (JIRA)" <ta...@jakarta.apache.org>.
     [ http://issues.apache.org/jira/browse/TAPESTRY-407?page=all ]

Paul Ferraro reassigned TAPESTRY-407:
-------------------------------------

    Assign To: Paul Ferraro

> 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

>
> 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: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org


[jira] Resolved: (TAPESTRY-407) FormatTranslator overwrites the pattern specified in initializer with default pattern

Posted by "Paul Ferraro (JIRA)" <ta...@jakarta.apache.org>.
     [ 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: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org