diff --git a/src/main/java/com/samskivert/depot/impl/DepotMarshaller.java b/src/main/java/com/samskivert/depot/impl/DepotMarshaller.java index 0119840..690ca33 100644 --- a/src/main/java/com/samskivert/depot/impl/DepotMarshaller.java +++ b/src/main/java/com/samskivert/depot/impl/DepotMarshaller.java @@ -951,6 +951,15 @@ public class DepotMarshaller implements QueryMarshal definition.add((IndexDesc)config); } else if (config instanceof List) { @SuppressWarnings("unchecked") List defs = (List)config; + // double check that their list contains objects of the correct type + if (defs.size() > 0) { + Object def = defs.get(0); + if (!(def instanceof IndexDesc)) { + throw new IllegalArgumentException( + "Method '" + name + "' must return ColumnExp[], SQLExpression or " + + "List"); + } + } definition.addAll(defs); } else { throw new IllegalArgumentException(