Comments for r767

This commit is contained in:
Joel Leitch 2011-04-05 23:57:13 +00:00
parent dc283e1121
commit 52bf144859
2 changed files with 10 additions and 4 deletions

View File

@ -56,7 +56,13 @@ public final class FieldAttributes {
private Collection<Annotation> annotations;
FieldAttributes(Class<?> declaringClazz, Field f) {
this(declaringClazz, f, declaringClazz);
this.declaringClazz = $Preconditions.checkNotNull(declaringClazz);
this.name = f.getName();
this.declaredType = f.getType();
this.isSynthetic = f.isSynthetic();
this.modifiers = f.getModifiers();
this.field = f;
this.resolvedType = getTypeInfoForField(f, declaringClazz);
}
/**

View File

@ -77,9 +77,9 @@ final class ReflectingFieldNavigator {
if (fields == null) {
fields = new ArrayList<FieldAttributes>();
for (Class<?> curr : getInheritanceHierarchy(type)) {
Field[] fields1 = curr.getDeclaredFields();
AccessibleObject.setAccessible(fields1, true);
Field[] classFields = fields1;
Field[] currentClazzFields = curr.getDeclaredFields();
AccessibleObject.setAccessible(currentClazzFields, true);
Field[] classFields = currentClazzFields;
for (Field f : classFields) {
fields.add(new FieldAttributes(curr, f, declaredType));
}