Exemplo n.º 1
0
 /**
  * Get all non-constructor, non-class-initializer methods declared by a class if their name is
  * equal to the specified name.
  *
  * @param cls the class
  * @param name the name
  */
 private Collection<IMethod> getDeclaredNormalMethods(IClass cls, Atom name) {
   Collection<IMethod> result = HashSetFactory.make();
   for (IMethod m : cls.getDeclaredMethods()) {
     if (!m.isInit() && !m.isClinit() && m.getSelector().getName().equals(name)) {
       result.add(m);
     }
   }
   return result;
 }
Exemplo n.º 2
0
 /**
  * Get all non-constructor, non-class-initializer methods declared by a class and all its
  * superclasses if their name is equal to the specified name.
  *
  * @param cls the class
  * @param name the name
  */
 private Collection<IMethod> getAllNormalPublicMethods(IClass cls, Atom name) {
   Collection<IMethod> result = HashSetFactory.make();
   Collection<IMethod> allMethods = null;
   allMethods = cls.getAllMethods();
   for (IMethod m : allMethods) {
     if (!m.isInit() && !m.isClinit() && m.isPublic() && m.getSelector().getName().equals(name)) {
       result.add(m);
     }
   }
   return result;
 }