nus-yam/ex-repair huggingface dataset:
Program: 67578
Project: 67578
Buggy source:
public void addChoiceElement(XMLField field,String elementTypeName){
  this.fieldToClassNameMappings.put(field,elementTypeName);
}

Fixed version (ground truth):
public void addChoiceElement(XMLField field,String elementTypeName){
  this.fieldToClassNameMappings.put(field,elementTypeName);
  addChoiceElementMapping(field,elementTypeName);
}
Program: 67580
Project: 67580
Buggy source:
public void convertClassNamesToClasses(ClassLoader classLoader){
  Iterator<XMLField> fields=fieldToClassNameMappings.keySet().iterator();
  while (fields.hasNext()) {
    XMLField next=fields.next();
    String className=fieldToClassNameMappings.get(next);
    Class elementType=null;
    try {
      if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()) {
        try {
          elementType=(Class)AccessController.doPrivileged(new PrivilegedClassForName(className,true,classLoader));
        }
 catch (        PrivilegedActionException exception) {
          throw ValidationException.classNotFoundWhileConvertingClassNames(className,exception.getException());
        }
      }
 else {
        elementType=org.eclipse.persistence.internal.security.PrivilegedAccessHelper.getClassForName(className,true,classLoader);
      }
    }
 catch (    ClassNotFoundException exc) {
      throw ValidationException.classNotFoundWhileConvertingClassNames(className,exc);
    }
    addChoiceElement(next,elementType);
  }
}

Fixed version (ground truth):
public void convertClassNamesToClasses(ClassLoader classLoader){
  Iterator<XMLField> fields=fieldToClassNameMappings.keySet().iterator();
  while (fields.hasNext()) {
    XMLField next=fields.next();
    String className=fieldToClassNameMappings.get(next);
    Class elementType=null;
    try {
      if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()) {
        try {
          elementType=(Class)AccessController.doPrivileged(new PrivilegedClassForName(className,true,classLoader));
        }
 catch (        PrivilegedActionException exception) {
          throw ValidationException.classNotFoundWhileConvertingClassNames(className,exception.getException());
        }
      }
 else {
        elementType=org.eclipse.persistence.internal.security.PrivilegedAccessHelper.getClassForName(className,true,classLoader);
      }
    }
 catch (    ClassNotFoundException exc) {
      throw ValidationException.classNotFoundWhileConvertingClassNames(className,exc);
    }
    if (classToFieldMappings.get(elementType) == null) {
      classToFieldMappings.put(elementType,next);
    }
  }
}
Program: 67581
Project: 67581
Buggy source:
public void addChoiceElement(XMLField field,String elementTypeName){
  this.fieldToClassNameMappings.put(field,elementTypeName);
}

Fixed version (ground truth):
public void addChoiceElement(XMLField field,String elementTypeName){
  this.fieldToClassNameMappings.put(field,elementTypeName);
  addChoiceElementMapping(field,elementTypeName);
}
Program: 67583
Project: 67583
Buggy source:
public void removeNullCapableValue(NullCapableValue nullCapableValue){
  if (null == getNullCapableValues()) {
    return;
  }
  getNullCapableValues().remove(nullCapableValue);
}

Fixed version (ground truth):
public void removeNullCapableValue(NullCapableValue nullCapableValue){
  getNullCapableValues().remove(nullCapableValue);
}
Program: 67584
Project: 67584
Buggy source:
public UnmarshalRecord(TreeObjectBuilder treeObjectBuilder){
  super();
  this.levelIndex=0;
  this.xPathFragment=new XPathFragment();
  this.stringBuffer=new StrBuffer();
  this.isBufferCDATA=false;
  this.treeObjectBuilder=treeObjectBuilder;
  if (null != treeObjectBuilder) {
    this.xPathNode=treeObjectBuilder.getRootXPathNode();
    if (null != treeObjectBuilder.getNullCapableValues()) {
      nullCapableValues=new ArrayList();
      nullCapableValues.addAll(treeObjectBuilder.getNullCapableValues());
    }
  }
  fragmentBuilder=new SAXFragmentBuilder(this);
  isSelfRecord=false;
}

Fixed version (ground truth):
public UnmarshalRecord(TreeObjectBuilder treeObjectBuilder){
  super();
  this.levelIndex=0;
  this.xPathFragment=new XPathFragment();
  this.stringBuffer=new StrBuffer();
  this.isBufferCDATA=false;
  this.treeObjectBuilder=treeObjectBuilder;
  nullCapableValues=new ArrayList();
  if (null != treeObjectBuilder) {
    this.xPathNode=treeObjectBuilder.getRootXPathNode();
    if (null != treeObjectBuilder.getNullCapableValues()) {
      nullCapableValues.addAll(treeObjectBuilder.getNullCapableValues());
    }
  }
  fragmentBuilder=new SAXFragmentBuilder(this);
  isSelfRecord=false;
}
Program: 67585
Project: 67585
Buggy source:
private JAXBElement createJAXBElementFromWrappedValue(WrappedValue wrappedValue){
  Object unwrappedValue=wrappedValue.getWrappedValue();
  return createJAXBElement(wrappedValue.getQName(),wrappedValue.getWrappedValueClass(),unwrappedValue);
}

Fixed version (ground truth):
private JAXBElement createJAXBElementFromWrappedValue(WrappedValue wrappedValue){
  Object unwrappedValue=wrappedValue.getWrappedValue();
  if (unwrappedValue == null && wrappedValue.getWrappedValueClass().equals(ClassConstants.STRING)) {
    if (!wrappedValue.isSetValue()) {
      unwrappedValue="String_Node_Str";
    }
  }
  return createJAXBElement(wrappedValue.getQName(),wrappedValue.getWrappedValueClass(),unwrappedValue);
}
Program: 67588
Project: 67588
Buggy source:
public ExpertBeerConsumer(){
  super();
  audio=new ArrayList<byte[]>();
  quotes=new HashMap<Date,String>();
  celebrations=new HashMap<Birthday,String>();
}

Fixed version (ground truth):
public ExpertBeerConsumer(){
  super();
  quotes=new HashMap<Date,String>();
  celebrations=new HashMap<Birthday,String>();
}
Program: 67591
Project: 67591
Buggy source:
public ExpertBeerConsumer(){
  super();
  audio=new ArrayList<byte[]>();
  quotes=new HashMap<Date,String>();
  celebrations=new HashMap<Birthday,String>();
}

