Bug 257715 - PDB: Iterators of Tree and Tuple do not entirely adhere to the java.util.Iterator interface.
Summary: PDB: Iterators of Tree and Tuple do not entirely adhere to the java.util.Iter...
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: IMP (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: Robert M. Fuhrer CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-12-05 08:53 EST by Arnold Lankamp CLA
Modified: 2014-01-09 15:03 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Arnold Lankamp CLA 2008-12-05 08:53:37 EST
Build ID: I20070625-1500

Steps To Reproduce:
N/A

More information:
The iterators of org.eclipse.imp.pdb.impl.hash.Tree and org.eclipse.imp.pdb.impl.hash.Tuple do not entirely adhere to the java.util.Iterator interface.

Calling 'Iterator#next()' on the iterators of Tree or Tuple too many times results in an error. However, according to the specification a NoSuchElementException should be thrown in this case instead (although I admit the spec isn't all that clear).

See: http://java.sun.com/j2se/1.5.0/docs/api/java/util/Iterator.html#next()

This is relatively easy to fix. Just add this, as first line, to the 'Iterator#next()' method(s):
if(!hasNext()) throw new NoSuchElementException("No more elements in this iteration");