public boolean implies(Permission permission){
  if (!(permission instanceof BasicPermission))   return false;
  BasicPermission bp=(BasicPermission)permission;
  if (bp.getClass() != permClass)   return false;
  if (all_allowed)   return true;
  String path=bp.getCanonicalName();
  Permission x;
synchronized (this) {
    x=perms.get(path);
  }
  if (x != null) {
    return x.implies(permission);
  }
  int last, offset;
  offset=path.length() - 1;
  while ((last=path.lastIndexOf(".",offset)) != -1) {
    path=path.substring(0,last + 1) + "*";
synchronized (this) {
      x=perms.get(path);
    }
    if (x != null) {
      return x.implies(permission);
    }
    offset=last - 1;
  }
  return false;
}

public boolean implies ( Permission permission ) { if ( ! ( permission instanceof BasicPermission ) ) return false ; BasicPermission bp = ( BasicPermission ) permission ; if ( bp . getClass ( ) != permClass ) return false ; if ( all_allowed ) return true ; String path = bp . getCanonicalName ( ) ; Permission x ; synchronized ( this ) { x = perms . get ( path ) ; } if ( x != null ) { return x . implies ( permission ) ; } int last , offset ; offset = path . length ( ) - 1 ; while ( ( last = path . lastIndexOf ( "." , offset ) ) != - 1 ) { path = path . substring ( 0 , last + 1 ) + "*" ; synchronized ( this ) { x = perms . get ( path ) ; } if ( x != null ) { return x . implies ( permission ) ; } offset = last - 1 ; } return false ; }
check and see if this set of permissions implies the permissions expressed in " permission " .
