nus-yam/ex-repair huggingface dataset:
Program: 66254
Project: 66254
Buggy source:
/** 
 * Internal: This gets called on each batch statement execution Needs to be implemented so that it returns the number of rows successfully modified by this statement for optimistic locking purposes (if useNativeBatchWriting is enabled, and  the call uses optimistic locking).  
 * @param isStatementPrepared - flag is set to true if this statement is prepared 
 * @return - number of rows modified/deleted by this statement
 */
public int executeBatch(Statement statement,boolean isStatementPrepared) throws java.sql.SQLException {
  int[] updateResult=statement.executeBatch();
  int updateCount=0;
  for (  int count : updateResult) {
    if (count == Statement.SUCCESS_NO_INFO) {
      count=1;
    }
    updateCount+=count;
  }
  return updateCount;
}

Fixed version (ground truth):
/** 
 * Internal: This gets called on each batch statement execution Needs to be implemented so that it returns the number of rows successfully modified by this statement for optimistic locking purposes (if useNativeBatchWriting is enabled, and  the call uses optimistic locking).  
 * @param isStatementPrepared - flag is set to true if this statement is prepared 
 * @return - number of rows modified/deleted by this statement
 */
public int executeBatch(Statement statement,boolean isStatementPrepared) throws java.sql.SQLException {
  int[] updateResult=statement.executeBatch();
  if (isStatementPrepared) {
    int updateCount=0;
    for (    int count : updateResult) {
      if (count == Statement.SUCCESS_NO_INFO) {
        count=1;
      }
      updateCount+=count;
    }
    return updateCount;
  }
 else {
    return updateResult.length;
  }
}
Program: 66256
Project: 66256
Buggy source:
/** 
 * Convenience method to determine if a class exists in a given ArrayList. The classes are compared via equals() method.
 */
public boolean classExistsInArray(JavaClass theClass,ArrayList<JavaClass> existingClasses){
  for (  JavaClass jClass : existingClasses) {
    if (areClassesEqual(jClass,theClass)) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Convenience method to determine if a class exists in a given ArrayList. The classes are compared via equals() method.
 */
public boolean classExistsInArray(JavaClass theClass,ArrayList<JavaClass> existingClasses){
  return aProcessor.getHelper().classExistsInArray(theClass,existingClasses);
}
Program: 66257
Project: 66257
Buggy source:
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTestSuite(ExceptionHandlingTestCases.class);
  suite.addTestSuite(CustomizerExceptionTestCases.class);
  return suite;
}

Fixed version (ground truth):
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTestSuite(ExceptionHandlingTestCases.class);
  return suite;
}
Program: 66263
Project: 66263
Buggy source:
public void endElement(String uri,String localName,String qName) throws SAXException {
  levelIndex--;
  EndElementEvent event=new EndElementEvent(uri,localName,qName);
  events.add(event);
  if (charactersOccurred) {
    processSimpleElement();
  }
 else   if (startOccurred) {
    processEmptyElement();
  }
  if ((levelIndex == 0) && (parent != null)) {
    XMLReader xmlReader=parent.getXMLReader();
    xmlReader.setContentHandler(parent);
    xmlReader.setLexicalHandler(parent);
  }
}

Fixed version (ground truth):
public void endElement(String uri,String localName,String qName) throws SAXException {
  levelIndex--;
  EndElementEvent event=new EndElementEvent(uri,localName,qName);
  events.add(event);
  if (charactersOccurred) {
    processSimpleElement();
  }
 else   if (startOccurred) {
    if (attributesOccurred) {
      processEmptyElementWithAttributes();
    }
 else {
      processEmptyElement();
    }
  }
  if ((levelIndex == 0) && (parent != null)) {
    XMLReader xmlReader=parent.getXMLReader();
    xmlReader.setContentHandler(parent);
    xmlReader.setLexicalHandler(parent);
  }
}
Program: 66264
Project: 66264
Buggy source:
protected AttributeList buildAttributeList(Attributes attrs) throws SAXException {
  AttributeList attributes=new AttributeList(attrs.getLength());
  for (int i=0; i < attrs.getLength(); i++) {
    attributes.addAttribute(attrs.getLocalName(i),attrs.getQName(i),attrs.getURI(i),attrs.getType(i),attrs.getValue(i),i);
  }
  return attributes;
}

Fixed version (ground truth):
protected AttributeList buildAttributeList(Attributes attrs) throws SAXException {
  int attrsLength=attrs.getLength();
  AttributeList attributes=new AttributeList(attrsLength);
  for (int i=0; i < attrsLength; i++) {
    String qName=attrs.getQName(i);
    String uri=attrs.getURI(i);
    attributes.addAttribute(attrs.getLocalName(i),qName,uri,attrs.getType(i),attrs.getValue(i),i);
    if (!XMLConstants.SCHEMA_INSTANCE_URL.equals(uri) && (null != qName && !qName.startsWith(XMLConstants.XMLNS))) {
      attributesOccurred=true;
    }
  }
  return attributes;
}
Program: 66265
Project: 66265
Buggy source:
public void testNonNullComplexElement() throws Exception {
  InputStream inputStream=ClassLoader.getSystemResourceAsStream("String_Node_Str");
  saxParser.getXMLReader().parse(new InputSource(inputStream));
  assertEquals(1,tdch.PROCESS_COMPLEX_ELEMENT);
  assertEquals(0,tdch.PROCESS_EMPTY);
  assertEquals(0,tdch.PROCESS_SIMPLE_ELEMENT);
}

Fixed version (ground truth):
public void testNonNullComplexElement() throws Exception {
  InputStream inputStream=ClassLoader.getSystemResourceAsStream("String_Node_Str");
  saxParser.getXMLReader().parse(new InputSource(inputStream));
  assertEquals(1,tdch.PROCESS_COMPLEX_ELEMENT);
  assertEquals(0,tdch.PROCESS_EMPTY);
  assertEquals(0,tdch.PROCESS_EMPTY_WITH_ATTRIBUTES);
  assertEquals(0,tdch.PROCESS_SIMPLE_ELEMENT);
}
Program: 66266
Project: 66266
Buggy source:
public void testNonNullSimpleElement() throws Exception {
  InputStream inputStream=ClassLoader.getSystemResourceAsStream("String_Node_Str");
  saxParser.getXMLReader().parse(new InputSource(inputStream));
  assertEquals(1,tdch.PROCESS_SIMPLE_ELEMENT);
  assertEquals(0,tdch.PROCESS_COMPLEX_ELEMENT);
  assertEquals(0,tdch.PROCESS_EMPTY);
}

