Program: 68274
Project: 68274
Buggy source:
/** 
 * INTERNAL: This function is referenced by processImport or processInclude possibly recursively
 * @param Include theImportOrInclude
 * @throws Exception
 */
private void processImportIncludeInternal(Include theImportOrInclude) throws Exception {
  if (theImportOrInclude.getSchema() != null) {
    SDOTypesGenerator generator=new SDOTypesGenerator(aHelperContext);
    generator.setGeneratedTypes(getGeneratedTypes());
    generator.setGeneratedGlobalElements(getGeneratedGlobalElements());
    generator.setGeneratedGlobalAttributes(getGeneratedGlobalAttributes());
    generator.setIsImportProcessor(true);
    java.util.List<Type> importedTypes=generator.define(theImportOrInclude.getSchema(),isReturnAllTypes(),isProcessImports());
    processedComplexTypes.putAll(generator.processedComplexTypes);
    processedSimpleTypes.putAll(generator.processedSimpleTypes);
    processedElements.putAll(generator.processedElements);
    processedAttributes.putAll(generator.processedAttributes);
    if (null != importedTypes) {
      for (int i=0, size=importedTypes.size(); i < size; i++) {
        Type nextType=importedTypes.get(i);
        String name=nextType.getName();
        QName qname=new QName(nextType.getURI(),name);
        getGeneratedTypes().put(qname,nextType);
      }
    }
    Iterator<QName> globalPropsIter=generator.getGeneratedGlobalElements().keySet().iterator();
    while (globalPropsIter.hasNext()) {
      QName nextKey=globalPropsIter.next();
      getGeneratedGlobalElements().put(nextKey,generator.getGeneratedGlobalElements().get(nextKey));
    }
    globalPropsIter=generator.getGeneratedGlobalAttributes().keySet().iterator();
    while (globalPropsIter.hasNext()) {
      QName nextKey=globalPropsIter.next();
      getGeneratedGlobalAttributes().put(nextKey,generator.getGeneratedGlobalAttributes().get(nextKey));
    }
    Iterator<Type> globalRefsIter=generator.getGlobalRefs().keySet().iterator();
    while (globalRefsIter.hasNext()) {
      Type nextKey=globalRefsIter.next();
      getGlobalRefs().put(nextKey,generator.getGlobalRefs().get(nextKey));
    }
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: This function is referenced by processImport or processInclude possibly recursively
 * @param Include theImportOrInclude
 * @throws Exception
 */
private void processImportIncludeInternal(Include theImportOrInclude) throws Exception {
  if (theImportOrInclude.getSchema() != null) {
    SDOTypesGenerator generator=new SDOTypesGenerator(aHelperContext);
    generator.setGeneratedTypes(getGeneratedTypes());
    generator.setGeneratedTypesByXsdQName(getGeneratedTypesByXsdQName());
    generator.setGeneratedGlobalElements(getGeneratedGlobalElements());
    generator.setGeneratedGlobalAttributes(getGeneratedGlobalAttributes());
    generator.setIsImportProcessor(true);
    java.util.List<Type> importedTypes=generator.define(theImportOrInclude.getSchema(),isReturnAllTypes(),isProcessImports());
    processedComplexTypes.putAll(generator.processedComplexTypes);
    processedSimpleTypes.putAll(generator.processedSimpleTypes);
    processedElements.putAll(generator.processedElements);
    processedAttributes.putAll(generator.processedAttributes);
    if (null != importedTypes) {
      for (int i=0, size=importedTypes.size(); i < size; i++) {
        Type nextType=importedTypes.get(i);
        String name=nextType.getName();
        QName qname=new QName(nextType.getURI(),name);
        getGeneratedTypes().put(qname,nextType);
      }
    }
    Iterator<QName> globalPropsIter=generator.getGeneratedGlobalElements().keySet().iterator();
    while (globalPropsIter.hasNext()) {
      QName nextKey=globalPropsIter.next();
      getGeneratedGlobalElements().put(nextKey,generator.getGeneratedGlobalElements().get(nextKey));
    }
    globalPropsIter=generator.getGeneratedGlobalAttributes().keySet().iterator();
    while (globalPropsIter.hasNext()) {
      QName nextKey=globalPropsIter.next();
      getGeneratedGlobalAttributes().put(nextKey,generator.getGeneratedGlobalAttributes().get(nextKey));
    }
    Iterator<Type> globalRefsIter=generator.getGlobalRefs().keySet().iterator();
    while (globalRefsIter.hasNext()) {
      Type nextKey=globalRefsIter.next();
      getGlobalRefs().put(nextKey,generator.getGlobalRefs().get(nextKey));
    }
  }
}