| 1164 | */ |
| 1165 | //@Deprecated |
| 1166 | public static Field getFirstNSFFieldByType(Class clz, Class type) { |
| 1167 | if (clz == null) { |
| 1168 | throw new NullPointerException("clz == null"); |
| 1169 | } |
| 1170 | if (type == null) { |
| 1171 | throw new NullPointerException("type == null"); |
| 1172 | } |
| 1173 | while (clz != null && !clz.equals(Object.class)) { |
| 1174 | for (Field f : clz.getDeclaredFields()) { |
| 1175 | if (!f.getType().equals(type)) { |
| 1176 | continue; |
| 1177 | } |
| 1178 | int m = f.getModifiers(); |
| 1179 | if (Modifier.isStatic(m) || Modifier.isFinal(m)) { |
| 1180 | continue; |
| 1181 | } |
| 1182 | f.setAccessible(true); |
| 1183 | return f; |
| 1184 | } |
| 1185 | clz = clz.getSuperclass(); |
| 1186 | } |
| 1187 | return null; |
| 1188 | } |
| 1189 | |
| 1190 | @NonNull |
| 1191 | public static String getShortClassName(Object obj) { |