code: private List<Field> allFields(final Class<?> c) {
          List<Field> l = this.fieldsCache.get(c);
          if (l == null) {
              l = new LinkedList<Field>();
              final Field[] fields = c.getDeclaredFields();
              addAll(l, fields);
              Class<?> sc = c;
              while (((sc = sc.getSuperclass()) != Object.class) && (sc != null)) {
                  addAll(l, sc.getDeclaredFields());
              }
              this.fieldsCache.putIfAbsent(c, l);
          }
          return l;
      }
docs: reflection utils