[jira] [Created] (COLLECTIONS-397) BoundedFifoBuffer could allow null entries

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (COLLECTIONS-397) BoundedFifoBuffer could allow null entries

ASF GitHub Bot (Jira)
BoundedFifoBuffer could allow null entries
------------------------------------------

                 Key: COLLECTIONS-397
                 URL: https://issues.apache.org/jira/browse/COLLECTIONS-397
             Project: Commons Collections
          Issue Type: Improvement
            Reporter: Sebb


BoundedFifoBuffer could easily allow null entries - it uses an array for storage.

Is there any reason why nulls should not be (optionally) allowed?
This would mean changing the remove() implementation.

--
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 | Threaded
Open this post in threaded view
|

[jira] [Commented] (COLLECTIONS-397) BoundedFifoBuffer could allow null entries

ASF GitHub Bot (Jira)

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

Sebb commented on COLLECTIONS-397:
----------------------------------

If COLLECTIONS-398-2.patch is applied (see COLLECTIONS-398) then the underlying code will support nulls.

The null check in add() would obviously have to be disabled to allow null entries.

Two possible approaches:
- remove the restriction that nulls are not allowed; this would be a change in behaviour so might not be acceptable
- add new ctors with a boolean parameter to specify whether nulls are allowed.
               

> BoundedFifoBuffer could allow null entries
> ------------------------------------------
>
>                 Key: COLLECTIONS-397
>                 URL: https://issues.apache.org/jira/browse/COLLECTIONS-397
>             Project: Commons Collections
>          Issue Type: Improvement
>            Reporter: Sebb
>
> BoundedFifoBuffer could easily allow null entries - it uses an array for storage.
> Is there any reason why nulls should not be (optionally) allowed?
> This would mean changing the remove() implementation.

--
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