Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspingel2009-10-12 04:41:09 -0400
committerspingel2009-10-12 04:41:09 -0400
commit3c2980c1893aa0ad787dfddba398c7ce3f3730d7 (patch)
tree80b347c8c306956ac90745948f539b141d6f5603 /org.eclipse.mylyn.tasks.core
parentb75302ee85ec351227c2b1066acf59163160ee70 (diff)
downloadorg.eclipse.mylyn.tasks-3c2980c1893aa0ad787dfddba398c7ce3f3730d7.tar.gz
org.eclipse.mylyn.tasks-3c2980c1893aa0ad787dfddba398c7ce3f3730d7.tar.xz
org.eclipse.mylyn.tasks-3c2980c1893aa0ad787dfddba398c7ce3f3730d7.zip
NEW - bug 291084: make time tracking optional and opt-in
https://bugs.eclipse.org/bugs/show_bug.cgi?id=291084
Diffstat (limited to 'org.eclipse.mylyn.tasks.core')
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskActivationHistory.java36
1 files changed, 20 insertions, 16 deletions
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskActivationHistory.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskActivationHistory.java
index d4c2ac220..2bccfaa49 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskActivationHistory.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskActivationHistory.java
@@ -43,7 +43,7 @@ public class TaskActivationHistory {
*/
private int previousIndex = -1;
- public void addTask(AbstractTask task) {
+ public synchronized void addTask(AbstractTask task) {
boolean isPreviousTask = false;
// optimization: do not modify list, if task is already last
if (history.isEmpty() || history.get(history.size() - 1) != task) {
@@ -61,15 +61,20 @@ public class TaskActivationHistory {
}
}
- public boolean containsTask(ITask task) {
- return history.contains(task);
+ public synchronized void addTaskInternal(AbstractTask task) {
+ history.add(task);
}
- public boolean removeTask(ITask task) {
- return history.remove(task);
+ public synchronized void clear() {
+ history.clear();
+ previousIndex = -1;
+ }
+
+ public synchronized boolean containsTask(ITask task) {
+ return history.contains(task);
}
- public AbstractTask getPreviousTask() {
+ public synchronized AbstractTask getPreviousTask() {
if (history.isEmpty()) {
return null;
}
@@ -81,14 +86,14 @@ public class TaskActivationHistory {
}
}
- public List<AbstractTask> getPreviousTasks() {
+ public synchronized List<AbstractTask> getPreviousTasks() {
return Collections.unmodifiableList(new ArrayList<AbstractTask>(history));
}
/**
* Returns task activation history for tasks present in <code>containers</code>
*/
- public List<AbstractTask> getPreviousTasks(Set<AbstractTaskContainer> containers) {
+ public synchronized List<AbstractTask> getPreviousTasks(Set<AbstractTaskContainer> containers) {
if (containers.isEmpty()) {
return getPreviousTasks();
}
@@ -106,22 +111,21 @@ public class TaskActivationHistory {
return Collections.unmodifiableList(allScopedTasks);
}
- public boolean hasPrevious() {
- return getPreviousTask() != null;
+ public synchronized int getSize() {
+ return history.size();
}
- public void clear() {
- history.clear();
- previousIndex = -1;
+ public synchronized boolean hasPrevious() {
+ return getPreviousTask() != null;
}
- public int indexOf(ITask task) {
+ public synchronized int indexOf(ITask task) {
return history.indexOf(task);
}
- public int getSize() {
- return history.size();
+ public synchronized boolean removeTask(ITask task) {
+ return history.remove(task);
}
}

Back to the top