You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@weex.apache.org by GitBox <gi...@apache.org> on 2018/09/12 05:40:20 UTC

[GitHub] YorkShen closed pull request #1511: [WEEX-611][Android] Fix java.lang.ArrayIndexOutOfBoundsException

YorkShen closed pull request #1511: [WEEX-611][Android] Fix java.lang.ArrayIndexOutOfBoundsException
URL: https://github.com/apache/incubator-weex/pull/1511
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/android/sdk/src/main/java/com/taobao/weex/utils/batch/BatchOperationHelper.java b/android/sdk/src/main/java/com/taobao/weex/utils/batch/BatchOperationHelper.java
index a900cc4c45..3c79d538ee 100644
--- a/android/sdk/src/main/java/com/taobao/weex/utils/batch/BatchOperationHelper.java
+++ b/android/sdk/src/main/java/com/taobao/weex/utils/batch/BatchOperationHelper.java
@@ -32,7 +32,7 @@
 
 
   private BactchExecutor mExecutor;
-  private ArrayList <Runnable> sRegisterTasks = new ArrayList<>();
+  private CopyOnWriteArrayList<Runnable> sRegisterTasks = new CopyOnWriteArrayList<>();
   private boolean isCollecting = false;
 
   public BatchOperationHelper(BactchExecutor executor){
@@ -62,7 +62,8 @@ public void run() {
         while(iterator.hasNext()){
           Runnable item = iterator.next();
           item.run();
-          iterator.remove();
+//          iterator.remove();
+          sRegisterTasks.remove(item);
         }
       }
     });


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services