Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Davis2017-03-24 13:17:47 -0400
committerSam Davis2017-03-24 14:38:21 -0400
commit6941c63bda477183df09a54326ecf19a7de78fb3 (patch)
tree45b1e2c438a40084fd6be3bb4f31cb77c13742d3
parentb81cfc5248c1ef87bd858b537ce8176328521bd7 (diff)
downloadorg.eclipse.mylyn.tasks-e_4_7_m_3_22_x.tar.gz
org.eclipse.mylyn.tasks-e_4_7_m_3_22_x.tar.xz
org.eclipse.mylyn.tasks-e_4_7_m_3_22_x.zip
513930: ConcurrentModificationException in SynchronizeRelevantTasksJobR_3_22_0e_4_7_m_3_22_x
Change-Id: Ib77827f45549c64a0179165a568b7453a63d24d2 Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=513930
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/SynchronizeRelevantTasksJob.java14
1 files changed, 8 insertions, 6 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/SynchronizeRelevantTasksJob.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/SynchronizeRelevantTasksJob.java
index bbb3c07d4..77865730a 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/SynchronizeRelevantTasksJob.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/SynchronizeRelevantTasksJob.java
@@ -13,6 +13,7 @@ package org.eclipse.mylyn.internal.tasks.ui;
import java.util.ArrayList;
import java.util.HashSet;
+import java.util.Iterator;
import java.util.List;
import java.util.Set;
@@ -127,14 +128,15 @@ public class SynchronizeRelevantTasksJob extends Job {
}
private void addTodaysTasks(HashSet<ITask> relevantTasks) {
- Set<ITask> dueTasks = taskActivityManager.getScheduledTasks(TaskActivityUtil.getCurrentWeek().getToday());
- for (ITask dueTask : dueTasks) {
- if (dueTask.isCompleted()) {
- dueTasks.remove(dueTask);
+ Set<ITask> scheduledTasks = taskActivityManager.getScheduledTasks(TaskActivityUtil.getCurrentWeek().getToday());
+ for (Iterator<ITask> iterator = scheduledTasks.iterator(); iterator.hasNext();) {
+ ITask scheduledTask = iterator.next();
+ if (scheduledTask.isCompleted()) {
+ iterator.remove();
}
}
- if (dueTasks.size() < MAX_NUM_TASKS) {
- relevantTasks.addAll(dueTasks);
+ if (scheduledTasks.size() < MAX_NUM_TASKS) {
+ relevantTasks.addAll(scheduledTasks);
}
}

Back to the top