Skip to content

Commit

Permalink
Merge branch 'master' into master-androidx
Browse files Browse the repository at this point in the history
  • Loading branch information
keepactive committed Dec 16, 2020
2 parents 6b29a71 + bd8b37b commit 0eeb14f
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,13 @@ public static <T> void register(@NonNull Class<T> tClass, @NonNull String name,
Utils.checkNullPointer(name, "name");
Utils.checkNullPointer(callable, "callable");
synchronized (serviceMap) {
unregister(tClass);
HashMap<String, Callable<?>> implServiceMap = serviceMap.get(tClass);
if (implServiceMap == null) {
implServiceMap = new HashMap<>();
serviceMap.put(tClass, implServiceMap);
}
if (Component.isDebug()) {
if (implServiceMap.containsKey(name)) {
throw new RuntimeException("the key of " + name + " is exist");
}
if (implServiceMap.containsKey(name)) {
throw new RuntimeException("the key of " + name + " is exist");
}
implServiceMap.put(name, callable);
}
Expand Down

0 comments on commit 0eeb14f

Please sign in to comment.