private void attach() throws ExecutionException {
    RemoteConnection remoteConnection = myDebugEnvironment.getRemoteConnection();

    myDebugProcess.attachVirtualMachine(myDebugEnvironment, this);

    StringBuilder description = new StringBuilder(JavaDebuggerBundle.message("status.waiting.attach"));
    if (!(remoteConnection instanceof RemoteConnectionStub)) {
      String connectionName = DebuggerUtilsImpl.getConnectionDisplayName(remoteConnection);
      description.append("; ").append(JavaDebuggerBundle.message("status.waiting.attach.address", connectionName));
    }
    DebuggerInvocationUtil.swingInvokeLater(getProject(), () -> {
      getContextManager().setState(SESSION_EMPTY_CONTEXT, State.WAITING_ATTACH, Event.START_WAIT_ATTACH, description.toString());
    });
  }
private void attach()