public PutStaticMethodCollector(String targetClassName) { this(targetClassName, createStaticFields(targetClassName)); }
@Test public void testFooBar1() { String className = FooBar1.class.getName(); PutStaticMethodCollector collector = new PutStaticMethodCollector(className); MethodIdentifier expected_method_id = new MethodIdentifier( FooBar2.class.getName(), "init_used_int_field", Type.getMethodDescriptor(Type.VOID_TYPE)); Set<MethodIdentifier> expected_methods = Collections .singleton(expected_method_id); Set<MethodIdentifier> methods = collector.collectMethods(); assertEquals(expected_methods, methods); } }
String calleeFieldName = fieldInsn.name; if (contains(getStaticFields, calleeClassName, calleeFieldName)) {
PutStaticMethodCollector collector = new PutStaticMethodCollector(Properties.TARGET_CLASS, staticFields); Set<MethodIdentifier> methodIdentifiers = collector.collectMethods();