Looks for SystemException in the cause chain.
@return Found SystemException in the cause chain, or null if none found
16663
public static SystemException unwrapSystemException(Throwable throwable) {
        if (throwable == null) {
            return null;
        } else if (throwable instanceof SystemException) {
            return (SystemException) throwable;
        } else if (throwable.getCause() != null) {
            // recursive call to unwrap the cause
            return unwrapSystemException(throwable.getCause());
        } else {
            // didn't find any SystemException in the cause stack
            return null;
        }
    }
1205483
private RetriesExhaustedWithDetailsException getExceptions()
      throws RetriesExhaustedWithDetailsException {
    if (!hasExceptions.get()) {
      return null;
    }

    ArrayList<MutationException> mutationExceptions = null;
    synchronized (globalExceptions) {
      hasExceptions.set(false);
      if (globalExceptions.isEmpty()) {
        return null;
      }

      mutationExceptions = new ArrayList<>(globalExceptions);
      globalExceptions.clear();
    }

    List<Throwable> problems = new ArrayList<>(mutationExceptions.size());
    ArrayList<String> hostnames = new ArrayList<>(mutationExceptions.size());
    List<Row> failedMutations = new ArrayList<>(mutationExceptions.size());

    if (!mutationExceptions.isEmpty()) {
      LOG.warn("Exception occurred in BufferedMutator", mutationExceptions.get(0).throwable);
    }
    for (MutationException mutationException : mutationExceptions) {
      problems.add(mutationException.throwable);
      failedMutations.add(mutationException.mutation);
      hostnames.add(host);
      LOG.debug("Exception occurred in BufferedMutator", mutationException.throwable);
    }

    return new RetriesExhaustedWithDetailsException(problems, failedMutations, hostnames);
  }
977800
@SuppressWarnings("deprecation")
    protected Throwable getNestedException(Throwable t) {
        Throwable root = t;
        for (;;) {
            if (root instanceof RemoteException) {
                RemoteException re = (RemoteException) root;
                if (re.detail == null)
                    break;
                root = re.detail;
            } else if (root instanceof NamingException) {
                NamingException ne = (NamingException) root;
                if (ne.getRootCause() == null)
                    break;
                root = ne.getRootCause();
            } else if (root instanceof com.ibm.ws.exception.WsNestedException) { //d121522
                com.ibm.ws.exception.WsNestedException ne = (com.ibm.ws.exception.WsNestedException) root;
                if (ne.getCause() == null)
                    break;
                root = ne.getCause();
            } else {
                break;
            }
        }
        return root;
    }
596208
protected BpmnError checkIfCauseOfExceptionIsBpmnError(Throwable e) {
    if (e instanceof BpmnError) {
      return (BpmnError) e;
    } else if (e.getCause() == null) {
      return null;
    }
    return checkIfCauseOfExceptionIsBpmnError(e.getCause());
  }
890539
public String getExceptionType()
    {
        String exceptionType = null;
        Throwable rootCause = this;
        
        do{
            Throwable temp = ((ServletException)rootCause).getRootCause();
            if(temp != null) {
                rootCause = temp;
            }
            else{
                break;
            }
        }while (rootCause instanceof ServletException);

        // rootCause must be non-null (it started as "this" and was then NEVER set to null by the loop above
        exceptionType = rootCause.getClass().getName();

        return exceptionType;
    }
62226
static sun.misc.Unsafe getUnsafe() {
        try {
            return sun.misc.Unsafe.getUnsafe();
        } catch (SecurityException se) {
            try {
                return java.security.AccessController.doPrivileged
                    (new java.security
                     .PrivilegedExceptionAction<sun.misc.Unsafe>() {
                        public sun.misc.Unsafe run() throws Exception {
                            java.lang.reflect.Field f = sun.misc
                                .Unsafe.class.getDeclaredField("theUnsafe");
                            f.setAccessible(true);
                            return (sun.misc.Unsafe) f.get(null);
                        }});
            } catch (java.security.PrivilegedActionException e) {
                throw new RuntimeException("Could not initialize intrinsics",
                                           e.getCause());
            }
        }
    }
7608
public List<ApplicationExceptionType<AssemblyDescriptorType<T>>> getAllApplicationException()
   {
      List<ApplicationExceptionType<AssemblyDescriptorType<T>>> list = new ArrayList<ApplicationExceptionType<AssemblyDescriptorType<T>>>();
      List<Node> nodeList = childNode.get("application-exception");
      for(Node node: nodeList)
      {
         ApplicationExceptionType<AssemblyDescriptorType<T>>  type = new ApplicationExceptionTypeImpl<AssemblyDescriptorType<T>>(this, "application-exception", childNode, node);
         list.add(type);
      }
      return list;
   }
