You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Thomas Neidhart (Updated) (JIRA)" <ji...@apache.org> on 2012/04/09 19:17:15 UTC
[jira] [Updated] (COLLECTIONS-388) Inconsistent Javadoc comment and
code for prototypeFactory(T) in org.apache.commons.collections.FactoryUtils
[ https://issues.apache.org/jira/browse/COLLECTIONS-388?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Thomas Neidhart updated COLLECTIONS-388:
----------------------------------------
Fix Version/s: 4.0
> 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