Program: 67227
Project: 67227
Buggy source:
public void initTypeToSchemaType(){
  this.typeToSchemaType=new HashMap<Type,QName>();
  Iterator descriptors=xmlContext.getSession(0).getProject().getOrderedDescriptors().iterator();
  HashMap defaults=XMLConversionManager.getDefaultJavaTypes();
  while (descriptors.hasNext()) {
    XMLDescriptor next=(XMLDescriptor)descriptors.next();
    Class javaClass=next.getJavaClass();
    QName schemaType=next.getSchemaReference().getSchemaContextAsQName(next.getNamespaceResolver());
    Type type;
    if (generator != null) {
      type=generator.getAnnotationsProcessor().getGeneratedClassesToCollectionClasses().get(javaClass);
      if (type == null) {
        JavaClass arrayClass=(JavaClass)generator.getAnnotationsProcessor().getGeneratedClassesToArrayClasses().get(javaClass);
        if (arrayClass != null) {
          String arrayClassName=arrayClass.getName();
          try {
            type=PrivilegedAccessHelper.getClassForName(arrayClassName);
          }
 catch (          Exception ex) {
          }
        }
      }
      if (type == null) {
        type=javaClass;
      }
    }
 else {
      type=javaClass;
    }
    this.typeToSchemaType.put(type,schemaType);
  }
  if (boundTypes != null) {
    for (    Type next : this.boundTypes) {
      if (this.typeToSchemaType.get(next) == null) {
        QName name=null;
        if (next instanceof Class) {
          name=this.generator.getAnnotationsProcessor().getUserDefinedSchemaTypes().get(((Class)next).getName());
        }
        if (name == null) {
          if (next == ClassConstants.ABYTE || next == ClassConstants.APBYTE) {
            name=XMLConstants.BASE_64_BINARY_QNAME;
          }
 else {
            name=(QName)defaults.get(next);
          }
        }
        if (name != null) {
          this.typeToSchemaType.put(next,name);
        }
      }
    }
  }
}

Fixed version (ground truth):
public void initTypeToSchemaType(){
  this.typeToSchemaType=new HashMap<Type,QName>();
  Iterator descriptors=xmlContext.getSession(0).getProject().getOrderedDescriptors().iterator();
  HashMap defaults=XMLConversionManager.getDefaultJavaTypes();
  while (descriptors.hasNext()) {
    XMLDescriptor next=(XMLDescriptor)descriptors.next();
    Class javaClass=next.getJavaClass();
    if (next.getSchemaReference() != null) {
      QName schemaType=next.getSchemaReference().getSchemaContextAsQName(next.getNamespaceResolver());
      Type type;
      if (generator != null) {
        type=generator.getAnnotationsProcessor().getGeneratedClassesToCollectionClasses().get(javaClass);
        if (type == null) {
          JavaClass arrayClass=(JavaClass)generator.getAnnotationsProcessor().getGeneratedClassesToArrayClasses().get(javaClass);
          if (arrayClass != null) {
            String arrayClassName=arrayClass.getName();
            try {
              type=PrivilegedAccessHelper.getClassForName(arrayClassName);
            }
 catch (            Exception ex) {
            }
          }
        }
        if (type == null) {
          type=javaClass;
        }
      }
 else {
        type=javaClass;
      }
      this.typeToSchemaType.put(type,schemaType);
    }
  }
  if (boundTypes != null) {
    for (    Type next : this.boundTypes) {
      if (this.typeToSchemaType.get(next) == null) {
        QName name=null;
        if (next instanceof Class) {
          name=this.generator.getAnnotationsProcessor().getUserDefinedSchemaTypes().get(((Class)next).getName());
        }
        if (name == null) {
          if (next == ClassConstants.ABYTE || next == ClassConstants.APBYTE) {
            name=XMLConstants.BASE_64_BINARY_QNAME;
          }
 else {
            name=(QName)defaults.get(next);
          }
        }
        if (name != null) {
          this.typeToSchemaType.put(next,name);
        }
      }
    }
  }
}