Set the {@link StackTraceElement} for the given {@link Throwable}, using the {@link Class} and method name.
777476
static <T extends Throwable> T unknownStackTrace(T cause, Class<?> clazz, String method) {
        cause.setStackTrace(new StackTraceElement[] { new StackTraceElement(clazz.getName(), method, null, -1) });
        return cause;
    }
998094
public void sendException(Throwable throwable) {
        EventBuilder eventBuilder = new EventBuilder().withMessage(throwable.getMessage())
            .withLevel(Event.Level.ERROR)
            .withSentryInterface(new ExceptionInterface(throwable));
        sendEvent(eventBuilder);
    }
645786
public void trace(Object message, Throwable exception) {
    log(Level.TRACE, message, exception);
  }
90285
public void setErrorMessage(Throwable exception) {
		if (exception != null) {
			String message = exception.getLocalizedMessage();
			if (Strings.isNullOrEmpty(message)) {
				message = exception.getMessage();
			}
			if (Strings.isNullOrEmpty(message)) {
				message = MessageFormat.format(Messages.SREsPreferencePage_9, exception.getClass().getName());
			}
			setErrorMessage(message);
		}
	}
554178
private void setMethod(Method method, Object targetObject, Object value) throws UnmarshalException {
		try {
			method.invoke(targetObject, value);
		} catch (IllegalArgumentException e) {
			throw new UnmarshalException(e);
		} catch (IllegalAccessException e) {
			throw new UnmarshalException(e);
		} catch (InvocationTargetException e) {
			throw new UnmarshalException(e);
		}
	}
718319
public static String getStackTrace(Throwable throwable, boolean isHtmlStyle) {
        AssertHelper.notNull(throwable, "throwable can't be null.");
        String line = isHtmlStyle ? "<br/>" : "\r\n";
        String tab = isHtmlStyle ? "&nbsp;&nbsp;&nbsp;&nbsp;" : "\t";
        while (throwable instanceof NiubiException) {
            throwable = throwable.getCause();
        }
        StringBuffer stringBuffer = new StringBuffer(throwable.getClass().getName()).append(":");
        if (throwable.getMessage() != null) {
            stringBuffer.append(throwable.getMessage()).append(line);
        } else {
            stringBuffer.append(line);
        }
        try {
            StackTraceElement[] stackElements = throwable.getStackTrace();
            if (stackElements != null) {
                for (int i = 0; i < stackElements.length && i < MAX_STACK_TRACE_DEEP; i++) {
                    stringBuffer.append(tab);
                    stringBuffer.append(stackElements[i].getClassName()).append('.');
                    stringBuffer.append(stackElements[i].getMethodName()).append('(');
                    stringBuffer.append(stackElements[i].getFileName()).append(':');
                    stringBuffer.append(stackElements[i].getLineNumber()).append(')');
                    stringBuffer.append(line);
                }
            }
        } catch (Exception e) {
            //ignored
        }
        if (isHtmlStyle) {
            return stringBuffer.length() > MAX_LENGTH ? (stringBuffer.substring(0, stringBuffer.lastIndexOf(line)) + DEFAULT_END_STRING) : stringBuffer.toString();
        } else {
            return stringBuffer.length() > MAX_LENGTH ? (stringBuffer.substring(0, MAX_LENGTH) + DEFAULT_END_STRING) : stringBuffer.toString();
        }
    }
933216
public static void trimStackTraceTo(Throwable t, Class<?> cls) {
    StackTraceElement[] ste = t.getStackTrace();
    String name = cls.getName();
    for (int i = 0; i < ste.length; i++) {
      if (ste[i].getClassName().equals(name)) {
        t.setStackTrace(Arrays.copyOf(ste, i));
        return;
      }
    }
  }
472371
private String getStackTrace(final Throwable exception) {

        if (exception != null) {

            StringBuilder sb = new StringBuilder();

            StackTraceElement[] stackTrace = exception.getStackTrace();
            for (StackTraceElement element : stackTrace) {
                sb.append(element.toString());
                sb.append('\n');
            }

            if (exception.getCause() != null) {

                StackTraceElement[] stackTraceCause = exception.getCause().getStackTrace();
                for (StackTraceElement element : stackTraceCause) {
                    sb.append(element.toString());
                    sb.append('\n');
                }

            }

            return sb.toString();
        }

        return null;
    }
