docs: public static RemoteException RemoteException(String message,
                                                    Throwable cause) {
          RemoteException remote = null;
  
          // -----------------------------------------------------------------------
          // If a cause was not specified, then this method has been called to
          // just create a generic RemoteException with the specified message.
          // -----------------------------------------------------------------------
          if (cause == null) {
              remote = new RemoteException(message);
          }
  
          // -----------------------------------------------------------------------
          // If the cause happens to be a WebSphere specific subclass of
          // EJBException or RemoteException, then convert it to a plain
          // RemoteException or at least unwrap it, so a plain RemoteException
          // is created below.
          // -----------------------------------------------------------------------
          String causeMessage = null;
          while (cause != null &&
                 (cause instanceof ContainerException ||
                  cause instanceof UncheckedException ||
                  cause instanceof EJSPersistenceException ||
                  cause instanceof CPIException ||
                  cause instanceof CPMIException ||
                  cause instanceof CSIException ||
                  cause instanceof InjectionException || // d436080
                  (cause instanceof EJBException &&
                   cause instanceof WsNestedException))) {
              Throwable nextCause = cause.getCause();
              if (nextCause == null) {
                  // Nothing was nested in the WebSphere specific exception,
                  // so convert to RemoteException, copying the message and stack.
                  if (causeMessage == null) {
                      causeMessage = cause.getMessage();
                  }
                  remote = new RemoteException(causeMessage);
                  remote.setStackTrace(cause.getStackTrace());
              } else if (causeMessage == null && cause instanceof InjectionException) {
                  causeMessage = cause.getMessage();
              }
              cause = nextCause;
          }
  
          // -----------------------------------------------------------------------
          // If the cause is not already a RemoteException, then create a new
          // RemoteException and clear the stack ... let the cause stack point to
          // the failure.
          // -----------------------------------------------------------------------
          if (remote == null) {
              if (cause instanceof RemoteException) {
                  remote = (RemoteException) cause;
              } else {
                  if (causeMessage == null) {
                      causeMessage = message;
                  }
                  remote = new RemoteException(message, cause);
              }
          }
  
          return remote;
      }