public boolean implies(Permission permission){
  if (!(permission instanceof PropertyPermission))   return false;
  PropertyPermission pp=(PropertyPermission)permission;
  PropertyPermission x;
  int desired=pp.getMask();
  int effective=0;
  if (all_allowed) {
synchronized (this) {
      x=perms.get("*");
    }
    if (x != null) {
      effective|=x.getMask();
      if ((effective & desired) == desired)       return true;
    }
  }
  String name=pp.getName();
synchronized (this) {
    x=perms.get(name);
  }
  if (x != null) {
    effective|=x.getMask();
    if ((effective & desired) == desired)     return true;
  }
  int last, offset;
  offset=name.length() - 1;
  while ((last=name.lastIndexOf(".",offset)) != -1) {
    name=name.substring(0,last + 1) + "*";
synchronized (this) {
      x=perms.get(name);
    }
    if (x != null) {
      effective|=x.getMask();
      if ((effective & desired) == desired)       return true;
    }
    offset=last - 1;
  }
  return false;
}

public boolean implies ( Permission permission ) { if ( ! ( permission instanceof PropertyPermission ) ) return false ; PropertyPermission pp = ( PropertyPermission ) permission ; PropertyPermission x ; int desired = pp . getMask ( ) ; int effective = 0 ; if ( all_allowed ) { synchronized ( this ) { x = perms . get ( "*" ) ; } if ( x != null ) { effective |= x . getMask ( ) ; if ( ( effective & desired ) == desired ) return true ; } } String name = pp . getName ( ) ; synchronized ( this ) { x = perms . get ( name ) ; } if ( x != null ) { effective |= x . getMask ( ) ; if ( ( effective & desired ) == desired ) return true ; } int last , offset ; offset = name . length ( ) - 1 ; while ( ( last = name . lastIndexOf ( "." , offset ) ) != - 1 ) { name = name . substring ( 0 , last + 1 ) + "*" ; synchronized ( this ) { x = perms . get ( name ) ; } if ( x != null ) { effective |= x . getMask ( ) ; if ( ( effective & desired ) == desired ) return true ; } offset = last - 1 ; } return false ; }
check and see if this set of permissions implies the permissions expressed in " permission " .
