code: public static Method[] getAllMethods(Class<?> intf)
      {
          // Changed from using a Vector and Hashtable to using an
          // ArrayList and HashMap to improve performance.                 d366807.3
  
          Method[] allMethods = intf.getMethods();
          ArrayList<Method> result = new ArrayList<Method>(allMethods.length);
          HashMap<String, Method> methodNameTable = new HashMap<String, Method>();
  
          for (int i = 0; i < allMethods.length; i++) {
              Method m = allMethods[i];
  
              //---------------------------
              // Filter out static methods
              //---------------------------
  
              if (Modifier.isStatic(m.getModifiers())) {
                  continue;
              }
  
              String mKey = methodKey(m);
              String interfaceName = m.getDeclaringClass().getName();
              if ((!(interfaceName.equals("javax.ejb.EJBObject") || // d135803
                  interfaceName.equals("javax.ejb.EJBLocalObject"))) // d135803
                  || m.getName().equals("remove")) { // d135803
                  Method synonym = methodNameTable.get(mKey);
                  if (synonym == null) {
                      methodNameTable.put(mKey, m);
                      result.add(m); // d366807.3
                  } else {
                      //---------------------------------------------
                      // Method declared on most specific class wins
                      //---------------------------------------------
                      Class<?> mClass = m.getDeclaringClass();
                      Class<?> sClass = synonym.getDeclaringClass();
                      if (sClass.isAssignableFrom(mClass)) {
                          methodNameTable.put(mKey, m);
                          result.set(result.indexOf(synonym), m); // d366807.3
                      }
                  }
              }
          }
  
          return sortMethods(result);
      }
docs: Returns all the methods belonging to an interface (including
  its super interfaces). Filters out methods belonging to the
  javax.ejb.EJBObject interface (except remove) and method synonyms
  (in case method overrides are present in the inheritance hierarchy).
  
  The same as getMethods(), except including remove method of
  interface javax.ejb.EJBObject
  
  This method used only by EJBDeploy.