Skip to content

Commit 27f4eb7

Browse files
Merge pull request #34 from BorderTech/fix-pool
Allow null pool
2 parents f4c7e01 + 48db7e5 commit 27f4eb7

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

taskmaster-cache-helper/src/main/java/com/github/bordertech/taskmaster/cache/impl/CachingHelperProviderXmlConfig.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import com.github.bordertech.taskmaster.cache.CachingHelperProvider;
55
import java.net.URI;
66
import java.net.URISyntaxException;
7+
import java.net.URL;
78
import javax.cache.Cache;
89
import javax.cache.CacheManager;
910
import javax.cache.Caching;
@@ -30,7 +31,11 @@ public class CachingHelperProviderXmlConfig implements CachingHelperProvider {
3031
LOGGER.info("Loading cache config [" + config + "].");
3132
URI uri;
3233
try {
33-
uri = CachingHelperProviderXmlConfig.class.getResource(config).toURI();
34+
URL url = CachingHelperProviderXmlConfig.class.getResource(config);
35+
if (url == null) {
36+
throw new IllegalStateException("Could not find cache config [" + config + "].");
37+
}
38+
uri = url.toURI();
3439
} catch (URISyntaxException e) {
3540
throw new IllegalStateException("Could not load cache config [" + config + "]." + e.getMessage(), e);
3641
}

taskmaster-core/src/main/java/com/github/bordertech/taskmaster/impl/TaskMasterProviderExecutorService.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@ public <T> TaskFuture<T> submit(final Runnable task, final T result, final Strin
4141
if (result == null) {
4242
throw new IllegalArgumentException("Result cannot be null");
4343
}
44-
if (pool == null) {
45-
throw new IllegalArgumentException("Pool cannot be null");
46-
}
4744
// Get the executor
4845
ExecutorService exec = getPool(pool);
4946
// Submit the task

0 commit comments

Comments
 (0)