public static boolean isCurrentlyFinal(RVMMethod callee,boolean searchSubclasses){
  RVMClass klass=callee.getDeclaringClass();
  if (klass.isInterface()) {
    return false;
  }
  RVMClass[] subClasses=klass.getSubClasses();
  if (subClasses.length == 0) {
    return true;
  }
 else   if (searchSubclasses) {
    Stack<RVMClass> s=new Stack<RVMClass>();
    for (    RVMClass subClass1 : subClasses) {
      s.push(subClass1);
    }
    while (!s.isEmpty()) {
      RVMClass subClass=s.pop();
      if (subClass.findDeclaredMethod(callee.getName(),callee.getDescriptor()) != null) {
        return false;
      }
      subClasses=subClass.getSubClasses();
      for (      RVMClass subClass1 : subClasses) {
        s.push(subClass1);
      }
    }
    return true;
  }
 else {
    return false;
  }
}

public static boolean isCurrentlyFinal ( RVMMethod callee , boolean searchSubclasses ) { RVMClass klass = callee . getDeclaringClass ( ) ; if ( klass . isInterface ( ) ) { return false ; } RVMClass [ ] subClasses = klass . getSubClasses ( ) ; if ( subClasses . length == 0 ) { return true ; } else if ( searchSubclasses ) { Stack < RVMClass > s = new Stack < RVMClass > ( ) ; for ( RVMClass subClass1 : subClasses ) { s . push ( subClass1 ) ; } while ( ! s . isEmpty ( ) ) { RVMClass subClass = s . pop ( ) ; if ( subClass . findDeclaredMethod ( callee . getName ( ) , callee . getDescriptor ( ) ) != null ) { return false ; } subClasses = subClass . getSubClasses ( ) ; for ( RVMClass subClass1 : subClasses ) { s . push ( subClass1 ) ; } } return true ; } else { return false ; } }
is the method currently final ( not overridden by any subclass ) ? < p > note that this says nothing about whether or not the method will be overridden by future dynamically loaded classes .