Fixed version (ground truth):
public ExpertBeerConsumer(){
  super();
  quotes=new HashMap<Date,String>();
  celebrations=new HashMap<Birthday,String>();
}
Program: 67594
Project: 67594
Buggy source:
protected void addProblemsTo(List currentProblems){
  super.addProblemsTo(currentProblems);
  this.checkRequiredNamespacePrefix(currentProblems);
  this.checkDuplicateNamespacePrefix(currentProblems);
}

Fixed version (ground truth):
protected void addProblemsTo(List currentProblems){
  super.addProblemsTo(currentProblems);
  this.checkRequiredNamespacePrefix(currentProblems);
  this.checkDuplicateNamespacePrefix(currentProblems);
  this.checkSpacesinNamespacePrefix(currentProblems);
}
Program: 67595
Project: 67595
Buggy source:
/** 
 * INTERNAL: Put a ClassLoader/HelperContext key/value pair in the Thread HelperContext  map.  If Thread.currentThread().getContextClassLoader() == key during  getHelperContext() call then the HelperContext (value) will be returned. This method will overwrite an existing entry in the map with the same ClassLoader key.
 * @param key class loader
 * @param value helper context
 */
public static void putHelperContext(ClassLoader key,HelperContext value){
  if (key == null || value == null) {
    return;
  }
  userSetHelperContexts.put(key,value);
}

Fixed version (ground truth):
/** 
 * INTERNAL: Put a ClassLoader/HelperContext key/value pair in the Thread HelperContext  map.  If Thread.currentThread().getContextClassLoader() == key during  getHelperContext() call then the HelperContext (value) will be returned. This method will overwrite an existing entry in the map with the same ClassLoader key.
 * @param key class loader
 * @param value helper context
 */
public static void putHelperContext(ClassLoader key,HelperContext value){
  if (key == null || value == null) {
    return;
  }
  userSetHelperContexts.put(key,new WeakReference<HelperContext>(value));
}
Program: 67596
Project: 67596
Buggy source:
/** 
 * INTERNAL:  Return the helper context for a given key.  The key will either be a ClassLoader or a String (representing an application name). A new context will be created and put in the map if none exists  for the given key. The key is assumed to be non-null -  getDelegateKey should always return either a string representing the application name (for WLS) or a class loader.  This is relevant since 'putIfAbsent' will  throw a null pointer exception if the key is null.   
 */
public static HelperContext getHelperContext(){
  ClassLoader contextClassLoader=Thread.currentThread().getContextClassLoader();
  HelperContext hCtx=userSetHelperContexts.get(contextClassLoader);
  if (hCtx != null) {
    return hCtx;
  }
  Object key=getDelegateMapKey(contextClassLoader);
  hCtx=helperContexts.get(key);
  if (hCtx == null) {
    hCtx=new SDOHelperContext();
    HelperContext existingCtx=helperContexts.putIfAbsent(key,hCtx);
    if (existingCtx != null) {
      hCtx=existingCtx;
    }
    if (key.getClass() == ClassConstants.STRING) {
      helperContexts.put(contextClassLoader,hCtx);
    }
    addNotificationListener(key);
  }
  return hCtx;
}

Fixed version (ground truth):
/** 
 * INTERNAL:  Return the helper context for a given key.  The key will either be a ClassLoader or a String (representing an application name). A new context will be created and put in the map if none exists  for the given key. The key is assumed to be non-null -  getDelegateKey should always return either a string representing the application name (for WLS) or a class loader.  This is relevant since 'putIfAbsent' will  throw a null pointer exception if the key is null.   
 */
public static HelperContext getHelperContext(){
  ClassLoader contextClassLoader=Thread.currentThread().getContextClassLoader();
  HelperContext hCtx=getHelperContext(contextClassLoader);
  if (hCtx != null) {
    return hCtx;
  }
  Object key=getDelegateMapKey(contextClassLoader);
  hCtx=helperContexts.get(key);
  if (hCtx == null) {
    hCtx=new SDOHelperContext();
    HelperContext existingCtx=helperContexts.putIfAbsent(key,hCtx);
    if (existingCtx != null) {
      hCtx=existingCtx;
    }
    if (key.getClass() == ClassConstants.STRING) {
      helperContexts.put(contextClassLoader,hCtx);
    }
    addNotificationListener(key);
  }
  return hCtx;
}
Program: 67598
Project: 67598
Buggy source:
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTestSuite(SchemaGenEmployeeTestCases.class);
  suite.addTestSuite(SchemaGenXMLTypeTestCases.class);
  suite.addTestSuite(SchemaGenXMLRootElementTestCases.class);
  suite.addTestSuite(SchemaGenImportTestCases.class);
  return suite;
}

Fixed version (ground truth):
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTestSuite(SchemaGenEmployeeTestCases.class);
  suite.addTestSuite(SchemaGenXMLTypeTestCases.class);
  suite.addTestSuite(SchemaGenXMLRootElementTestCases.class);
  return suite;
}
Program: 67601
Project: 67601
Buggy source:
public void generateCollectionMapping(Property property,XMLDescriptor descriptor,NamespaceInfo namespaceInfo){
  JavaClass javaClass=null;
  if (property.getGenericType() != null) {
    javaClass=(JavaClass)property.getGenericType();
  }
  if (helper.isAnnotationPresent(property.getElement(),XmlElement.class)) {
    XmlElement xmlElement=(XmlElement)helper.getAnnotation(property.getElement(),XmlElement.class);
    if (xmlElement.type() != XmlElement.DEFAULT.class) {
      javaClass=helper.getJavaClass(xmlElement.type());
    }
  }
  if (javaClass != null && typeInfo.get(javaClass.getQualifiedName()) != null) {
    TypeInfo referenceInfo=typeInfo.get(javaClass.getQualifiedName());
    if (referenceInfo.isEnumerationType()) {
      generateEnumCollectionMapping(property,descriptor,namespaceInfo,(EnumTypeInfo)referenceInfo);
    }
 else {
      if (helper.isAnnotationPresent(property.getElement(),XmlIDREF.class)) {
        generateXMLCollectionReferenceMapping(property,descriptor,namespaceInfo,javaClass);
      }
 else {
        generateCompositeCollectionMapping(property,descriptor,namespaceInfo,javaClass);
      }
    }
  }
 else {
    generateDirectCollectionMapping(property,descriptor,namespaceInfo);
  }
}

