code: private Set getPrivateGenericCredentials(final Subject subj) throws ResourceException {
  
          Set privateGenericCredentials = null;
  
          if (System.getSecurityManager() != null) {
              try {
                  privateGenericCredentials = (Set) AccessController.doPrivileged(
                                                                                  new PrivilegedExceptionAction() {
                                                                                      @Override
                                                                                      public Object run() throws Exception {
                                                                                          return subj.getPrivateCredentials(GenericCredential.class);
                                                                                      }
                                                                                  });
              } catch (PrivilegedActionException pae) {
                  FFDCFilter.processException(pae, "com.ibm.ejs.j2c.ThreadIdentitySecurityHelper.beforeGettingConnection", "18", this);
                  Tr.error(tc, "FAILED_DOPRIVILEGED_J2CA0060", pae);
                  Exception e = pae.getException();
                  ResourceException re = new ResourceException("ThreadIdentitySecurityHelper failed attempting to access Subject's credentials");
                  re.initCause(e);
                  throw re;
              }
  
          } else {
              privateGenericCredentials = subj.getPrivateCredentials(GenericCredential.class);
          }
  
          return privateGenericCredentials;
      }
docs: Return the set of private credentials of type GenericCredential from the
  given subject.
  
  Basically this method is a wrapper around Subject.getPrivateCredentials
  with Java 2 Security handling.