public NodeIterator findNodes(Set propertyNames, String value, Name ntName,
boolean exact, long maxSize) throws RepositoryException {
String sr = getSearchRoot(ntName);
// TODO: remove cast once 283 is released
SessionImpl sImpl = (SessionImpl) getSession();
if (sImpl.nodeExists(sr)) {
try {
Node root = sImpl.getNode(sr);
return collectNodes(value, propertyNames, ntName, root.getNodes(), exact, maxSize);
} catch (PathNotFoundException e) {
// should not get here