/** make main entrypoints, even in the primordial loader. */ public static Iterable<Entrypoint> makePrimordialMainEntrypoints( AnalysisScope scope, ClassHierarchy cha) { final Atom mainMethod = Atom.findOrCreateAsciiAtom("main"); final HashSet<Entrypoint> result = HashSetFactory.make(); for (IClass klass : cha) { MethodReference mainRef = MethodReference.findOrCreate( klass.getReference(), mainMethod, Descriptor.findOrCreateUTF8("([Ljava/lang/String;)V")); IMethod m = klass.getMethod(mainRef.getSelector()); if (m != null) { result.add(new DefaultEntrypoint(m, cha)); } } return new Iterable<Entrypoint>() { @Override public Iterator<Entrypoint> iterator() { return result.iterator(); } }; }
/** @see com.ibm.wala.classLoader.IMethod#isInit() */ public boolean isInit() { return method.getSelector().equals(MethodReference.initSelector); }
public Descriptor getDescriptor() { return method.getSelector().getDescriptor(); }
public Atom getName() { return method.getSelector().getName(); }