From 6930ed5b40cfe46f45024ccfaa9499e58671dc1f Mon Sep 17 00:00:00 2001 From: Par Winzell Date: Thu, 25 Feb 2010 18:48:24 +0000 Subject: [PATCH] Bring back this test: WithKeys's constructor begins with iterator().next().getClass() and it's not obvious to me that it can made to elegantly not knowing that class. --- src/java/com/samskivert/depot/DepotRepository.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/java/com/samskivert/depot/DepotRepository.java b/src/java/com/samskivert/depot/DepotRepository.java index 466d1ae..82b4899 100644 --- a/src/java/com/samskivert/depot/DepotRepository.java +++ b/src/java/com/samskivert/depot/DepotRepository.java @@ -198,8 +198,8 @@ public abstract class DepotRepository public List loadAll (Iterable> keys) throws DatabaseException { - return _ctx.invoke(new FindAllQuery.WithKeys(_ctx, keys)); - } + return Iterables.isEmpty(keys) ? Collections.emptyList() : + _ctx.invoke(new FindAllQuery.WithKeys(_ctx, keys)); } /** * A varargs version of {@link #findAll(Class,Iterable)}.