in src/main/java/org/apache/sling/servlets/get/impl/helpers/JsonRenderer.java [153:173]
protected int getMaxRecursionLevel(SlingHttpServletRequest req) throws IllegalArgumentException {
int maxRecursionLevels = 0;
final String[] selectors = req.getRequestPathInfo().getSelectors();
if (selectors != null && selectors.length > 0) {
final String level = selectors[selectors.length - 1];
if(!TIDY.equals(level) && !HARRAY.equals(level)) {
if (INFINITY.equals(level)) {
maxRecursionLevels = -1;
} else {
try {
maxRecursionLevels = parseRecursionLevel(level);
} catch (ArithmeticException ae) {
maxRecursionLevels = -1;
} catch (NumberFormatException nfe) {
throw new IllegalArgumentException("Invalid recursion selector value '" + level + "'");
}
}
}
}
return maxRecursionLevels;
}