docs: private Object[] stubWaitForResult(Stub stub, long waitTime)
                      throws ExecutionException, InterruptedException, RemoteException { // F16043
          while (true) {
              if (!Util.isLocal(stub)) {
                  org.omg.CORBA_2_3.portable.InputStream in = null;
                  try {
                      try {
                          OutputStream out = stub._request("waitForResult", true);
                          out.write_longlong(waitTime);
                          in = (org.omg.CORBA_2_3.portable.InputStream) stub._invoke(out);
                          return (Object[]) in.read_value(Object[].class);
                      } catch (ApplicationException ex) {
                          in = (org.omg.CORBA_2_3.portable.InputStream) ex.getInputStream();
                          String id = in.read_string();
                          if (id.equals("IDL:java/util/concurrent/ExecutionEx:1.0")) {
                              throw (ExecutionException) in.read_value(ExecutionException.class);
                          }
                          if (id.equals("IDL:java/lang/InterruptedEx:1.0")) {
                              throw (InterruptedException) in.read_value(InterruptedException.class);
                          }
                          throw new UnexpectedException(id);
                      } catch (RemarshalException ex) {
                          continue;
                      }
                  } catch (SystemException ex) {
                      throw Util.mapSystemException(ex);
                  } finally {
                      stub._releaseReply(in);
                  }
              }
  
              ServantObject so = stub._servant_preinvoke("waitForResult", RemoteAsyncResultExtended.class);
              if (so == null) {
                  continue;
              }
  
              try {
                  Object[] result = ((RemoteAsyncResultExtended) so.servant).waitForResult(waitTime);
                  return (Object[]) Util.copyObject(result, stub._orb());
              } catch (Throwable ex) {
                  Throwable exCopy = (Throwable) Util.copyObject(ex, stub._orb());
                  if (exCopy instanceof ExecutionException) {
                      throw (ExecutionException) exCopy;
                  }
                  if (exCopy instanceof InterruptedException) {
                      throw (InterruptedException) exCopy;
                  }
                  throw Util.wrapException(exCopy);
              } finally {
                  stub._servant_postinvoke(so);
              }
          }
      }