If I pass an empty java.util.Collection to PersistenceManager.getObjectsById, it throws:
javax.jdo.JDOUserException: getObjectsById() does not accept null id values.
This seems totally incongruous, since JDOHelper.getObjectIds(emptyCollection) tolerates t just fine and returns an empty collection.
In other words, imho you should be able to do this:
Collection empty = new HashSet();
Collection objs = pm.getObjectsById(JDOHelper.getObjectIds(empty));
I know that seems ridiculous on the surface, but hopefully you get my gist. It sucks to have to empty-check and write special case code to handle that. Imho, pm.getObjectsById would just return an empty collection if it was passed an empty collection of OIDs.