private static int chooseUseIndex(SingleAttributeUse[] uses) {
    for (int i = 0; i < uses.length; i++)
      if (uses[i] != null && uses[i].getType() == null && uses[i].getDefaultValue() == null)
        return i;
    int firstIndex = -1;
    for (int i = 0; i < uses.length; i++) {
      if (uses[i] != null) {
        if (firstIndex == -1)
          firstIndex = i;
        else if (!Equal.equal(uses[i].getType(), uses[firstIndex].getType())
                 || !Equal.equal(uses[i].getDefaultValue(), uses[firstIndex].getDefaultValue()))
          return -1;
      }
    }
    return firstIndex;
  }