Program: 118312
Project: 118312
Buggy source:
private void findImportSchema(Definition wsdlDefinition,Vector schemas,Map importElement,Set<String> imports){
  org.w3c.dom.Element schemaElementt;
  List includeElement=null;
  Iterator keyIterator=importElement.keySet().iterator();
  Boolean isHaveImport=false;
  while (keyIterator.hasNext()) {
    Object object=keyIterator.next();
    if (object != null) {
      String key=object.toString();
      Vector importEle=(Vector)importElement.get(key);
      for (int i=0; i < importEle.size(); i++) {
        Map importChildElement=null;
        com.ibm.wsdl.extensions.schema.SchemaImportImpl importImpl=(com.ibm.wsdl.extensions.schema.SchemaImportImpl)importEle.elementAt(i);
        String importLocation=importImpl.getSchemaLocationURI() + "String_Node_Str" + importImpl.getNamespaceURI();
        if (imports.contains(importLocation)) {
          continue;
        }
 else {
          imports.add(importLocation);
        }
        if (importImpl.getReferencedSchema() != null) {
          schemaElementt=importImpl.getReferencedSchema().getElement();
          String documentBase=importImpl.getReferencedSchema().getDocumentBaseURI();
          if ((com.ibm.wsdl.extensions.schema.SchemaImportImpl)importEle.elementAt(i) != null) {
            if (((com.ibm.wsdl.extensions.schema.SchemaImportImpl)importEle.elementAt(i)).getReferencedSchema() != null) {
              importChildElement=((com.ibm.wsdl.extensions.schema.SchemaImportImpl)importEle.elementAt(i)).getReferencedSchema().getImports();
              if (importChildElement != null && importChildElement.size() > 0 && !isIncludeSchema(documentBase)) {
                isHaveImport=true;
                documentBaseList.add(documentBase);
              }
            }
          }
          XmlSchema schemaImport=createschemafromtype(schemaElementt,wsdlDefinition,documentBase);
          if (schemaImport != null) {
            schemas.add(schemaImport);
            if (schemaImport.getTargetNamespace() != null) {
              schemaNames.add(schemaImport.getTargetNamespace());
            }
          }
        }
        if (isHaveImport) {
          findImportSchema(wsdlDefinition,schemas,importChildElement,imports);
        }
        if ((com.ibm.wsdl.extensions.schema.SchemaImportImpl)importEle.elementAt(i) != null) {
          if (((com.ibm.wsdl.extensions.schema.SchemaImportImpl)importEle.elementAt(i)).getReferencedSchema() != null) {
            includeElement=((com.ibm.wsdl.extensions.schema.SchemaImportImpl)importEle.elementAt(i)).getReferencedSchema().getIncludes();
            if (includeElement != null && includeElement.size() > 0) {
              findIncludesSchema(wsdlDefinition,schemas,includeElement);
            }
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
private void findImportSchema(Definition wsdlDefinition,Vector schemas,Map importElement,Set<String> imports) throws WSDLException {
  org.w3c.dom.Element schemaElementt;
  List includeElement=null;
  Iterator keyIterator=importElement.keySet().iterator();
  Boolean isHaveImport=false;
  while (keyIterator.hasNext()) {
    Object object=keyIterator.next();
    if (object != null) {
      String key=object.toString();
      Vector importEle=(Vector)importElement.get(key);
      for (int i=0; i < importEle.size(); i++) {
        Map importChildElement=null;
        com.ibm.wsdl.extensions.schema.SchemaImportImpl importImpl=(com.ibm.wsdl.extensions.schema.SchemaImportImpl)importEle.elementAt(i);
        String importLocation=importImpl.getSchemaLocationURI() + "String_Node_Str" + importImpl.getNamespaceURI();
        if (imports.contains(importLocation)) {
          continue;
        }
 else {
          imports.add(importLocation);
        }
        if (importImpl.getReferencedSchema() != null) {
          schemaElementt=importImpl.getReferencedSchema().getElement();
          String documentBase=importImpl.getReferencedSchema().getDocumentBaseURI();
          if ((com.ibm.wsdl.extensions.schema.SchemaImportImpl)importEle.elementAt(i) != null) {
            if (((com.ibm.wsdl.extensions.schema.SchemaImportImpl)importEle.elementAt(i)).getReferencedSchema() != null) {
              importChildElement=((com.ibm.wsdl.extensions.schema.SchemaImportImpl)importEle.elementAt(i)).getReferencedSchema().getImports();
              if (importChildElement != null && importChildElement.size() > 0 && !isIncludeSchema(documentBase)) {
                isHaveImport=true;
                documentBaseList.add(documentBase);
              }
            }
          }
          XmlSchema schemaImport=createschemafromtype(schemaElementt,wsdlDefinition,documentBase);
          if (schemaImport != null) {
            schemas.add(schemaImport);
            if (schemaImport.getTargetNamespace() != null) {
              schemaNames.add(schemaImport.getTargetNamespace());
            }
          }
        }
        if (isHaveImport) {
          findImportSchema(wsdlDefinition,schemas,importChildElement,imports);
        }
        if ((com.ibm.wsdl.extensions.schema.SchemaImportImpl)importEle.elementAt(i) != null) {
          if (((com.ibm.wsdl.extensions.schema.SchemaImportImpl)importEle.elementAt(i)).getReferencedSchema() != null) {
            includeElement=((com.ibm.wsdl.extensions.schema.SchemaImportImpl)importEle.elementAt(i)).getReferencedSchema().getIncludes();
            if (includeElement != null && includeElement.size() > 0) {
              findIncludesSchema(wsdlDefinition,schemas,includeElement);
            }
          }
        }
      }
    }
  }
}