Fixed version (ground truth):
public void testNonNullSimpleElement() throws Exception {
  InputStream inputStream=ClassLoader.getSystemResourceAsStream("String_Node_Str");
  saxParser.getXMLReader().parse(new InputSource(inputStream));
  assertEquals(1,tdch.PROCESS_SIMPLE_ELEMENT);
  assertEquals(0,tdch.PROCESS_COMPLEX_ELEMENT);
  assertEquals(0,tdch.PROCESS_EMPTY);
  assertEquals(0,tdch.PROCESS_EMPTY_WITH_ATTRIBUTES);
}
Program: 66267
Project: 66267
Buggy source:
public void testEmptyElement() throws Exception {
  InputStream inputStream=ClassLoader.getSystemResourceAsStream("String_Node_Str");
  saxParser.getXMLReader().parse(new InputSource(inputStream));
  assertEquals(1,tdch.PROCESS_EMPTY);
  assertEquals(0,tdch.PROCESS_SIMPLE_ELEMENT);
  assertEquals(0,tdch.PROCESS_COMPLEX_ELEMENT);
}

Fixed version (ground truth):
public void testEmptyElement() throws Exception {
  InputStream inputStream=ClassLoader.getSystemResourceAsStream("String_Node_Str");
  saxParser.getXMLReader().parse(new InputSource(inputStream));
  assertEquals(1,tdch.PROCESS_EMPTY);
  assertEquals(0,tdch.PROCESS_EMPTY_WITH_ATTRIBUTES);
  assertEquals(0,tdch.PROCESS_SIMPLE_ELEMENT);
  assertEquals(0,tdch.PROCESS_COMPLEX_ELEMENT);
}
Program: 66272
Project: 66272
Buggy source:
public void setPhoneNumbers(List<PhoneNumber> phoneNumbers);

Fixed version (ground truth):
void setPhoneNumbers(List<PhoneNumber> phoneNumbers);
Program: 66273
Project: 66273
Buggy source:
@XmlElement(name="String_Node_Str") public List<PhoneNumber> getPhoneNumbers();

Fixed version (ground truth):
@XmlElement(name="String_Node_Str") List<PhoneNumber> getPhoneNumbers();
Program: 66275
Project: 66275
Buggy source:
public void testSequenceObjectDefinition(){
  EntityManager em=createEntityManager("String_Node_Str");
  ServerSession ss=getServerSession("String_Node_Str");
  if (!ss.getLogin().getPlatform().supportsSequenceObjects()) {
    closeEntityManager(em);
    return;
  }
  String seqName="String_Node_Str";
  try {
    internalTestSequenceObjectDefinition(10,1,seqName,em,ss);
    internalTestSequenceObjectDefinition(10,5,seqName + "String_Node_Str",em,ss);
    internalTestSequenceObjectDefinition(10,15,seqName + "String_Node_Str",em,ss);
  }
  finally {
    closeEntityManager(em);
  }
}

Fixed version (ground truth):
public void testSequenceObjectDefinition(){
  EntityManager em=createEntityManager("String_Node_Str");
  ServerSession ss=getServerSession("String_Node_Str");
  if (!ss.getLogin().getPlatform().supportsSequenceObjects() || isOnServer()) {
    closeEntityManager(em);
    return;
  }
  String seqName="String_Node_Str";
  try {
    internalTestSequenceObjectDefinition(10,1,seqName,em,ss);
    internalTestSequenceObjectDefinition(10,5,seqName + "String_Node_Str",em,ss);
    internalTestSequenceObjectDefinition(10,15,seqName + "String_Node_Str",em,ss);
  }
  finally {
    closeEntityManager(em);
  }
}
Program: 66278
Project: 66278
Buggy source:
/** 
 * The specified TimeZone will be used for all String to date object conversions. By default the TimeZone from the JVM is used.
 */
public void setTimeZone(TimeZone timeZone){
  if (null == timeZone) {
    getXMLConversionManager().setTimeZone(TimeZone.getTimeZone("String_Node_Str"));
  }
 else {
    getXMLConversionManager().setTimeZone(timeZone);
  }
}

Fixed version (ground truth):
/** 
 * The specified TimeZone will be used for all String to Date object conversions.  By default the GMT time zone is used.
 */
public void setTimeZone(TimeZone timeZone){
  if (null == timeZone) {
    getXMLConversionManager().setTimeZone(TimeZone.getTimeZone("String_Node_Str"));
  }
 else {
    getXMLConversionManager().setTimeZone(timeZone);
  }
}
Program: 66280
Project: 66280
Buggy source:
public java.util.Date convertStringToDate(String sourceString,QName schemaType){
  XMLGregorianCalendar xmlGregorianCalender=convertStringToXMLGregorianCalendar(sourceString,schemaType);
  if (schemaType == null) {
    schemaType=xmlGregorianCalender.getXMLSchemaType();
  }
  GregorianCalendar cal=toGregorianCalendar(xmlGregorianCalender);
  Date returnDate=cal.getTime();
  return returnDate;
}

Fixed version (ground truth):
public java.util.Date convertStringToDate(String sourceString,QName schemaType){
  XMLGregorianCalendar xmlGregorianCalender=convertStringToXMLGregorianCalendar(sourceString,schemaType);
  Calendar cal=toCalendar(xmlGregorianCalender);
  Date returnDate=cal.getTime();
  return returnDate;
}
Program: 66282
Project: 66282
Buggy source:
public Calendar convertStringToCalendar(String sourceString,QName schemaTypeQName){
  java.util.Date date=convertStringToDate(sourceString,schemaTypeQName);
  Calendar cal=Helper.calendarFromUtilDate(date);
  cal.setTimeZone(getTimeZone());
  return cal;
}

