/* 347 */ userRoles = copyGroups(userRoles, subjectRoles);
/* */
/* 354 */ if ((subjectRoles != userRoles) || (emptyContextRoles))
/* */ {
/* 356 */ MappingManager mm = sc.getMappingManager();
/* 357 */ MappingContext mc = mm.getMappingContext(Group.class);
/* 358 */ Group mappedUserRoles = userRoles;
/* 359 */ if (mc != null)
/* */ {
/* 361 */ Map contextMap = new HashMap();
/* 362 */ contextMap.put("Roles", userRoles);
/* 363 */ contextMap.put("Principal", principal);
/* */
/* 365 */ contextMap.put("deploymentPrincipalRolesMap", SecurityRolesAssociation.getSecurityRoles());
/* */
/* 369 */ contextMap.put("PrincipalsSet", subject.getPrincipals());
/* 370 */ if (this.trace)
/* 371 */ log.trace("Roles before mapping:" + userRoles);
/* 372 */ mc.performMapping(contextMap, userRoles);
/* 373 */ mappedUserRoles = (Group)mc.getMappingResult().getMappedObject();
/* 374 */ if (this.trace)
/* 375 */ log.trace("Roles after mapping:" + userRoles);
/* */ }
/* 377 */ sc.getData().put("Roles", mappedUserRoles);
/* */ }