[ 
https://issues.apache.org/jira/browse/COLLECTIONS-388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13249988#comment-13249988
 ] 

Hudson commented on COLLECTIONS-388:
------------------------------------

Integrated in commons-collections #16 (See 
[https://builds.apache.org/job/commons-collections/16/])
    [COLLECTIONS-388] Fixed javadoc, thanks to Shin Hwei Tan. (Revision 1311334)

     Result = SUCCESS
tn : http://svn.apache.org/viewvc/?view=rev&rev=1311334
Files : 
* 
/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/FactoryUtils.java
* 
/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/functors/PrototypeFactory.java

                
> 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

        

Reply via email to