[Libreoffice-commits] core.git: xmerge/source

rbuj robert.buj at gmail.com
Thu Jul 31 02:45:03 PDT 2014


 xmerge/source/xmerge/java/org/openoffice/xmerge/util/registry/ConverterInfoMgr.java |   15 ++++------
 1 file changed, 7 insertions(+), 8 deletions(-)

New commits:
commit 56739cf7ae7d697aba4daad0b3eb66cbd6b35af2
Author: rbuj <robert.buj at gmail.com>
Date:   Wed Jul 30 14:13:01 2014 +0200

    xmerge: Avoid java.util.ConcurrentModificationException
    
    Fix removeByName function, which deletes elements of the list without an iterator.
    
    Move declarations inside the for loop in the removeByJar function, and delete the comment about removing list elements.
    
    Change-Id: I6a9ba82af2999703d1447c5c0bc5800ec4367b65

diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/util/registry/ConverterInfoMgr.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/util/registry/ConverterInfoMgr.java
index 76b0792..adf2be9 100644
--- a/xmerge/source/xmerge/java/org/openoffice/xmerge/util/registry/ConverterInfoMgr.java
+++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/util/registry/ConverterInfoMgr.java
@@ -132,13 +132,11 @@ public final class ConverterInfoMgr {
 
         boolean       rc = false;
 
-        Iterator<ConverterInfo> ciIter = converterInfoList.iterator();
-        while (ciIter.hasNext())
-        {
-            ConverterInfo converterInfo = ciIter.next();
+        for (Iterator<ConverterInfo> it = converterInfoList.iterator(); it.hasNext();) {
+            ConverterInfo converterInfo = it.next();
             if (jar.equals(converterInfo.getJarName())) {
-               ciIter.remove();
-               rc = true;
+                it.remove();
+                rc = true;
             }
         }
         return rc;
@@ -157,9 +155,10 @@ public final class ConverterInfoMgr {
 
         boolean       rc = false;
 
-        for (ConverterInfo converterInfo : converterInfoList) {
+        for (Iterator<ConverterInfo> it = converterInfoList.iterator(); it.hasNext();) {
+            ConverterInfo converterInfo = it.next();
             if (name.equals(converterInfo.getDisplayName())) {
-                converterInfoList.remove(converterInfo);
+                it.remove();
                 rc = true;
             }
         }


More information about the Libreoffice-commits mailing list