I eventually got round the problem by doing this:
rules.add((CompoundConstraint) or(new PropertiesConstraint("password", EqualTo.instance(), "oldPassword"), new PropertiesConstraint("password", EqualTo.instance(), "confirmPassword")));
It seems that when you do
It assumes that "password" is the object that must be checked. But if this was the case then I would have expected an extra method signature in the form of
rules.add("password", eqProperty("password", "oldPassword"));
Does this make sense or am I missing something?
public void add(Object, PropertyConstraint)