summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteffen Pingel2013-06-28 11:36:42 (EDT)
committerGerrit Code Review @ Eclipse.org2013-07-03 10:02:11 (EDT)
commitf82af84a906206b9f3cdbf92132bf0db1f4832f9 (patch)
treea399a50e99d569373bf699265380d4495ddd6100
parent93e000540e9c140e7a25e095f6fd420dff2deed4 (diff)
downloadorg.eclipse.mylyn.tasks-f82af84a906206b9f3cdbf92132bf0db1f4832f9.zip
org.eclipse.mylyn.tasks-f82af84a906206b9f3cdbf92132bf0db1f4832f9.tar.gz
org.eclipse.mylyn.tasks-f82af84a906206b9f3cdbf92132bf0db1f4832f9.tar.bz2
410655: add @NonNull annotations to task data and attachment handlerrefs/changes/37/14137/3
Change-Id: I7461144d4efc127a8ff5ad84d7923ad1b92f3e5a Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=410655
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/AbstractTaskAttachmentHandler.java14
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/AbstractTaskDataHandler.java26
2 files changed, 22 insertions, 18 deletions
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/AbstractTaskAttachmentHandler.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/AbstractTaskAttachmentHandler.java
index 5d3df4e..bb3b94e 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/AbstractTaskAttachmentHandler.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/AbstractTaskAttachmentHandler.java
@@ -15,6 +15,8 @@ import java.io.InputStream;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.TaskRepository;
@@ -26,14 +28,14 @@ import org.eclipse.mylyn.tasks.core.TaskRepository;
*/
public abstract class AbstractTaskAttachmentHandler {
- public abstract boolean canGetContent(TaskRepository repository, ITask task);
+ public abstract boolean canGetContent(@NonNull TaskRepository repository, @NonNull ITask task);
- public abstract boolean canPostContent(TaskRepository repository, ITask task);
+ public abstract boolean canPostContent(@NonNull TaskRepository repository,@NonNull ITask task);
- public abstract InputStream getContent(TaskRepository repository, ITask task, TaskAttribute attachmentAttribute,
- IProgressMonitor monitor) throws CoreException;
+ public abstract InputStream getContent(@NonNull TaskRepository repository, @NonNull ITask task, @Nullable TaskAttribute attachmentAttribute,
+ @Nullable IProgressMonitor monitor) throws CoreException;
- public abstract void postContent(TaskRepository repository, ITask task, AbstractTaskAttachmentSource source,
- String comment, TaskAttribute attachmentAttribute, IProgressMonitor monitor) throws CoreException;
+ public abstract void postContent(@NonNull TaskRepository repository, @NonNull ITask task, @NonNull AbstractTaskAttachmentSource source,
+ @Nullable String comment, @Nullable TaskAttribute attachmentAttribute, @Nullable IProgressMonitor monitor) throws CoreException;
}
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/AbstractTaskDataHandler.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/AbstractTaskDataHandler.java
index f58e26e..05d70a2 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/AbstractTaskDataHandler.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/AbstractTaskDataHandler.java
@@ -16,6 +16,8 @@ import java.util.Set;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.ITaskMapping;
import org.eclipse.mylyn.tasks.core.RepositoryResponse;
@@ -37,8 +39,8 @@ public abstract class AbstractTaskDataHandler {
*
* @since 3.0
*/
- public void getMultiTaskData(TaskRepository repository, Set<String> taskIds, TaskDataCollector collector,
- IProgressMonitor monitor) throws CoreException {
+ public void getMultiTaskData(@NonNull TaskRepository repository, @NonNull Set<String> taskIds, @NonNull TaskDataCollector collector,
+ @Nullable IProgressMonitor monitor) throws CoreException {
throw new UnsupportedOperationException();
}
@@ -47,16 +49,16 @@ public abstract class AbstractTaskDataHandler {
*
* @since 3.0
*/
- public abstract RepositoryResponse postTaskData(TaskRepository repository, TaskData taskData,
- Set<TaskAttribute> oldAttributes, IProgressMonitor monitor) throws CoreException;
+ public abstract RepositoryResponse postTaskData(@NonNull TaskRepository repository, @NonNull TaskData taskData,
+ @Nullable Set<TaskAttribute> oldAttributes, @Nullable IProgressMonitor monitor) throws CoreException;
/**
* Initialize a new task data object with default attributes and values
*
* @since 3.0
*/
- public abstract boolean initializeTaskData(TaskRepository repository, TaskData data,
- ITaskMapping initializationData, IProgressMonitor monitor) throws CoreException;
+ public abstract boolean initializeTaskData(@NonNull TaskRepository repository, @NonNull TaskData data,
+ @Nullable ITaskMapping initializationData, @Nullable IProgressMonitor monitor) throws CoreException;
/**
* Initializes <code>taskData</code> with default attributes for a subtask of <code>parentTaskData</code>.
@@ -64,8 +66,8 @@ public abstract class AbstractTaskDataHandler {
* @return false if this operation is not supported by the connector, true if initialized
* @since 3.0
*/
- public boolean initializeSubTaskData(TaskRepository repository, TaskData taskData, TaskData parentTaskData,
- IProgressMonitor monitor) throws CoreException {
+ public boolean initializeSubTaskData(@NonNull TaskRepository repository, @NonNull TaskData taskData, @NonNull TaskData parentTaskData,
+ @Nullable IProgressMonitor monitor) throws CoreException {
return false;
}
@@ -78,7 +80,7 @@ public abstract class AbstractTaskDataHandler {
* the parent task data, may be null
* @since 3.0
*/
- public boolean canInitializeSubTaskData(TaskRepository repository, ITask task) {
+ public boolean canInitializeSubTaskData(@NonNull TaskRepository repository, @Nullable ITask task) {
return false;
}
@@ -88,7 +90,7 @@ public abstract class AbstractTaskDataHandler {
* @see TaskAttributeMapper
* @since 3.0
*/
- public abstract TaskAttributeMapper getAttributeMapper(TaskRepository repository);
+ public abstract TaskAttributeMapper getAttributeMapper(@NonNull TaskRepository repository);
/**
* Returns true if connector support downloading multiple task data in single request, false otherwise. If true,
@@ -98,7 +100,7 @@ public abstract class AbstractTaskDataHandler {
* the repository for which multi task data download is supported
* @since 3.0
*/
- public boolean canGetMultiTaskData(TaskRepository repository) {
+ public boolean canGetMultiTaskData(@NonNull TaskRepository repository) {
return false;
}
@@ -110,7 +112,7 @@ public abstract class AbstractTaskDataHandler {
*
* @since 3.0
*/
- public void migrateTaskData(TaskRepository repository, TaskData taskData) {
+ public void migrateTaskData(@NonNull TaskRepository repository, @NonNull TaskData taskData) {
}
} \ No newline at end of file