Get the TRY block with a CATCH that would be run if n throws an exception.
@return The CATCH node or null if it there isn't a CATCH before the
the function terminates.
161628
static Node getExceptionHandler(Node n) {
    for (Node cur = n;
        !cur.isScript() && !cur.isFunction();
        cur = cur.getParent()) {
      Node catchNode = getCatchHandlerForBlock(cur);
      if (catchNode != null) {
        return catchNode;
      }
    }
    return null;
  }
317798
public Integer getTimeout()
   {
      if (childNode.getTextValueForPatternName("timeout") != null && !childNode.getTextValueForPatternName("timeout").equals("null")) {
         return Integer.valueOf(childNode.getTextValueForPatternName("timeout"));
      }
      return null;
   }
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;
    }
85223
private Node tryFoldHook(Node n) {
    checkState(n.isHook(), n);
    Node parent = n.getParent();
    checkNotNull(parent);
    Node cond = n.getFirstChild();
    Node thenBody = cond.getNext();
    Node elseBody = thenBody.getNext();

    TernaryValue condValue = NodeUtil.getImpureBooleanValue(cond);
    if (condValue == TernaryValue.UNKNOWN) {
      // If the result nodes are equivalent, then one of the nodes can be
      // removed and it doesn't matter which.
      if (!areNodesEqualForInlining(thenBody, elseBody)) {
        return n;  // We can't remove branches otherwise!
      }
    }

    // Transform "(a = 2) ? x =2 : y" into "a=2,x=2"
    Node branchToKeep;
    Node branchToRemove;
    if (condValue.toBoolean(true)) {
      branchToKeep = thenBody;
      branchToRemove = elseBody;
    } else {
      branchToKeep = elseBody;
      branchToRemove = thenBody;
    }

    Node replacement;
    boolean condHasSideEffects = mayHaveSideEffects(cond);
    // Must detach after checking for side effects, to ensure that the parents
    // of nodes are set correctly.
    n.detachChildren();
    if (condHasSideEffects) {
      replacement = IR.comma(cond, branchToKeep).srcref(n);
    } else {
      replacement = branchToKeep;
      markFunctionsDeleted(cond);
    }

    parent.replaceChild(n, replacement);
    reportChangeToEnclosingScope(replacement);
    markFunctionsDeleted(branchToRemove);
    return replacement;
  }
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;
	}
240779
public ExceptionThrownRule getExceptionThrownRule(Throwable ex) {
        ExceptionThrownRule exceptionThrownRule = null;
        int deepest = Integer.MAX_VALUE;
        for (Map.Entry<String, ExceptionThrownRule> entry : exceptionThrownRuleMap.entrySet()) {
            int depth = getMatchedDepth(entry.getKey(), ex);
            if (depth >= 0 && depth < deepest) {
                deepest = depth;
                exceptionThrownRule = entry.getValue();
            }
        }
        return (exceptionThrownRule != null ? exceptionThrownRule : defaultExceptionThrownRule);
    }
727014
public Object get() {
		Object result = null;
		if (over)
			return eventResult;
		try {
			boolean runOk = (Boolean) futureTask.get(timeoutforeturnResult, TimeUnit.MILLISECONDS);
			if (runOk) {
				result = this.eventResult;
			}
			over = true;
		} catch (Exception e) {
			e.printStackTrace();
		}
		return result;
	}
733033
public synchronized T getNonBlocking ()
    {
        if (_count == 0) {
            return null;
        }

        // pull the object off, and clear our reference to it
        T retval = _items[_start];
        _items[_start] = null;

        _start = (_start + 1) % _size;
        _count--;

        return retval;
    }
677833
public ISynchronizationPoint<Exception> startRootElement() {
		ISynchronizationPoint<Exception> start = start();
		if (start.isUnblocked()) {
			if (start.hasError()) return start;
			if (Type.START_ELEMENT.equals(event.type)) return start;
			return nextStartElement();
		}
		SynchronizationPoint<Exception> sp = new SynchronizationPoint<>();
		start.listenAsync(new ParsingTask(() -> {
			if (Type.START_ELEMENT.equals(event.type)) sp.unblock();
			else nextStartElement().listenInline(sp);
		}), sp);
		return sp;
	}
