Hi,
In org.postgresql.core.v3.SimpleParameterList there is the following code:
void setResolvedType(int index, int oid) {
// only allow overwriting an unknown value
if (paramTypes[index-1] == Oid.UNSPECIFIED) {
paramTypes[index-1] = oid;
} else if (paramTypes[index-1] != oid) {
throw new IllegalArgumentException("Can't change resolved type for param: " + index + " from " + paramTypes[index] + " to " + oid);
}
}
In the throw statement, paramTypes[index] should be paramTypes[index-1]. (This was a little confusing until we spotted it).
It's possible the message could be more explanatory as well, would something like "Param " + index + " type mismatch - expected " + getNameForOid(oid) + " but was bound to " + getNameForOid(paramTypes[index-1]) make sense?
Cheers,
Nathan