In src/main/java/org/skife/jdbi/v2/sqlobject/BindMapFactory.java:
> + if (allowedKeys.isEmpty() || allowedKeys.remove(key)) {
> + q.bind(prefix + key, e.getValue());
> + }
> + }
> +
> + // Any leftover keys were specified but not found in the map, so bind as null
> + for (String key : allowedKeys) {
> + final Object val = map.get(key);
> + if (val != null) {
> + throw new IllegalStateException("Internal error: map iteration missed key " + key);
> + }
> + q.bind(prefix + key, val);
> + }
> + }
> + catch (Exception e) {
> + throw new IllegalStateException("Unable to bind map properties", e);
rethrow the IllegalArgumentException you got from above (better yet, rethrow all RuntimeExceptions without wrapping).
—
Reply to this email directly or view it on GitHub.![]()
In src/main/java/org/skife/jdbi/v2/sqlobject/BindMapFactory.java:
> +class BindMapFactory implements BinderFactory
> +{
> + @Override
> + public Binder build(Annotation annotation)
> + {
> + return new Binder<BindMap, Object>()
> + {
> + @Override
> + public void bind(SQLStatement q, BindMap bind, Object arg)
> + {
> + final String prefix;
> + if (BindBean.BARE_BINDING.equals(bind.prefix())) {
> + prefix = "";
> + }
> + else {
> + prefix = bind.prefix() + ".";
possible NPE if bind is null. (if not here, then two lines down at the bind.value())
Any chance this will get fixed up and merged?