private void fixUpRemoteEx(Throwable t) {
    if (getSender() == null) {
      return;
    }

    String senderId = getSender().toString();
    addSenderInfo(t, senderId);

    StackTraceElement[] remoteStack = t.getStackTrace();
    StackTraceElement[] localStack = Thread.currentThread().getStackTrace();

    int localStartIdx = 0;
    if (localStartIdx < localStack.length) {
      // pop off the fixUpRemoteEx frame
      localStartIdx++;
      if (localStartIdx < localStack.length) {
        // pop off the handleAsUnexpected frame
        localStartIdx++;
      }
    }

    // do not consider localStartIdx no. of elements.
    StackTraceElement[] newStack =
        new StackTraceElement[remoteStack.length + localStack.length - localStartIdx];

    int i = 0;
    for (; i < remoteStack.length; i++) {
      newStack[i] = remoteStack[i];
    }
    for (int j = 2; i < newStack.length; j++, i++) {
      newStack[i] = localStack[j];
    }

    t.setStackTrace(newStack);
  }
Fixes a remote exception that this ReplyException has wrapped. Adds the local stack frames. The
remote stack elements have the sender id info.

@param t Remote exception to fix up
@since GemFire 5.1
geode-core/src/main/java/org/apache/geode/distributed/internal/ReplyException.java