Fixed version (ground truth):
public Calendar convertStringToCalendar(String sourceString,QName schemaTypeQName){
  XMLGregorianCalendar xmlGregorianCalender=convertStringToXMLGregorianCalendar(sourceString,schemaTypeQName);
  return toCalendar(xmlGregorianCalender);
}
Program: 66283
Project: 66283
Buggy source:
public void testUtilDateToString_dateTime_negative_year() throws Exception {
  String control="String_Node_Str";
  GregorianCalendar cal=new GregorianCalendar();
  cal.setGregorianChange(new java.util.Date(Long.MIN_VALUE));
  cal.clear();
  cal.set(Calendar.ERA,java.util.GregorianCalendar.BC);
  cal.set(Calendar.YEAR,2006);
  cal.set(Calendar.MONTH,Calendar.JANUARY);
  cal.set(Calendar.DAY_OF_MONTH,1);
  cal.set(Calendar.MILLISECOND,1);
  java.util.Date utilDate=cal.getTime();
  String test=(String)xcm.convertObject(utilDate,String.class,XMLConstants.DATE_TIME_QNAME);
  this.assertEquals(control,test);
}

Fixed version (ground truth):
public void testUtilDateToString_dateTime_negative_year() throws Exception {
  String control="String_Node_Str";
  GregorianCalendar cal=new GregorianCalendar();
  cal.clear();
  cal.set(Calendar.ERA,java.util.GregorianCalendar.BC);
  cal.set(Calendar.YEAR,2006);
  cal.set(Calendar.MONTH,Calendar.JANUARY);
  cal.set(Calendar.DAY_OF_MONTH,1);
  cal.set(Calendar.MILLISECOND,1);
  java.util.Date utilDate=cal.getTime();
  String test=(String)xcm.convertObject(utilDate,String.class,XMLConstants.DATE_TIME_QNAME);
  this.assertEquals(control,test);
}
Program: 66284
Project: 66284
Buggy source:
public void testToDateBeforeGregorianChange(){
  Date dateObj=dataHelper.toDate("String_Node_Str");
  assertTrue("String_Node_Str" + dateObj.getMonth(),dateObj.getMonth() == 0);
  assertTrue("String_Node_Str" + dateObj.getDate(),dateObj.getDate() == 1);
}

Fixed version (ground truth):
public void testToDateBeforeGregorianChange(){
  Date dateObj=dataHelper.toDate("String_Node_Str");
  SimpleDateFormat sdf=new SimpleDateFormat();
  sdf.applyPattern("String_Node_Str");
  String controlString="String_Node_Str";
  assertEquals(controlString,sdf.format(dateObj));
}
Program: 66285
Project: 66285
Buggy source:
/** 
 * Convert from a Date to a String representation of the MonthDay type.
 * @param date the date to convert
 * @return a Date to a String representation of the MonthDay type.
 */
public String toMonthDay(Date date){
  if (null == date) {
    return null;
  }
  GregorianCalendar dateCalendar=new GregorianCalendar(getXMLConversionManager().getTimeZone());
  dateCalendar.setGregorianChange(new Date(Long.MIN_VALUE));
  dateCalendar.clear();
  dateCalendar.setTime(date);
  dateCalendar.clear(Calendar.ZONE_OFFSET);
  return toMonthDay(dateCalendar);
}

Fixed version (ground truth):
/** 
 * Convert from a Date to a String representation of the MonthDay type.
 * @param date the date to convert
 * @return a Date to a String representation of the MonthDay type.
 */