521893
public function checkForActivationErrors()
    {
        if (!$this->getId()) {
            return 'EXCEPTION_THEME_NOT_LOADED';
        }
        $oParent = $this->getParent();
        if ($oParent) {
            $sParentVersion = $oParent->getInfo('version');
            if (!$sParentVersion) {
                return 'EXCEPTION_PARENT_VERSION_UNSPECIFIED';
            }
            $aMyParentVersions = $this->getInfo('parentVersions');
            if (!$aMyParentVersions || !is_array($aMyParentVersions)) {
                return 'EXCEPTION_UNSPECIFIED_PARENT_VERSIONS';
            }
            if (!in_array($sParentVersion, $aMyParentVersions)) {
                return 'EXCEPTION_PARENT_VERSION_MISMATCH';
            }
        } elseif ($this->getInfo('parentTheme')) {
            return 'EXCEPTION_PARENT_THEME_NOT_FOUND';
        }

        return false;
    }
1064659
public int checkCanExceptionMessage()
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "checkCanExceptionMessage");

        // Return code
        int rc = DestinationHandler.OUTPUT_HANDLER_NOT_FOUND;

        String newExceptionDestination = null;

        boolean usingDefault = false;

        if (_originalDestination != null)
        {
            newExceptionDestination = _originalDestination.getExceptionDestination();
            if (newExceptionDestination == null || newExceptionDestination.equals(""))
            {
                // Simply return with OUTPUT_HANDLER_NOT_FOUND
                if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                    SibTr.exit(tc, "checkCanExceptionMessage", rc);
                return rc;
            }
            if (newExceptionDestination.equals(JsConstants.DEFAULT_EXCEPTION_DESTINATION))
            {
                newExceptionDestination = _defaultExceptionDestinationName;
                usingDefault = true;
            }
        }
        else
        {
            newExceptionDestination = _defaultExceptionDestinationName;
            usingDefault = true;
        }

        try
        {
            DestinationHandler exceptionDestHandler =
                            _messageProcessor.getDestinationManager().
                                            getDestination(newExceptionDestination, true);

            rc = exceptionDestHandler.checkCanAcceptMessage(null, null);
        } catch (SIException e)
        {
            // No FFDC code needed

            SibTr.exception(tc, e);
        }

        // If we havent checked the system default destination, then do that now
        if (rc != DestinationHandler.OUTPUT_HANDLER_FOUND && !usingDefault)
        {
            try
            {
                DestinationHandler exceptionDestHandler =
                                _messageProcessor.getDestinationManager().
                                                getDestination(_defaultExceptionDestinationName, true);

                rc = exceptionDestHandler.checkCanAcceptMessage(null, null);
            } catch (SIException e)
            {
                // No FFDC code needed

                SibTr.exception(tc, e);
            }
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "checkCanExceptionMessage", Integer.valueOf(rc));

        return rc;
    }
6601
@SuppressWarnings("unchecked")
	public <T extends EntitySystem> T getSystem(Class<T> systemType) {
		return systemManager.getSystem(systemType);
	}
1211501
public static Http2Exception getEmbeddedHttp2Exception(Throwable cause) {
        while (cause != null) {
            if (cause instanceof Http2Exception) {
                return (Http2Exception) cause;
            }
            cause = cause.getCause();
        }
        return null;
    }
1350517
protected void checkError() throws IOException {
		final Throwable t = cause.get();

		if (t != null) {
			if (t instanceof CancelTaskException) {
				throw (CancelTaskException) t;
			}
			if (t instanceof IOException) {
				throw (IOException) t;
			}
			else {
				throw new IOException(t);
			}
		}
	}
1356500
public Class<? extends Throwable>[] getIgnoredExceptions()
    {
        IgnoredException ignoredException = method.getAnnotation( IgnoredException.class );
        return ignoredException == null ? null : ignoredException.value();
    }
917933
public Error getError() {
		if(isOk())
			return error;
		
		try {
			JAXBContext context = JAXBContext.newInstance(Error.class);
			Unmarshaller unmarshaller = context.createUnmarshaller();
			
			StringReader xml = new StringReader(content);
			if(!content.isEmpty())
				error = (Error)unmarshaller.unmarshal(new StreamSource(xml));
		}
		catch(JAXBException e) {
			e.printStackTrace();
		}
		
		return error;
	}
1013181
public static String getCurrentId()
  {
    SystemManager system = getCurrent();

    if (system == null) {
      ClassLoader loader = Thread.currentThread().getContextClassLoader();

      throw new IllegalStateException(L.l("{0} is not available in this context.\n  {1}",
                                          SystemManager.class.getSimpleName(),
                                          loader));
    }

    return system.getId();
  }
1334220
public Throwable getMostSpecificCause()
    {
        Throwable rootCause = null;
        Throwable cause = getCause();
        while (cause != null  &&  cause != rootCause) {
            rootCause = cause;
            cause = cause.getCause();
        }

        return (rootCause == null ? this : rootCause);
    }
470468
public final String getExceptionMessage() {
        /* If the Exception information is set, return the translated message */
        if (getHdr2().getChoiceField(JsHdr2Access.EXCEPTION) != JsHdr2Access.IS_EXCEPTION_EMPTY) {
            return exceptionMessages.getFormattedMessage(MfpConstants.EXCEPTION_MESSAGE_KEY_PREFIX + getExceptionReason().toString()
                                                         , getExceptionInserts()
                                                         , "Failed to deliver message, rc=" + getExceptionReason() + ". Inserts: " + Arrays.asList(getExceptionInserts())
                            );
        }
        /* If no, just return null. */
        else {
            return null;
        }
    }