Program: 118309
Project: 118309
Buggy source:
protected Vector<XmlSchema> createSchemaFromTypes(List<Definition> wsdlDefinitions){
  Vector<XmlSchema> schemas=new Vector<XmlSchema>();
  Set<String> imports=new HashSet<String>();
  org.w3c.dom.Element schemaElementt=null;
  Map importElement=null;
  List includeElement=null;
  for (  Definition def : wsdlDefinitions) {
    if (def.getTypes() != null) {
      Vector schemaExtElem=findExtensibilityElement(def.getTypes().getExtensibilityElements(),"String_Node_Str");
      for (int i=0; i < schemaExtElem.size(); i++) {
        ExtensibilityElement schemaElement=(ExtensibilityElement)schemaExtElem.elementAt(i);
        if (schemaElement != null && schemaElement instanceof UnknownExtensibilityElement) {
          schemaElementt=((UnknownExtensibilityElement)schemaElement).getElement();
          String documentBase=((javax.wsdl.extensions.schema.Schema)schemaElement).getDocumentBaseURI();
          XmlSchema schema=createschemafromtype(schemaElementt,def,documentBase);
          if (schema != null) {
            schemas.add(schema);
            if (schema.getTargetNamespace() != null) {
              schemaNames.add(schema.getTargetNamespace());
            }
          }
          importElement=((javax.wsdl.extensions.schema.Schema)schemaElement).getImports();
          if (importElement != null && importElement.size() > 0) {
            findImportSchema(def,schemas,importElement,imports);
          }
        }
        if (schemaElement != null && schemaElement instanceof javax.wsdl.extensions.schema.Schema) {
          schemaElementt=((javax.wsdl.extensions.schema.Schema)schemaElement).getElement();
          String documentBase=((javax.wsdl.extensions.schema.Schema)schemaElement).getDocumentBaseURI();
          Boolean isHaveImport=false;
          importElement=((javax.wsdl.extensions.schema.Schema)schemaElement).getImports();
          if (importElement != null && importElement.size() > 0) {
            Iterator keyIterator=importElement.keySet().iterator();
            if (importElement.size() > 0) {
              isHaveImport=true;
            }
          }
          XmlSchema schema=createschemafromtype(schemaElementt,def,documentBase);
          if (schema != null) {
            schemas.add(schema);
            if (schema.getTargetNamespace() != null) {
              schemaNames.add(schema.getTargetNamespace());
            }
          }
          if (isHaveImport) {
            findImportSchema(def,schemas,importElement,imports);
          }
        }
      }
    }
  }
  return schemas;
}

Fixed version (ground truth):
protected Vector<XmlSchema> createSchemaFromTypes(List<Definition> wsdlDefinitions) throws WSDLException {
  Vector<XmlSchema> schemas=new Vector<XmlSchema>();
  Set<String> imports=new HashSet<String>();
  org.w3c.dom.Element schemaElementt=null;
  Map importElement=null;
  List includeElement=null;
  for (  Definition def : wsdlDefinitions) {
    if (def.getTypes() != null) {
      Vector schemaExtElem=findExtensibilityElement(def.getTypes().getExtensibilityElements(),"String_Node_Str");
      for (int i=0; i < schemaExtElem.size(); i++) {
        ExtensibilityElement schemaElement=(ExtensibilityElement)schemaExtElem.elementAt(i);
        if (schemaElement != null && schemaElement instanceof UnknownExtensibilityElement) {
          schemaElementt=((UnknownExtensibilityElement)schemaElement).getElement();
          String documentBase=((javax.wsdl.extensions.schema.Schema)schemaElement).getDocumentBaseURI();
          XmlSchema schema=createschemafromtype(schemaElementt,def,documentBase);
          if (schema != null) {
            schemas.add(schema);
            if (schema.getTargetNamespace() != null) {
              schemaNames.add(schema.getTargetNamespace());
            }
          }
          importElement=((javax.wsdl.extensions.schema.Schema)schemaElement).getImports();
          if (importElement != null && importElement.size() > 0) {
            findImportSchema(def,schemas,importElement,imports);
          }
        }
        if (schemaElement != null && schemaElement instanceof javax.wsdl.extensions.schema.Schema) {
          schemaElementt=((javax.wsdl.extensions.schema.Schema)schemaElement).getElement();
          String documentBase=((javax.wsdl.extensions.schema.Schema)schemaElement).getDocumentBaseURI();
          Boolean isHaveImport=false;
          importElement=((javax.wsdl.extensions.schema.Schema)schemaElement).getImports();
          if (importElement != null && importElement.size() > 0) {
            Iterator keyIterator=importElement.keySet().iterator();
            if (importElement.size() > 0) {
              isHaveImport=true;
            }
          }
          XmlSchema schema=createschemafromtype(schemaElementt,def,documentBase);
          if (schema != null) {
            schemas.add(schema);
            if (schema.getTargetNamespace() != null) {
              schemaNames.add(schema.getTargetNamespace());
            }
          }
          if (isHaveImport) {
            findImportSchema(def,schemas,importElement,imports);
          }
        }
      }
    }
  }
  return schemas;
}