public String toMonthDay(Date date){
  if (null == date) {
    return null;
  }
  GregorianCalendar dateCalendar=new GregorianCalendar(getXMLConversionManager().getTimeZone());
  dateCalendar.clear();
  dateCalendar.setTime(date);
  dateCalendar.clear(Calendar.ZONE_OFFSET);
  return toMonthDay(dateCalendar);
}
Program: 66289
Project: 66289
Buggy source:
public void pop(String prefix){
  List<String> uris=namespaceMap.get(prefix);
  if (uris != null) {
    int size=uris.size();
    if (size > 0) {
      String uri=uris.remove(size - 1);
      if (uri != null) {
        List<String> prefixes=uriToPrefixMap.get(uri);
        if (prefixes != null) {
          int prefixesSize=prefixes.size();
          if (prefixesSize > 0) {
            prefixes.remove(prefixesSize - 1);
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
public void pop(String prefix){
  List<String> uris=namespaceMap.get(prefix);
  if (uris != null) {
    int size=uris.size();
    if (size > 0) {
      String uri=uris.remove(size - 1);
      if (size == 1) {
        namespaceMap.remove(prefix);
      }
      if (uri != null) {
        List<String> prefixes=uriToPrefixMap.get(uri);
        if (prefixes != null) {
          int prefixesSize=prefixes.size();
          if (prefixesSize == 1) {
            uriToPrefixMap.remove(uri);
          }
 else {
            prefixes.remove(prefixesSize - 1);
          }
        }
      }
    }
  }
}
Program: 66290
Project: 66290
Buggy source:
/** 
 * INTERNAL: Convert all the class-name-based settings in this converter to actual  class-based settings. This method is used when converting a project  that has been built with class names to a project with classes.
 * @param classLoader 
 */
public void convertClassNamesToClasses(ClassLoader classLoader){
  if (m_enumClass == null || (m_enumClass != null && !m_enumClass.getClassLoader().equals(classLoader))) {
    try {
      if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()) {
        try {
          m_enumClass=(Class)AccessController.doPrivileged(new PrivilegedClassForName(m_enumClassName,true,classLoader));
        }
 catch (        PrivilegedActionException exception) {
          throw ValidationException.classNotFoundWhileConvertingClassNames(m_enumClassName,exception.getException());
        }
      }
 else {
        m_enumClass=PrivilegedAccessHelper.getClassForName(m_enumClassName,true,classLoader);
      }
    }
 catch (    ClassNotFoundException exception) {
      throw ValidationException.classNotFoundWhileConvertingClassNames(m_enumClassName,exception);
    }
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: Convert all the class-name-based settings in this converter to actual  class-based settings. This method is used when converting a project  that has been built with class names to a project with classes.
 * @param classLoader 
 */
public void convertClassNamesToClasses(ClassLoader classLoader){
  if (m_enumClass == null || (m_enumClass != null && !m_enumClass.getClassLoader().equals(classLoader))) {
    try {
      if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()) {
        try {
          m_enumClass=(Class)AccessController.doPrivileged(new PrivilegedClassForName(m_enumClassName,true,classLoader));
        }
 catch (        PrivilegedActionException exception) {
          throw ValidationException.classNotFoundWhileConvertingClassNames(m_enumClassName,exception.getException());
        }
      }
 else {
        m_enumClass=PrivilegedAccessHelper.getClassForName(m_enumClassName,true,classLoader);
      }
    }
 catch (    ClassNotFoundException exception) {
      throw ValidationException.classNotFoundWhileConvertingClassNames(m_enumClassName,exception);
    }
  }
  initializeConversions(m_enumClass);
}
Program: 66291
Project: 66291
Buggy source:
/** 
 * INTERNAL: Every converter needs to be able to process themselves.
 */
public void process(DatabaseMapping mapping,MappingAccessor accessor,MetadataClass referenceClass,boolean isForMapKey){
  if (!EnumeratedMetadata.isValidEnumeratedType(referenceClass)) {
    throw ValidationException.invalidTypeForEnumeratedAttribute(mapping.getAttributeName(),referenceClass,accessor.getJavaClass());
  }
  boolean isOrdinal=true;
  if (m_enumeratedType != null) {
    isOrdinal=m_enumeratedType.equals(EnumType.ORDINAL.name());
  }
  setConverter(mapping,new EnumTypeConverter(mapping,getJavaClass(referenceClass),isOrdinal),isForMapKey);
}

Fixed version (ground truth):
/** 
 * INTERNAL: Every converter needs to be able to process themselves.
 */
public void process(DatabaseMapping mapping,MappingAccessor accessor,MetadataClass referenceClass,boolean isForMapKey){
  if (!EnumeratedMetadata.isValidEnumeratedType(referenceClass)) {
    throw ValidationException.invalidTypeForEnumeratedAttribute(mapping.getAttributeName(),referenceClass,accessor.getJavaClass());
  }
  boolean isOrdinal=true;
  if (m_enumeratedType != null) {
    isOrdinal=m_enumeratedType.equals(EnumType.ORDINAL.name());
  }
  setConverter(mapping,new EnumTypeConverter(mapping,referenceClass.getName()),isForMapKey);
}
Program: 66292
Project: 66292
Buggy source:
public NamespaceResolvableProject(NamespaceResolverWithPrefixes ns){
  super();
  this.ns=ns;
  buildDescriptors();
  setNamespaceResolverOnDescriptors();
}

Fixed version (ground truth):
public NamespaceResolvableProject(NamespaceResolverWithPrefixes ns){
  super();
  fieldQname=new QName(getSecondaryNamespace(),"String_Node_Str");
  this.ns=ns;
  buildDescriptors();
  setNamespaceResolverOnDescriptors();
}
Program: 66293
Project: 66293
Buggy source:
protected void initializeConversions(Class enumClass){
  EnumSet theEnums=EnumSet.allOf(enumClass);
  Iterator<Enum> i=theEnums.iterator();
  while (i.hasNext()) {
    Enum theEnum=i.next();
    if (m_useOrdinalValues) {
      addConversionValue(theEnum.ordinal(),theEnum.name());
    }
 else {
      addConversionValue(theEnum.name(),theEnum.name());
    }
  }
}

Fixed version (ground truth):
protected void initializeConversions(Class enumClass){
  if (getFieldToAttributeValues().isEmpty()) {
    EnumSet theEnums=EnumSet.allOf(enumClass);
    Iterator<Enum> i=theEnums.iterator();
    while (i.hasNext()) {
      Enum theEnum=i.next();
      if (m_useOrdinalValues) {
        addConversionValue(theEnum.ordinal(),theEnum.name());
      }
 else {
        addConversionValue(theEnum.name(),theEnum.name());
      }
    }
  }
}
Program: 66294
Project: 66294
Buggy source:
/** 
 * INTERNAL: Every converter needs to be able to process themselves.
 */
public void process(DatabaseMapping mapping,MappingAccessor accessor,MetadataClass referenceClass,boolean isForMapKey){
  if (!EnumeratedMetadata.isValidEnumeratedType(referenceClass)) {
    throw ValidationException.invalidTypeForEnumeratedAttribute(mapping.getAttributeName(),referenceClass,accessor.getJavaClass());
  }
  boolean isOrdinal=true;
  if (m_enumeratedType != null) {
    isOrdinal=m_enumeratedType.equals(EnumType.ORDINAL.name());
  }
  setConverter(mapping,new EnumTypeConverter(mapping,referenceClass.getName()),isForMapKey);
}

Fixed version (ground truth):
/** 
 * INTERNAL: Every converter needs to be able to process themselves.
 */
public void process(DatabaseMapping mapping,MappingAccessor accessor,MetadataClass referenceClass,boolean isForMapKey){
  if (!EnumeratedMetadata.isValidEnumeratedType(referenceClass)) {
    throw ValidationException.invalidTypeForEnumeratedAttribute(mapping.getAttributeName(),referenceClass,accessor.getJavaClass());
  }
  boolean isOrdinal=true;
  if (m_enumeratedType != null) {
    isOrdinal=m_enumeratedType.equals(EnumType.ORDINAL.name());
  }
  setConverter(mapping,new EnumTypeConverter(mapping,referenceClass.getName(),isOrdinal),isForMapKey);
}
Program: 66297
Project: 66297
Buggy source:
public void endElement(String uri,String localName,String name) throws SAXException {
  this.unmappedContentHandler.endElement(uri,localName,name);
  this.depth--;
  if (0 == depth) {
    parentRecord.endElement(uri,localName,name);
    xmlReader.setContentHandler(parentRecord);
    xmlReader.setLexicalHandler(parentRecord);
  }
}

Fixed version (ground truth):
public void endElement(String uri,String localName,String name) throws SAXException {
  this.unmappedContentHandler.endElement(uri,localName,name);
  this.depth--;
  if (0 == depth) {
    parentRecord.endUnmappedElement(uri,localName,name);
    xmlReader.setContentHandler(parentRecord);
    xmlReader.setLexicalHandler(parentRecord);
  }
}
Program: 66298
Project: 66298
Buggy source:
public void unmappedContent(){
  this.unmarshalContext.unmappedContent(this);
}

Fixed version (ground truth):
public void unmappedContent(){
  if (this.xPathNode.getParent() != null) {
    xPathNode=xPathNode.getParent();
  }
  this.unmarshalContext.unmappedContent(this);
}
Program: 66300
Project: 66300
Buggy source:
public ArrayList getNoAccessTypePropertiesForClass(JavaClass cls,TypeInfo info){
  ArrayList list=new ArrayList();
  if (cls == null) {
    return list;
  }
  ArrayList fieldProperties=getFieldPropertiesForClass(cls,info,false);
  ArrayList methodProperties=getPropertyPropertiesForClass(cls,info,false);
  for (int i=0; i < fieldProperties.size(); i++) {
    Property next=(Property)fieldProperties.get(i);
    JavaHasAnnotations elem=next.getElement();
    if (hasJAXBAnnotations(elem)) {
      list.add(next);
    }
  }
  for (int i=0; i < methodProperties.size(); i++) {
    Property next=(Property)methodProperties.get(i);
    JavaHasAnnotations elem=next.getElement();
    if (hasJAXBAnnotations(elem)) {
      list.add(next);
    }
  }
  return list;
}

Fixed version (ground truth):
public ArrayList getNoAccessTypePropertiesForClass(JavaClass cls,TypeInfo info){
  ArrayList list=new ArrayList();
  if (cls == null) {
    return list;
  }
  ArrayList fieldProperties=getFieldPropertiesForClass(cls,info,false);
  ArrayList methodProperties=getPropertyPropertiesForClass(cls,info,false);
  for (int i=0; i < fieldProperties.size(); i++) {
    Property next=(Property)fieldProperties.get(i);
    JavaHasAnnotations elem=next.getElement();
    if (!hasJAXBAnnotations(elem)) {
      next.setTransient(true);
    }
    list.add(next);
  }
  for (int i=0; i < methodProperties.size(); i++) {
    Property next=(Property)methodProperties.get(i);
    JavaHasAnnotations elem=next.getElement();
    if (!hasJAXBAnnotations(elem)) {
      next.setTransient(true);
    }
    list.add(next);
  }
  return list;
}
Program: 66303
Project: 66303
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)|| helper.isAnnotationPresent(elem,XmlElementWrapper.class)|| helper.isAnnotationPresent(elem,XmlList.class)|| helper.isAnnotationPresent(elem,XmlMimeType.class)|| helper.isAnnotationPresent(elem,XmlIDREF.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,XmlList.class)|| helper.isAnnotationPresent(elem,XmlMimeType.class)|| helper.isAnnotationPresent(elem,XmlIDREF.class)|| helper.isAnnotationPresent(elem,XmlPath.class)|| helper.isAnnotationPresent(elem,XmlInverseReference.class)) {
    return true;
  }
  return false;
}
Program: 66304
Project: 66304
Buggy source:
/** 
 * Use the definition object to drop the schema entity from the database. This is used for dropping tables, views, procedures ... etc ...
 */
public void dropObject(DatabaseObjectDefinition databaseObjectDefinition) throws EclipseLinkException {
  boolean usesBatchWriting=false;
  if (getSession().getPlatform().usesBatchWriting()) {
    usesBatchWriting=true;
    getSession().getPlatform().setUsesBatchWriting(false);
  }
  try {
    if (shouldWriteToDatabase()) {
      databaseObjectDefinition.dropFromDatabase(getSession());
    }
 else {
      Writer dropSchemaWriter=getDropSchemaWriter();
      databaseObjectDefinition.dropObject(getSession(),dropSchemaWriter,createSQLFiles);
      if (createSQLFiles) {
        this.appendToDDLWriter(dropSchemaWriter,getSession().getPlatform().getStoredProcedureTerminationToken());
      }
      this.appendToDDLWriter(dropSchemaWriter,"String_Node_Str");
    }
  }
  finally {
    if (usesBatchWriting) {
      getSession().getPlatform().setUsesBatchWriting(true);
    }
  }
}

Fixed version (ground truth):
/** 
 * Use the definition object to drop the schema entity from the database. This is used for dropping tables, views, procedures ... etc ...
 */
public void dropObject(DatabaseObjectDefinition databaseObjectDefinition) throws EclipseLinkException {
  boolean usesBatchWriting=false;
  if (getSession().getPlatform().usesBatchWriting()) {
    usesBatchWriting=true;
    getSession().getPlatform().setUsesBatchWriting(false);
  }
  try {
    databaseObjectDefinition.preDropObject(getSession(),getDropSchemaWriter(),createSQLFiles);
    if (shouldWriteToDatabase()) {
      databaseObjectDefinition.dropFromDatabase(getSession());
    }
 else {
      Writer dropSchemaWriter=getDropSchemaWriter();
      databaseObjectDefinition.dropObject(getSession(),dropSchemaWriter,createSQLFiles);
      if (createSQLFiles) {
        this.appendToDDLWriter(dropSchemaWriter,getSession().getPlatform().getStoredProcedureTerminationToken());
      }
      this.appendToDDLWriter(dropSchemaWriter,"String_Node_Str");
    }
  }
  finally {
    if (usesBatchWriting) {
      getSession().getPlatform().setUsesBatchWriting(true);
    }
  }
}
Program: 66305
Project: 66305
Buggy source:
/** 
 * Use the definition object to create the schema entity on the database. This is used for creating tables, views, procedures ... etc ...
 */
public void createObject(DatabaseObjectDefinition databaseObjectDefinition) throws EclipseLinkException {
  boolean usesBatchWriting=false;
  if (getSession().getPlatform().usesBatchWriting()) {
    usesBatchWriting=true;
    getSession().getPlatform().setUsesBatchWriting(false);
  }
  try {
    if (shouldWriteToDatabase()) {
      databaseObjectDefinition.createOnDatabase(getSession());
    }
 else {
      databaseObjectDefinition.createObject(getSession(),createSchemaWriter);
      if (createSQLFiles) {
        this.appendToDDLWriter(createSchemaWriter,getSession().getPlatform().getStoredProcedureTerminationToken());
      }
      this.appendToDDLWriter(createSchemaWriter,"String_Node_Str");
      databaseObjectDefinition.postCreateObject(getSession(),createSchemaWriter,createSQLFiles);
    }
  }
  finally {
    if (usesBatchWriting) {
      getSession().getPlatform().setUsesBatchWriting(true);
    }
  }
}

Fixed version (ground truth):
/** 
 * Use the definition object to create the schema entity on the database. This is used for creating tables, views, procedures ... etc ...
 */
public void createObject(DatabaseObjectDefinition databaseObjectDefinition) throws EclipseLinkException {
  boolean usesBatchWriting=false;
  if (getSession().getPlatform().usesBatchWriting()) {
    usesBatchWriting=true;
    getSession().getPlatform().setUsesBatchWriting(false);
  }
  try {
    if (shouldWriteToDatabase()) {
      databaseObjectDefinition.createOnDatabase(getSession());
    }
 else {
      databaseObjectDefinition.createObject(getSession(),createSchemaWriter);
      if (createSQLFiles) {
        this.appendToDDLWriter(createSchemaWriter,getSession().getPlatform().getStoredProcedureTerminationToken());
      }
      this.appendToDDLWriter(createSchemaWriter,"String_Node_Str");
    }
    databaseObjectDefinition.postCreateObject(getSession(),createSchemaWriter,createSQLFiles);
  }
  finally {
    if (usesBatchWriting) {
      getSession().getPlatform().setUsesBatchWriting(true);
    }
  }
}
Program: 66306
Project: 66306
Buggy source:
/** 
 * INTERNAL:<br/> Write the SQL create index string if passed a writer, else delegate to a method that executes the string on the database.
 * @see #createIndicesOnUniqueKeysOnDatabase(AbstractSession)
 * @throws ValidationException wraps any IOException from the writer
 */
public void createIndicesOnUniqueKeys(AbstractSession session,Writer schemaWriter) throws EclipseLinkException {
  if (schemaWriter == null) {
    createIndicesOnUniqueKeysOnDatabase(session);
    return;
  }
  try {
    for (    UniqueKeyConstraint uniqueKey : getUniqueKeys()) {
      buildIndexCreationWriter(session,uniqueKey.getName(),uniqueKey.getSourceFields(),schemaWriter);
      if (createSQLFiles) {
        schemaWriter.write(session.getPlatform().getStoredProcedureTerminationToken());
      }
      schemaWriter.write("String_Node_Str");
    }
    for (    FieldDefinition field : getFields()) {
      if (field.isUnique()) {
        List<String> columnAsList=new ArrayList<String>();
        columnAsList.add(field.getName());
        buildIndexCreationWriter(session,field.getName(),columnAsList,new StringWriter());
        if (createSQLFiles) {
          schemaWriter.write(session.getPlatform().getStoredProcedureTerminationToken());
        }
        schemaWriter.write("String_Node_Str");
      }
    }
  }
 catch (  IOException exception) {
    throw ValidationException.fileError(exception);
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL:<br/> Write the SQL create index string if passed a writer, else delegate to a method that executes the string on the database.
 * @see #createIndicesOnUniqueKeysOnDatabase(AbstractSession)
 * @throws ValidationException wraps any IOException from the writer
 */
public void createIndicesOnUniqueKeys(AbstractSession session,Writer schemaWriter) throws EclipseLinkException {
  if (schemaWriter == null) {
    createIndicesOnUniqueKeysOnDatabase(session);
    return;
  }
  try {
    for (    UniqueKeyConstraint uniqueKey : getUniqueKeys()) {
      buildIndexCreationWriter(session,uniqueKey.getName(),uniqueKey.getSourceFields(),schemaWriter);
      if (createSQLFiles) {
        schemaWriter.write(session.getPlatform().getStoredProcedureTerminationToken());
      }
      schemaWriter.write("String_Node_Str");
    }
    for (    FieldDefinition field : getFields()) {
      if (field.isUnique()) {
        List<String> columnAsList=new ArrayList<String>();
        columnAsList.add(field.getName());
        buildIndexCreationWriter(session,field.getName(),columnAsList,schemaWriter);
        if (createSQLFiles) {
          schemaWriter.write(session.getPlatform().getStoredProcedureTerminationToken());
        }
        schemaWriter.write("String_Node_Str");
      }
    }
  }
 catch (  IOException exception) {
    throw ValidationException.fileError(exception);
  }
}
Program: 66307
Project: 66307
Buggy source:
/** 
 * Creates the decorator responsible to format the <code>Boolean</code> values in the Clustering combo box.
 * @return {@link SessionClusteringPropertiesPage.BooleanLabelDecorator}
 */
private CellRendererAdapter buildClusteringLabelDecorator(){
  ResourceRepository resourceRepository=resourceRepository();
  return new TriStateBooleanCellRendererAdapter(resourceRepository){
    @Override protected String trueResourceKey(){
      return "String_Node_Str";
    }
    @Override protected String falseResourceKey(){
      return "String_Node_Str";
    }
    @Override protected String undefinedResourceKey(){
      return "String_Node_Str";
    }
  }
;
}

Fixed version (ground truth):
/** 
 * Creates the decorator responsible to format the <code>Boolean</code> values in the Clustering combo box.
 * @return {@link SessionClusteringPropertiesPage.BooleanLabelDecorator}
 */
private CellRendererAdapter buildClusteringLabelDecorator(){
  ResourceRepository resourceRepository=resourceRepository();
  return new BooleanCellRendererAdapter(resourceRepository.getString("String_Node_Str"),resourceRepository.getString("String_Node_Str"));
}
Program: 66308
Project: 66308
Buggy source:
/** 
 * Creates the <code>CollectionValueModel</code> containing the actual items to be shown in the Clustering combo box.
 * @return The <code>CollectionValueModel</code> containing the items
 */
private CollectionValueModel buildClusteringCollectionHolder(){
  return new CollectionAspectAdapter(getSelectionHolder(),null){
    protected Iterator getValueFromSubject(){
      return new ArrayIterator(new Object[]{TriStateBoolean.UNDEFINED,TriStateBoolean.TRUE,TriStateBoolean.FALSE});
    }
  }
;
}

Fixed version (ground truth):
/** 
 * Creates the <code>CollectionValueModel</code> containing the actual items to be shown in the Clustering combo box.
 * @return The <code>CollectionValueModel</code> containing the items
 */
private CollectionValueModel buildClusteringCollectionHolder(){
  return new CollectionAspectAdapter(getSelectionHolder(),null){
    protected Iterator getValueFromSubject(){
      return new ArrayIterator(new Object[]{Boolean.TRUE,Boolean.FALSE});
    }
  }
;
}
Program: 66309
Project: 66309
Buggy source:
/** 
 * Creates the <code>PropertyValueModel</code> responsible to listen to changes made to the type of clustering to be used, which is either Remote Command Manager or Cache Synchronization.
 * @return A new <code>PropertyValueModel</code>
 */
private PropertyValueModel buildClusteringTypeSelectionHolder(){
  String[] propertyNames=new String[]{SessionAdapter.REMOTE_COMMAND_MANAGER_CONFIG_PROPERTY};
  return new PropertyAspectAdapter(getSelectionHolder(),propertyNames){
    protected Object getValueFromSubject(){
      SessionAdapter adapter=(SessionAdapter)subject;
      if (adapter.hasNoClusteringService())       return TriStateBoolean.UNDEFINED;
      return TriStateBoolean.valueOf(adapter.hasRemoteCommandManager());
    }
    protected void setValueOnSubject(    Object value){
      SessionAdapter adapter=(SessionAdapter)subject;
      if (TriStateBoolean.TRUE.equals(value)) {
        adapter.setClusteringToRemoteCommandManager();
      }
 else       if (TriStateBoolean.FALSE.equals(value) || TriStateBoolean.UNDEFINED.equals(value)) {
        adapter.setClusteringToNothing();
      }
    }
  }
;
}

Fixed version (ground truth):
/** 
 * Creates the <code>PropertyValueModel</code> responsible to listen to changes made to the type of clustering to be used, which is either Remote Command Manager or Cache Synchronization.
 * @return A new <code>PropertyValueModel</code>
 */
private PropertyValueModel buildClusteringTypeSelectionHolder(){
  String[] propertyNames=new String[]{SessionAdapter.REMOTE_COMMAND_MANAGER_CONFIG_PROPERTY};
  return new PropertyAspectAdapter(getSelectionHolder(),propertyNames){
    protected Object getValueFromSubject(){
      SessionAdapter adapter=(SessionAdapter)subject;
      if (adapter.hasNoClusteringService()) {
        return Boolean.FALSE;
      }
      return Boolean.valueOf(adapter.hasRemoteCommandManager());
    }
    protected void setValueOnSubject(    Object value){
      SessionAdapter adapter=(SessionAdapter)subject;
      if (Boolean.TRUE.equals(value)) {
        adapter.setClusteringToRemoteCommandManager();
      }
 else {
        adapter.setClusteringToNothing();
      }
    }
  }
;
}
Program: 66310
Project: 66310
Buggy source:
protected void setValueOnSubject(Object value){
  SessionAdapter adapter=(SessionAdapter)subject;
  if (TriStateBoolean.TRUE.equals(value)) {
    adapter.setClusteringToRemoteCommandManager();
  }
 else   if (TriStateBoolean.FALSE.equals(value) || TriStateBoolean.UNDEFINED.equals(value)) {
    adapter.setClusteringToNothing();
  }
}

Fixed version (ground truth):
protected void setValueOnSubject(Object value){
  SessionAdapter adapter=(SessionAdapter)subject;
  if (Boolean.TRUE.equals(value)) {
    adapter.setClusteringToRemoteCommandManager();
  }
 else {
    adapter.setClusteringToNothing();
  }
}
Program: 66312
Project: 66312
Buggy source:
/** 
 * The setup is done as a test, both to record its failure, and to allow execution in the server.
 */
public void testSetup(){
  clearCache();
  DatabaseSession session=JUnitTestCase.getServerSession();
  EmployeePopulator employeePopulator=new EmployeePopulator();
  PartnerLinkPopulator partnerLinkPopulator=new PartnerLinkPopulator();
  new AdvancedTableCreator().replaceTables(session);
  comparer=new JUnitDomainObjectComparer();
  comparer.setSession((AbstractSession)session.getActiveSession());
  employeePopulator.buildExamples();
  employeePopulator.persistExample(session);
  partnerLinkPopulator.buildExamples();
  partnerLinkPopulator.persistExample(session);
  new InheritedTableManager().replaceTables(session);
  new DataTypesTableCreator().replaceTables(session);
}

Fixed version (ground truth):
/** 
 * The setup is done as a test, both to record its failure, and to allow execution in the server.
 */
public void testSetup(){
  clearCache();
  DatabaseSession session=JUnitTestCase.getServerSession();
  EmployeePopulator employeePopulator=new EmployeePopulator();
  PartnerLinkPopulator partnerLinkPopulator=new PartnerLinkPopulator();
  new AdvancedTableCreator().replaceTables(session);
  comparer=new JUnitDomainObjectComparer();
  comparer.setSession((AbstractSession)session.getActiveSession());
  employeePopulator.buildExamples();
  employeePopulator.persistExample(session);
  partnerLinkPopulator.buildExamples();
  partnerLinkPopulator.persistExample(session);
  new InheritedTableManager().replaceTables(session);
  new DataTypesTableCreator().replaceTables(session);
  SchemaManager schema=new SchemaManager((session));
  schema.replaceObject(buildStoredFunction());
}
Program: 66313
Project: 66313
Buggy source:
/** 
 * Return a unique hashCode (as an int) for this instance.  The code will be based on the application name if set, otherwise it will be based on the loader. Assumes that this instance's loader is non-null.
 */
public int hashCode(){
  int hash;
  if (getApplicationName() != null) {
    hash=getApplicationName().hashCode();
  }
 else {
    hash=getLoader().hashCode();
  }
  return hash;
}

Fixed version (ground truth):
/** 
 * Return a hashCode (as an int) for this instance.
 */
public int hashCode(){
  return 7;
}
Program: 66314
Project: 66314
Buggy source:
/** 
 * Equality will be based on the applicationName attribute if set, or the class  loader if applicationName is null.
 * @param Object to be compared to this HelperContextMapKey instance
 * @return true if the given object is equal to this HelperContextMapKey instance; false otherwise
 */
public boolean equals(Object obj){
  HelperContextMapKey ckey;
  try {
    ckey=(HelperContextMapKey)obj;
  }
 catch (  ClassCastException cce) {
    return false;
  }
  if (applicationName != null) {
    return this.applicationName.equals(ckey.getApplicationName());
  }
  return areLoadersEqual(ckey.getLoader());
}

Fixed version (ground truth):
/** 
 * Equality will be based on the applicationName attribute if set, or the class  loader if applicationName is null.
 * @param Object to be compared to this HelperContextMapKey instance
 * @return true if the given object is equal to this HelperContextMapKey instance; false otherwise
 */
public boolean equals(Object obj){
  HelperContextMapKey ckey;
  try {
    ckey=(HelperContextMapKey)obj;
  }
 catch (  ClassCastException cce) {
    return false;
  }
  if (applicationName != null) {
    return this.applicationName.equals(ckey.getApplicationName()) || areLoadersEqual(ckey.getLoader());
  }
  return areLoadersEqual(ckey.getLoader());
}
Program: 66315
Project: 66315
Buggy source:
/** 
 * Returns the map of helper contexts, keyed on Identifier, for the current application
 * @return
 */
static ConcurrentMap<String,HelperContext> getContextMap(){
  ClassLoader contextClassLoader=Thread.currentThread().getContextClassLoader();
  String classLoaderName=contextClassLoader.getClass().getName();
  HelperContextMapKey key=getContextMapKey(contextClassLoader,classLoaderName);
  ConcurrentHashMap<String,HelperContext> contextMap=helperContexts.get(key);
  if (contextMap != null && (classLoaderName.contains(WAS_CLASSLOADER_NAME) || classLoaderName.contains(JBOSS_CLASSLOADER_NAME))) {
    if (key.getApplicationName() != null) {
      for (      HelperContextMapKey existingKey : helperContexts.keySet()) {
        if (key.equals(existingKey)) {
          if (!key.areLoadersEqual(existingKey.getLoader())) {
            helperContexts.remove(key,contextMap);
            contextMap=null;
          }
        }
      }
    }
  }
  if (null == contextMap) {
    contextMap=new ConcurrentHashMap<String,HelperContext>();
    ConcurrentHashMap existingMap=helperContexts.putIfAbsent(key,contextMap);
    if (existingMap != null) {
      contextMap=existingMap;
    }
    if (key.getClass() == ClassConstants.STRING) {
      helperContexts.put(new HelperContextMapKey(contextClassLoader),contextMap);
    }
  }
  addNotificationListener(key);
  return contextMap;
}

Fixed version (ground truth):
/** 
 * Returns the map of helper contexts, keyed on Identifier, for the current application
 * @return
 */
static ConcurrentMap<String,HelperContext> getContextMap(){
  ClassLoader contextClassLoader=Thread.currentThread().getContextClassLoader();
  String classLoaderName=contextClassLoader.getClass().getName();
  HelperContextMapKey key=getContextMapKey(contextClassLoader,classLoaderName);
  ConcurrentHashMap<String,HelperContext> contextMap=helperContexts.get(key);
  if (contextMap != null && (classLoaderName.contains(WAS_CLASSLOADER_NAME) || classLoaderName.contains(JBOSS_CLASSLOADER_NAME))) {
    if (key.getApplicationName() != null) {
      for (      HelperContextMapKey existingKey : helperContexts.keySet()) {
        if (key.equals(existingKey)) {
          if (!key.areLoadersEqual(existingKey.getLoader())) {
            helperContexts.remove(key,contextMap);
            contextMap=null;
          }
        }
      }
    }
  }
  if (null == contextMap) {
    contextMap=new ConcurrentHashMap<String,HelperContext>();
    ConcurrentHashMap existingMap=helperContexts.putIfAbsent(key,contextMap);
    if (null == existingMap) {
      addNotificationListener(key);
    }
 else {
      contextMap=existingMap;
    }
  }
  return contextMap;
}
Program: 66316
Project: 66316
Buggy source:
/** 
 * INTERNAL: Initialize the mapping.
 */
public void initialize(AbstractSession session) throws DescriptorException {
  super.initialize(session);
  if (this.getField() instanceof XMLField && getValueConverter() instanceof TypeConversionConverter) {
    TypeConversionConverter converter=(TypeConversionConverter)getValueConverter();
    this.getField().setType(converter.getObjectClass());
  }
  ContainerPolicy cp=getContainerPolicy();
  if (cp != null) {
    if (cp.getContainerClass() == null) {
      Class cls=session.getDatasourcePlatform().getConversionManager().convertClassNameToClass(cp.getContainerClassName());
      cp.setContainerClass(cls);
    }
  }
  ((XMLField)this.getField()).setIsCDATA(this.isCDATA());
}

Fixed version (ground truth):
/** 
 * INTERNAL: Initialize the mapping.
 */
public void initialize(AbstractSession session) throws DescriptorException {
  super.initialize(session);
  if (this.getField() instanceof XMLField) {
    if (getValueConverter() instanceof TypeConversionConverter) {
      TypeConversionConverter converter=(TypeConversionConverter)getValueConverter();
      this.getField().setType(converter.getObjectClass());
    }
    String xpathString=((XMLField)getField()).getXPath();
    if (this.isAbstractCompositeDirectCollectionMapping() && (xpathString.indexOf(XMLConstants.ATTRIBUTE) == -1) && (!xpathString.endsWith(XMLConstants.TEXT))) {
      throw DescriptorException.invalidXpathForXMLDirectMapping(this);
    }
  }
  ContainerPolicy cp=getContainerPolicy();
  if (cp != null) {
    if (cp.getContainerClass() == null) {
      Class cls=session.getDatasourcePlatform().getConversionManager().convertClassNameToClass(cp.getContainerClassName());
      cp.setContainerClass(cls);
    }
  }
  ((XMLField)this.getField()).setIsCDATA(this.isCDATA());
}
Program: 66317
Project: 66317
Buggy source:
public void initialize(AbstractSession session) throws DescriptorException {
  super.initialize(session);
  ((XMLField)getField()).setIsCDATA(this.isCDATA());
}

Fixed version (ground truth):
public void initialize(AbstractSession session) throws DescriptorException {
  super.initialize(session);
  ((XMLField)getField()).setIsCDATA(this.isCDATA());
  String xpathString=((XMLField)getField()).getXPath();
  if (this.isAbstractDirectMapping() && (xpathString.indexOf(XMLConstants.ATTRIBUTE) == -1) && (!xpathString.endsWith(XMLConstants.TEXT))) {
    throw DescriptorException.invalidXpathForXMLDirectMapping(this);
  }
}
Program: 66318
Project: 66318
Buggy source:
/** 
 * INTERNAL:
 */
public void attribute(String namespaceURI,String localName,String qName,String value){
  try {
    outputStreamWrite(SPACE);
    outputStreamWrite(qName.getBytes(XMLConstants.DEFAULT_XML_ENCODING));
    outputStreamWrite((byte)'=');
    outputStreamWrite((byte)'"');
    writeValue(value,false);
    outputStreamWrite(CLOSE_ATTRIBUTE_VALUE);
  }
 catch (  UnsupportedEncodingException e) {
    throw XMLMarshalException.marshalException(e);
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL:
 */
public void attribute(String namespaceURI,String localName,String qName,String value){
  try {
    outputStreamWrite(SPACE);
    outputStreamWrite(qName.getBytes(XMLConstants.DEFAULT_XML_ENCODING));
    outputStreamWrite((byte)'=');
    outputStreamWrite((byte)'"');
    writeValue(value,true);
    outputStreamWrite(CLOSE_ATTRIBUTE_VALUE);
  }
 catch (  UnsupportedEncodingException e) {
    throw XMLMarshalException.marshalException(e);
  }
}