Fixed version (ground truth):
public void generateCollectionMapping(Property property,XMLDescriptor descriptor,NamespaceInfo namespaceInfo){
  JavaClass javaClass=null;
  if (property.getGenericType() != null) {
    javaClass=(JavaClass)property.getGenericType();
  }
  if (helper.isAnnotationPresent(property.getElement(),XmlElement.class)) {
    XmlElement xmlElement=(XmlElement)helper.getAnnotation(property.getElement(),XmlElement.class);
    if (xmlElement.type() != XmlElement.DEFAULT.class) {
      javaClass=helper.getJavaClass(xmlElement.type());
    }
  }
  if (javaClass != null && typeInfo.get(javaClass.getQualifiedName()) != null) {
    TypeInfo referenceInfo=typeInfo.get(javaClass.getQualifiedName());
    if (referenceInfo.isEnumerationType()) {
      generateEnumCollectionMapping(property,descriptor,namespaceInfo,(EnumTypeInfo)referenceInfo);
    }
 else {
      if (helper.isAnnotationPresent(property.getElement(),XmlIDREF.class)) {
        generateXMLCollectionReferenceMapping(property,descriptor,namespaceInfo,javaClass);
      }
 else {
        generateCompositeCollectionMapping(property,descriptor,namespaceInfo,javaClass.getQualifiedName());
      }
    }
  }
 else {
    generateDirectCollectionMapping(property,descriptor,namespaceInfo);
  }
}
Program: 67603
Project: 67603
Buggy source:
public XMLCompositeObjectMapping generateCompositeObjectMapping(Property property,XMLDescriptor descriptor,NamespaceInfo namespaceInfo,String referenceClassName){
  XMLCompositeObjectMapping mapping=new XMLCompositeObjectMapping();
  mapping.setReferenceClassName(referenceClassName);
  mapping.setAttributeName(property.getPropertyName());
  if (property.isMethodProperty()) {
    if (property.getSetMethodName() != null) {
      mapping.setSetMethodName(property.getSetMethodName());
      mapping.setGetMethodName(property.getGetMethodName());
    }
 else {
      mapping.setGetMethodName(property.getGetMethodName());
    }
  }
  mapping.setXPath(getXPathForField(property,namespaceInfo,false).getXPath());
  if (helper.isAnnotationPresent(property.getElement(),XmlContainerProperty.class)) {
    XmlContainerProperty containerProp=(XmlContainerProperty)helper.getAnnotation(property.getElement(),XmlContainerProperty.class);
    String name=containerProp.value();
    mapping.setContainerAttributeName(name);
    if (!containerProp.getMethodName().equals("String_Node_Str") && !containerProp.setMethodName().equals("String_Node_Str")) {
      mapping.setContainerGetMethodName(containerProp.getMethodName());
      mapping.setContainerSetMethodName(containerProp.setMethodName());
    }
  }
  descriptor.addMapping(mapping);
  return mapping;
}

Fixed version (ground truth):
public XMLCompositeObjectMapping generateCompositeObjectMapping(Property property,XMLDescriptor descriptor,NamespaceInfo namespaceInfo,String referenceClassName){
  XMLCompositeObjectMapping mapping=new XMLCompositeObjectMapping();
  mapping.setReferenceClassName(referenceClassName);
  mapping.setAttributeName(property.getPropertyName());
  if (property.isMethodProperty()) {
    if (property.getSetMethodName() != null) {
      mapping.setSetMethodName(property.getSetMethodName());
      mapping.setGetMethodName(property.getGetMethodName());
    }
 else {
      mapping.setGetMethodName(property.getGetMethodName());
    }
  }
  if (property.isNillable()) {
    mapping.getNullPolicy().setNullRepresentedByXsiNil(true);
  }
  mapping.setXPath(getXPathForField(property,namespaceInfo,false).getXPath());
  if (helper.isAnnotationPresent(property.getElement(),XmlContainerProperty.class)) {
    XmlContainerProperty containerProp=(XmlContainerProperty)helper.getAnnotation(property.getElement(),XmlContainerProperty.class);
    String name=containerProp.value();
    mapping.setContainerAttributeName(name);
    if (!containerProp.getMethodName().equals("String_Node_Str") && !containerProp.setMethodName().equals("String_Node_Str")) {
      mapping.setContainerGetMethodName(containerProp.getMethodName());
      mapping.setContainerSetMethodName(containerProp.setMethodName());
    }
  }
  descriptor.addMapping(mapping);
  return mapping;
}
Program: 67604
Project: 67604
Buggy source:
public XMLDirectMapping generateDirectMapping(Property property,XMLDescriptor descriptor,NamespaceInfo namespaceInfo){
  XMLDirectMapping mapping=new XMLDirectMapping();
  mapping.setAttributeName(property.getPropertyName());
  if (property.isMethodProperty()) {
    if (property.getSetMethodName() != null) {
      mapping.setSetMethodName(property.getSetMethodName());
      mapping.setGetMethodName(property.getGetMethodName());
    }
 else {
      mapping.setGetMethodName(property.getGetMethodName());
    }
  }
  mapping.setField(getXPathForField(property,namespaceInfo,true));
  if (XMLConstants.QNAME_QNAME.equals(property.getSchemaType())) {
    ((XMLField)mapping.getField()).setSchemaType(XMLConstants.QNAME_QNAME);
  }
  descriptor.addMapping(mapping);
  return mapping;
}

Fixed version (ground truth):
public XMLDirectMapping generateDirectMapping(Property property,XMLDescriptor descriptor,NamespaceInfo namespaceInfo){
  XMLDirectMapping mapping=new XMLDirectMapping();
  mapping.setAttributeName(property.getPropertyName());
  if (property.isMethodProperty()) {
    if (property.getSetMethodName() != null) {
      mapping.setSetMethodName(property.getSetMethodName());
      mapping.setGetMethodName(property.getGetMethodName());
    }
 else {
      mapping.setGetMethodName(property.getGetMethodName());
    }
  }
  if (property.isNillable()) {
    mapping.getNullPolicy().setNullRepresentedByXsiNil(true);
  }
  mapping.setField(getXPathForField(property,namespaceInfo,true));
  if (XMLConstants.QNAME_QNAME.equals(property.getSchemaType())) {
    ((XMLField)mapping.getField()).setSchemaType(XMLConstants.QNAME_QNAME);
  }
  descriptor.addMapping(mapping);
  return mapping;
}
Program: 67607
Project: 67607
Buggy source:
/** 
 * INTERNAL:
 * @return Returns the keyClassFields.
 */
protected KeyElementAccessor[] getKeyClassFields(Class clazz){
  if (this.keyClassFields == null) {
    this.keyClassFields=initializePrimaryKeyFields(this.pkClass);
  }
  return this.keyClassFields;
}

Fixed version (ground truth):
/** 
 * INTERNAL:
 * @return Returns the keyClassFields.
 */
protected KeyElementAccessor[] getKeyClassFields(Class clazz){
  return this.keyClassFields;
}
Program: 67609
Project: 67609
Buggy source:
/** 
 * Returns true if the field or method passed in is annotated with JAXB annotations.
 */
