private static StringBuilder initTrace(int i, ExtendedStackTraceElement[] stes) { final StringBuilder stackTrace = new StringBuilder(); for (int j = 0; j <= i; j++) { final ExtendedStackTraceElement ste2 = stes[j]; if (ste2.getClassName().equals(Thread.class.getName()) && ste2.getMethodName().equals("getStackTrace")) continue; printTraceLine(stackTrace, ste2); } return stackTrace; }
@Override public MethodVisitor visitMethod(int access, String name, final String desc, String signature, String[] exceptions) { MethodVisitor mv = super.visitMethod(access, name, desc, signature, exceptions); if (descriptor.get() == null && este.getMethodName().equals(name)) { mv = new MethodVisitor(api, mv) { int minLine = Integer.MAX_VALUE, maxLine = Integer.MIN_VALUE; @Override public void visitLineNumber(int line, Label start) { if (line < minLine) minLine = line; if (line > maxLine) maxLine = line; } @Override public void visitEnd() { if (minLine <= este.getLineNumber() && maxLine >= este.getLineNumber()) descriptor.set(desc); super.visitEnd(); } }; } return mv; } });
public static /*Executable*/ Member lookupMethod(ExtendedStackTraceElement ste) { if (ste.getDeclaringClass() == null) return null; if (ste.getMethod() != null) return ste.getMethod(); for (final Method m : ste.getDeclaringClass().getDeclaredMethods()) { if (m.getName().equals(ste.getMethodName())) { final Instrumented i = getAnnotation(m, Instrumented.class); if (m.isSynthetic() || isWaiver(m.getDeclaringClass().getName(), m.getName()) || i != null && ste.getLineNumber() >= i.methodStart() && ste.getLineNumber() <= i.methodEnd()) return m; } } return null; }
if (este.getMethodName().equals(m.getName())) { if (method == null) method = m; final String desc = descriptor.get(); for (Member m : ms) { if (este.getMethodName().equals(getName(m)) && desc.equals(getDescriptor(m))) { method = m; break;
for (int i = 0; i < stes.length; i++) { final ExtendedStackTraceElement ste = stes[i]; if (ste.getClassName().equals(Thread.class.getName()) && ste.getMethodName().equals("getStackTrace")) continue; if (ste.getClassName().equals(ExtendedStackTrace.class.getName())) && !ste.getClassName().equals(Stack.class.getName()) && !SuspendableHelper.isWaiver(ste.getClassName(), ste.getMethodName())) { final Class<?> clazz = ste.getDeclaringClass(); final boolean classInstrumented = SuspendableHelper.isInstrumented(clazz); ok = false; } else if (ste.getClassName().equals(Fiber.class.getName()) && ste.getMethodName().equals("run1")) { if (!ok) { final String str = "Uninstrumented whole methods ('**') or single calls ('!!') detected: " + stackTrace;
&& ((calleeSte.getClassName().equals(Fiber.class.getName()) && calleeSte.getMethodName().equals("verifySuspend")) || (calleeSte.getClassName().equals(Stack.class.getName()) && calleeSte.getMethodName().equals("popMethod")))) { return new Pair<>(true, null); } else { final Member callee = calleeSte.getMethod(); if (callee == null) { final String methodName = "." + calleeSte.getMethodName() + "("; for (String callsite : i.suspendableCallSiteNames()) { if (callsite.contains(methodName)) {