/** * Does a particular class contain (implement) a particular method? * * @param clazz class in question * @param selector method selector * @return the method if found, else null */ private static IMethod findMethod(IClass clazz, Selector selector) { return clazz.getMethod(selector); }
@Override public AstMethod getMethod() { return (AstMethod) cls.getMethod(sel); } };
/** * Does a particular class contain (implement) a particular method? * * @param clazz class in question * @param selector method selector * @return the method if found, else null */ private static IMethod findMethod(IClass clazz, Selector selector) { return clazz.getMethod(selector); }
@Override public AstMethod getMethod() { return (AstMethod) cls.getMethod(sel); } };
@Override public IMethod getMethod(Selector selector) { return realType.getMethod(selector); }
@Override public IMethod getMethod(Selector selector) { if (declaredMethods.containsKey(selector)) { return declaredMethods.get(selector); } else if (getSuperclass() != null) { return getSuperclass().getMethod(selector); } else { return null; } }
@Override public IMethod getMethod(Selector selector) { if (declaredMethods.containsKey(selector)) { return declaredMethods.get(selector); } else if (getSuperclass() != null) { return getSuperclass().getMethod(selector); } else { return null; } }
protected LexicalParent[] getParents(InstanceKey base) { DynamicMethodObject function = (DynamicMethodObject) base.getConcreteType().getMethod(AstMethodReference.fnSelector); return function==null? new LexicalParent[0]: function.getParents(); }
private static IMethod getPublicDefaultCtor(IClass klass) { IMethod ctorMethod = klass.getMethod(defCtorSelector); if (ctorMethod != null && ctorMethod.isPublic() && ctorMethod.getDeclaringClass() == klass) { return ctorMethod; } return null; }
private static IMethod getPublicDefaultCtor(IClass klass) { IMethod ctorMethod = klass.getMethod(defCtorSelector); if (ctorMethod != null && ctorMethod.isPublic() && ctorMethod.getDeclaringClass() == klass) { return ctorMethod; } return null; }
protected LexicalParent[] getParents(InstanceKey base) { DynamicMethodObject function = (DynamicMethodObject) base.getConcreteType().getMethod(AstMethodReference.fnSelector); return function==null? new LexicalParent[0]: function.getParents(); }
private static IMethod getCallTargetMethod(IMethod method) { if(method.getName().equals(JavaScriptMethods.ctorAtom)) { method = method.getDeclaringClass().getMethod(AstMethodReference.fnSelector); if(method != null) return method; } return method; }
@Override public IMethod getMethod(Selector selector) { if (selector.equals(AstMethodReference.fnSelector)) { return functionBody; } else { return loader.lookupClass(superReference.getName()).getMethod(selector); } }
private static IMethod getCallTargetMethod(IMethod method) { if(method.getName().equals(JavaScriptMethods.ctorAtom)) { method = method.getDeclaringClass().getMethod(AstMethodReference.fnSelector); if(method != null) return method; } return method; }
@Override public IMethod getMethod(Selector selector) { if (selector.equals(AstMethodReference.fnSelector)) { return functionBody; } else { return loader.lookupClass(superReference.getName()).getMethod(selector); } }
@Override public void act(int i) { InstanceKey I = system.getInstanceKey(i); IClass C = I.getConcreteType(); if ((C.getMethod(targetMethod.getSelector()) == targetMethod) == sense) { if (L.add(i)) { result = true; } } } }
@Override public IMethod getMethod(Selector sig) { return cha.lookupClass(getClassLoader().getLanguage().getRootType()).getMethod(sig); }
@Override public void act(int i) { InstanceKey I = system.getInstanceKey(i); IClass C = I.getConcreteType(); if ((C.getMethod(targetMethod.getSelector()) == targetMethod) == sense) { if (L.add(i)) { result = true; } } } }
@Override public IMethod getMethod(Selector sig) { return cha.lookupClass(getClassLoader().getLanguage().getRootType()).getMethod(sig); }
@Test public void testConstructorLookup() { IClass testKlass = cha.lookupClass(TypeReference.findOrCreate(ClassLoaderReference.Application, "LmethodLookup/MethodLookupStuff$B")); IMethod m = testKlass.getMethod(Selector.make("<init>(I)V")); Assert.assertNull(m); } }