@Test @AgentAttachmentRule.Enforce public void FileSystemTracer_should_indicate_if_event_is_failure_via_exception() throws NoSuchMethodException { Method create = clazzFS.getMethod("create", Path.class, FsPermission.class, boolean.class, int.class, short.class, long.class, Progressable.class); try { create.invoke(dfs, new Path("ssss: } catch (Exception ignore) { } checkEvent(FsAction.WRITE.name(), new Path("ssss: }
public static Method getMethod(ClassLoader classLoader, String clazz, String method, Class<?>... parameterTypes) { return (Method) getMethodCache().computeIfAbsent(classLoader + clazz + method, k -> { try { Class classzz = classLoader.loadClass(clazz); return classzz.getMethod(method, parameterTypes); } catch (NoSuchMethodException | ClassNotFoundException ignored) { return null; } }); }
FileSystemTracer { public static Method getMethod(ClassLoader classLoader, String clazz, String method, Class<?>... parameterTypes) { return (Method) getMethodCache().computeIfAbsent(classLoader + clazz + method, k -> { try { Class classzz = classLoader.loadClass(clazz); return classzz.getMethod(method, parameterTypes); } catch (NoSuchMethodException | ClassNotFoundException ignored) { return null; } }); } }
FileSystemTracer { public static Method getMethod(ClassLoader classLoader, String clazz, String method, Class<?>... parameterTypes) { return (Method) getMethodCache().computeIfAbsent(classLoader + clazz + method, k -> { try { Class classzz = classLoader.loadClass(clazz); return classzz.getMethod(method, parameterTypes); } catch (NoSuchMethodException | ClassNotFoundException ignored) { return null; } }); } protected  FileSystemTracer(); }
FileSystemTracer { public static Method getMethod(ClassLoader classLoader, String clazz, String method, Class<?>... parameterTypes) { return (Method) getMethodCache().computeIfAbsent(classLoader + clazz + method, k -> { try { Class classzz = classLoader.loadClass(clazz); return classzz.getMethod(method, parameterTypes); } catch (NoSuchMethodException | ClassNotFoundException ignored) { return null; } }); } protected  FileSystemTracer(); static void setup(Instrumentation instrumentation, BiConsumer<Long, Object> eventConsumer); static ConcurrentHashMap getFieldCache(); static ConcurrentHashMap getMethodCache(); static Method getMethod(ClassLoader classLoader, String clazz, String method, Class<?>... parameterTypes); static Field getField(ClassLoader classLoader, String clazz, String field); static void initEventHandler(BiConsumer<Long, Object> eventConsumer); }
FileSystemTracer { public static Method getMethod(ClassLoader classLoader, String clazz, String method, Class<?>... parameterTypes) { return (Method) getMethodCache().computeIfAbsent(classLoader + clazz + method, k -> { try { Class classzz = classLoader.loadClass(clazz); return classzz.getMethod(method, parameterTypes); } catch (NoSuchMethodException | ClassNotFoundException ignored) { return null; } }); } protected  FileSystemTracer(); static void setup(Instrumentation instrumentation, BiConsumer<Long, Object> eventConsumer); static ConcurrentHashMap getFieldCache(); static ConcurrentHashMap getMethodCache(); static Method getMethod(ClassLoader classLoader, String clazz, String method, Class<?>... parameterTypes); static Field getField(ClassLoader classLoader, String clazz, String field); static void initEventHandler(BiConsumer<Long, Object> eventConsumer);  }