nus-yam/ex-repair huggingface dataset:
Program: 68642
Project: 68642
Buggy source:
public void testEmployeeSchemaGeneration() throws Exception {
  boolean exception=false;
  String msg=null;
  String src="String_Node_Str";
  String tmpdir=System.getenv("String_Node_Str");
  try {
    Class[] jClasses=new Class[]{Address.class,Employee.class,PhoneNumber.class,Department.class};
    Generator gen=new Generator(new JavaModelInputImpl(jClasses,new JavaModelImpl()));
    gen.generateSchemaFiles(tmpdir,null);
    SchemaFactory sFact=SchemaFactory.newInstance(W3C_XML_SCHEMA_NS_URI);
    Schema theSchema=sFact.newSchema(new File(tmpdir + "String_Node_Str"));
    Validator validator=theSchema.newValidator();
    StreamSource ss=new StreamSource(new File(src));
    validator.validate(ss);
  }
 catch (  Exception ex) {
    exception=true;
    msg=ex.toString();
  }
  assertTrue("String_Node_Str" + msg,exception == false);
}

Fixed version (ground truth):
public void testEmployeeSchemaGeneration() throws Exception {
  boolean exception=false;
  String msg=null;
  String src="String_Node_Str";
  String tmpdir=System.getenv("String_Node_Str");
  try {
    Class[] jClasses=new Class[]{Address.class,Employee.class,PhoneNumber.class,Department.class};
    Generator gen=new Generator(new JavaModelInputImpl(jClasses,new JavaModelImpl(Thread.currentThread().getContextClassLoader())));
    gen.generateSchemaFiles(tmpdir,null);
    SchemaFactory sFact=SchemaFactory.newInstance(W3C_XML_SCHEMA_NS_URI);
    Schema theSchema=sFact.newSchema(new File(tmpdir + "String_Node_Str"));
    Validator validator=theSchema.newValidator();
    StreamSource ss=new StreamSource(new File(src));
    validator.validate(ss);
  }
 catch (  Exception ex) {
    exception=true;
    msg=ex.toString();
  }
  assertTrue("String_Node_Str" + msg,exception == false);
}
Program: 68644
Project: 68644
Buggy source:
/** 
 * INTERNAL: Set the enum class.
 */
