Issue575110

classification
Title: Multiple for's on Collection broken
Type: Severity: normal
Components: Core Versions:
Milestone:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: bckfnn Nosy List: bckfnn
Priority: normal Keywords:

Created on 2002-06-28.16:52:06 by anonymous, last changed 2002-07-03.19:39:05 by bckfnn.

Files
File name Uploaded Description Edit Remove
BinForEach.py nobody, 2002-06-28.16:52:06 iterate through a hashset twice for the error
Messages
msg679 (view) Author: Nobody/Anonymous (nobody) Date: 2002-06-28.16:52:06
If multiple for loops are used on a java.util.Collection that 
is not also a java.util.List the second loop will cause a 
value error.

###############
from java.util import HashSet

hs = HashSet()

hs.add(1)

for x in hs:
    print x

for y in hs:
    print y
###############

the error is:
1
Traceback (innermost last):
  File "test/com/cnnxn/audit/jython/BinForEach.py", line 
10, in ?
ValueError: iterator indices must be consecutive ints 
starting at 0


my email: gyork@cnnxn.com

msg680 (view) Author: Finn Bock (bckfnn) Date: 2002-07-03.19:39:05
Logged In: YES 
user_id=4201

This bug has already been fixed with the iterator
implementation in CVS.
History
Date User Action Args
2002-06-28 16:52:06anonymouscreate