Use of Object instead of generic T in StringAutoCompleteRenderer
----------------------------------------------------------------

                 Key: WICKET-2520
                 URL: https://issues.apache.org/jira/browse/WICKET-2520
             Project: Wicket
          Issue Type: Bug
          Components: wicket-extensions
    Affects Versions: 1.4.2
         Environment: N/A
            Reporter: Keith R. Bennett
            Priority: Minor


The method getTextValue is defined in 
org.apache.wicket.extensions.ajax.markup.html.autocomplete.AbstractAutoCompleteRenderer
 as:

        protected abstract String getTextValue(T object);

...but overridden in StringAutoCompleteRenderer as:

         // @see AbstractAutoCompleteTextRenderer#getTextValue(Object)
        protected String getTextValue(Object object)
        {
                return object.toString();
        }

The Javadoc implies that the intention is to override the superclass' method. I 
think the parameter type should be changed from Object to T.

I recommend that when using something like T, to name the parameter 'value' 
rather than 'object'.  'object' is misleading, as, by convention, it implies 
that its data type is Object.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to