Result (@NotNull VirtualFile file) { if (!visited.add(file)) { throw new AssertionError(file + " already visited"); } String name = file.equals(myRoot) ? "/" : file.getName(); String s = "-> " + name + " [" + getCurrentValue() + "]\n"; visitLog.putValue(file.getParent(), Pair.create(file, s)); setValueForChildren(getCurrentValue() + 1); if (condition != null) { Object result = condition.fun(file); if (result instanceof Result) return (Result)result; if (result instanceof VirtualFile) return skipTo((VirtualFile)result); } return CONTINUE; }