From fcee628c1292fe0c32de9036ab97be15f2d9823f Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Fri, 3 Aug 2012 12:45:39 +0000 Subject: [PATCH] Throw IllegalArgumentException from addParameter for null parameters instead of silently ignoring them (#9147) svn changeset:24057/svn branch:6.8 --- .../util/sqlcontainer/query/generator/StatementHelper.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/com/vaadin/data/util/sqlcontainer/query/generator/StatementHelper.java b/src/com/vaadin/data/util/sqlcontainer/query/generator/StatementHelper.java index f9458609c3..b012ce7685 100644 --- a/src/com/vaadin/data/util/sqlcontainer/query/generator/StatementHelper.java +++ b/src/com/vaadin/data/util/sqlcontainer/query/generator/StatementHelper.java @@ -47,6 +47,10 @@ public class StatementHelper implements Serializable { if (parameter != null) { parameters.add(parameter); dataTypes.put(parameters.size() - 1, parameter.getClass()); + } else { + throw new IllegalArgumentException( + "You cannot add null parameters using addParamaters(Object). " + + "Use addParameters(Object,Class) instead"); } } -- 2.39.5