} else { List<T> childStates = getChildAsList(state, name); List<Object> list = new ArrayList<>(childStates.size()); for (T childState : childStates) {
throw new PropertyNotFoundException(xpath, "Cannot use index after segment: " + segment); List<T> list = state == null ? Collections.emptyList() : getChildAsList(state, name); if (index >= list.size()) { throw new PropertyNotFoundException(xpath, "Index out of bounds: " + index);
throw new PropertyNotFoundException(xpath, "Cannot use index after segment: " + segment); List<T> list = getChildAsList(state, name); if (index >= list.size()) { throw new PropertyNotFoundException(xpath, "Index out of bounds: " + index);
List<T> childStates = getChildAsList(state, name);