private static AccessControlContext createPrivilegedContext(Class caller,AccessControlContext acc){
  DomainCombiner comb=acc.getDomainCombiner();
  ProtectionDomain pd=caller.getProtectionDomain();
  ProtectionDomain[] pds=(pd != null) ? new ProtectionDomain[]{pd} : null;
  if (comb != null) {
    pds=comb.combine(pds,null);
  }
  if (pds == null) {
    pds=new ProtectionDomain[0];
  }
  return new AccessControlContext(new AccessControlContext(pds),comb);
}

private static AccessControlContext createPrivilegedContext ( Class caller , AccessControlContext acc ) { DomainCombiner comb = acc . getDomainCombiner ( ) ; ProtectionDomain pd = caller . getProtectionDomain ( ) ; ProtectionDomain [ ] pds = ( pd != null ) ? new ProtectionDomain [ ] { pd } : null ; if ( comb != null ) { pds = comb . combine ( pds , null ) ; } if ( pds == null ) { pds = new ProtectionDomain [ 0 ] ; } return new AccessControlContext ( new AccessControlContext ( pds ) , comb ) ; }
creates privileged context that contains the protection domain of the given caller class ( if non - null ) and uses the domain combiner of the specified context . this method assumes it is called from within a privileged block .
