Program: 67823
Project: 67823
Buggy source:
private SDOType startNewSimpleType(String targetNamespace,String defaultNamespace,String sdoTypeName,String xsdLocalName,SimpleType simpleType){
  SDOType currentType;
  if (null == simpleType.getName()) {
    currentType=createSDOTypeForName(targetNamespace,sdoTypeName,xsdLocalName);
    currentType.setDataType(true);
  }
 else {
    currentType=getGeneratedTypesByXsdQName().get(new QName(targetNamespace,simpleType.getName()));
  }
  SDOTypeHelper typeHelper=((SDOTypeHelper)aHelperContext.getTypeHelper());
  QName baseTypeQName=null;
  if (simpleType.getRestriction() != null) {
    String baseType=simpleType.getRestriction().getBaseType();
    baseTypeQName=this.getQNameForString(defaultNamespace,baseType);
    SDOType baseSDOType=getTypeForXSDQName(baseTypeQName);
    currentType.addBaseType(baseSDOType);
    currentType.setInstanceClass(baseSDOType.getInstanceClass());
  }
  SDOWrapperType wrapperType=new SDOWrapperType(currentType,sdoTypeName,typeHelper,baseTypeQName);
  typeHelper.getWrappersHashMap().put(currentType.getQName(),wrapperType);
  typeHelper.getTypesHashMap().put(wrapperType.getQName(),wrapperType);
  typeHelper.getInterfacesToSDOTypeHashMap().put(wrapperType.getXmlDescriptor().getInterfacePolicy().getParentInterfaces().firstElement(),wrapperType);
  ArrayList list=new ArrayList(1);
  list.add(wrapperType);
  ((SDOXMLHelper)aHelperContext.getXMLHelper()).addDescriptors(list);
  if (simpleType.getAnnotation() != null) {
    currentType.setAppInfoElements(simpleType.getAnnotation().getAppInfo());
  }
  return currentType;
}

Fixed version (ground truth):
private SDOType startNewSimpleType(String targetNamespace,String defaultNamespace,String sdoTypeName,String xsdLocalName,SimpleType simpleType){
  SDOType currentType;
  if (null == simpleType.getName()) {
    currentType=createSDOTypeForName(targetNamespace,sdoTypeName,xsdLocalName);
    currentType.setDataType(true);
  }
 else {
    currentType=getGeneratedTypesByXsdQName().get(new QName(targetNamespace,simpleType.getName()));
  }
  SDOTypeHelper typeHelper=((SDOTypeHelper)aHelperContext.getTypeHelper());
  QName baseTypeQName=null;
  if (simpleType.getRestriction() != null) {
    String baseType=simpleType.getRestriction().getBaseType();
    baseTypeQName=this.getQNameForString(defaultNamespace,baseType);
    SDOType baseSDOType=getTypeForXSDQName(baseTypeQName);
    currentType.addBaseType(baseSDOType);
    currentType.setInstanceClass(baseSDOType.getInstanceClass());
  }
  SDOWrapperType wrapperType=new SDOWrapperType(currentType,sdoTypeName,typeHelper,baseTypeQName);
  typeHelper.getWrappersHashMap().put(currentType.getQName(),wrapperType);
  typeHelper.getTypesHashMap().put(wrapperType.getQName(),wrapperType);
  typeHelper.getInterfacesToSDOTypeHashMap().put(wrapperType.getXmlDescriptor().getInterfacePolicy().getParentInterfaces().firstElement(),wrapperType);
  typeHelper.getImplClassesToSDOType().put(wrapperType.getXmlDescriptor().getJavaClass(),wrapperType);
  ArrayList list=new ArrayList(1);
  list.add(wrapperType);
  ((SDOXMLHelper)aHelperContext.getXMLHelper()).addDescriptors(list);
  if (simpleType.getAnnotation() != null) {
    currentType.setAppInfoElements(simpleType.getAnnotation().getAppInfo());
  }
  return currentType;
}