private LocalsArraySet mergeWithOne(OneLocalsArray other) {
    OneLocalsArray newPrimary;
    ArrayList<LocalsArray> newSecondaries;
    boolean secondariesChanged = false;

    newPrimary = primary.merge(other.getPrimary());
    newSecondaries = new ArrayList(secondaries.size());

    int sz = secondaries.size();
    for (int i = 0; i < sz; i++) {
      LocalsArray la = secondaries.get(i);
      LocalsArray resultla = null;

      if (la != null) {
        try {
          resultla = la.merge(other);
        } catch (SimException ex) {
          ex.addContext("Merging one locals against caller block " + Hex.u2(i));
        }
      }

      secondariesChanged = secondariesChanged || (la != resultla);

      newSecondaries.add(resultla);
    }

    if ((primary == newPrimary) && !secondariesChanged) {
      return this;
    }

    return new LocalsArraySet(newPrimary, newSecondaries);
  }
Merges this set with a {@code OneLocalsArray} instance.

@param other {@code non-null;} to merge
@return {@code non-null;} this instance if merge was a no-op, or new merged instance.
android/android_framework/dex-maker/src/main/java/com/android/dx/cf/code/LocalsArraySet.java