Project: JDT
Bug 176595 [cleanup] convert loop gets multiple iterators wrong
Reported: 2007-03-07 07:10:31 | Status: resolved fixed

Build ID: I20070209-1006 Steps To Reproduce: Was trying to compare the elements in two equally-sized lists: for (Iterator<?> it1 = list1.iterator(), it2 = list2.iterator(); it1.hasNext();) { Object e1 = it1.next(), e2 = it2.next(); if (e1 == null ? e2 != null : !e1.equals(e2)) { return false; } } More information: Loop becomes this: for (Object e2 : list2) { if (e1 == null ? e2 != null : !e1.equals(e2)) { return false; } }

Files changed in fix:
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/ConvertIterableLoopQuickFixTest.java org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/ConvertIterableLoopOperation.java