else if(original != null && original.getMethodPermissions() != null)
this.setMethodPermissions(original.getMethodPermissions());
SecurityRolesMetaData securityRolesMetaData = null;
SecurityRolesMetaData jbossSecurityRolesMetaData = null;
MessageDestinationsMetaData messageDestinationsMetaData = null;
MessageDestinationsMetaData jbossMessageDestinationsMetaData = null;
if(override != null )
{
jbossMessageDestinationsMetaData = override.getMessageDestinations();
jbossSecurityRolesMetaData = override.getSecurityRoles();
}
if (original != null)
{
securityRolesMetaData = original.getSecurityRoles();
messageDestinationsMetaData = original.getMessageDestinations();
}
if (jbossSecurityRolesMetaData == null || jbossSecurityRolesMetaData.isEmpty())
{
if (securityRolesMetaData != null)
merged.setSecurityRoles(securityRolesMetaData);
}
else
{
SecurityRolesMetaData mergedSecurityRolesMetaData = new SecurityRolesMetaData();
mergedSecurityRolesMetaData = JavaEEMetaDataUtil.mergeJBossXml(mergedSecurityRolesMetaData, securityRolesMetaData, jbossSecurityRolesMetaData, "security-role", false);
if (mergedSecurityRolesMetaData != null && mergedSecurityRolesMetaData.isEmpty() == false)
merged.setSecurityRoles(mergedSecurityRolesMetaData);
}
if (jbossMessageDestinationsMetaData == null || jbossMessageDestinationsMetaData.isEmpty())
{
if (messageDestinationsMetaData != null && jbossMessageDestinationsMetaData == null)
merged.setMessageDestinations(messageDestinationsMetaData);
}
else
{
MessageDestinationsMetaData mergedMessageDestinationsMetaData = new MessageDestinationsMetaData();
mergedMessageDestinationsMetaData = JavaEEMetaDataUtil.mergeJBossXml(mergedMessageDestinationsMetaData, messageDestinationsMetaData, jbossMessageDestinationsMetaData, "message-destination", true);
if (mergedMessageDestinationsMetaData != null && mergedMessageDestinationsMetaData.isEmpty() == false)
merged.setMessageDestinations(mergedMessageDestinationsMetaData);
}
}