private Set<Integer> getFieldIds(Dex dex, Set<Integer> memberNameIndexes, int declaringType) {
    Set<Integer> fields = new HashSet<Integer>();
    int fieldIndex = 0;
    for (FieldId fieldId : dex.fieldIds()) {
      if (memberNameIndexes.contains(fieldId.getNameIndex())
          && declaringType == fieldId.getDeclaringClassIndex()) {
        fields.add(fieldIndex);
      }
      fieldIndex++;
    }
    return fields;
  }
Returns the fields with {@code memberNameIndex} declared by {@code declaringType}.
android/android_framework/dex-maker/src/main/java/com/android/dx/command/findusages/FindUsages.java