967575
public static RuntimeException getRuntimeException(final Throwable exc) {
        Throwable e = exc;
        while (e.getCause() instanceof RuntimeException) {
            e = e.getCause();
        }
        if (e instanceof RuntimeException) {
            return (RuntimeException) e;
        } else {
            return new RuntimeException(exc);
        }
    }
570837
public int getNumNonExceptionSucessors(BasicBlock block) {
        int numNonExceptionSuccessors = block.getNumNonExceptionSuccessors();
        if (numNonExceptionSuccessors < 0) {
            numNonExceptionSuccessors = 0;
            for (Iterator<Edge> i = outgoingEdgeIterator(block); i.hasNext();) {
                Edge edge = i.next();
                if (!edge.isExceptionEdge()) {
                    numNonExceptionSuccessors++;
                }
            }
            block.setNumNonExceptionSuccessors(numNonExceptionSuccessors);
        }
        return numNonExceptionSuccessors;
    }
900811
public static String getExceptionMessage(Throwable exception)
    {
        StringWriter        out = new StringWriter();
        exception.printStackTrace(new PrintWriter(out));
        BufferedReader      in = new BufferedReader(new StringReader(out.toString()));
        try
        {
            StringBuilder       str = new StringBuilder();
            for(;;)
            {
                String  line = in.readLine();
                if ( line == null )
                {
                    break;
                }
                if ( str.length() > 0 )
                {
                    str.append(", ");
                }
                str.append(line);
            }
            return str.toString();
        }
        catch ( IOException e )
        {
            // ignore
        }
        return "n/a";
    }
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;
    }
397750
public Throwable getOriginalException() {
        if (tc.isEntryEnabled())
            Tr.entry(tc, "getOriginalException");
        if (tc.isEntryEnabled())
            Tr.exit(tc, "getOriginalException", _originalException);
        return _originalException;
    }
1324869
public Location getExceptionThrowerLocation(Edge exceptionEdge) {
        if (!exceptionEdge.isExceptionEdge()) {
            throw new IllegalArgumentException();
        }

        InstructionHandle handle = exceptionEdge.getSource().getExceptionThrower();
        if (handle == null) {
            throw new IllegalStateException();
        }

        BasicBlock basicBlock = (handle.getInstruction() instanceof ATHROW) ? exceptionEdge.getSource()
                : getSuccessorWithEdgeType(exceptionEdge.getSource(), EdgeTypes.FALL_THROUGH_EDGE);

        if (basicBlock == null && removedEdgeList != null) {
            // The fall-through edge might have been removed during
            // CFG pruning. Look for it in the removed edge list.
            for (Edge removedEdge : removedEdgeList) {
                if (removedEdge.getType() == EdgeTypes.FALL_THROUGH_EDGE
                        && removedEdge.getSource() == exceptionEdge.getSource()) {
                    basicBlock = removedEdge.getTarget();
                    break;
                }
            }
        }

        if (basicBlock == null) {
            throw new IllegalStateException("No basic block for thrower " + handle + " in " + this.methodGen.getClassName() + "."
                    + this.methodName + " : " + this.methodGen.getSignature());
        }

        return new Location(handle, basicBlock);
    }
43205
def CATCH(exception_klass, &block)
      block.call
    rescue ::Exception
      if $!.instance_of? exception_klass
        pass
      else
        failure("Faced a exception, that instance of #{exception_klass}.",
                "Faced a exception, that instance of #{$!.class}.", 2)
      end
    else
      failure("Faced a exception, that instance of #{exception_klass}.",
              'The block was not faced any exceptions.', 2)
    ensure
      _declared!
    end
881393
public AttemptTimelimit<R> getTimelimiter() {
        return this.tryTimeout = (null == this.tryTimeout ? new AttemptTimelimit<R>() {
            //An implementation which actually does not attempt to limit time at all
            @Override public R call(Callable<R> callable) throws Exception {
                return checkNotNull(callable).call();
            }
        } : this.tryTimeout);
    }