//check equality
for (WSDLExtensibilityElement el1 : pol1)
{
boolean done = false;
Iterator it = pol2.iterator();
WSDLExtensibilityElement el2 = null;
while (it.hasNext() && !done)
{
el2 = (WSDLExtensibilityElement)it.next();
done = (el1.isRequired() == el2.isRequired()) &&
checkElementEquality(el1.getElement(), el2.getElement());
}
if (!done)
{
log.error("Failing policy validation on policy on: "+ext1+" and "+ext2);
return false;
}
pol2.remove(el2);
}
//policy references
List<WSDLExtensibilityElement> polRef1 = new ArrayList<WSDLExtensibilityElement>(
ext1.getExtensibilityElements(Constants.WSDL_ELEMENT_POLICYREFERENCE));
List<WSDLExtensibilityElement> polRef2 = new ArrayList<WSDLExtensibilityElement>(
ext2.getExtensibilityElements(Constants.WSDL_ELEMENT_POLICYREFERENCE));
//check whether lists are the same size
if (polRef1.size() != polRef2.size())
throw new JBossWSToolsException("Policy ref WSDLExtensibilityElement mismatch!");
//check equality
for (WSDLExtensibilityElement el1 : polRef1)
{
boolean done = false;
Iterator it = polRef2.iterator();
WSDLExtensibilityElement el2 = null;
while (it.hasNext() && !done)
{
el2 = (WSDLExtensibilityElement)it.next();
done = (el1.isRequired() == el2.isRequired()) &&
checkElementEquality(el1.getElement(), el2.getElement());
}
if (!done)
{
log.error("Failing policy validation on policy ref on: "+ext1+" and "+ext2);
return false;