Map<SelectorName, SelectorName> rewrittenSelectors ) {
if (constraint instanceof And) {
And and = (And)constraint;
Constraint left = replaceReferencesToRemovedSource(context, and.left(), rewrittenSelectors);
Constraint right = replaceReferencesToRemovedSource(context, and.right(), rewrittenSelectors);
if (left == and.left() && right == and.right()) return and;
return new And(left, right);
}
if (constraint instanceof Or) {
Or or = (Or)constraint;
Constraint left = replaceReferencesToRemovedSource(context, or.left(), rewrittenSelectors);