Set knownServletMappings = new HashSet();
ServletMappingType[] servletMappingArray = webApp.getServletMappingArray();
Map servletMappings = new HashMap();
for (int i = 0; i < servletMappingArray.length; i++) {
ServletMappingType servletMappingType = servletMappingArray[i];
String servletName = servletMappingType.getServletName().getStringValue().trim();
if(!knownServlets.contains(servletName)) {
throw new DeploymentException("Servlet mapping refers to servlet '"+servletName+"' but no such servlet was found!");
}
String urlPattern = servletMappingType.getUrlPattern().getStringValue().trim();
if (!knownServletMappings.contains(urlPattern)) {
knownServletMappings.add(urlPattern);
checkString(urlPattern);
Set urlsForServlet = (Set) servletMappings.get(servletName);
if (urlsForServlet == null) {