Update the relevant ProtectionDomains with the Principals from the {@code Subject} associated with this{@code SubjectDomainCombiner}.
A new {@code ProtectionDomain} instance is createdfor each {@code ProtectionDomain} in thecurrentDomains array. Each new {@code ProtectionDomain}instance is created using the {@code CodeSource}, {@code Permission}s and {@code ClassLoader}from the corresponding {@code ProtectionDomain} incurrentDomains, as well as with the Principals from the {@code Subject} associated with this{@code SubjectDomainCombiner}.
All of the newly instantiated ProtectionDomains are combined into a new array. The ProtectionDomains from the assignedDomains array are appended to this new array, and the result is returned.
Note that optimizations such as the removal of duplicate ProtectionDomains may have occurred. In addition, caching of ProtectionDomains may be permitted.
@param currentDomains the ProtectionDomains associated with thecurrent execution Thread, up to the most recent privileged {@code ProtectionDomain}. The ProtectionDomains are are listed in order of execution, with the most recently executing {@code ProtectionDomain}residing at the beginning of the array. This parameter may be {@code null} if the current execution Threadhas no associated ProtectionDomains.
@param assignedDomains the ProtectionDomains inherited from theparent Thread, or the ProtectionDomains from the privileged context, if a call to AccessController.doPrivileged(..., context) had occurred This parameter may be {@code null}if there were no ProtectionDomains inherited from the parent Thread, or from the privileged context.
@return a new array consisting of the updated ProtectionDomains,or {@code null}.