From c2e07ec760c603c12220fa99ab5d798e8f3df9c4 Mon Sep 17 00:00:00 2001 From: Kin-Wai Koo Date: Sat, 14 Jul 2012 13:57:32 +0800 Subject: [PATCH] Fixed issues with ConcurrentModificationExceptions being thrown in the command-line interface. --- src/cli/WhisperPrep.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/cli/WhisperPrep.java b/src/cli/WhisperPrep.java index 5ef42b4..6ce7d13 100644 --- a/src/cli/WhisperPrep.java +++ b/src/cli/WhisperPrep.java @@ -1,5 +1,6 @@ package cli; +import java.util.Iterator; import java.util.List; import java.io.BufferedReader; import java.io.File; @@ -125,15 +126,16 @@ public class WhisperPrep asin = null; } - for (EXTHRecord rec : exthList) + for (Iterator it = exthList.iterator(); it.hasNext(); ) { + EXTHRecord rec = it.next(); int recType = rec.getRecordType(); if (recType == 113) { - if (asin != null) exthList.remove(rec); + if (asin != null) it.remove(); } else if (recType == 501) - exthList.remove(rec); + it.remove(); } if (asin != null) exthList.add(new EXTHRecord(113, asin, encoding));