You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "SHIN HWEI TAN (Created) (JIRA)" <ji...@apache.org> on 2012/01/08 09:30:39 UTC
[jira] [Created] (COLLECTIONS-388) Inconsistent Javadoc comment and
code for prototypeFactory(T) in org.apache.commons.collections.FactoryUtils
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
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
[jira] [Updated] (COLLECTIONS-388) Inconsistent Javadoc comment and
code for prototypeFactory(T) in org.apache.commons.collections.FactoryUtils
Posted by "Thomas Neidhart (Updated) (JIRA)" <ji...@apache.org>.
[ 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
[jira] [Commented] (COLLECTIONS-388) Inconsistent Javadoc comment
and code for prototypeFactory(T) in
org.apache.commons.collections.FactoryUtils
Posted by "Thomas Neidhart (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/COLLECTIONS-388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13249973#comment-13249973 ]
Thomas Neidhart commented on COLLECTIONS-388:
---------------------------------------------
Thanks for the hint, it has been fixed in r1311334.
> 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
> 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
[jira] [Resolved] (COLLECTIONS-388) Inconsistent Javadoc comment
and code for prototypeFactory(T) in
org.apache.commons.collections.FactoryUtils
Posted by "Thomas Neidhart (Resolved) (JIRA)" <ji...@apache.org>.
[ 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
[jira] [Commented] (COLLECTIONS-388) Inconsistent Javadoc comment
and code for prototypeFactory(T) in
org.apache.commons.collections.FactoryUtils
Posted by "Hudson (Commented) (JIRA)" <ji...@apache.org>.
[ 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