I'd refactor these lines to:

```java
for (int i = 0; i < path.length - 1; i++) {
    Field field = reflectField(path[i]);
    type = getActualType(field.getGenericType());
}
reflectField(path[path.length - 1]);
```
with `reflectField` throwing NPE if field is null and path doesn't start with `?`