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

Henri Yandell commented on COLLECTIONS-239:
-------------------------------------------

(grr's at firefox 2 for losing a long reply).

I'm still thinking we should resolve this as not to be fixed. Here's why:

OrderedIterator oi = ...;
oi.next();
oi.previous();
oi.next();
oi.previous();
// back at the start

If hasPrevious() was to return false after moving passed the first element, 
then the above would not be possible. Looking at the Javadoc for 
OrderedIterator, the previous() method does need to indicate that movement 
happens, and the class Javadoc could do with a note on this subject - that 
hasPrevious() returns true after calling the first next().

> In LinkIterator hasPrevious() is not working properly for the first entry
> -------------------------------------------------------------------------
>
>                 Key: COLLECTIONS-239
>                 URL: https://issues.apache.org/jira/browse/COLLECTIONS-239
>             Project: Commons Collections
>          Issue Type: Bug
>          Components: Iterator
>    Affects Versions: 3.2
>         Environment: Windows XP, jdk-1.5.0_02
>            Reporter: Michael Pavlov
>         Attachments: COLLECTIONS-239-test.patch
>
>
> In hasPrevious() method of LinkIterator 'next' field is used, that is not 
> correct  - method returns 'true' for the first entry. 'last' field should be 
> used insted.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to