twotoasters / clusterkraf

A clustering library for the Google Maps Android API v2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ConcurrentModificationException in ClustersBuilder.addAll()

carltonwhitehead opened this issue · comments

java.lang.RuntimeException: An error occured while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:299)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:352)
at java.util.concurrent.FutureTask.setException(FutureTask.java:219)
at java.util.concurrent.FutureTask.run(FutureTask.java:239)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
at java.lang.Thread.run(Thread.java:856)
Caused by: java.util.ConcurrentModificationException
at java.util.ArrayList$ArrayListIterator.next(ArrayList.java:569)
at com.twotoasters.clusterkraf.ClustersBuilder.addAll(ClustersBuilder.java:54)
at com.twotoasters.clusterkraf.ClusteringTask.doInBackground(ClusteringTask.java:34)
at com.twotoasters.clusterkraf.ClusteringTask.doInBackground(ClusteringTask.java:1)
at android.os.AsyncTask$2.call(AsyncTask.java:287)
at java.util.concurrent.FutureTask.run(FutureTask.java:234)
... 3 more

Created in response to a crash report received on Google Play

  • Date: May 2, 2013
  • Version: 1.0.1
  • Device: Galaxy Nexus
  • User Message: force closes

If you experienced this error, please comment if this description matches your experience.

Steps to reproduce (library / abstract)

  1. Trigger a clustering task.
  2. While the clusters are building, call clusterkraf.clear()

Steps to reproduce (Sample app)

  1. Start Clusterkraf Sample and go to Advanced Mode tab
  2. Choose Geographic Distribution of Randomized Points: Worldwide
  3. Choose Points: 25,000
  4. Choose Expand Bounds Factor (Overdraw): 1.0
  5. Tap Start Advanced Mode
  6. Wait for the initial clustering pass to finish
  7. Move the camera
  8. Immediately tap the device back button or ActionBar up indicator

Steps 2-4 and 6 are not necessarily required, but will make it easier to repeat the problem, as they will increase the time spent in the problem code.

Sample app expected behavior

Sample Activity finishes, leaving the user at the MainActivity / Advanced Mode settings list

Sample app actual behavior

Sample app crashes