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

Commit 3d529c5b authored by Mathieu Chartier's avatar Mathieu Chartier
Browse files

Change getDeclaredFieldsUnchecked call to new return value

Required for related libcore change.

Bug: 19264997
Change-Id: I17ca0cf4b9ba853e59f4a6eff3a05d9d90cf23f9
parent 5fc9b336
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;
    }