StringBuffer conflictingResources = new StringBuffer();
Set<Resource> resourceSet = new HashSet<Resource>();
Iterator<SunResourcesXML> sunResourcesXMLIter = sunResList.iterator();
while(sunResourcesXMLIter.hasNext()){
//get list of resources from one sun-resources.xml file
SunResourcesXML sunResXML = sunResourcesXMLIter.next();
List<Resource> resources = sunResXML.getResourcesList();
Iterator<Resource> resourcesIter = resources.iterator();
//for each resource mentioned
while(resourcesIter.hasNext()){
Resource res = resourcesIter.next();
Iterator<Resource> resSetIter = resourceSet.iterator();
boolean addResource = true;
//check if a duplicate has already been added
while(resSetIter.hasNext()){
Resource existingRes = resSetIter.next();
if(existingRes.equals(res)){
//duplicate within an archive
addResource = false;
_logger.warning(localStrings.getString("duplicate.resource.sun.resource.xml",
getIdToCompare(res), sunResXML.getXMLPath()));
break;
}
//check if another existing resource conflicts with the
//resource being added
if(existingRes.isAConflict(res)){
//conflict within an archive
addResource = false;
conflictingResources.append("\n");
String message = localStrings.getString("conflict.resource.sun.resource.xml",
getIdToCompare(res), sunResXML.getXMLPath());
conflictingResources.append(message);
_logger.warning(message);
if(_logger.isLoggable(Level.FINE))
logAttributes(res);
}