Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrelves2007-06-22 21:36:11 +0000
committerrelves2007-06-22 21:36:11 +0000
commite1302bdc874028bcb074345cdd4fcef3e15d02a7 (patch)
treeae6493d309d63d2d9c296551d0580b1559b5c763
parent29176824f4d2ded21745569b2ba6c973031626f0 (diff)
downloadorg.eclipse.mylyn.tasks-e1302bdc874028bcb074345cdd4fcef3e15d02a7.tar.gz
org.eclipse.mylyn.tasks-e1302bdc874028bcb074345cdd4fcef3e15d02a7.tar.xz
org.eclipse.mylyn.tasks-e1302bdc874028bcb074345cdd4fcef3e15d02a7.zip
NEW - bug 193428: [api] API fails silently
https://bugs.eclipse.org/bugs/show_bug.cgi?id=193428
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskList.java22
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListContentProvider.java3
2 files changed, 18 insertions, 7 deletions
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskList.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskList.java
index 826fe9c11..0b29b1242 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskList.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskList.java
@@ -73,7 +73,7 @@ public class TaskList {
categories.put(archiveContainer.getHandleIdentifier(), archiveContainer);
}
- public void addTask(AbstractTask task) {
+ public void addTask(AbstractTask task) throws IllegalArgumentException {
addTask(task, archiveContainer);
}
@@ -102,9 +102,9 @@ public class TaskList {
* @param container
* task container, query or parent task
*/
- public void addTask(AbstractTask task, AbstractTaskContainer parentContainer) {
+ public void addTask(AbstractTask task, AbstractTaskContainer parentContainer) throws IllegalArgumentException {
if (task == null) {
- return;
+ throw new IllegalArgumentException("Task cannot be null");
}
AbstractTask newTask = tasks.get(task.getHandleIdentifier());
@@ -198,7 +198,11 @@ public class TaskList {
}
}
- public void addCategory(TaskCategory category) {
+ public void addCategory(TaskCategory category) throws IllegalArgumentException {
+ if (category == null) {
+ throw new IllegalArgumentException("Category cannot be null");
+ }
+
categories.put(category.getHandleIdentifier(), category);
Set<TaskContainerDelta> delta = new HashSet<TaskContainerDelta>();
@@ -247,7 +251,10 @@ public class TaskList {
}
}
- public void addQuery(AbstractRepositoryQuery query) {
+ public void addQuery(AbstractRepositoryQuery query) throws IllegalArgumentException {
+ if (query == null) {
+ throw new IllegalArgumentException("Query cannot be null");
+ }
queries.put(query.getHandleIdentifier(), query);
Set<TaskContainerDelta> delta = new HashSet<TaskContainerDelta>();
delta.add(new TaskContainerDelta(query, TaskContainerDelta.Kind.ADDED));
@@ -606,7 +613,8 @@ public class TaskList {
/**
* @param task
- * @param content true if the content for the task (e.g. repository task data) has changed
+ * @param content
+ * true if the content for the task (e.g. repository task data) has changed
*/
public void notifyTaskChanged(AbstractTask task, boolean content) {
for (ITaskListChangeListener listener : new ArrayList<ITaskListChangeListener>(changeListeners)) {
@@ -617,7 +625,7 @@ public class TaskList {
kind = TaskContainerDelta.Kind.CONTENT;
} else {
kind = TaskContainerDelta.Kind.CHANGED;
- }
+ }
delta.add(new TaskContainerDelta(task, kind));
listener.containersChanged(delta);
} catch (Throwable t) {
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListContentProvider.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListContentProvider.java
index 7c9a8aca1..568e2ed2a 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListContentProvider.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListContentProvider.java
@@ -61,6 +61,9 @@ public class TaskListContentProvider implements IStructuredContentProvider, ITre
return getChildren(parent);
}
+ /**
+ * returns first parent found
+ */
public Object getParent(Object child) {
// Return first parent found, first search within queries then categories.
if (child instanceof AbstractTask) {

Back to the top