Here you can find the source of getAllFieldsNoCache(Class realClass, Class upperClass)
private static List getAllFieldsNoCache(Class realClass, Class upperClass)
//package com.java2s; import java.util.ArrayList; import java.util.Arrays; import java.util.List; public class Main { private static List getAllFieldsNoCache(Class realClass, Class upperClass) { if (realClass == upperClass) { return new ArrayList(0); }//from w w w .j a v a 2 s . co m List fields = getAllFieldsNoCache(realClass.getSuperclass(), upperClass); fields.addAll(Arrays.asList(realClass.getDeclaredFields())); return fields; } }