jdk/src/java.base/share/classes/javax/security/auth/SubjectDomainCombiner.java
changeset 39747 2d542b973871
parent 29492 a4bf9a570035
child 39751 47948cf5c3c5
equal deleted inserted replaced
39746:e3a56c19a668 39747:2d542b973871
   231                 ProtectionDomain pd = currentDomains[i];
   231                 ProtectionDomain pd = currentDomains[i];
   232 
   232 
   233                 subjectPd = cachedPDs.getValue(pd);
   233                 subjectPd = cachedPDs.getValue(pd);
   234 
   234 
   235                 if (subjectPd == null) {
   235                 if (subjectPd == null) {
   236                     subjectPd = new ProtectionDomain(pd.getCodeSource(),
   236                     if (pd.staticPermissionsOnly()) {
       
   237                         // keep static ProtectionDomain objects static
       
   238                         subjectPd = pd;
       
   239                     } else {
       
   240                         subjectPd = new ProtectionDomain(pd.getCodeSource(),
   237                                                 pd.getPermissions(),
   241                                                 pd.getPermissions(),
   238                                                 pd.getClassLoader(),
   242                                                 pd.getClassLoader(),
   239                                                 principals);
   243                                                 principals);
       
   244                     }
   240                     cachedPDs.putValue(pd, subjectPd);
   245                     cachedPDs.putValue(pd, subjectPd);
   241                 } else {
   246                 } else {
   242                     allNew = false;
   247                     allNew = false;
   243                 }
   248                 }
   244                 newDomains[i] = subjectPd;
   249                 newDomains[i] = subjectPd;