public void add(Permission permission){
  if (!(permission instanceof PropertyPermission))   throw new IllegalArgumentException("invalid permission: " + permission);
  if (isReadOnly())   throw new SecurityException("attempt to add a Permission to a readonly PermissionCollection");
  PropertyPermission pp=(PropertyPermission)permission;
  String propName=pp.getName();
synchronized (this) {
    PropertyPermission existing=perms.get(propName);
    if (existing != null) {
      int oldMask=existing.getMask();
      int newMask=pp.getMask();
      if (oldMask != newMask) {
        int effective=oldMask | newMask;
        String actions=PropertyPermission.getActions(effective);
        perms.put(propName,new PropertyPermission(propName,actions));
      }
    }
 else {
      perms.put(propName,pp);
    }
  }
  if (!all_allowed) {
    if (propName.equals("*"))     all_allowed=true;
  }
}

public void add ( Permission permission ) { if ( ! ( permission instanceof PropertyPermission ) ) throw new IllegalArgumentException ( "invalid permission: " + permission ) ; if ( isReadOnly ( ) ) throw new SecurityException ( "attempt to add a Permission to a readonly PermissionCollection" ) ; PropertyPermission pp = ( PropertyPermission ) permission ; String propName = pp . getName ( ) ; synchronized ( this ) { PropertyPermission existing = perms . get ( propName ) ; if ( existing != null ) { int oldMask = existing . getMask ( ) ; int newMask = pp . getMask ( ) ; if ( oldMask != newMask ) { int effective = oldMask | newMask ; String actions = PropertyPermission . getActions ( effective ) ; perms . put ( propName , new PropertyPermission ( propName , actions ) ) ; } } else { perms . put ( propName , pp ) ; } } if ( ! all_allowed ) { if ( propName . equals ( "*" ) ) all_allowed = true ; } }
adds a permission to the propertypermissions . the key for the hash is the name .
