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

Juergen Donnerstag reassigned WICKET-3480:
------------------------------------------

    Assignee: Juergen Donnerstag

> org/apache/wicket/extensions/markup/html/tree/table/{PropertyRenderableColumn,PropertyTreeColumn}
>  common code
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-3480
>                 URL: https://issues.apache.org/jira/browse/WICKET-3480
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket-extensions
>    Affects Versions: 1.5-RC1
>         Environment: all
>            Reporter: Richard Emberson
>            Assignee: Juergen Donnerstag
>            Priority: Trivial
>
> org/apache/wicket/extensions/markup/html/tree/table/PropertyRenderableColumn
> and 
> org/apache/wicket/extensions/markup/html/tree/table/PropertyTreeColumn
> both inherit from AbstractColumn
> and have the following very similar methods:
> In PropertyRenderableColumn
>   @Override
>   public String getNodeValue(TreeNode node)
>   {
>     Object result = PropertyResolver.getValue(propertyExpression, node);
>     if (converter != null)
>     {
>       Locale locale = this.locale;
>       if (locale == null)
>       {
>         locale = Session.get().getLocale();
>       }
>       return converter.convertToString(result, locale);
>     }
>     else
>     {
>       return result != null ? result.toString() : "";
>     }
>   }
> and
> In PropertyTreeColumn
>   @Override
>   public String renderNode(TreeNode node)
>   {
>     Object result = PropertyResolver.getValue(propertyExpression, node);
>     if (converter != null)
>     {
>       Locale locale = this.locale;
>       if (locale == null)
>       {
>         locale = Session.get().getLocale();
>       }
>       return converter.convertToString(result, locale);
>     }
>     else
>     {
>       return result != null ? result.toString() : null;
>     }
>   }
> One returns null and the other returns "" when result is null.
> Question 1: Can the two methods be merged?
> Question 2: Why null in one case and "" in the other?

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

        

Reply via email to