Source:
<code>public void index(final ProgressMonitor progress) throws IOException { progress.start(2 ); try { try { readPackHeader(); entries = new PackedObjectInfo[(int) objectCount]; baseById = new ObjectIdSubclassMap<DeltaChain>(); baseByPos = new LongMap<UnresolvedDelta>(); progress.beginTask(PROGRESS_DOWNLOAD, (int) objectCount); for (int done = 0; done < objectCount; done++) { indexOneObject(); progress.update(1); if (progress.isCancelled()) throw new IOException("Download cancelled"); } readPackFooter(); endInput(); progress.endTask(); if (deltaCount > 0) { if (packOut == null) throw new IOException("need packOut"); resolveDeltas(progress); if (needBaseObjectIds) { Iterator<DeltaChain> iter = baseById.iterator(); baseIds = new HashSet<ObjectId>(); <START> while (iter.hasNext()) { <END> baseIds.add(iter.next()); } } if (entryCount < objectCount) { if (!fixThin) { throw new IOException("pack has " + (objectCount - entryCount) + " unresolved deltas"); } fixThinPack(progress); } } if (packOut != null && (keepEmpty || entryCount > 0)) packOut.getChannel().force(true); packDigest = null; baseById = null; baseByPos = null; if (dstIdx != null && (keepEmpty || entryCount > 0)) writeIdx(); } finally { try { InflaterCache.release(inflater); } finally { inflater = null; objectDatabase.close(); } readCurs = WindowCursor.release(readCurs); progress.endTask(); if (packOut != null) packOut.close(); } if (keepEmpty || entryCount > 0) { if (dstPack != null) dstPack.setReadOnly(); if (dstIdx != null) dstIdx.setReadOnly(); } } catch (IOException err) { if (dstPack != null) dstPack.delete(); if (dstIdx != null) dstIdx.delete(); throw err; } }</code><technical_language>a for(DeltaChain c : baseById) loop instead of Iterator</technical_language>

Target:
public void index(final ProgressMonitor progress) throws IOException { progress.start(2 ); try { try { readPackHeader(); entries = new PackedObjectInfo[(int) objectCount]; baseById = new ObjectIdSubclassMap<DeltaChain>(); baseByPos = new LongMap<UnresolvedDelta>(); progress.beginTask(PROGRESS_DOWNLOAD, (int) objectCount); for (int done = 0; done < objectCount; done++) { indexOneObject(); progress.update(1); if (progress.isCancelled()) throw new IOException("Download cancelled"); } readPackFooter(); endInput(); progress.endTask(); if (deltaCount > 0) { if (packOut == null) throw new IOException("need packOut"); resolveDeltas(progress); if (needBaseObjectIds) { baseIds = new HashSet<ObjectId>(); for (DeltaChain c : baseById) { baseIds.add(c); } } if (entryCount < objectCount) { if (!fixThin) { throw new IOException("pack has " + (objectCount - entryCount) + " unresolved deltas"); } fixThinPack(progress); } } if (packOut != null && (keepEmpty || entryCount > 0)) packOut.getChannel().force(true); packDigest = null; baseById = null; baseByPos = null; if (dstIdx != null && (keepEmpty || entryCount > 0)) writeIdx(); } finally { try { InflaterCache.release(inflater); } finally { inflater = null; objectDatabase.close(); } readCurs = WindowCursor.release(readCurs); progress.endTask(); if (packOut != null) packOut.close(); } if (keepEmpty || entryCount > 0) { if (dstPack != null) dstPack.setReadOnly(); if (dstIdx != null) dstIdx.setReadOnly(); } } catch (IOException err) { if (dstPack != null) dstPack.delete(); if (dstIdx != null) dstIdx.delete(); throw err; } }