docs: private Exception mapCSIException(EJSDeployedSupport s, CSIException e) throws CSIException
      {
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
              Tr.entry(tc, "mapCSIException: " + e);
          }
  
          Exception mappedException = null;
          String message = " ";
  
          // First map CSIException to a RemoteException.
          RemoteException rex;
  
          if (e instanceof CSITransactionRolledbackException)
          {
              //445903 start: We must look for a HeuristicMixedException nested in the CSITransactionRolledbackException
              //and if found, make sure it is nested in a RemoteException so the user will see the HeuristicMixedException.
              //If we throw a TransactionRolledbackException with the HeuristicMixedException nested within it, or if we
              //throw only the TransactionRolledbackException (pre-d445903), this will give the impression that the transaction
              //has been rolledback.  However, by its definition, a HeuristicMixedException indicates that some updates/resources
              //have been committed and other may have been committed.  As such, throwing only a TransactionRolledbackException
              //or TransactionRolledbackException + HeuristicMixedException can be misleading.
              //
              //PK87857 note: When this APAR was put in earlier releases, the 'instanceof' check for HME was included in the
              //same 'if' check as is included in the 'else if' block to follow.  However, in v7.0 dev, the following 'if'
              //block was added via d445903.  As such, we must leave this code 'as-is' so as not to regress anyone.  It
              //should also be noted that this 'if' block is a potential spec violation.  That is, if the HME is caused by
              //a component other than the Tx 'beginner', the RemoteException + HME will flow back up stream rather than the
              //spec mandated TransactionRolledbackException; needless to say this causes a spec violation.
              if (e.detail instanceof HeuristicMixedException) {
                  //Nest the HeuristicMixedException within a RemoteException.
                  rex = new RemoteException("", e.detail);
              }
              //PK87857: We must look for a HeuristicRollbackException nested in the
              //CSITransactionRolledbackException and if found, we must make sure it is nested in an
              //RemoteException so the user will see the Heuristic Exception.  Let me explain why this should be done:
              //  If we throw a TransactionRolledbackException with the HeuristicRollbackException nested within it, or
              //  if we throw only the TransactionRolledbackException (pre-PK87857), this will give the impression that the
              //  transaction has been rolledback.  In the case of a HeuristicRollbackException, the transaction has
              //  been rolledback so a TransactionRolledbackException is valid, however, it may be important for the user
              //  to know that a Heuristic decision was made to rollback the transaction.
              else if (IncludeNestedExceptionsExtended
                       && (s.began || AllowSpecViolationOnRollback)
                       && (e.detail instanceof HeuristicRollbackException)) {
                  //Nest the Heuristic Exception in a RemoteException.
                  rex = new RemoteException("", e.detail);
              }
              else {
                  rex = new TransactionRolledbackException(message);
              }
              //445903 end
          }
          else if (e instanceof CSIAccessException)
          {
              rex = new AccessException(message);
          }
          else if (e instanceof CSIInvalidTransactionException)
          {
              rex = new InvalidTransactionException(message);
          }
          else if (e instanceof CSITransactionRequiredException)
          {
              rex = new TransactionRequiredException(message);
          }
          //        else if (e instanceof CSIInvalidActivityException)
  //        {
  //            rex = new InvalidActivityException(message);
  //        }
  //        else if (e instanceof CSIActivityRequiredException)
  //        {
  //            rex = new ActivityRequiredException(message);
  //        }
  //        else if (e instanceof CSIActivityCompletedException)
  //        {
  //            rex = new ActivityCompletedException(message);
  //        }
          else if (e instanceof CSINoSuchObjectException)
          {
              rex = new java.rmi.NoSuchObjectException(message);
          }
          else
          {
              // CSIException is a RemoteException, but should not be exposed
              // to the customer, so convert to a plain RemoteException.      d228774
              // Note that 'detail' or its cause has been saved in 'root', so
              // clear 'detail' before calling getMessage(), or getMessage will
              // include the text/stack of detail, which ends up duplicating
              // the message text.                                            d228774
              e.detail = null;
              rex = new RemoteException(e.getMessage());
          }
  
          // Check the system property to determine if the customer wishes to have
          // nested exceptions included on the RemoteException when possible.
          // This option not the default because the client will need to ensure that
          // all possible nested exceptions are included in their classpath.  253963
          // Property access & default now handled by ContainerProperties.    391302
          // PK87857 note: recall that the property
          // ContainerProperties.IncludeNestedExceptionsExtended will automatically
          // enabled ContainerProperties.IncludeNestedExceptions
          if (IncludeNestedExceptions)
          {
              if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                  Tr.debug(tc, "Nested exceptions will be included on rollback when possible. " +
                               rex + ": " + s.began);
  
              // If the transaction was begun within the context of the method that
              // was called then per the spec. we should return a generic
              // RemoteException so that the nested excpetions will not be stripped
              // off by the ORB                                               253963
              // PK87857- Or if the user allows for the RemoteException even when the the Tx rollback
              // is caused by someone other than the "beginner" (this is a violation
              // of the spec).
              if ((rex instanceof TransactionRolledbackException) &&
                  (s.began || AllowSpecViolationOnRollback)) //PK87857
              {
                  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                      Tr.debug(tc, "Transaction was begun in context of this bean method, or "
                                   + "the user allows the spec to be violated "
                                   + "(ContainerProperties.AllowSpecViolationOnRollback=" + AllowSpecViolationOnRollback + ").");
                  rex = new RemoteException("", rex);
              }
          }
  
          // Now set detail in RemoteException.
          rex.detail = s.rootEx;
  
          // Since this code created the RemoteException being passed
          // to OrbUtilsImpl.mapException method, set the stack trace
          // in it to be the exception stack from the root exception
          // so that any exception chain the ORB returns to the
          // client (e.g. CORBA UnknownException case) does not point
          // to this code as being the root cause of the problem.
          rex.setStackTrace(s.rootEx.getStackTrace()); //180095
  
          // If the current method request came through the ORB, then the final
          // RemoteException must be mapped to the appropriate CORBA exception.
          // Otherwise, for example for WebService Endpoint methods, the
          // RemoteException does not need to be mapped to anything,
          // WebServices will do that.                                       d228774
          if (s.ivWrapper.ivInterface.ivORB)
          {
              if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                  Tr.debug(tc, "mapCSIException calling OrbUtils.mapException: " + rex);
              }
  
              // Now have OrbUtils map to a CORBA exception for remote client stub.
  
              // Perform standard exception mapping using the exception
              // mapping utilities (just like EJSDeployedSupport). This
              // will wrap the CSI exception in a
              // TransactionRolledBackException, which is the exception
              // required by the EJB spec, then that will be mapped to
              // a CORBA TRANSACTION_ROLLEDBACK exception, as required
              // by the ORB.  The ORB should convert the
              // TRANSACTION_ROLLEDBACK to a TransactionRolledBackException
              // on the client.  Note that the root cause will be lost,
              // but will be embeded as part of the message text.  d109641.1
  
              int minorCode = e.getMinorCode();
              if (minorCode == CSIException.NO_MINOR_CODE)
              {
                  mappedException = getOrbUtils().mapException(rex);
              }
              else
              {
                  mappedException = getOrbUtils().mapException(rex, minorCode);
              }
          }
          else
          {
              mappedException = rex;
          }
  
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
              Tr.exit(tc, "mapCSIException returning: " + mappedException);
          }
  
          return mappedException;
      }