Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d9dddea5 authored by Mathieu Chartier's avatar Mathieu Chartier Committed by Android Git Automerger
Browse files

am 631565ab: Merge "Change getDeclaredFieldsUnchecked call to new return value"

* commit '631565ab':
  Change getDeclaredFieldsUnchecked call to new return value
parents d7fb6d26 631565ab
Loading
Loading
Loading
Loading
+15 −23
Original line number Diff line number Diff line
@@ -1005,30 +1005,22 @@ public class ViewDebug {
            return fields;
        }

        final ArrayList<Field> declaredFields = new ArrayList();
        klass.getDeclaredFieldsUnchecked(false, declaredFields);

        final ArrayList<Field> foundFields = new ArrayList<Field>();
        final int count = declaredFields.size();
        for (int i = 0; i < count; i++) {
            final Field field = declaredFields.get(i);

            // Ensure the field type can be resolved.
        try {
                field.getType();
            } catch (NoClassDefFoundError e) {
                continue;
            }

            if (field.isAnnotationPresent(ExportedProperty.class)) {
            final Field[] declaredFields = klass.getDeclaredFieldsUnchecked(false);
            final ArrayList<Field> foundFields = new ArrayList<Field>();
            for (final Field field : declaredFields) {
              // Fields which can't be resolved have a null type.
              if (field.getType() != null && field.isAnnotationPresent(ExportedProperty.class)) {
                  field.setAccessible(true);
                  foundFields.add(field);
                  sAnnotations.put(field, field.getAnnotation(ExportedProperty.class));
              }
            }

            fields = foundFields.toArray(new Field[foundFields.size()]);
            map.put(klass, fields);
        } catch (NoClassDefFoundError e) {
            throw new AssertionError(e);
        }

        return fields;
    }