Hi,

We added the method addParameterNode() to the node builder API, allowing for the creation of custom subpaths in cross-parameter constraint validators.

Currently such a path will look like this (the first two nodes are the default ones, the remain ones are custom created nodes):

METHOD -> CROSS_PARAMETER -> PARAMETER -> ...

I'm wondering whether it wouldn't be better to get rid of the cross-parameter node in this case:

METHOD -> PARAMETER -> ...

E.g. when looking at the following example:

    @OldAndNewPasswordDifferent
    public void resetPassword(String new, String old) { ... }

Then I think the following path might be what constraint authors want:

MethodNode("resetPassword") -> ParameterNode("old", arg1)

As it seems, the RI does the same when custom nodes are added in class-level constraint validators (i.e. no node for the class-level constraint will be part of the path). Shortly looking in the spec, I couldn't find an example mandating this behavior, though.

Any thoughts?

--Gunnar