public static boolean isCallerValid(String className){
  if (!checkCaller) {
    return (true);
  }
  String parentClass=getParentClass(className);
  for (int i=0; i < VALID_PACKAGES.length; i++) {
    if (parentClass.startsWith(VALID_PACKAGES[i])) {
      return (true);
    }
  }
  for (int i=0; i < VALID_CLASSES.length; i++) {
    if (parentClass.equals(VALID_CLASSES[i])) {
      return (true);
    }
  }
  return (false);
}

public static boolean isCallerValid ( String className ) { if ( ! checkCaller ) { return ( true ) ; } String parentClass = getParentClass ( className ) ; for ( int i = 0 ; i < VALID_PACKAGES . length ; i ++ ) { if ( parentClass . startsWith ( VALID_PACKAGES [ i ] ) ) { return ( true ) ; } } for ( int i = 0 ; i < VALID_CLASSES . length ; i ++ ) { if ( parentClass . equals ( VALID_CLASSES [ i ] ) ) { return ( true ) ; } } return ( false ) ; }
check to determine if the calling class has the privilege to execute sensitive methods which returns passwords , decrypts data , etc . this method uses the stack trace to determine the calling class .
