avoid creating condition visitor if there are no conditions
@@ -251,13 +251,13 @@ public class UserQueryManager {
}
StringBuilder statement = new StringBuilder();
- ConditionVisitor visitor = new XPathConditionVisitor(statement, namePathMapper, userManager);
String searchRoot = namePathMapper.getJcrPath(QueryUtil.getSearchRoot(builder.getSelectorType(), config));
String ntName = namePathMapper.getJcrName(QueryUtil.getNodeTypeName(builder.getSelectorType()));
statement.append(searchRoot).append("//element(*,").append(ntName).append(')');
if (condition != null) {
+ ConditionVisitor visitor = new XPathConditionVisitor(statement, namePathMapper, userManager);
statement.append('[');
condition.accept(visitor);
statement.append(']');