904293
public static String printStackTraceElement(StackTraceElement stackTraceElement) {
        final String toString;
        if (stackTraceElement == null) {
            toString = "at null";
        }
        // Look for our eyecatcher representing a truncation
        else if (TRIMMED_STACK_TRACE_ELEMENT.equals(stackTraceElement)) {
            // Use only the class name, which is actually [internal classes]
            toString = "at " + stackTraceElement.getClassName();
            // Look for our eyecatcher representing a the stripping of redundant cause frames
        } else if (DUPLICATE_FRAMES_EYECATCHER.equals(stackTraceElement.getMethodName())) {
            // Use only the class name, which will include the ... - we don't want a "at " in this case
            toString = stackTraceElement.getClassName();
        } else {
            // The 'at' is a non-internationalised string in what we're trying to imitate   
            toString = "at " + stackTraceElement.toString();
        }
        return toString;
    }
660790
private static Method getStackTraceElementGetter() {
		try {
			Method method = Throwable.class.getDeclaredMethod("getStackTraceElement", int.class);
			method.setAccessible(true);
			StackTraceElement stackTraceElement = (StackTraceElement) method.invoke(new Throwable(), 0);
			if (LegacyJavaRuntime.class.getName().equals(stackTraceElement.getClassName())) {
				return method;
			} else {
				return null;
			}
		} catch (Exception ex) {
			return null;
		}
	}
624424
private static void filterThrowable(Throwable t) {

        // Now we want to remove the superfluous lines of stack trace from the
        // exception (those that have been inserted as a result of the way we
        // created the exception.
        StackTraceElement[] stackLines = t.getStackTrace();

        // If there is definitely something to work with.
        if ((stackLines != null) && (stackLines.length > 1)) {
            Vector v = new Vector();

            // Look at each stack line in turn until we reach the JmsErrorUtils
            // class stuff, then copy them over starting with the first line after
            // JmsErrorUtils finishes.
            boolean euStarted = false;

            // First read up to the point where the JmsErrorUtils entries start.
            int index = 0;
            for (index = 0; index < stackLines.length; index++) {
                StackTraceElement ste = stackLines[index];

                // See if this is the errorUtils
                if (className.equals(ste.getClassName())) {
                    // We have found an error utils line
                    euStarted = true;
                }
                else {
                    if (euStarted) {
                        // This indicates that we have now left the ErrorUtils lines,
                        // and everything left in the stack should be copied across.
                        v.add(ste);
                    }
                }
            }

            // Now we take the filtered stack trace and set it back into the
            // exception we originally got it from.
            if (v.size() != 0) {
                StackTraceElement[] filteredSTE = new StackTraceElement[v.size()];
                for (int i = 0; i < filteredSTE.length; i++) {
                    filteredSTE[i] = (StackTraceElement) v.elementAt(i);
                }
                t.setStackTrace(filteredSTE);
            }
        }
    }
1085468
public static void setProperty(Object messageArgument, Class senderClass, Object receiver, String messageName) throws Throwable {
        try {
            if (receiver==null) receiver= NullObject.getNullObject();
            InvokerHelper.setProperty(receiver, messageName, messageArgument);
        } catch (GroovyRuntimeException gre) {
            throw unwrap(gre);
        }
    }
14252
@Override
    public void interceptSetupMethod(IMethodInvocation invocation) throws Throwable {
        log.fine("before " + invocation.getFeature().getFeatureMethod().getReflection().getName());
        getTestRunner().before(invocation.getTarget(), invocation.getFeature().getFeatureMethod().getReflection(),
            new InvocationExecutor(invocation));
    }
697517
public static String getStackTrace( Throwable throwable ) {
        if (throwable == null) return null;
        final ByteArrayOutputStream bas = new ByteArrayOutputStream();
        final PrintWriter pw = new PrintWriter(bas);
        throwable.printStackTrace(pw);
        pw.close();
        return bas.toString();
    }
554675
public final void methodName() throws RecognitionException {
		int methodName_StartIndex = input.index();

		try {
			if ( state.backtracking>0 && alreadyParsedRule(input, 128) ) { return; }

			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1230:5: ( Identifier | 'insert' | 'update' | 'modify' | 'retract' | 'delete' )
			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:
			{
			if ( input.LA(1)==Identifier||input.LA(1)==75||input.LA(1)==90||input.LA(1)==95||input.LA(1)==103||input.LA(1)==117 ) {
				input.consume();
				state.errorRecovery=false;
				state.failed=false;
			}
			else {
				if (state.backtracking>0) {state.failed=true; return;}
				MismatchedSetException mse = new MismatchedSetException(null,input);
				throw mse;
			}
			}

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
		}
		finally {
			// do for sure before leaving
			if ( state.backtracking>0 ) { memoize(input, 128, methodName_StartIndex); }

		}
	}
404033
public static void set(Object obj, String property, Object value) throws Throwable {
        getSetterMethod(obj.getClass(), property).invoke(obj, value);
    }
168456
private static String __getStackTrace(Throwable throwable) {
        StringWriter stringWriter = new StringWriter();
        throwable.printStackTrace(new PrintWriter(stringWriter));

        return stringWriter.toString();
    }