@Test @AgentAttachmentRule.Enforce public void FileSystemTracer_should_attach_to_rename_deprecated() throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, IOException, ClassNotFoundException { Path toRename = new Path("/test/to_rename"); Path dst = new Path("/test/to_rename_dst_deprecated"); createSrcPathDistributedFilesystem(toRename); Method rename = clazzFS.getMethod("rename", Path.class, Path.class); rename.invoke(dfs, toRename, dst); checkEvent(FsAction.RENAME.name(), dst); }
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);  }