public void initialize(DatabaseMapping mapping,Session session){
  if (getEnumClass() == null) {
    if (getEnumClassName() == null) {
      throw XMLMarshalException.enumClassNotSpecified();
    }
 else {
      try {
        enumClass=Class.forName(enumClassName);
      }
 catch (      Exception e) {
        throw XMLMarshalException.invalidEnumClassSpecified(e,enumClassName);
      }
    }
  }
  try {
    fromStringMethod=enumClass.getMethod("String_Node_Str",new Class[]{String.class});
  }
 catch (  Exception ex) {
    throw XMLMarshalException.errorInvokingFromStringMethod(ex,enumClass.getName());
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: Set the enum class.
 */
public void initialize(DatabaseMapping mapping,Session session){
  if (getEnumClass() == null) {
    if (getEnumClassName() == null) {
      throw XMLMarshalException.enumClassNotSpecified();
    }
 else {
      try {
        enumClass=session.getDatasourcePlatform().getConversionManager().getLoader().loadClass(enumClassName);
      }
 catch (      Exception e) {
        throw XMLMarshalException.invalidEnumClassSpecified(e,enumClassName);
      }
    }
  }
  try {
    fromStringMethod=enumClass.getMethod("String_Node_Str",new Class[]{String.class});
  }
 catch (  Exception ex) {
    throw XMLMarshalException.errorInvokingFromStringMethod(ex,enumClass.getName());
  }
}
Program: 68645
Project: 68645
Buggy source:
public JavaClass getClass(String classname){
  try {
    return new JavaClassImpl(Class.forName(classname));
  }
 catch (  Exception x) {
    return null;
  }
}

Fixed version (ground truth):
public JavaClass getClass(String classname){
  try {
    return new JavaClassImpl(classLoader.loadClass(classname));
  }
 catch (  Exception x) {
    return null;
  }
}
Program: 68646
Project: 68646
Buggy source:
public JavaModelImpl(){
}

Fixed version (ground truth):
public JavaModelImpl(ClassLoader classLoader){
  this.classLoader=classLoader;
}
Program: 68647
Project: 68647
Buggy source:
public ClassLoader getClassLoader(){
  return ClassLoader.getSystemClassLoader();
}

Fixed version (ground truth):
public ClassLoader getClassLoader(){
  return this.classLoader;
}
Program: 68648
Project: 68648
Buggy source:
private MWTypeDeclaration getReturnTypeDeclarationFrom(MWMethod mwMethod) throws Exception {
  Method method=null;
  method=MWMethod.class.getDeclaredMethod("String_Node_Str",null);
  method.setAccessible(true);
  MWTypeDeclaration typeDeclaration=null;
  typeDeclaration=(MWTypeDeclaration)method.invoke(mwMethod,null);
  return typeDeclaration;
}

Fixed version (ground truth):
private MWTypeDeclaration getReturnTypeDeclarationFrom(MWMethod mwMethod) throws Exception {
  Method method=null;
  method=MWMethod.class.getDeclaredMethod("String_Node_Str",(Class[])null);
  method.setAccessible(true);
  MWTypeDeclaration typeDeclaration=null;
  typeDeclaration=(MWTypeDeclaration)method.invoke(mwMethod,(Object[])null);
  return typeDeclaration;
}
Program: 68649
Project: 68649
Buggy source:
protected void buidPlatforms(){
  this.addPlatform(AQ_ID,"String_Node_Str");
  this.addPlatform(ATTUNITY_ID,"String_Node_Str");
  this.addPlatform(MQ_ID,"String_Node_Str");
}

Fixed version (ground truth):
protected void buidPlatforms(){
  this.addPlatform(AQ_ID,"String_Node_Str");
  this.addPlatform(MQ_ID,"String_Node_Str");
}
Program: 68650
Project: 68650
Buggy source:
private void buidConnectionSpecs(){
  this.connectionSpecs.put(AQ_ID,"String_Node_Str");
  this.connectionSpecs.put(ATTUNITY_ID,"String_Node_Str");
  this.connectionSpecs.put(MQ_ID,"String_Node_Str");
}

Fixed version (ground truth):
private void buidConnectionSpecs(){
  this.connectionSpecs.put(AQ_ID,"String_Node_Str");
  this.connectionSpecs.put(MQ_ID,"String_Node_Str");
}
Program: 68652
Project: 68652
Buggy source:
private void endElementProcessText(UnmarshalRecord unmarshalRecord,Object collection,XPathFragment xPathFragment){
  Object value=unmarshalRecord.getStringBuffer().toString().trim();
  unmarshalRecord.resetStringBuffer();
  if (!EMPTY_STRING.equals(value) && xmlAnyCollectionMapping.isMixedContent()) {
    QName qname=unmarshalRecord.getTypeQName();
    if (qname != null) {
      Class theClass=(Class)XMLConversionManager.getDefaultXMLTypes().get(qname);
      if (theClass != null) {
        value=((XMLConversionManager)unmarshalRecord.getSession().getDatasourcePlatform().getConversionManager()).convertObject(value,theClass,qname);
      }
    }
    if (!xmlAnyCollectionMapping.usesXMLRoot()) {
      unmarshalRecord.addAttributeValue(this,value);
    }
 else {
      XMLRoot xmlRoot=new XMLRoot();
      xmlRoot.setNamespaceURI(xPathFragment.getNamespaceURI());
      xmlRoot.setLocalName(xPathFragment.getLocalName());
      xmlRoot.setSchemaType(qname);
      xmlRoot.setObject(value);
      unmarshalRecord.addAttributeValue(this,xmlRoot);
    }
  }
}

Fixed version (ground truth):
private void endElementProcessText(UnmarshalRecord unmarshalRecord,Object collection,XPathFragment xPathFragment){
  Object value=unmarshalRecord.getStringBuffer().toString().trim();
  if (xmlAnyCollectionMapping.getConverter() != null) {
    value=xmlAnyCollectionMapping.getConverter().convertDataValueToObjectValue(value,unmarshalRecord.getSession(),unmarshalRecord.getUnmarshaller());
  }
  unmarshalRecord.resetStringBuffer();
  if (!EMPTY_STRING.equals(value) && xmlAnyCollectionMapping.isMixedContent()) {
    QName qname=unmarshalRecord.getTypeQName();
    if (qname != null) {
      Class theClass=(Class)XMLConversionManager.getDefaultXMLTypes().get(qname);
      if (theClass != null) {
        value=((XMLConversionManager)unmarshalRecord.getSession().getDatasourcePlatform().getConversionManager()).convertObject(value,theClass,qname);
      }
    }
    if (!xmlAnyCollectionMapping.usesXMLRoot()) {
      unmarshalRecord.addAttributeValue(this,value);
    }
 else {
      XMLRoot xmlRoot=new XMLRoot();
      xmlRoot.setNamespaceURI(xPathFragment.getNamespaceURI());
      xmlRoot.setLocalName(xPathFragment.getLocalName());
      xmlRoot.setSchemaType(qname);
      xmlRoot.setObject(value);
      unmarshalRecord.addAttributeValue(this,xmlRoot);
    }
  }
}
Program: 68653
Project: 68653
Buggy source:
public boolean marshal(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,AbstractSession session,NamespaceResolver namespaceResolver){
  if (xmlAnyCollectionMapping.isReadOnly()) {
    return false;
  }
  ContainerPolicy cp=xmlAnyCollectionMapping.getContainerPolicy();
  Object collection=xmlAnyCollectionMapping.getAttributeAccessor().getAttributeValueFromObject(object);
  if (null == collection) {
    return false;
  }
  Object iterator=cp.iteratorFor(collection);
  if (cp.hasNext(iterator)) {
    XPathFragment groupingFragment=marshalRecord.openStartGroupingElements(namespaceResolver);
    marshalRecord.closeStartGroupingElements(groupingFragment);
  }
 else {
    return false;
  }
  Object objectValue;
  while (cp.hasNext(iterator)) {
    objectValue=cp.next(iterator,session);
    marshalSingleValue(xPathFragment,marshalRecord,object,objectValue,session,namespaceResolver,ObjectMarshalContext.getInstance());
  }
  return true;
}

Fixed version (ground truth):
public boolean marshal(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,AbstractSession session,NamespaceResolver namespaceResolver){
  if (xmlAnyCollectionMapping.isReadOnly()) {
    return false;
  }
  ContainerPolicy cp=xmlAnyCollectionMapping.getContainerPolicy();
  Object collection=xmlAnyCollectionMapping.getAttributeAccessor().getAttributeValueFromObject(object);
  if (null == collection) {
    return false;
  }
  Object iterator=cp.iteratorFor(collection);
  if (cp.hasNext(iterator)) {
    XPathFragment groupingFragment=marshalRecord.openStartGroupingElements(namespaceResolver);
    marshalRecord.closeStartGroupingElements(groupingFragment);
  }
 else {
    return false;
  }
  Object objectValue;
  while (cp.hasNext(iterator)) {
    objectValue=cp.next(iterator,session);
    if (xmlAnyCollectionMapping.getConverter() != null) {
      objectValue=xmlAnyCollectionMapping.getConverter().convertObjectValueToDataValue(objectValue,session,marshalRecord.getMarshaller());
    }
    marshalSingleValue(xPathFragment,marshalRecord,object,objectValue,session,namespaceResolver,ObjectMarshalContext.getInstance());
  }
  return true;
}
Program: 68654
Project: 68654
Buggy source:
public void endElement(XPathFragment xPathFragment,UnmarshalRecord unmarshalRecord){
  unmarshalRecord.removeNullCapableValue(this);
  Object childObject=null;
  if (null != unmarshalRecord.getChildRecord()) {
    childObject=unmarshalRecord.getChildRecord().getCurrentObject();
    if (!xmlAnyObjectMapping.usesXMLRoot()) {
      unmarshalRecord.setAttributeValue(childObject,xmlAnyObjectMapping);
    }
 else {
      if (workingDescriptor != null) {
        String prefix=xPathFragment.getPrefix();
        if ((prefix == null) && (xPathFragment.getNamespaceURI() != null)) {
          prefix=unmarshalRecord.resolveNamespaceUri(xPathFragment.getNamespaceURI());
        }
        childObject=workingDescriptor.wrapObjectInXMLRoot(childObject,xPathFragment.getNamespaceURI(),xPathFragment.getLocalName(),prefix,false);
        unmarshalRecord.setAttributeValue(childObject,xmlAnyObjectMapping);
        workingDescriptor=null;
      }
    }
  }
 else {
    endElementProcessText(unmarshalRecord,xPathFragment);
  }
}

Fixed version (ground truth):
public void endElement(XPathFragment xPathFragment,UnmarshalRecord unmarshalRecord){
  unmarshalRecord.removeNullCapableValue(this);
  Object childObject=null;
  if (null != unmarshalRecord.getChildRecord()) {
    childObject=unmarshalRecord.getChildRecord().getCurrentObject();
    if (xmlAnyObjectMapping.getConverter() != null) {
      childObject=xmlAnyObjectMapping.getConverter().convertDataValueToObjectValue(childObject,unmarshalRecord.getSession(),unmarshalRecord.getUnmarshaller());
    }
    if (!xmlAnyObjectMapping.usesXMLRoot()) {
      unmarshalRecord.setAttributeValue(childObject,xmlAnyObjectMapping);
    }
 else {
      if (workingDescriptor != null) {
        String prefix=xPathFragment.getPrefix();
        if ((prefix == null) && (xPathFragment.getNamespaceURI() != null)) {
          prefix=unmarshalRecord.resolveNamespaceUri(xPathFragment.getNamespaceURI());
        }
        childObject=workingDescriptor.wrapObjectInXMLRoot(childObject,xPathFragment.getNamespaceURI(),xPathFragment.getLocalName(),prefix,false);
        unmarshalRecord.setAttributeValue(childObject,xmlAnyObjectMapping);
        workingDescriptor=null;
      }
    }
  }
 else {
    endElementProcessText(unmarshalRecord,xPathFragment);
  }
}
Program: 68655
Project: 68655
Buggy source:
private void endElementProcessText(UnmarshalRecord unmarshalRecord,XPathFragment xPathFragment){
  Object value=unmarshalRecord.getStringBuffer().toString().trim();
  unmarshalRecord.resetStringBuffer();
  if (!EMPTY_STRING.equals(value)) {
    QName qname=unmarshalRecord.getTypeQName();
    if (qname != null) {
      Class theClass=(Class)XMLConversionManager.getDefaultXMLTypes().get(qname);
      if (theClass != null) {
        value=((XMLConversionManager)unmarshalRecord.getSession().getDatasourcePlatform().getConversionManager()).convertObject(value,theClass,qname);
      }
    }
    if (!xmlAnyObjectMapping.usesXMLRoot()) {
      unmarshalRecord.setAttributeValue(value,xmlAnyObjectMapping);
    }
 else {
      XMLRoot xmlRoot=new XMLRoot();
      xmlRoot.setNamespaceURI(xPathFragment.getNamespaceURI());
      xmlRoot.setSchemaType(qname);
      xmlRoot.setLocalName(xPathFragment.getLocalName());
      xmlRoot.setObject(value);
      unmarshalRecord.setAttributeValue(xmlRoot,xmlAnyObjectMapping);
    }
  }
}

Fixed version (ground truth):
private void endElementProcessText(UnmarshalRecord unmarshalRecord,XPathFragment xPathFragment){
  Object value=unmarshalRecord.getStringBuffer().toString().trim();
  if (xmlAnyObjectMapping.getConverter() != null) {
    value=xmlAnyObjectMapping.getConverter().convertDataValueToObjectValue(value,unmarshalRecord.getSession(),unmarshalRecord.getUnmarshaller());
  }
  unmarshalRecord.resetStringBuffer();
  if (!EMPTY_STRING.equals(value)) {
    QName qname=unmarshalRecord.getTypeQName();
    if (qname != null) {
      Class theClass=(Class)XMLConversionManager.getDefaultXMLTypes().get(qname);
      if (theClass != null) {
        value=((XMLConversionManager)unmarshalRecord.getSession().getDatasourcePlatform().getConversionManager()).convertObject(value,theClass,qname);
      }
    }
    if (!xmlAnyObjectMapping.usesXMLRoot()) {
      unmarshalRecord.setAttributeValue(value,xmlAnyObjectMapping);
    }
 else {
      XMLRoot xmlRoot=new XMLRoot();
      xmlRoot.setNamespaceURI(xPathFragment.getNamespaceURI());
      xmlRoot.setSchemaType(qname);
      xmlRoot.setLocalName(xPathFragment.getLocalName());
      xmlRoot.setObject(value);
      unmarshalRecord.setAttributeValue(xmlRoot,xmlAnyObjectMapping);
    }
  }
}
Program: 68659
Project: 68659
Buggy source:
public void initialize(AbstractSession session) throws DescriptorException {
  if (getField() != null) {
    setField(getDescriptor().buildField(getField()));
  }
}

Fixed version (ground truth):
public void initialize(AbstractSession session) throws DescriptorException {
  if (getField() != null) {
    setField(getDescriptor().buildField(getField()));
  }
  if (valueConverter != null) {
    valueConverter.initialize(this,session);
  }
}
Program: 68662
Project: 68662
Buggy source:
public DateAndTimeTestCases(String name){
  super(name);
}

Fixed version (ground truth):
public DateAndTimeTestCases(String name){
  super(name);
  Calendar cal=Calendar.getInstance();
  cal.clear();
  cal.set(1975,1,21);
  CONTROL_DATE=cal.getTimeInMillis();
  cal.clear();
  cal.set(1975,1,21,7,47,15);
  this.CONTROL_DATE_TIME_0MS=cal.getTimeInMillis();
  this.CONTROL_DATE_TIME_100MS=cal.getTimeInMillis() + 100;
  this.CONTROL_DATE_TIME_10MS=cal.getTimeInMillis() + 10;
  this.CONTROL_DATE_TIME_1MS=cal.getTimeInMillis() + 1;
  cal.clear();
  cal.set(1970,0,1,7,47,15);
  this.CONTROL_TIME_0MS=cal.getTimeInMillis();
  this.CONTROL_TIME_100MS=cal.getTimeInMillis() + 100;
  this.CONTROL_TIME_10MS=cal.getTimeInMillis() + 10;
  this.CONTROL_TIME_1MS=cal.getTimeInMillis() + 1;
  cal.clear();
  cal.set(Calendar.DAY_OF_MONTH,21);
  this.CONTROL_G_DAY=cal.getTimeInMillis();
  cal.clear();
  cal.set(Calendar.MONTH,1);
  this.CONTROL_G_MONTH=cal.getTimeInMillis();
  cal.clear();
  cal.set(Calendar.MONTH,1);
  cal.set(Calendar.DATE,21);
  this.CONTROL_G_MONTH_DAY=cal.getTimeInMillis();
  cal.clear();
  cal.set(Calendar.YEAR,1975);
  this.CONTROL_G_YEAR=cal.getTimeInMillis();
  cal.clear();
  cal.set(Calendar.YEAR,1975);
  cal.set(Calendar.MONTH,1);
  this.CONTROL_G_YEAR_MONTH=cal.getTimeInMillis();
}
Program: 68663
Project: 68663
Buggy source:
private QName getSchemaType(XMLField xmlField,Object value){
  QName schemaType=null;
  if (xmlField.isTypedTextField()) {
    schemaType=xmlField.getXMLType(value.getClass());
  }
 else   if (xmlField.isUnionField()) {
    return getSchemaTypeForUnion((XMLUnionField)xmlField,value);
  }
 else   if (xmlField.getSchemaType() != null) {
    schemaType=xmlField.getSchemaType();
  }
  return schemaType;
}

Fixed version (ground truth):
private QName getSchemaType(XMLField xmlField,Object value,AbstractSession session){
  QName schemaType=null;
  if (xmlField.isTypedTextField()) {
    schemaType=xmlField.getXMLType(value.getClass());
  }
 else   if (xmlField.isUnionField()) {
    return getSchemaTypeForUnion((XMLUnionField)xmlField,value,session);
  }
 else   if (xmlField.getSchemaType() != null) {
    schemaType=xmlField.getSchemaType();
  }
  return schemaType;
}
Program: 68664
Project: 68664
Buggy source:
private QName getSchemaTypeForUnion(XMLUnionField xmlField,Object value){
  ArrayList schemaTypes=xmlField.getSchemaTypes();
  QName schemaType=null;
  QName nextQName;
  Class javaClass;
  for (int i=0; i < schemaTypes.size(); i++) {
    nextQName=(QName)(xmlField).getSchemaTypes().get(i);
    try {
      if (nextQName != null) {
        javaClass=xmlField.getJavaClass(nextQName);
        value=XMLConversionManager.getDefaultXMLManager().convertObject(value,javaClass,nextQName);
        schemaType=nextQName;
        break;
      }
    }
 catch (    ConversionException ce) {
      if (i == (schemaTypes.size() - 1)) {
        schemaType=nextQName;
      }
    }
  }
  return schemaType;
}

Fixed version (ground truth):
private QName getSchemaTypeForUnion(XMLUnionField xmlField,Object value,AbstractSession session){
  ArrayList schemaTypes=xmlField.getSchemaTypes();
  QName schemaType=null;
  QName nextQName;
  Class javaClass;
  for (int i=0; i < schemaTypes.size(); i++) {
    nextQName=(QName)(xmlField).getSchemaTypes().get(i);
    try {
      if (nextQName != null) {
        javaClass=xmlField.getJavaClass(nextQName);
        value=((XMLConversionManager)session.getDatasourcePlatform().getConversionManager()).convertObject(value,javaClass,nextQName);
        schemaType=nextQName;
        break;
      }
    }
 catch (    ConversionException ce) {
      if (i == (schemaTypes.size() - 1)) {
        schemaType=nextQName;
      }
    }
  }
  return schemaType;
}
Program: 68665
Project: 68665
Buggy source:
public boolean marshal(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,AbstractSession session,NamespaceResolver namespaceResolver){
  Object objectValue=directMapping.getAttributeValueFromObject(object);
  Object fieldValue=directMapping.getFieldValue(objectValue,session);
  if ((null == fieldValue) || (null == namespaceResolver)) {
    return false;
  }
  XMLField xmlField=(XMLField)directMapping.getField();
  QName schemaType=getSchemaType(xmlField,fieldValue);
  if (null == schemaType) {
    return false;
  }
  XPathFragment groupingFragment=marshalRecord.openStartGroupingElements(namespaceResolver);
  String typeQName=namespaceResolver.resolveNamespaceURI(XMLConstants.SCHEMA_INSTANCE_URL) + "String_Node_Str";
  String schemaTypePrefix=namespaceResolver.resolveNamespaceURI(schemaType.getNamespaceURI());
  marshalRecord.attribute(XMLConstants.SCHEMA_INSTANCE_URL,schemaType.getLocalPart(),typeQName,schemaTypePrefix + ':' + schemaType.getLocalPart());
  marshalRecord.closeStartGroupingElements(groupingFragment);
  return true;
}

Fixed version (ground truth):
public boolean marshal(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,AbstractSession session,NamespaceResolver namespaceResolver){
  Object objectValue=directMapping.getAttributeValueFromObject(object);
  Object fieldValue=directMapping.getFieldValue(objectValue,session);
  if ((null == fieldValue) || (null == namespaceResolver)) {
    return false;
  }
  XMLField xmlField=(XMLField)directMapping.getField();
  QName schemaType=getSchemaType(xmlField,fieldValue,session);
  if (null == schemaType) {
    return false;
  }
  XPathFragment groupingFragment=marshalRecord.openStartGroupingElements(namespaceResolver);
  String typeQName=namespaceResolver.resolveNamespaceURI(XMLConstants.SCHEMA_INSTANCE_URL) + "String_Node_Str";
  String schemaTypePrefix=namespaceResolver.resolveNamespaceURI(schemaType.getNamespaceURI());
  marshalRecord.attribute(XMLConstants.SCHEMA_INSTANCE_URL,schemaType.getLocalPart(),typeQName,schemaTypePrefix + ':' + schemaType.getLocalPart());
  marshalRecord.closeStartGroupingElements(groupingFragment);
  return true;
}
Program: 68667
Project: 68667
Buggy source:
private void endElementProcessText(UnmarshalRecord unmarshalRecord,Object collection,XPathFragment xPathFragment){
  Object value=unmarshalRecord.getStringBuffer().toString().trim();
  unmarshalRecord.resetStringBuffer();
  if (!EMPTY_STRING.equals(value) && xmlAnyCollectionMapping.isMixedContent()) {
    QName qname=unmarshalRecord.getTypeQName();
    if (qname != null) {
      XMLConversionManager xmlConversionManager=(XMLConversionManager)unmarshalRecord.getSession().getDatasourcePlatform().getConversionManager();
      Class theClass=(Class)xmlConversionManager.getDefaultXMLTypes().get(qname);
      if (theClass != null) {
        value=xmlConversionManager.convertObject(value,theClass,qname);
      }
    }
    if (!xmlAnyCollectionMapping.usesXMLRoot()) {
      unmarshalRecord.addAttributeValue(this,value);
    }
 else {
      XMLRoot xmlRoot=new XMLRoot();
      xmlRoot.setNamespaceURI(xPathFragment.getNamespaceURI());
      xmlRoot.setLocalName(xPathFragment.getLocalName());
      xmlRoot.setSchemaType(qname);
      xmlRoot.setObject(value);
      unmarshalRecord.addAttributeValue(this,xmlRoot);
    }
  }
}

Fixed version (ground truth):
private void endElementProcessText(UnmarshalRecord unmarshalRecord,Object collection,XPathFragment xPathFragment){
  Object value=unmarshalRecord.getStringBuffer().toString().trim();
  unmarshalRecord.resetStringBuffer();
  if (!EMPTY_STRING.equals(value) && xmlAnyCollectionMapping.isMixedContent()) {
    QName qname=unmarshalRecord.getTypeQName();
    if (qname != null) {
      Class theClass=(Class)XMLConversionManager.getDefaultXMLTypes().get(qname);
      if (theClass != null) {
        value=((XMLConversionManager)unmarshalRecord.getSession().getDatasourcePlatform().getConversionManager()).convertObject(value,theClass,qname);
      }
    }
    if (!xmlAnyCollectionMapping.usesXMLRoot()) {
      unmarshalRecord.addAttributeValue(this,value);
    }
 else {
      XMLRoot xmlRoot=new XMLRoot();
      xmlRoot.setNamespaceURI(xPathFragment.getNamespaceURI());
      xmlRoot.setLocalName(xPathFragment.getLocalName());
      xmlRoot.setSchemaType(qname);
      xmlRoot.setObject(value);
      unmarshalRecord.addAttributeValue(this,xmlRoot);
    }
  }
}
Program: 68668
Project: 68668
Buggy source:
public boolean marshal(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,AbstractSession session,NamespaceResolver namespaceResolver){
  if (xmlAnyCollectionMapping.isReadOnly()) {
    return false;
  }
  XMLDescriptor descriptor;
  TreeObjectBuilder objectBuilder;
  AbstractSession childSession;
  ContainerPolicy cp=xmlAnyCollectionMapping.getContainerPolicy();
  Object collection=xmlAnyCollectionMapping.getAttributeAccessor().getAttributeValueFromObject(object);
  if (null == collection) {
    return false;
  }
  Object iterator=cp.iteratorFor(collection);
  if (cp.hasNext(iterator)) {
    XPathFragment groupingFragment=marshalRecord.openStartGroupingElements(namespaceResolver);
    marshalRecord.closeStartGroupingElements(groupingFragment);
  }
 else {
    return false;
  }
  Object objectValue;
  while (cp.hasNext(iterator)) {
    objectValue=cp.next(iterator,session);
    marshalSingleValue(xPathFragment,marshalRecord,object,objectValue,session,namespaceResolver,ObjectMarshalContext.getInstance());
  }
  return true;
}

Fixed version (ground truth):
public boolean marshal(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,AbstractSession session,NamespaceResolver namespaceResolver){
  if (xmlAnyCollectionMapping.isReadOnly()) {
    return false;
  }
  ContainerPolicy cp=xmlAnyCollectionMapping.getContainerPolicy();
  Object collection=xmlAnyCollectionMapping.getAttributeAccessor().getAttributeValueFromObject(object);
  if (null == collection) {
    return false;
  }
  Object iterator=cp.iteratorFor(collection);
  if (cp.hasNext(iterator)) {
    XPathFragment groupingFragment=marshalRecord.openStartGroupingElements(namespaceResolver);
    marshalRecord.closeStartGroupingElements(groupingFragment);
  }
 else {
    return false;
  }
  Object objectValue;
  while (cp.hasNext(iterator)) {
    objectValue=cp.next(iterator,session);
    marshalSingleValue(xPathFragment,marshalRecord,object,objectValue,session,namespaceResolver,ObjectMarshalContext.getInstance());
  }
  return true;
}
Program: 68669
Project: 68669
Buggy source:
/** 
 * Wraps the XmlAdapter unmarshal method.
 */
public Object convertDataValueToObjectValue(Object dataValue,Session session,XMLUnmarshaller unmarshaller){
  try {
    XmlAdapter adapter=this.xmlAdapter;
    if (unmarshaller != null) {
      HashMap adapters=(HashMap)unmarshaller.getProperty(JAXBUnmarshaller.XML_JAVATYPE_ADAPTERS);
      if (adapters != null) {
        XmlAdapter runtimeAdapter=(XmlAdapter)adapters.get(this.xmlAdapterClass);
        if (runtimeAdapter != null) {
          adapter=runtimeAdapter;
        }
      }
    }
    Object toConvert=dataValue;
    if ((dataValue != null) && !(dataValue.getClass() == this.valueType)) {
      if (this.mapping instanceof XMLBinaryDataMapping) {
        toConvert=XMLBinaryDataHelper.getXMLBinaryDataHelper().convertObject(dataValue,valueType);
      }
 else {
        if (getSchemaType() != null) {
          toConvert=XMLConversionManager.getDefaultXMLManager().convertObject(dataValue,valueType,getSchemaType());
        }
 else {
          toConvert=XMLConversionManager.getDefaultXMLManager().convertObject(dataValue,valueType);
        }
      }
    }
    return adapter.unmarshal(toConvert);
  }
 catch (  Exception ex) {
    throw ConversionException.couldNotBeConverted(dataValue,boundType);
  }
}

Fixed version (ground truth):
/** 
 * Wraps the XmlAdapter unmarshal method.
 */
public Object convertDataValueToObjectValue(Object dataValue,Session session,XMLUnmarshaller unmarshaller){
  try {
    XmlAdapter adapter=this.xmlAdapter;
    if (unmarshaller != null) {
      HashMap adapters=(HashMap)unmarshaller.getProperty(JAXBUnmarshaller.XML_JAVATYPE_ADAPTERS);
      if (adapters != null) {
        XmlAdapter runtimeAdapter=(XmlAdapter)adapters.get(this.xmlAdapterClass);
        if (runtimeAdapter != null) {
          adapter=runtimeAdapter;
        }
      }
    }
    Object toConvert=dataValue;
    if ((dataValue != null) && !(dataValue.getClass() == this.valueType)) {
      if (this.mapping instanceof XMLBinaryDataMapping) {
        toConvert=XMLBinaryDataHelper.getXMLBinaryDataHelper().convertObject(dataValue,valueType,(AbstractSession)session);
      }
 else {
        if (getSchemaType() != null) {
          toConvert=((XMLConversionManager)session.getDatasourcePlatform().getConversionManager()).convertObject(dataValue,valueType,getSchemaType());
        }
 else {
          toConvert=session.getDatasourcePlatform().getConversionManager().convertObject(dataValue,valueType);
        }
      }
    }
    return adapter.unmarshal(toConvert);
  }
 catch (  Exception ex) {
    throw ConversionException.couldNotBeConverted(dataValue,boundType);
  }
}
Program: 68671
Project: 68671
Buggy source:
protected void initializeTabs(){
  addTab(buildGeneralPropertiesPage(),buildGeneralPropertiesPageTitle());
  addTab(buildOptionsPropertiesPage(),buildOptionsPropertiesPageTitle());
  addTab(buildLoginPropertiesPage(),buildLoginPropertiesPageTitle());
  addTab(buildLoggingPropertiesPage(),buildLoggingPropertiesPageTitle());
  addTab(buildConnectionPolicyVisibleHolder(),5,buildConnectionPolicyPropertiesPage(),buildConnectionPolicyPropertiesPageTitle());
}

Fixed version (ground truth):
protected void initializeTabs(){
  addTab(buildGeneralPropertiesPage(),buildGeneralPropertiesPageTitle());
  addTab(buildOptionsPropertiesPage(),buildOptionsPropertiesPageTitle());
  addTab(buildLoginPropertiesPage(),buildLoginPropertiesPageTitle());
  addTab(buildLoggingPropertiesPage(),buildLoggingPropertiesPageTitle());
  addTab(buildClusteringPropertiesPage(),buildClusteringPropertiesPageTitle());
  addTab(buildConnectionPolicyVisibleHolder(),5,buildConnectionPolicyPropertiesPage(),buildConnectionPolicyPropertiesPageTitle());
}
Program: 68672
Project: 68672
Buggy source:
protected void initializeTabs(){
  addTab(buildGeneralPropertiesPage(),buildGeneralPropertiesPageTitle());
  addTab(buildOptionsPropertiesPage(),buildOptionsPropertiesPageTitle());
  addTab(buildLoginPropertiesPage(),buildLoginPropertiesPageTitle());
  addTab(buildLoggingPropertiesPage(),buildLoggingPropertiesPageTitle());
  addTab(buildConnectionPolicyVisibleHolder(),5,buildConnectionPolicyPropertiesPage(),buildConnectionPolicyPropertiesPageTitle());
}

Fixed version (ground truth):
protected void initializeTabs(){
  addTab(buildGeneralPropertiesPage(),buildGeneralPropertiesPageTitle());
  addTab(buildOptionsPropertiesPage(),buildOptionsPropertiesPageTitle());
  addTab(buildLoginPropertiesPage(),buildLoginPropertiesPageTitle());
  addTab(buildLoggingPropertiesPage(),buildLoggingPropertiesPageTitle());
  addTab(buildClusteringPropertiesPage(),buildClusteringPropertiesPageTitle());
  addTab(buildConnectionPolicyVisibleHolder(),5,buildConnectionPolicyPropertiesPage(),buildConnectionPolicyPropertiesPageTitle());
}
Program: 68673
Project: 68673
Buggy source:
private static Set buildCoreClassNames(){
  Set result=new HashSet(10000);
  CollectionTools.addAll(result,MWClass.nonReferenceClassNames());
  List locations=new ArrayList();
  for (int i=0; i < CORE_KEYS.length; i++) {
    locations.add(Classpath.locationFor(CORE_KEYS[i]));
  }
  Classpath cp=new Classpath(locations);
  cp.addClassNamesTo(result);
  return result;
}

Fixed version (ground truth):
private static Set buildCoreClassNames(){
  Set result=new HashSet(10000);
  CollectionTools.addAll(result,MWClass.nonReferenceClassNames());
  List locations=buildCoreClassLocations();
  Classpath cp=new Classpath(locations);
  cp.addClassNamesTo(result);
  return result;
}
Program: 68674
Project: 68674
Buggy source:
/** 
 * return the classpath with the entries converted to fully qualified files (any relative entries will be resolved relative to the project save directory)
 */
private File[] buildExternalClassRepositoryClasspath(){
  List files=new ArrayList(this.classpathEntriesSize() + CORE_KEYS.length);
  CollectionTools.addAll(files,this.fullyQualifiedClasspathFiles());
  for (int i=0; i < CORE_KEYS.length; i++) {
    files.add(new File(Classpath.locationFor(CORE_KEYS[i])));
  }
  return (File[])files.toArray(new File[files.size()]);
}

Fixed version (ground truth):
/** 
 * return the classpath with the entries converted to fully qualified files (any relative entries will be resolved relative to the project save directory)
 */
private File[] buildExternalClassRepositoryClasspath(){
  List<String> coreFiles=buildCoreClassLocations();
  List files=new ArrayList(this.classpathEntriesSize() + coreFiles.size());
  CollectionTools.addAll(files,this.fullyQualifiedClasspathFiles());
  ListIterator<String> coreFileIter=coreFiles.listIterator();
  while (coreFileIter.hasNext()) {
    files.add(new File(coreFileIter.next()));
  }
  return (File[])files.toArray(new File[files.size()]);
}
Program: 68675
Project: 68675
Buggy source:
/** 
 * INTERNAL: Called from RelationshipWeaverTestSuite which uses only annotations and no XML.
 */
public void processAnnotations(){
  for (  ClassAccessor accessor : m_project.getAllAccessors()) {
    if (!accessor.isProcessed()) {
      accessor.process();
      accessor.setIsProcessed();
    }
  }
  m_project.process();
}

Fixed version (ground truth):
/** 
 * INTERNAL: Called from RelationshipWeaverTestSuite which uses only annotations and no XML.
 */
public void processAnnotations(){
  for (  ClassAccessor accessor : m_project.getClassAccessors()) {
    if (!accessor.isProcessed()) {
      accessor.process();
      accessor.setIsProcessed();
    }
  }
  m_project.process();
}
Program: 68676
Project: 68676
Buggy source:
public void exec(String[] args) throws Exception {
  UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
  String copyright="String_Node_Str";
  Icon image=new ImageIcon(this.getClass().getResource("String_Node_Str"));
  SplashScreen ss=new SplashScreen(new Frame(),copyright,image,5000);
  ss.start();
  JOptionPane.showMessageDialog(ss,"String_Node_Str");
  ss.stop();
  System.exit(0);
}

Fixed version (ground truth):
public void exec(String[] args) throws Exception {
  UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
  Icon image=new ImageIcon(this.getClass().getResource("String_Node_Str"));
  SplashScreen ss=new SplashScreen(new Frame(),image);
  ss.start();
  JOptionPane.showMessageDialog(ss,"String_Node_Str");
  ss.stop();
  System.exit(0);
}
Program: 68677
Project: 68677
Buggy source:
/** 
 * Creates the widgets of this dialog.
 * @return The container with its widgets
 */
@Override protected Component buildMainPanel(){
  GridBagConstraints constraints=new GridBagConstraints();
  JPanel container=new JPanel(new GridBagLayout());
  LabelArea messageLabel=new LabelArea(resourceRepository().getString(this.messageKey),resourceRepository().getMnemonic(this.messageKey));
  messageLabel.getAccessibleContext().setAccessibleName(messageLabel.getText());
  messageLabel.setScrollable(true);
  constraints.gridx=0;
  constraints.gridy=0;
  constraints.gridwidth=1;
  constraints.gridheight=1;
  constraints.weightx=1;
  constraints.weighty=0;
  constraints.fill=GridBagConstraints.HORIZONTAL;
  constraints.anchor=GridBagConstraints.CENTER;
  constraints.insets=new Insets(0,0,0,0);
  container.add(messageLabel,constraints);
  this.tree=new StatusTree();
  this.tree.setRowHeight(0);
  this.tree.setShowsRootHandles(false);
  this.tree.setRootVisible(false);
  this.tree.setDoubleBuffered(true);
  this.tree.setCellRenderer(new StatusTreeNodeRenderer());
  constraints.gridx=0;
  constraints.gridy=1;
  constraints.gridwidth=1;
  constraints.gridheight=1;
  constraints.weightx=1;
  constraints.weighty=1;
  constraints.fill=GridBagConstraints.BOTH;
  constraints.anchor=GridBagConstraints.CENTER;
  constraints.insets=new Insets(1,0,0,0);
  JScrollPane pane=new JScrollPane(this.tree);
  pane.addComponentListener(buildComponentListener());
  container.add(pane,constraints);
  messageLabel.setLabelFor(this.tree);
  return container;
}

Fixed version (ground truth):
/** 
 * Creates the widgets of this dialog.
 * @return The container with its widgets
 */
@Override protected Component buildMainPanel(){
  GridBagConstraints constraints=new GridBagConstraints();
  JPanel container=new JPanel(new GridBagLayout());
  LabelArea messageLabel=new LabelArea(resourceRepository().getString(this.messageKey));
  messageLabel.getAccessibleContext().setAccessibleName(messageLabel.getText());
  messageLabel.setScrollable(true);
  constraints.gridx=0;
  constraints.gridy=0;
  constraints.gridwidth=1;
  constraints.gridheight=1;
  constraints.weightx=1;
  constraints.weighty=0;
  constraints.fill=GridBagConstraints.HORIZONTAL;
  constraints.anchor=GridBagConstraints.CENTER;
  constraints.insets=new Insets(0,0,0,0);
  container.add(messageLabel,constraints);
  this.tree=new StatusTree();
  this.tree.setRowHeight(0);
  this.tree.setShowsRootHandles(false);
  this.tree.setRootVisible(false);
  this.tree.setDoubleBuffered(true);
  this.tree.setCellRenderer(new StatusTreeNodeRenderer());
  constraints.gridx=0;
  constraints.gridy=1;
  constraints.gridwidth=1;
  constraints.gridheight=1;
  constraints.weightx=1;
  constraints.weighty=1;
  constraints.fill=GridBagConstraints.BOTH;
  constraints.anchor=GridBagConstraints.CENTER;
  constraints.insets=new Insets(1,0,0,0);
  JScrollPane pane=new JScrollPane(this.tree);
  pane.addComponentListener(buildComponentListener());
  container.add(pane,constraints);
  messageLabel.setLabelFor(this.tree);
  return container;
}
Program: 68679
Project: 68679
Buggy source:
/** 
 * Define the list of DataObjects as Types. The Types are available through TypeHelper and DataGraph getType() methods.
 * @param types a List of DataObjects representing the Types.
 * @return the defined Types.
 * @throws IllegalArgumentException if the Types could not be defined.
 */
public List define(List types){
  List definedTypes=new ArrayList();
  for (int i=0; i < types.size(); i++) {
    Type definedType=define((DataObject)types.get(i));
    definedTypes.add(definedType);
  }
  return definedTypes;
}

Fixed version (ground truth):
/** 
 * Define the list of DataObjects as Types. The Types are available through TypeHelper and DataGraph getType() methods.
 * @param types a List of DataObjects representing the Types.
 * @return the defined Types.
 * @throws IllegalArgumentException if the Types could not be defined.
 */
public synchronized List define(List types){
  List definedTypes=new ArrayList();
  for (int i=0; i < types.size(); i++) {
    Type definedType=define((DataObject)types.get(i));
    definedTypes.add(definedType);
  }
  return definedTypes;
}
Program: 68680
Project: 68680
Buggy source:
/** 
 * Define XML Schema as Types. The Types are available through TypeHelper and DataGraph getType() methods.
 * @param xsdInputStream input stream to an XML Schema.
 * @param schemaLocation the URI of the location of the schema, usedfor processing relative imports and includes.  May be null if not used.
 * @return the defined Types.
 * @throws IllegalArgumentException if the Types could not be defined.
 */
public List define(InputStream xsdInputStream,String schemaLocation){
  InputStreamReader xsdReader=new InputStreamReader(xsdInputStream);
  return define(xsdReader,schemaLocation);
}

Fixed version (ground truth):
/** 
 * Define XML Schema as Types. The Types are available through TypeHelper and DataGraph getType() methods.
 * @param xsdInputStream input stream to an XML Schema.
 * @param schemaLocation the URI of the location of the schema, usedfor processing relative imports and includes.  May be null if not used.
 * @return the defined Types.
 * @throws IllegalArgumentException if the Types could not be defined.
 */
public synchronized List define(InputStream xsdInputStream,String schemaLocation){
  InputStreamReader xsdReader=new InputStreamReader(xsdInputStream);
  return define(xsdReader,schemaLocation);
}
Program: 68681
Project: 68681
Buggy source:
/** 
 * INTERNAL: Process a cache metadata. 
 */
protected void processCache(){
  if (m_cache != null || isAnnotationPresent(Cache.class)) {
    if (getDescriptor().isEmbeddable()) {
      throw ValidationException.cacheNotSupportedWithEmbeddable(getJavaClass());
    }
 else     if (getDescriptor().isInheritanceSubclass()) {
      getLogger().logWarningMessage(MetadataLogger.IGNORE_INHERITANCE_SUBCLASS_CACHE,getJavaClass());
    }
 else     if (getDescriptor().isCacheSet()) {
      getLogger().logWarningMessage(MetadataLogger.IGNORE_MAPPED_SUPERCLASS_CACHE,getDescriptor().getJavaClass(),getJavaClass());
    }
 else {
      if (m_cache == null) {
        Cache cache=getAnnotation(Cache.class);
        new CacheMetadata(cache).process(getDescriptor(),getJavaClass());
      }
 else {
        m_cache.process(getDescriptor(),getJavaClass());
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: Process a cache metadata. 
 */
protected void processCache(){
  if (m_cache != null || isAnnotationPresent(Cache.class)) {
    if (getDescriptor().isEmbeddable()) {
      throw ValidationException.cacheNotSupportedWithEmbeddable(getJavaClass());
    }
 else     if (getDescriptor().isInheritanceSubclass()) {
      getLogger().logWarningMessage(MetadataLogger.IGNORE_INHERITANCE_SUBCLASS_CACHE,getJavaClass());
    }
 else     if (getDescriptor().isCacheSet()) {
      getLogger().logWarningMessage(MetadataLogger.IGNORE_MAPPED_SUPERCLASS_CACHE,getDescriptor().getJavaClass(),getJavaClass());
    }
 else {
      if (m_cache == null) {
        Object cache=getAnnotation(Cache.class);
        new CacheMetadata(cache).process(getDescriptor(),getJavaClass());
      }
 else {
        m_cache.process(getDescriptor(),getJavaClass());
      }
    }
  }
}
Program: 68682
Project: 68682
Buggy source:
/** 
 * Return if a given class is annotated with @Entity.
 */
public static boolean isEntity(Class candidateClass){
  return candidateClass.isAnnotationPresent(javax.persistence.Entity.class);
}

Fixed version (ground truth):
/** 
 * Return if a given class is annotated with @Entity.
 */
public static boolean isEntity(Class candidateClass){
  return MetadataHelper.isAnnotationPresent(javax.persistence.Entity.class,candidateClass);
}
Program: 68683
Project: 68683
Buggy source:
/** 
 * Return if a given class is annotated with @Embeddable.
 */
public static boolean isEmbeddable(Class candidateClass){
  return candidateClass.isAnnotationPresent(javax.persistence.Embeddable.class);
}

Fixed version (ground truth):
/** 
 * Return if a given class is annotated with @Embeddable.
 */
public static boolean isEmbeddable(Class candidateClass){
  return MetadataHelper.isAnnotationPresent(javax.persistence.Embeddable.class,candidateClass);
}
Program: 68684
Project: 68684
Buggy source:
/** 
 * INTERNAL: Stored on the root class of an inheritance hierarchy.
 */
public void setInheritanceStrategy(InheritanceType inheritanceStrategy){
  if (inheritanceStrategy.equals(InheritanceType.TABLE_PER_CLASS)) {
    throw ValidationException.tablePerClassInheritanceNotSupported(getJavaClass());
  }
 else   if (inheritanceStrategy.equals(InheritanceType.SINGLE_TABLE)) {
    m_descriptor.getInheritancePolicy().setSingleTableStrategy();
  }
 else {
    m_descriptor.getInheritancePolicy().setJoinedStrategy();
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: Stored on the root class of an inheritance hierarchy.
 */
public void setInheritanceStrategy(Enum inheritanceStrategy){
  if (inheritanceStrategy.equals(InheritanceType.TABLE_PER_CLASS)) {
    throw ValidationException.tablePerClassInheritanceNotSupported(getJavaClass());
  }
 else   if (inheritanceStrategy.equals(InheritanceType.SINGLE_TABLE)) {
    m_descriptor.getInheritancePolicy().setSingleTableStrategy();
  }
 else {
    m_descriptor.getInheritancePolicy().setJoinedStrategy();
  }
}
Program: 68685
Project: 68685
Buggy source:
/** 
 * INTERNAL: Return the discriminator type class for the given discriminator type.
 */
public static Class getDiscriminatorType(DiscriminatorType discriminatorType){
  if (discriminatorType == null || discriminatorType.equals(DiscriminatorType.STRING)) {
    return String.class;
  }
 else   if (discriminatorType.equals(DiscriminatorType.CHAR)) {
    return Character.class;
  }
 else {
    return Integer.class;
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: Return the discriminator type class for the given discriminator type.
 */
public static Class getDiscriminatorType(Enum discriminatorType){
  if (discriminatorType == null || discriminatorType.equals(DiscriminatorType.STRING)) {
    return String.class;
  }
 else   if (discriminatorType.equals(DiscriminatorType.CHAR)) {
    return Character.class;
  }
 else {
    return Integer.class;
  }
}
Program: 68686
Project: 68686
Buggy source:
/** 
 * INTERNAL: Return the field classification for the given temporal type.
 */
public static Class getFieldClassification(TemporalType type){
switch (type) {
case DATE:
    return java.sql.Date.class;
case TIME:
  return java.sql.Time.class;
case TIMESTAMP:
return java.sql.Timestamp.class;
default :
return null;
}
}

Fixed version (ground truth):
/** 
 * INTERNAL: Return the field classification for the given temporal type.
 */
public static Class getFieldClassification(Enum type){
  if (type.equals(TemporalType.DATE)) {
    return java.sql.Date.class;
  }
  if (type.equals(TemporalType.TIME)) {
    return java.sql.Time.class;
  }
  if (type.equals(TemporalType.TIMESTAMP)) {
    return java.sql.Timestamp.class;
  }
  return null;
}
Program: 68688
Project: 68688
Buggy source:
/** 
 * INTERNAL:
 */
public BasicAccessor(MetadataAccessibleObject accessibleObject,ClassAccessor classAccessor){
  super(accessibleObject,classAccessor);
  Basic basic=getAnnotation(Basic.class);
  if (basic != null) {
    setFetch(basic.fetch());
    setOptional(basic.optional());
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL:
 */
public BasicAccessor(MetadataAccessibleObject accessibleObject,ClassAccessor classAccessor){
  super(accessibleObject,classAccessor);
  Object basic=getAnnotation(Basic.class);
  if (basic != null) {
    setFetch((Enum)invokeMethod("String_Node_Str",basic,(Object[])null));
    setOptional((Boolean)invokeMethod("String_Node_Str",basic,(Object[])null));
  }
}
Program: 68689
Project: 68689
Buggy source:
/** 
 * INTERNAL: Return the column from xml if there is one, otherwise look for an annotation.
 */
protected ColumnMetadata getColumn(String loggingCtx){
  if (m_column == null) {
    Column column=getAnnotation(Column.class);
    return new ColumnMetadata(column,getAttributeName());
  }
 else {
    return m_column;
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: Return the column from xml if there is one, otherwise look for an annotation.
 */
protected ColumnMetadata getColumn(String loggingCtx){
  if (m_column == null) {
    Object column=getAnnotation(Column.class);
    return new ColumnMetadata(column,getAttributeName());
  }
 else {
    return m_column;
  }
}
Program: 68690
Project: 68690
Buggy source:
/** 
 * INTERNAL: Process the Mutable annotation.
 */
public void processMutable(DatabaseMapping mapping){
  if (m_mutable == null) {
    Mutable mutable=getAnnotation(Mutable.class);
    if (mutable != null) {
      ((DirectToFieldMapping)mapping).setIsMutable(mutable.value());
    }
  }
 else {
    ((DirectToFieldMapping)mapping).setIsMutable(m_mutable.booleanValue());
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: Process the Mutable annotation.
 */
public void processMutable(DatabaseMapping mapping){
  if (m_mutable == null) {
    Object mutable=getAnnotation(Mutable.class);
    if (mutable != null) {
      ((DirectToFieldMapping)mapping).setIsMutable((Boolean)invokeMethod("String_Node_Str",mutable,(Object[])null));
    }
  }
 else {
    ((DirectToFieldMapping)mapping).setIsMutable(m_mutable.booleanValue());
  }
}
Program: 68691
Project: 68691
Buggy source:
/** 
 * INTERNAL:  Used for OX mapping.
 */
public JoinFetchType getJoinFetch(){
  return m_joinFetch;
}

Fixed version (ground truth):
/** 
 * INTERNAL:  Used for OX mapping.
 */
public Enum getJoinFetch(){
  return m_joinFetch;
}
Program: 68692
Project: 68692
Buggy source:
/** 
 * INTERNAL:  Used for OX mapping.
 */
public void setJoinFetch(JoinFetchType joinFetch){
  m_joinFetch=joinFetch;
}

Fixed version (ground truth):
/** 
 * INTERNAL:  Used for OX mapping.
 */
public void setJoinFetch(Enum joinFetch){
  m_joinFetch=joinFetch;
}