code: public static int findIndexForFieldPath(final String fieldPath, final List<JBBPNamedFieldInfo> namedFields) {
      final String normalized = JBBPUtils.normalizeFieldNameOrPath(fieldPath);
      int result = -1;
      for (int i = namedFields.size() - 1; i >= 0; i--) {
        final JBBPNamedFieldInfo f = namedFields.get(i);
        if (normalized.equals(f.getFieldPath())) {
          result = i;
          break;
        }
      }
      return result;
    }
docs: Find a named field info index in a list for its path.
  
  @param fieldPath   a field path, it must not be null.
  @param namedFields a list contains named field info items.
  @return the index of a field for the path if found one, -1 otherwise