Simplify AbstractTask constructor

This commit is contained in:
Gian Merlino 2013-08-20 13:38:52 -07:00
parent d8493f8e26
commit 25e330780c
1 changed files with 1 additions and 5 deletions

View File

@ -58,11 +58,7 @@ public abstract class AbstractTask implements Task
protected AbstractTask(String id, String groupId, String dataSource, Interval interval) protected AbstractTask(String id, String groupId, String dataSource, Interval interval)
{ {
this.id = Preconditions.checkNotNull(id, "id"); this(id, groupId, new TaskResource(id, 1), dataSource, interval);
this.groupId = Preconditions.checkNotNull(groupId, "groupId");
this.taskResource = new TaskResource(id, 1);
this.dataSource = Preconditions.checkNotNull(dataSource, "dataSource");
this.interval = Optional.fromNullable(interval);
} }
protected AbstractTask(String id, String groupId, TaskResource taskResource, String dataSource, Interval interval) protected AbstractTask(String id, String groupId, TaskResource taskResource, String dataSource, Interval interval)