private boolean hasJAXBAnnotations(JavaHasAnnotations elem){
  if (helper.isAnnotationPresent(elem,XmlElement.class) || helper.isAnnotationPresent(elem,XmlAttribute.class) || helper.isAnnotationPresent(elem,XmlAnyElement.class)|| helper.isAnnotationPresent(elem,XmlAnyAttribute.class)|| helper.isAnnotationPresent(elem,XmlValue.class)|| helper.isAnnotationPresent(elem,XmlElements.class)|| helper.isAnnotationPresent(elem,XmlElementRef.class)|| helper.isAnnotationPresent(elem,XmlElementRefs.class)|| helper.isAnnotationPresent(elem,XmlID.class)|| helper.isAnnotationPresent(elem,XmlSchemaType.class)) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Returns true if the field or method passed in is annotated with JAXB annotations.
 */
private boolean hasJAXBAnnotations(JavaHasAnnotations elem){
  if (helper.isAnnotationPresent(elem,XmlElement.class) || helper.isAnnotationPresent(elem,XmlAttribute.class) || helper.isAnnotationPresent(elem,XmlAnyElement.class)|| helper.isAnnotationPresent(elem,XmlAnyAttribute.class)|| helper.isAnnotationPresent(elem,XmlValue.class)|| helper.isAnnotationPresent(elem,XmlElements.class)|| helper.isAnnotationPresent(elem,XmlElementRef.class)|| helper.isAnnotationPresent(elem,XmlElementRefs.class)|| helper.isAnnotationPresent(elem,XmlID.class)|| helper.isAnnotationPresent(elem,XmlSchemaType.class)|| helper.isAnnotationPresent(elem,XmlElementWrapper.class)|| helper.isAnnotationPresent(elem,XmlID.class)|| helper.isAnnotationPresent(elem,XmlIDREF.class)) {
    return true;
  }
  return false;
}
Program: 67610
Project: 67610
Buggy source:
public XMLChoiceObjectMapping generateChoiceMapping(Property property,XMLDescriptor descriptor,NamespaceInfo namespace){
  ChoiceProperty prop=(ChoiceProperty)property;
  XMLChoiceObjectMapping mapping=new XMLChoiceObjectMapping();
  mapping.setAttributeName(property.getPropertyName());
  if (property.isMethodProperty()) {
    mapping.setGetMethodName(property.getGetMethodName());
    mapping.setSetMethodName(property.getSetMethodName());
  }
  Iterator<Property> choiceProperties=prop.getChoiceProperties().iterator();
  while (choiceProperties.hasNext()) {
    Property next=choiceProperties.next();
    JavaClass type=next.getType();
    XMLField xpath=getXPathForField(next,namespace,!(this.typeInfo.containsKey(type.getQualifiedName())));
    mapping.addChoiceElement(xpath.getName(),type.getQualifiedName(),false);
  }
  descriptor.addMapping(mapping);
  return mapping;
}

Fixed version (ground truth):
public XMLChoiceObjectMapping generateChoiceMapping(Property property,XMLDescriptor descriptor,NamespaceInfo namespace){
  ChoiceProperty prop=(ChoiceProperty)property;
  XMLChoiceObjectMapping mapping=new XMLChoiceObjectMapping();
  mapping.setAttributeName(property.getPropertyName());
  if (property.isMethodProperty()) {
    if (property.getSetMethodName() != null) {
      mapping.setSetMethodName(property.getSetMethodName());
      mapping.setGetMethodName(property.getGetMethodName());
    }
 else {
      mapping.setGetMethodName(property.getGetMethodName());
    }
  }
  Iterator<Property> choiceProperties=prop.getChoiceProperties().iterator();
  while (choiceProperties.hasNext()) {
    Property next=choiceProperties.next();
    JavaClass type=next.getType();
    XMLField xpath=getXPathForField(next,namespace,!(this.typeInfo.containsKey(type.getQualifiedName())));
    mapping.addChoiceElement(xpath.getName(),type.getQualifiedName(),false);
  }
  descriptor.addMapping(mapping);
  return mapping;
}
Program: 67611
Project: 67611
Buggy source:
public void generateEnumCollectionMapping(Property property,XMLDescriptor descriptor,NamespaceInfo namespaceInfo,EnumTypeInfo info){
  XMLCompositeDirectCollectionMapping mapping=new XMLCompositeDirectCollectionMapping();
  mapping.setAttributeName(property.getPropertyName());
  if (property.isMethodProperty()) {
    mapping.setGetMethodName(property.getGetMethodName());
    mapping.setSetMethodName(property.getSetMethodName());
  }
  mapping.setValueConverter(buildJAXBEnumTypeConverter(mapping,info));
  JavaClass collectionType=property.getType();
  if (areEquals(collectionType,Collection.class) || areEquals(collectionType,List.class)) {
    collectionType=jotArrayList;
  }
 else   if (areEquals(collectionType,Set.class)) {
    collectionType=jotHashSet;
  }
  mapping.useCollectionClassName(collectionType.getRawName());
  mapping.setField(getXPathForField(property,namespaceInfo,true));
  if (helper.isAnnotationPresent(property.getElement(),XmlList.class)) {
    mapping.setUsesSingleNode(true);
  }
  descriptor.addMapping(mapping);
}

Fixed version (ground truth):
public void generateEnumCollectionMapping(Property property,XMLDescriptor descriptor,NamespaceInfo namespaceInfo,EnumTypeInfo info){
  XMLCompositeDirectCollectionMapping mapping=new XMLCompositeDirectCollectionMapping();
  mapping.setAttributeName(property.getPropertyName());
  if (property.isMethodProperty()) {
    if (property.getSetMethodName() != null) {
      mapping.setSetMethodName(property.getSetMethodName());
      mapping.setGetMethodName(property.getGetMethodName());
    }
 else {
      mapping.setGetMethodName(property.getGetMethodName());
    }
  }
  mapping.setValueConverter(buildJAXBEnumTypeConverter(mapping,info));
  JavaClass collectionType=property.getType();
  if (areEquals(collectionType,Collection.class) || areEquals(collectionType,List.class)) {
    collectionType=jotArrayList;
  }
 else   if (areEquals(collectionType,Set.class)) {
    collectionType=jotHashSet;
  }
  mapping.useCollectionClassName(collectionType.getRawName());
  mapping.setField(getXPathForField(property,namespaceInfo,true));
  if (helper.isAnnotationPresent(property.getElement(),XmlList.class)) {
    mapping.setUsesSingleNode(true);
  }
  descriptor.addMapping(mapping);
}
Program: 67612
Project: 67612
Buggy source:
/** 
 * Create an XMLObjectReferenceMapping and add it to the descriptor.
 * @param property
 * @param descriptor
 * @param namespaceInfo
 * @param referenceClass
 */
public void generateXMLObjectReferenceMapping(Property property,XMLDescriptor descriptor,NamespaceInfo namespaceInfo,JavaClass referenceClass){
  XMLField srcXPath=getXPathForField(property,namespaceInfo,true);
  XMLObjectReferenceMapping mapping=new XMLObjectReferenceMapping();
  mapping.setAttributeName(property.getPropertyName());
  mapping.setReferenceClassName(referenceClass.getQualifiedName());
  TypeInfo referenceType=typeInfo.get(referenceClass.getQualifiedName());
  if (referenceType.isIDSet()) {
    Property prop=referenceType.getIDProperty();
    XMLField tgtXPath=getXPathForField(prop,namespaceInfo,!(helper.isAnnotationPresent(prop.getElement(),XmlAttribute.class)));
    mapping.addSourceToTargetKeyFieldAssociation(srcXPath.getXPath(),tgtXPath.getXPath());
  }
  descriptor.addMapping(mapping);
}

Fixed version (ground truth):
/** 
 * Create an XMLObjectReferenceMapping and add it to the descriptor.
 * @param property
 * @param descriptor
 * @param namespaceInfo
 * @param referenceClass
 */
public void generateXMLObjectReferenceMapping(Property property,XMLDescriptor descriptor,NamespaceInfo namespaceInfo,JavaClass referenceClass){
  XMLField srcXPath=getXPathForField(property,namespaceInfo,true);
  XMLObjectReferenceMapping mapping=new XMLObjectReferenceMapping();
  mapping.setAttributeName(property.getPropertyName());
  if (property.isMethodProperty()) {
    if (property.getSetMethodName() != null) {
      mapping.setSetMethodName(property.getSetMethodName());
      mapping.setGetMethodName(property.getGetMethodName());
    }
 else {
      mapping.setGetMethodName(property.getGetMethodName());
    }
  }
  mapping.setReferenceClassName(referenceClass.getQualifiedName());
  TypeInfo referenceType=typeInfo.get(referenceClass.getQualifiedName());
  if (referenceType.isIDSet()) {
    Property prop=referenceType.getIDProperty();
    XMLField tgtXPath=getXPathForField(prop,namespaceInfo,!(helper.isAnnotationPresent(prop.getElement(),XmlAttribute.class)));
    mapping.addSourceToTargetKeyFieldAssociation(srcXPath.getXPath(),tgtXPath.getXPath());
  }
  descriptor.addMapping(mapping);
}
Program: 67613
Project: 67613
Buggy source:
public void generateAnyAttributeMapping(Property property,XMLDescriptor descriptor,NamespaceInfo namespaceInfo){
  XMLAnyAttributeMapping mapping=new XMLAnyAttributeMapping();
  mapping.setAttributeName(property.getPropertyName());
  if (property.isMethodProperty()) {
    mapping.setGetMethodName(property.getGetMethodName());
    mapping.setSetMethodName(property.getSetMethodName());
  }
  mapping.setSchemaInstanceIncluded(false);
  mapping.setNamespaceDeclarationIncluded(false);
  descriptor.addMapping(mapping);
}

Fixed version (ground truth):
public void generateAnyAttributeMapping(Property property,XMLDescriptor descriptor,NamespaceInfo namespaceInfo){
  XMLAnyAttributeMapping mapping=new XMLAnyAttributeMapping();
  mapping.setAttributeName(property.getPropertyName());
  if (property.isMethodProperty()) {
    if (property.getSetMethodName() != null) {
      mapping.setSetMethodName(property.getSetMethodName());
      mapping.setGetMethodName(property.getGetMethodName());
    }
 else {
      mapping.setGetMethodName(property.getGetMethodName());
    }
  }
  mapping.setSchemaInstanceIncluded(false);
  mapping.setNamespaceDeclarationIncluded(false);
  descriptor.addMapping(mapping);
}
Program: 67614
Project: 67614
Buggy source:
public XMLBinaryDataMapping generateBinaryMapping(Property property,XMLDescriptor descriptor,NamespaceInfo namespaceInfo){
  XMLBinaryDataMapping mapping=new XMLBinaryDataMapping();
  mapping.setAttributeName(property.getPropertyName());
  if (property.isMethodProperty()) {
    mapping.setGetMethodName(property.getGetMethodName());
    mapping.setSetMethodName(property.getSetMethodName());
  }
  mapping.setField(getXPathForField(property,namespaceInfo,false));
  if (property.isSwaAttachmentRef()) {
    ((XMLField)mapping.getField()).setSchemaType(XMLConstants.SWA_REF_QNAME);
    mapping.setSwaRef(true);
  }
 else   if (property.isMtomAttachment()) {
    ((XMLField)mapping.getField()).setSchemaType(XMLConstants.BASE_64_BINARY_QNAME);
  }
  if (helper.isAnnotationPresent(property.getElement(),XmlInlineBinaryData.class)) {
    mapping.setShouldInlineBinaryData(true);
  }
  mapping.setMimeTypePolicy(new FixedMimeTypePolicy(property.getMimeType()));
  descriptor.addMapping(mapping);
  return mapping;
}

Fixed version (ground truth):
public XMLBinaryDataMapping generateBinaryMapping(Property property,XMLDescriptor descriptor,NamespaceInfo namespaceInfo){
  XMLBinaryDataMapping mapping=new XMLBinaryDataMapping();
  mapping.setAttributeName(property.getPropertyName());
  if (property.isMethodProperty()) {
    if (property.getSetMethodName() != null) {
      mapping.setSetMethodName(property.getSetMethodName());
      mapping.setGetMethodName(property.getGetMethodName());
    }
 else {
      mapping.setGetMethodName(property.getGetMethodName());
    }
  }
  mapping.setField(getXPathForField(property,namespaceInfo,false));
  if (property.isSwaAttachmentRef()) {
    ((XMLField)mapping.getField()).setSchemaType(XMLConstants.SWA_REF_QNAME);
    mapping.setSwaRef(true);
  }
 else   if (property.isMtomAttachment()) {
    ((XMLField)mapping.getField()).setSchemaType(XMLConstants.BASE_64_BINARY_QNAME);
  }
  if (helper.isAnnotationPresent(property.getElement(),XmlInlineBinaryData.class)) {
    mapping.setShouldInlineBinaryData(true);
  }
  mapping.setMimeTypePolicy(new FixedMimeTypePolicy(property.getMimeType()));
  descriptor.addMapping(mapping);
  return mapping;
}
Program: 67615
Project: 67615
Buggy source:
public XMLCompositeObjectMapping generateCompositeObjectMapping(Property property,XMLDescriptor descriptor,NamespaceInfo namespaceInfo,JavaClass referenceClass){
  XMLCompositeObjectMapping mapping=new XMLCompositeObjectMapping();
  mapping.setReferenceClassName(referenceClass.getQualifiedName());
  mapping.setAttributeName(property.getPropertyName());
  if (property.isMethodProperty()) {
    mapping.setGetMethodName(property.getGetMethodName());
    mapping.setSetMethodName(property.getSetMethodName());
  }
  mapping.setXPath(getXPathForField(property,namespaceInfo,false).getXPath());
  if (helper.isAnnotationPresent(property.getElement(),XmlContainerProperty.class)) {
    XmlContainerProperty containerProp=(XmlContainerProperty)helper.getAnnotation(property.getElement(),XmlContainerProperty.class);
    String name=containerProp.value();
    mapping.setContainerAttributeName(name);
    if (!containerProp.getMethodName().equals("String_Node_Str") && !containerProp.setMethodName().equals("String_Node_Str")) {
      mapping.setContainerGetMethodName(containerProp.getMethodName());
      mapping.setContainerSetMethodName(containerProp.setMethodName());
    }
  }
  descriptor.addMapping(mapping);
  return mapping;
}

Fixed version (ground truth):
public XMLCompositeObjectMapping generateCompositeObjectMapping(Property property,XMLDescriptor descriptor,NamespaceInfo namespaceInfo,JavaClass referenceClass){
  XMLCompositeObjectMapping mapping=new XMLCompositeObjectMapping();
  mapping.setReferenceClassName(referenceClass.getQualifiedName());
  mapping.setAttributeName(property.getPropertyName());
  if (property.isMethodProperty()) {
    if (property.getSetMethodName() != null) {
      mapping.setSetMethodName(property.getSetMethodName());
      mapping.setGetMethodName(property.getGetMethodName());
    }
 else {
      mapping.setGetMethodName(property.getGetMethodName());
    }
  }
  mapping.setXPath(getXPathForField(property,namespaceInfo,false).getXPath());
  if (helper.isAnnotationPresent(property.getElement(),XmlContainerProperty.class)) {
    XmlContainerProperty containerProp=(XmlContainerProperty)helper.getAnnotation(property.getElement(),XmlContainerProperty.class);
    String name=containerProp.value();
    mapping.setContainerAttributeName(name);
    if (!containerProp.getMethodName().equals("String_Node_Str") && !containerProp.setMethodName().equals("String_Node_Str")) {
      mapping.setContainerGetMethodName(containerProp.getMethodName());
      mapping.setContainerSetMethodName(containerProp.setMethodName());
    }
  }
  descriptor.addMapping(mapping);
  return mapping;
}
Program: 67617
Project: 67617
Buggy source:
public XMLDirectMapping generateDirectMapping(Property property,XMLDescriptor descriptor,NamespaceInfo namespaceInfo){
  XMLDirectMapping mapping=new XMLDirectMapping();
  mapping.setAttributeName(property.getPropertyName());
  if (property.isMethodProperty()) {
    mapping.setGetMethodName(property.getGetMethodName());
    mapping.setSetMethodName(property.getSetMethodName());
  }
  mapping.setField(getXPathForField(property,namespaceInfo,true));
  if (XMLConstants.QNAME_QNAME.equals(property.getSchemaType())) {
    ((XMLField)mapping.getField()).setSchemaType(XMLConstants.QNAME_QNAME);
  }
  descriptor.addMapping(mapping);
  return mapping;
}

Fixed version (ground truth):
public XMLDirectMapping generateDirectMapping(Property property,XMLDescriptor descriptor,NamespaceInfo namespaceInfo){
  XMLDirectMapping mapping=new XMLDirectMapping();
  mapping.setAttributeName(property.getPropertyName());
  if (property.isMethodProperty()) {
    if (property.getSetMethodName() != null) {
      mapping.setSetMethodName(property.getSetMethodName());
      mapping.setGetMethodName(property.getGetMethodName());
    }
 else {
      mapping.setGetMethodName(property.getGetMethodName());
    }
  }
  mapping.setField(getXPathForField(property,namespaceInfo,true));
  if (XMLConstants.QNAME_QNAME.equals(property.getSchemaType())) {
    ((XMLField)mapping.getField()).setSchemaType(XMLConstants.QNAME_QNAME);
  }
  descriptor.addMapping(mapping);
  return mapping;
}
Program: 67618
Project: 67618
Buggy source:
public XMLChoiceCollectionMapping generateChoiceCollectionMapping(Property property,XMLDescriptor descriptor,NamespaceInfo namespace){
  ChoiceProperty prop=(ChoiceProperty)property;
  XMLChoiceCollectionMapping mapping=new XMLChoiceCollectionMapping();
  mapping.setAttributeName(property.getPropertyName());
  if (property.isMethodProperty()) {
    mapping.setGetMethodName(property.getGetMethodName());
    mapping.setSetMethodName(property.getSetMethodName());
  }
  JavaClass collectionType=property.getType();
  if (areEquals(collectionType,Collection.class) || areEquals(collectionType,List.class)) {
    collectionType=jotArrayList;
  }
 else   if (areEquals(collectionType,Set.class)) {
    collectionType=jotHashSet;
  }
  mapping.useCollectionClassName(collectionType.getRawName());
  Iterator<Property> choiceProperties=prop.getChoiceProperties().iterator();
  while (choiceProperties.hasNext()) {
    Property next=choiceProperties.next();
    JavaClass type=next.getType();
    XMLField xpath=getXPathForField(next,namespace,!(this.typeInfo.containsKey(type.getQualifiedName())));
    mapping.addChoiceElement(xpath.getName(),type.getQualifiedName());
  }
  descriptor.addMapping(mapping);
  return mapping;
}

Fixed version (ground truth):
public XMLChoiceCollectionMapping generateChoiceCollectionMapping(Property property,XMLDescriptor descriptor,NamespaceInfo namespace){
  ChoiceProperty prop=(ChoiceProperty)property;
  XMLChoiceCollectionMapping mapping=new XMLChoiceCollectionMapping();
  mapping.setAttributeName(property.getPropertyName());
  if (property.isMethodProperty()) {
    if (property.getSetMethodName() != null) {
      mapping.setSetMethodName(property.getSetMethodName());
      mapping.setGetMethodName(property.getGetMethodName());
    }
 else {
      mapping.setGetMethodName(property.getGetMethodName());
    }
  }
  JavaClass collectionType=property.getType();
  if (areEquals(collectionType,Collection.class) || areEquals(collectionType,List.class)) {
    collectionType=jotArrayList;
  }
 else   if (areEquals(collectionType,Set.class)) {
    collectionType=jotHashSet;
  }
  mapping.useCollectionClassName(collectionType.getRawName());
  Iterator<Property> choiceProperties=prop.getChoiceProperties().iterator();
  while (choiceProperties.hasNext()) {
    Property next=choiceProperties.next();
    JavaClass type=next.getType();
    XMLField xpath=getXPathForField(next,namespace,!(this.typeInfo.containsKey(type.getQualifiedName())));
    mapping.addChoiceElement(xpath.getName(),type.getQualifiedName());
  }
  descriptor.addMapping(mapping);
  return mapping;
}
Program: 67619
Project: 67619
Buggy source:
/** 
 * Create an XMLCollectionReferenceMapping and add it to the descriptor.
 * @param property
 * @param descriptor
 * @param namespaceInfo
 * @param referenceClass
 */
public void generateXMLCollectionReferenceMapping(Property property,XMLDescriptor descriptor,NamespaceInfo namespaceInfo,JavaClass referenceClass){
  XMLField srcXPath=getXPathForField(property,namespaceInfo,true);
  XMLCollectionReferenceMapping mapping=new XMLCollectionReferenceMapping();
  mapping.setAttributeName(property.getPropertyName());
  mapping.setReferenceClassName(referenceClass.getQualifiedName());
  JavaClass collectionType=property.getType();
  if (areEquals(collectionType,Collection.class) || areEquals(collectionType,List.class)) {
    collectionType=jotArrayList;
  }
 else   if (areEquals(collectionType,Set.class)) {
    collectionType=jotHashSet;
  }
  mapping.useCollectionClassName(collectionType.getRawName());
  TypeInfo referenceType=typeInfo.get(referenceClass.getQualifiedName());
  if (referenceType.isIDSet()) {
    Property prop=referenceType.getIDProperty();
    XMLField tgtXPath=getXPathForField(prop,namespaceInfo,!(helper.isAnnotationPresent(prop.getElement(),XmlAttribute.class)));
    mapping.addSourceToTargetKeyFieldAssociation(srcXPath.getXPath(),tgtXPath.getXPath());
  }
  descriptor.addMapping(mapping);
}

Fixed version (ground truth):
/** 
 * Create an XMLCollectionReferenceMapping and add it to the descriptor.
 * @param property
 * @param descriptor
 * @param namespaceInfo
 * @param referenceClass
 */
public void generateXMLCollectionReferenceMapping(Property property,XMLDescriptor descriptor,NamespaceInfo namespaceInfo,JavaClass referenceClass){
  XMLField srcXPath=getXPathForField(property,namespaceInfo,true);
  XMLCollectionReferenceMapping mapping=new XMLCollectionReferenceMapping();
  mapping.setAttributeName(property.getPropertyName());
  if (property.isMethodProperty()) {
    if (property.getSetMethodName() != null) {
      mapping.setSetMethodName(property.getSetMethodName());
      mapping.setGetMethodName(property.getGetMethodName());
    }
 else {
      mapping.setGetMethodName(property.getGetMethodName());
    }
  }
  mapping.setReferenceClassName(referenceClass.getQualifiedName());
  JavaClass collectionType=property.getType();
  if (areEquals(collectionType,Collection.class) || areEquals(collectionType,List.class)) {
    collectionType=jotArrayList;
  }
 else   if (areEquals(collectionType,Set.class)) {
    collectionType=jotHashSet;
  }
  mapping.useCollectionClassName(collectionType.getRawName());
  TypeInfo referenceType=typeInfo.get(referenceClass.getQualifiedName());
  if (referenceType.isIDSet()) {
    Property prop=referenceType.getIDProperty();
    XMLField tgtXPath=getXPathForField(prop,namespaceInfo,!(helper.isAnnotationPresent(prop.getElement(),XmlAttribute.class)));
    mapping.addSourceToTargetKeyFieldAssociation(srcXPath.getXPath(),tgtXPath.getXPath());
  }
  descriptor.addMapping(mapping);
}
Program: 67622
Project: 67622
Buggy source:
public void generateDirectEnumerationMapping(Property property,XMLDescriptor descriptor,NamespaceInfo namespaceInfo,EnumTypeInfo enumInfo){
  XMLDirectMapping mapping=new XMLDirectMapping();
  mapping.setConverter(buildJAXBEnumTypeConverter(mapping,enumInfo));
  mapping.setAttributeName(property.getPropertyName());
  if (property.isMethodProperty()) {
    mapping.setGetMethodName(property.getGetMethodName());
    mapping.setSetMethodName(property.getSetMethodName());
  }
  mapping.setField(getXPathForField(property,namespaceInfo,true));
  descriptor.addMapping(mapping);
}

Fixed version (ground truth):
public void generateDirectEnumerationMapping(Property property,XMLDescriptor descriptor,NamespaceInfo namespaceInfo,EnumTypeInfo enumInfo){
  XMLDirectMapping mapping=new XMLDirectMapping();
  mapping.setConverter(buildJAXBEnumTypeConverter(mapping,enumInfo));
  mapping.setAttributeName(property.getPropertyName());
  if (property.isMethodProperty()) {
    if (property.getSetMethodName() != null) {
      mapping.setSetMethodName(property.getSetMethodName());
      mapping.setGetMethodName(property.getGetMethodName());
    }
 else {
      mapping.setGetMethodName(property.getGetMethodName());
    }
  }
  mapping.setField(getXPathForField(property,namespaceInfo,true));
  descriptor.addMapping(mapping);
}
Program: 67623
Project: 67623
Buggy source:
public void generateAnyObjectMapping(Property property,XMLDescriptor descriptor,NamespaceInfo namespaceInfo){
  XMLAnyObjectMapping mapping=new XMLAnyObjectMapping();
  mapping.setAttributeName(property.getPropertyName());
  if (property.isMethodProperty()) {
    mapping.setGetMethodName(property.getGetMethodName());
    mapping.setSetMethodName(property.getSetMethodName());
  }
  if (property.getType().getQualifiedName().equals("String_Node_Str")) {
    mapping.setKeepAsElementPolicy(UnmarshalKeepAsElementPolicy.KEEP_ALL_AS_ELEMENT);
  }
 else {
    mapping.setKeepAsElementPolicy(UnmarshalKeepAsElementPolicy.KEEP_UNKNOWN_AS_ELEMENT);
  }
  descriptor.addMapping(mapping);
}

Fixed version (ground truth):
public void generateAnyObjectMapping(Property property,XMLDescriptor descriptor,NamespaceInfo namespaceInfo){
  XMLAnyObjectMapping mapping=new XMLAnyObjectMapping();
  mapping.setAttributeName(property.getPropertyName());
  if (property.isMethodProperty()) {
    if (property.getSetMethodName() != null) {
      mapping.setSetMethodName(property.getSetMethodName());
      mapping.setGetMethodName(property.getGetMethodName());
    }
 else {
      mapping.setGetMethodName(property.getGetMethodName());
    }
  }
  if (property.getType().getQualifiedName().equals("String_Node_Str")) {
    mapping.setKeepAsElementPolicy(UnmarshalKeepAsElementPolicy.KEEP_ALL_AS_ELEMENT);
  }
 else {
    mapping.setKeepAsElementPolicy(UnmarshalKeepAsElementPolicy.KEEP_UNKNOWN_AS_ELEMENT);
  }
  descriptor.addMapping(mapping);
}
Program: 67624
Project: 67624
Buggy source:
public XMLCompositeDirectCollectionMapping generateDirectCollectionMapping(Property property,XMLDescriptor descriptor,NamespaceInfo namespaceInfo){
  XMLCompositeDirectCollectionMapping mapping=new XMLCompositeDirectCollectionMapping();
  mapping.setAttributeName(property.getPropertyName());
  if (property.isMethodProperty()) {
    mapping.setGetMethodName(property.getGetMethodName());
    mapping.setSetMethodName(property.getSetMethodName());
  }
  JavaClass collectionType=property.getType();
  if (areEquals(collectionType,Collection.class) || areEquals(collectionType,List.class)) {
    collectionType=jotArrayList;
  }
 else   if (areEquals(collectionType,Set.class)) {
    collectionType=jotHashSet;
  }
  mapping.useCollectionClassName(collectionType.getRawName());
  XMLField xmlField=getXPathForField(property,namespaceInfo,true);
  mapping.setField(xmlField);
  if (XMLConstants.QNAME_QNAME.equals(property.getSchemaType())) {
    ((XMLField)mapping.getField()).setSchemaType(XMLConstants.QNAME_QNAME);
  }
  if (xmlField.getXPathFragment().isAttribute()) {
    mapping.setUsesSingleNode(true);
  }
  if (helper.isAnnotationPresent(property.getElement(),XmlList.class)) {
    mapping.setUsesSingleNode(true);
  }
  descriptor.addMapping(mapping);
  return mapping;
}

Fixed version (ground truth):
public XMLCompositeDirectCollectionMapping generateDirectCollectionMapping(Property property,XMLDescriptor descriptor,NamespaceInfo namespaceInfo){
  XMLCompositeDirectCollectionMapping mapping=new XMLCompositeDirectCollectionMapping();
  mapping.setAttributeName(property.getPropertyName());
  if (property.isMethodProperty()) {
    if (property.getSetMethodName() != null) {
      mapping.setSetMethodName(property.getSetMethodName());
      mapping.setGetMethodName(property.getGetMethodName());
    }
 else {
      mapping.setGetMethodName(property.getGetMethodName());
    }
  }
  JavaClass collectionType=property.getType();
  if (areEquals(collectionType,Collection.class) || areEquals(collectionType,List.class)) {
    collectionType=jotArrayList;
  }
 else   if (areEquals(collectionType,Set.class)) {
    collectionType=jotHashSet;
  }
  mapping.useCollectionClassName(collectionType.getRawName());
  XMLField xmlField=getXPathForField(property,namespaceInfo,true);
  mapping.setField(xmlField);
  if (XMLConstants.QNAME_QNAME.equals(property.getSchemaType())) {
    ((XMLField)mapping.getField()).setSchemaType(XMLConstants.QNAME_QNAME);
  }
  if (xmlField.getXPathFragment().isAttribute()) {
    mapping.setUsesSingleNode(true);
  }
  if (helper.isAnnotationPresent(property.getElement(),XmlList.class)) {
    mapping.setUsesSingleNode(true);
  }
  descriptor.addMapping(mapping);
  return mapping;
}
Program: 67627
Project: 67627
Buggy source:
public boolean isCollectionType(Property field){
  JavaClass type=field.getType();
  return (helper.getJavaClass(java.util.Collection.class).isAssignableFrom(type) || helper.getJavaClass(java.util.List.class).isAssignableFrom(type) || helper.getJavaClass(java.util.Set.class).isAssignableFrom(type));
}

Fixed version (ground truth):
public boolean isCollectionType(Property field){
  JavaClass type=field.getType();
  return (helper.getJavaClass(java.util.Collection.class).isAssignableFrom(type) || helper.getJavaClass(java.util.List.class).isAssignableFrom(type) || helper.getJavaClass(java.util.Set.class).isAssignableFrom(type)|| type.isArray());
}
Program: 67628
Project: 67628
Buggy source:
public JavaClass getComponentType(){
  return null;
}

Fixed version (ground truth):
public JavaClass getComponentType(){
  if (!isArray()) {
    return null;
  }
  return new JavaClassImpl(this.jClass.getComponentType());
}
Program: 67633
Project: 67633
Buggy source:
private JAXBElement createJAXBElement(QName qname,Class theClass,Object value){
  if (theClass == null) {
    return new JAXBElement(qname,Object.class,value);
  }
  if (ClassConstants.XML_GREGORIAN_CALENDAR.isAssignableFrom(theClass)) {
    theClass=ClassConstants.XML_GREGORIAN_CALENDAR;
  }
 else   if (ClassConstants.DURATION.isAssignableFrom(theClass)) {
    theClass=ClassConstants.DURATION;
  }
  return new JAXBElement(qname,theClass,value);
}

Fixed version (ground truth):
private JAXBElement createJAXBElement(QName qname,Class theClass,Object value){
  if (theClass == null) {
    return new JAXBElement(qname,Object.class,value);
  }
  org.eclipse.persistence.sessions.Session sess=(org.eclipse.persistence.sessions.Session)xmlUnmarshaller.getXMLContext().getSessions().get(0);
  XMLDescriptor desc=(XMLDescriptor)sess.getClassDescriptor(value);
  if (desc != null && desc.hasInheritance()) {
    theClass=desc.getInheritancePolicy().getParentClass();
  }
  if (ClassConstants.XML_GREGORIAN_CALENDAR.isAssignableFrom(theClass)) {
    theClass=ClassConstants.XML_GREGORIAN_CALENDAR;
  }
 else   if (ClassConstants.DURATION.isAssignableFrom(theClass)) {
    theClass=ClassConstants.DURATION;
  }
  return new JAXBElement(qname,theClass,value);
}