commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Neidhart (Resolved) (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (COLLECTIONS-388) Inconsistent Javadoc comment and code for prototypeFactory(T) in org.apache.commons.collections.FactoryUtils
Date Mon, 09 Apr 2012 17:17:16 GMT

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

Thomas Neidhart resolved COLLECTIONS-388.
-----------------------------------------

    Resolution: Fixed
    
> Inconsistent Javadoc comment and code for prototypeFactory(T) in org.apache.commons.collections.FactoryUtils
> ------------------------------------------------------------------------------------------------------------
>
>                 Key: COLLECTIONS-388
>                 URL: https://issues.apache.org/jira/browse/COLLECTIONS-388
>             Project: Commons Collections
>          Issue Type: Bug
>          Components: Collection
>    Affects Versions: 4.0, 4.x
>         Environment: Platform independent
>            Reporter: SHIN HWEI TAN
>              Labels: javadoc, null
>             Fix For: 4.0
>
>   Original Estimate: 2m
>  Remaining Estimate: 2m
>
> The Javadoc comment below states that the method "throws IllegalArgumentException if
the prototype is null":
>    	    /**	     
> 	     ..
> 	     * @param prototype  the object to clone each time in the factory
> 	     * @return the <code>prototype</code> factory
> 	     * @throws IllegalArgumentException if the prototype is null
> 	     * @throws IllegalArgumentException if the prototype cannot be cloned
> 	     */
> 	    public static <T> Factory<T> prototypeFactory(T  prototype) {
> 	        return PrototypeFactory.<T>prototypeFactory(prototype);
> 	    }
> However, the method returns a NULL_INSTANCE object instead of throwing IllegalArgumentException
when called with null.
> Suggested Fixes:
> 1. Change "@throws IllegalArgumentException if the prototype is null" and "@return" to
"@return NULL_INSTANCE if the prototype is null".
> or
> 2. Remove the entire "throws IllegalArgumentException if the prototype is null".

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message