Revision: def6f44e6fae
Author: Torsten Zesch <
torste...@gmail.com>
Date: Tue Sep 9 15:02:51 2014 UTC
Log: Fixes issue 67
https://code.google.com/p/dkpro-lab/source/detail?r=def6f44e6fae
Added:
/dkpro-lab-core/src/test/java/de/tudarmstadt/ukp/dkpro/lab/task/TaskBaseTest.java
Modified:
/dkpro-lab-core/src/main/java/de/tudarmstadt/ukp/dkpro/lab/task/impl/TaskBase.java
=======================================
--- /dev/null
+++
/dkpro-lab-core/src/test/java/de/tudarmstadt/ukp/dkpro/lab/task/TaskBaseTest.java
Tue Sep 9 15:02:51 2014 UTC
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright 2014
+ * Ubiquitous Knowledge Processing (UKP) Lab
+ * Technische Universität Darmstadt
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+
******************************************************************************/
+package de.tudarmstadt.ukp.dkpro.lab.task;
+
+import org.junit.Test;
+
+import de.tudarmstadt.ukp.dkpro.lab.task.impl.TaskBase;
+
+public class TaskBaseTest {
+
+ @Test(expected=IllegalArgumentException.class)
+ public void nullReportTest() {
+ TaskBase base = new TaskBase();
+ base.addReport(null);
+ }
+}
=======================================
---
/dkpro-lab-core/src/main/java/de/tudarmstadt/ukp/dkpro/lab/task/impl/TaskBase.java
Tue Jun 17 23:23:31 2014 UTC
+++
/dkpro-lab-core/src/main/java/de/tudarmstadt/ukp/dkpro/lab/task/impl/TaskBase.java
Tue Sep 9 15:02:51 2014 UTC
@@ -319,6 +319,9 @@
@Override
public void addReport(Class<? extends Report> aReport)
{
+ if (aReport == null) {
+ throw new IllegalArgumentException("Report class cannot be null.");
+ }
reports.add(aReport);
}