[ 
https://issues.apache.org/jira/browse/COLLECTIONS-761?focusedWorklogId=535714&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-535714
 ]

ASF GitHub Bot logged work on COLLECTIONS-761:
----------------------------------------------

                Author: ASF GitHub Bot
            Created on: 13/Jan/21 21:26
            Start Date: 13/Jan/21 21:26
    Worklog Time Spent: 10m 
      Work Description: kinow commented on pull request #205:
URL: 
https://github.com/apache/commons-collections/pull/205#issuecomment-759749343


   Hi @arturobernalg , happy 2021!
   
   > I tried to prove the Jira and was not possible. I think it's working 
correctly.
   
   From the JIRA description, it sounded to me like we would get an empty list 
when it was not desired. So that was the issue/problem we would need to fix for 
the next release.
   
   > For some reason @garydgregory suggested adding the test. I guess its 
related with my last question about the regression
   
   I think what Gary meant, is that along what I explained above, that if we 
indeed have an issue, it is really good if the person that created the JIRA 
issue can provide a unit test, and/or some small code snippet to show the 
developers what needs to be fixed.
   
   For example, if you have a JIRA-1234 issue, where it says "Serializing an 
empty list results in an Exception", then it would be nice if the person 
reporting could include some code or unit test like
   
   ```java
   @Test
   public void testEmptyListSerializationIssue() {
       // NOTE: we are not testing assertThrows(() -> {...}) here, as the test 
is for "how should the API behave", and
       //             not "how the API is behaving now"
       UtilCode.serialize(new SomeCollectionsClass();
   }
   ```
   
   Hope it helps
   Bruno


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 535714)
    Time Spent: 1h  (was: 50m)

> org.apache.commons.collections.IteratorUtils.toList() will return empty list 
> when size of iterator is 1
> -------------------------------------------------------------------------------------------------------
>
>                 Key: COLLECTIONS-761
>                 URL: https://issues.apache.org/jira/browse/COLLECTIONS-761
>             Project: Commons Collections
>          Issue Type: Bug
>    Affects Versions: 3.2.2
>            Reporter: Chen Lingqi
>            Priority: Minor
>          Time Spent: 1h
>  Remaining Estimate: 0h
>
> org.apache.commons.collections.IteratorUtils.toList() will return empty list 
> when size of iterator is 1. In this case, iterator size is 1, return value of 
> iterator.hasNext() is false, therefore, it will return empty list by default.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to