nus-yam/ex-repair huggingface dataset:
Program: 65969
Project: 65969
Buggy source:
/** 
 * INTERNAL: Assign a string as a unique name of this Property among Properties that belongs to a DataObject.
 * @param name    a string representing unique name of a property of a DataObject.
 */
public void setName(String name){
  propertyName=name;
}

Fixed version (ground truth):
/** 
 * INTERNAL: Assign a string as a unique name of this Property among Properties that belongs to a DataObject.
 * @param name    a string representing unique name of a property of a DataObject.
 */
public void setName(String name){
  if (null != name) {
    name=name.intern();
  }
  propertyName=name;
}
Program: 65970
Project: 65970
Buggy source:
protected SDOType(String uri,String name,SDOTypeHelper sdoTypeHelper,XMLDescriptor xmlDescriptor){
  this(sdoTypeHelper,xmlDescriptor);
  this.qName=new QName(uri,name);
}

Fixed version (ground truth):
protected SDOType(String uri,String name,SDOTypeHelper sdoTypeHelper,XMLDescriptor xmlDescriptor){
  this(sdoTypeHelper,xmlDescriptor);
  if (null != uri) {
    uri=uri.intern();
  }
  if (null != name) {
    name=name.intern();
  }
  this.qName=new QName(uri,name);
}
Program: 65972
Project: 65972
Buggy source:
public boolean marshalSingleValue(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,Object objectValue,AbstractSession session,NamespaceResolver namespaceResolver,MarshalContext marshalContext){
  Object fieldValue=xmlDirectMapping.getFieldValue(objectValue,session,marshalRecord);
  if (null == fieldValue) {
    return xmlDirectMapping.getNullPolicy().directMarshal(xPathFragment,marshalRecord,object,session,namespaceResolver);
  }
 else {
    XPathFragment groupingFragment=marshalRecord.openStartGroupingElements(namespaceResolver);
    QName schemaType=getSchemaType((XMLField)xmlDirectMapping.getField(),fieldValue,session);
    String stringValue=getValueToWrite(schemaType,fieldValue,(XMLConversionManager)session.getDatasourcePlatform().getConversionManager(),marshalRecord);
    if (xPathFragment.isAttribute()) {
      marshalRecord.attribute(xPathFragment,namespaceResolver,stringValue);
      marshalRecord.closeStartGroupingElements(groupingFragment);
    }
 else {
      marshalRecord.closeStartGroupingElements(groupingFragment);
      if (xmlDirectMapping.isCDATA()) {
        marshalRecord.cdata(stringValue);
      }
 else {
        marshalRecord.characters(stringValue);
      }
    }
    return true;
  }
}

Fixed version (ground truth):
public boolean marshalSingleValue(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,Object objectValue,AbstractSession session,NamespaceResolver namespaceResolver,MarshalContext marshalContext){
  Object fieldValue=xmlDirectMapping.getFieldValue(objectValue,session,marshalRecord);
  if (null == fieldValue) {
    return xmlDirectMapping.getNullPolicy().directMarshal(xPathFragment,marshalRecord,object,session,namespaceResolver);
  }
 else {
    QName schemaType=getSchemaType((XMLField)xmlDirectMapping.getField(),fieldValue,session);
    XPathFragment groupingFragment=null;
    boolean isQName=false;
    if (XMLConstants.QNAME_QNAME.equals(schemaType)) {
      groupingFragment=openGroupingElementsForQName((QName)fieldValue,marshalRecord);
      isQName=true;
    }
    if (groupingFragment == null) {
      groupingFragment=marshalRecord.openStartGroupingElements(namespaceResolver);
    }
    String stringValue=getValueToWrite(schemaType,fieldValue,(XMLConversionManager)session.getDatasourcePlatform().getConversionManager(),marshalRecord);
    if (xPathFragment.isAttribute()) {
      marshalRecord.attribute(xPathFragment,namespaceResolver,stringValue);
      marshalRecord.closeStartGroupingElements(groupingFragment);
    }
 else {
      marshalRecord.closeStartGroupingElements(groupingFragment);
      if (xmlDirectMapping.isCDATA()) {
        marshalRecord.cdata(stringValue);
      }
 else {
        marshalRecord.characters(stringValue);
      }
    }
    if (isQName) {
      XPathFragment fragment=getLastGroupingFragment();
      if (fragment != groupingFragment) {
        marshalRecord.endElement(groupingFragment,namespaceResolver);
        return false;
      }
    }
    return true;
  }
}
Program: 65975
Project: 65975
Buggy source:
/** 
 * Inherited suite method for generating all test cases.
 * @return
 */
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTestSuite(SDOPropertyEqualityTests.class);
  return suite;
}

Fixed version (ground truth):
/** 
 * Inherited suite method for generating all test cases.
 * @return
 */
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTestSuite(SDOPropertyEqualityTests.class);
  suite.addTestSuite(XmlElementPropertyTestCases.class);
  return suite;
}
Program: 65976
Project: 65976
Buggy source:
public void setInstanceProperty(Property property,Object value){
  getPropertyValues().put(property,value);
  if (SDOConstants.SDOXML_URL.equals(((SDOProperty)property).getUri()) && SDOConstants.SDOXML_DATATYPE.equals(property.getName()) && value instanceof Type) {
    setType((Type)value);
  }
  if (SDOConstants.ORACLE_SDO_URL.equals(((SDOProperty)property).getUri()) && SDOConstants.XML_SCHEMA_TYPE_NAME.equals(property.getName()) && value instanceof Type) {
    Type schemaType=(Type)value;
    QName schemaTypeQName=new QName(schemaType.getURI(),schemaType.getName());
    setXsdType(schemaTypeQName);
  }
}

Fixed version (ground truth):
public void setInstanceProperty(Property property,Object value){
  if (SDOConstants.XMLELEMENT_PROPERTY.equals(property)) {
    isElement=(Boolean)value;
    if (null != propertyValues) {
      propertyValues.put(SDOConstants.XMLELEMENT_PROPERTY,isElement);
    }
  }
 else {
    if (null == propertyValues) {
      if (null != isElement) {
        propertyValues=new HashMap<Property,Object>(2);
        propertyValues.put(SDOConstants.XMLELEMENT_PROPERTY,isElement);
      }
 else {
        propertyValues=new HashMap<Property,Object>(1);
      }
    }
    propertyValues.put(property,value);
    if (SDOConstants.SDOXML_URL.equals(((SDOProperty)property).getUri()) && SDOConstants.SDOXML_DATATYPE.equals(property.getName()) && value instanceof Type) {
      setType((Type)value);
    }
    if (SDOConstants.ORACLE_SDO_URL.equals(((SDOProperty)property).getUri()) && SDOConstants.XML_SCHEMA_TYPE_NAME.equals(property.getName()) && value instanceof Type) {
      Type schemaType=(Type)value;
      QName schemaTypeQName=new QName(schemaType.getURI(),schemaType.getName());
      setXsdType(schemaTypeQName);
    }
  }
}
Program: 65977
Project: 65977
Buggy source:
public Object get(Property property){
  return getPropertyValues().get(property);
}

Fixed version (ground truth):
public Object get(Property property){
  if (SDOConstants.XMLELEMENT_PROPERTY.equals(property)) {
    return isElement;
  }
  if (null == propertyValues) {
    return null;
  }
  return propertyValues.get(property);
}
Program: 65978
Project: 65978
Buggy source:
/** 
 * INTERNAL:
 */
public Map getPropertyValues(){
  if (propertyValues == null) {
    propertyValues=new HashMap();
  }
  return propertyValues;
}

Fixed version (ground truth):
/** 
 * INTERNAL:
 */
public Map getPropertyValues(){
  if (propertyValues == null) {
    propertyValues=new HashMap<Property,Object>(1);
    if (null != isElement) {
      propertyValues.put(SDOConstants.XMLELEMENT_PROPERTY,isElement);
    }
  }
  return propertyValues;
}
Program: 65979
Project: 65979
Buggy source:
/** 
 * Indicate if a given SDOProperty instance is equal to this instance. Equality is determined based on name, uri, and type.  In addition, checking will be done to ensure that both properties are to be serialized in the same manner, ie. both to XML element or both to  XML attribute.
 * @param obj Object to compare to this SDOProperty instance
 * @return true if obj is equal to this SDOProperty instance, false if not 
 */
public boolean equals(Object obj){
  if (obj == null) {
    return false;
  }
  SDOProperty prop;
  try {
    prop=(SDOProperty)obj;
  }
 catch (  ClassCastException ccx) {
    return false;
  }
  if (prop.getType() == null) {
    if (this.getType() != null) {
      return false;
    }
  }
 else   if (this.getType() == null || !this.getType().equals(prop.getType())) {
    return false;
  }
  if (prop.getName() == null) {
    if (this.getName() != null) {
      return false;
    }
  }
 else   if (this.getName() == null || !this.getName().equals(prop.getName())) {
    return false;
  }
  if (prop.getUri() == null) {
    if (this.getUri() != null) {
      return false;
    }
  }
 else   if (this.getUri() == null || !this.getUri().equals(prop.getUri())) {
    return false;
  }
  XSDHelper helper=aHelperContext.getXSDHelper();
  if (helper.isAttribute(this)) {
    if (helper.isElement(prop)) {
      return false;
    }
  }
 else   if (helper.isAttribute(prop)) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Indicate if a given SDOProperty instance is equal to this instance. Equality is determined based on name, uri, and type.  In addition, checking will be done to ensure that both properties are to be serialized in the same manner, ie. both to XML element or both to  XML attribute.
 * @param obj Object to compare to this SDOProperty instance
 * @return true if obj is equal to this SDOProperty instance, false if not 
 */
public boolean equals(Object obj){
  if (obj == null) {
    return false;
  }
  SDOProperty prop;
  try {
    prop=(SDOProperty)obj;
  }
 catch (  ClassCastException ccx) {
    return false;
  }
  if (prop.getType() == null) {
    if (this.getType() != null) {
      return false;
    }
  }
 else   if (this.getType() == null || !this.getType().equals(prop.getType())) {
    return false;
  }
  if (prop.getName() == null) {
    if (this.getName() != null) {
      return false;
    }
  }
 else   if (this.getName() == null || !this.getName().equals(prop.getName())) {
    return false;
  }
  if (prop.getUri() == null) {
    if (this.getUri() != null) {
      return false;
    }
  }
 else   if (this.getUri() == null || !this.getUri().equals(prop.getUri())) {
    return false;
  }
  Boolean propIsElement=prop.isElement();
  if (null == isElement) {
    if (null != propIsElement) {
      return false;
    }
  }
 else {
    if (!isElement.equals(propIsElement)) {
      return false;
    }
  }
  return true;
}
Program: 65980
Project: 65980
Buggy source:
/** 
 * INTERNAL: Remove the open content property (property) from all 3 data structures. Add the property to the unset map. We restore this OC property in undoChanges
 * @param property
 */
public void removeOpenContentProperty(Property property){
  if (isLogging()) {
    getChangeSummary().setUnsetOCProperty(this,property);
  }
  _getOpenContentProperties().remove(property);
  _getOpenContentPropertiesAttributes().remove(property);
  getInstanceProperties().remove(property);
  for (int i=0, size=((SDOProperty)property).getAliasNames().size(); i < size; i++) {
    _getOpenContentAliasNamesMap().remove(((SDOProperty)property).getAliasNames().get(i));
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: Remove the open content property (property) from all 3 data structures. Add the property to the unset map. We restore this OC property in undoChanges
 * @param property
 */
public void removeOpenContentProperty(Property property){
  if (isLogging()) {
    getChangeSummary().setUnsetOCProperty(this,property);
  }
  _getOpenContentProperties().remove(property);
  _getOpenContentPropertiesAttributes().remove(property);
  getInstanceProperties().remove(property);
  if (((SDOProperty)property).hasAliasNames()) {
    for (int i=0, size=((SDOProperty)property).getAliasNames().size(); i < size; i++) {
      _getOpenContentAliasNamesMap().remove(((SDOProperty)property).getAliasNames().get(i));
    }
  }
}
Program: 65981
Project: 65981
Buggy source:
/** 
 * INTERNAL: Add the open content property into all 3 data structures. Remove the property from the unset map.
 * @param property
 */
public void addOpenContentProperty(Property property){
  List theList=null;
  if (aHelperContext.getXSDHelper().isAttribute(property)) {
    theList=_getOpenContentPropertiesAttributes();
  }
 else {
    theList=_getOpenContentProperties();
  }
  if (!theList.contains(property)) {
    if (isLogging()) {
      getChangeSummary().removeUnsetOCProperty(this,property);
    }
    theList.add(property);
    getInstanceProperties().add(property);
    for (int i=0, size=((SDOProperty)property).getAliasNames().size(); i < size; i++) {
      _getOpenContentAliasNamesMap().put((String)((SDOProperty)property).getAliasNames().get(i),property);
    }
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: Add the open content property into all 3 data structures. Remove the property from the unset map.
 * @param property
 */
public void addOpenContentProperty(Property property){
  List theList=null;
  if (aHelperContext.getXSDHelper().isAttribute(property)) {
    theList=_getOpenContentPropertiesAttributes();
  }
 else {
    theList=_getOpenContentProperties();
  }
  if (!theList.contains(property)) {
    if (isLogging()) {
      getChangeSummary().removeUnsetOCProperty(this,property);
    }
    theList.add(property);
    getInstanceProperties().add(property);
    if (((SDOProperty)property).hasAliasNames()) {
      for (int i=0, size=((SDOProperty)property).getAliasNames().size(); i < size; i++) {
        _getOpenContentAliasNamesMap().put((String)((SDOProperty)property).getAliasNames().get(i),property);
      }
    }
  }
}
Program: 65982
Project: 65982
Buggy source:
/** 
 * INTERNAL:
 * @param property
 */
public void addDeclaredProperty(SDOProperty property,int index){
  if (!getDeclaredPropertiesMap().containsKey(property.getName())) {
    int currentSize=getDeclaredProperties().size();
    int allSize=getProperties().size();
    int insertPlace=allSize - currentSize + index;
    for (int i=0; i < getSubTypes().size(); i++) {
      SDOType nextSubType=(SDOType)getSubTypes().get(i);
      nextSubType.updateIndices(insertPlace,property);
    }
    getDeclaredProperties().add(index,property);
    getProperties().add(insertPlace,property);
    property.setContainingType(this);
    getDeclaredPropertiesMap().put(property.getName(),property);
    for (int j=0; j < property.getAliasNames().size(); j++) {
      getDeclaredPropertiesMap().put(property.getAliasNames().get(j),property);
    }
    if ((property.getType() != null) && (property.getType().isChangeSummaryType())) {
      changeSummaryProperty=property;
    }
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL:
 * @param property
 */
public void addDeclaredProperty(SDOProperty property,int index){
  if (!getDeclaredPropertiesMap().containsKey(property.getName())) {
    int currentSize=getDeclaredProperties().size();
    int allSize=getProperties().size();
    int insertPlace=allSize - currentSize + index;
    for (int i=0; i < getSubTypes().size(); i++) {
      SDOType nextSubType=(SDOType)getSubTypes().get(i);
      nextSubType.updateIndices(insertPlace,property);
    }
    getDeclaredProperties().add(index,property);
    getProperties().add(insertPlace,property);
    property.setContainingType(this);
    getDeclaredPropertiesMap().put(property.getName(),property);
    if (property.hasAliasNames()) {
      for (int j=0; j < property.getAliasNames().size(); j++) {
        getDeclaredPropertiesMap().put(property.getAliasNames().get(j),property);
      }
    }
    if ((property.getType() != null) && (property.getType().isChangeSummaryType())) {
      changeSummaryProperty=property;
    }
  }
}
Program: 65990
Project: 65990
Buggy source:
/** 
 * Return an XMLGregorianCalander created with a given date string
 * @param dateString
 * @return
 */
public XMLGregorianCalendar convertStringToXMLGregorianCalendar(String sourceString){
  XMLGregorianCalendar calToReturn=null;
  try {
    calToReturn=getDatatypeFactory().newXMLGregorianCalendar(sourceString);
  }
 catch (  IllegalArgumentException e1) {
    try {
      calToReturn=getDatatypeFactory().newXMLGregorianCalendar(sourceString + "String_Node_Str");
    }
 catch (    IllegalArgumentException e2) {
      throw e1;
    }
  }
  return calToReturn;
}

Fixed version (ground truth):
/** 
 * Return an XMLGregorianCalander created with a given date string
 * @param dateString
 * @return
 */
public XMLGregorianCalendar convertStringToXMLGregorianCalendar(String sourceString){
  XMLGregorianCalendar calToReturn=null;
  try {
    calToReturn=getDatatypeFactory().newXMLGregorianCalendar(sourceString);
  }
 catch (  IllegalArgumentException e1) {
    try {
      int length=sourceString.length();
      String retryString=null;
      if (length >= 6 && (sourceString.charAt(4) == '-') && (sourceString.charAt(5) == '-')) {
        retryString=new StringBuilder(sourceString.substring(0,4)).append(length > 6 ? sourceString.substring(6) : "String_Node_Str").toString();
      }
 else       if (length >= 4) {
        retryString=new StringBuilder(sourceString.substring(0,4)).append("String_Node_Str").append(length > 4 ? sourceString.substring(4) : "String_Node_Str").toString();
      }
      if (retryString != null) {
        calToReturn=getDatatypeFactory().newXMLGregorianCalendar(retryString);
      }
 else {
        throw e1;
      }
    }
 catch (    IllegalArgumentException e2) {
      throw e1;
    }
  }
  return calToReturn;
}
Program: 65991
Project: 65991
Buggy source:
public XMLConversionManager getXmlConversionManager(){
  return (XMLConversionManager)getXmlContext().getSession(0).getDatasourceLogin().getDatasourcePlatform().getConversionManager();
}

Fixed version (ground truth):
public XMLConversionManager getXmlConversionManager(){
  XMLConversionManager xcm=(XMLConversionManager)getXmlContext().getSession(0).getDatasourceLogin().getDatasourcePlatform().getConversionManager();
  xcm.setTrimGMonth(true);
  return xcm;
}
Program: 65992
Project: 65992
Buggy source:
protected java.sql.Date convertObjectToSQLDate(Object sourceObject,QName schemaTypeQName){
  if (sourceObject instanceof String) {
    Date date=convertStringToDate((String)sourceObject,schemaTypeQName);
    return new java.sql.Date((date.getTime() / 1000) * 1000);
  }
  return super.convertObjectToDate(sourceObject);
}

Fixed version (ground truth):
protected java.sql.Date convertObjectToSQLDate(Object sourceObject,QName schemaTypeQName){
  if (sourceObject instanceof String) {
    Date date=convertStringToDate((String)sourceObject,schemaTypeQName);
    return new java.sql.Date((date.getTime() / 1000) * 1000);
  }
  return convertObjectToDate(sourceObject);
}
Program: 65993
Project: 65993
Buggy source:
/** 
 * This is the preferred (and only) constructor.
 * @param name
 */
public MultipleMappingPerFieldTestCases(String name){
  super(name);
}

Fixed version (ground truth):
/** 
 * This is the preferred (and only) constructor.
 * @param name
 */
public MultipleMappingPerFieldTestCases(String name){
  super(name);
  calendar=new GregorianCalendar(YEAR,MONTH,DAY);
  calendar.clear(Calendar.ZONE_OFFSET);
}
Program: 65994
Project: 65994
Buggy source:
/** 
 * Create the control Object.
 */
private CustomQuoteRequest getControlObject(){
  CustomQuoteRequest ctrlObj=new CustomQuoteRequest();
  ctrlObj.requestId="String_Node_Str";
  ctrlObj.currencyPairCode="String_Node_Str";
  ctrlObj.date=CALENDAR;
  return ctrlObj;
}

Fixed version (ground truth):
/** 
 * Create the control Object.
 */
private CustomQuoteRequest getControlObject(){
  CustomQuoteRequest ctrlObj=new CustomQuoteRequest();
  ctrlObj.requestId="String_Node_Str";
  ctrlObj.currencyPairCode="String_Node_Str";
  ctrlObj.date=calendar;
  return ctrlObj;
}
Program: 65995
Project: 65995
Buggy source:
private String stringFromCalendar(Calendar sourceCalendar){
  if (!(sourceCalendar.isSet(Calendar.HOUR) || sourceCalendar.isSet(Calendar.MINUTE) || sourceCalendar.isSet(Calendar.SECOND)|| sourceCalendar.isSet(Calendar.MILLISECOND))) {
    return stringFromCalendar(sourceCalendar,XMLConstants.DATE_QNAME);
  }
 else   if (!(sourceCalendar.isSet(Calendar.YEAR) || sourceCalendar.isSet(Calendar.MONTH) || sourceCalendar.isSet(Calendar.DATE))) {
    return stringFromCalendar(sourceCalendar,XMLConstants.TIME_QNAME);
  }
 else {
    return stringFromDate(sourceCalendar.getTime());
  }
}

Fixed version (ground truth):
private String stringFromCalendar(Calendar sourceCalendar){
  if (!(sourceCalendar.isSet(Calendar.HOUR) || sourceCalendar.isSet(Calendar.MINUTE) || sourceCalendar.isSet(Calendar.SECOND)|| sourceCalendar.isSet(Calendar.MILLISECOND))) {
    return stringFromCalendar(sourceCalendar,XMLConstants.DATE_QNAME);
  }
 else   if (!(sourceCalendar.isSet(Calendar.YEAR) || sourceCalendar.isSet(Calendar.MONTH) || sourceCalendar.isSet(Calendar.DATE))) {
    return stringFromCalendar(sourceCalendar,XMLConstants.TIME_QNAME);
  }
 else {
    return stringFromCalendar(sourceCalendar,XMLConstants.DATE_TIME_QNAME);
  }
}
Program: 65996
Project: 65996
Buggy source:
private Calendar toCalendar(XMLGregorianCalendar xgc){
  TimeZone tz=null;
  if (xgc.getTimezone() == DatatypeConstants.FIELD_UNDEFINED) {
    tz=getTimeZone();
  }
 else {
    tz=xgc.getTimeZone(xgc.getTimezone());
  }
  Calendar cal=Calendar.getInstance(tz,Locale.getDefault());
  cal.clear();
  BigInteger year=xgc.getEonAndYear();
  if (year != null) {
    cal.set(Calendar.ERA,year.signum() < 0 ? GregorianCalendar.BC : GregorianCalendar.AD);
    cal.set(Calendar.YEAR,year.abs().intValue());
  }
  if (xgc.getDay() != DatatypeConstants.FIELD_UNDEFINED)   cal.set(Calendar.DAY_OF_MONTH,xgc.getDay());
  if (xgc.getMonth() != DatatypeConstants.FIELD_UNDEFINED)   cal.set(Calendar.MONTH,xgc.getMonth() - 1);
  if (xgc.getHour() != DatatypeConstants.FIELD_UNDEFINED)   cal.set(Calendar.HOUR_OF_DAY,xgc.getHour());
  if (xgc.getMinute() != DatatypeConstants.FIELD_UNDEFINED)   cal.set(Calendar.MINUTE,xgc.getMinute());
  if (xgc.getSecond() != DatatypeConstants.FIELD_UNDEFINED)   cal.set(Calendar.SECOND,xgc.getSecond());
  if (xgc.getFractionalSecond() != null)   cal.set(Calendar.MILLISECOND,xgc.getMillisecond());
  return cal;
}

Fixed version (ground truth):
private Calendar toCalendar(XMLGregorianCalendar xgc){
  TimeZone tz=null;
  if (xgc.getTimezone() == DatatypeConstants.FIELD_UNDEFINED) {
    tz=getTimeZone();
  }
 else {
    tz=xgc.getTimeZone(xgc.getTimezone());
  }
  Calendar cal=Calendar.getInstance(tz,Locale.getDefault());
  cal.clear();
  if (xgc.getTimezone() != DatatypeConstants.FIELD_UNDEFINED) {
    cal.set(Calendar.ZONE_OFFSET,xgc.getTimezone() * 60000);
  }
  BigInteger year=xgc.getEonAndYear();
  if (year != null) {
    cal.set(Calendar.ERA,year.signum() < 0 ? GregorianCalendar.BC : GregorianCalendar.AD);
    cal.set(Calendar.YEAR,year.abs().intValue());
  }
  if (xgc.getDay() != DatatypeConstants.FIELD_UNDEFINED)   cal.set(Calendar.DAY_OF_MONTH,xgc.getDay());
  if (xgc.getMonth() != DatatypeConstants.FIELD_UNDEFINED)   cal.set(Calendar.MONTH,xgc.getMonth() - 1);
  if (xgc.getHour() != DatatypeConstants.FIELD_UNDEFINED)   cal.set(Calendar.HOUR_OF_DAY,xgc.getHour());
  if (xgc.getMinute() != DatatypeConstants.FIELD_UNDEFINED)   cal.set(Calendar.MINUTE,xgc.getMinute());
  if (xgc.getSecond() != DatatypeConstants.FIELD_UNDEFINED)   cal.set(Calendar.SECOND,xgc.getSecond());
  if (xgc.getFractionalSecond() != null)   cal.set(Calendar.MILLISECOND,xgc.getMillisecond());
  return cal;
}
Program: 65997
Project: 65997
Buggy source:
public void testCalendarToString_default_dateTime_1ms(){
  Calendar calendar=Calendar.getInstance();
  calendar.clear();
  calendar.setTimeInMillis(CONTROL_DATE_TIME_1MS);
  String control="String_Node_Str";
  String test=(String)xcm.convertObject(calendar,String.class);
  this.assertEquals(control,test);
}

Fixed version (ground truth):
public void testCalendarToString_default_dateTime_1ms(){
  Calendar calendar=Calendar.getInstance();
  calendar.clear();
  calendar.setTimeInMillis(CONTROL_DATE_TIME_1MS);
  calendar.clear(Calendar.ZONE_OFFSET);
  String control="String_Node_Str";
  String test=(String)xcm.convertObject(calendar,String.class);
  this.assertEquals(control,test);
}
Program: 65998
Project: 65998
Buggy source:
public void testCalendarToString_default_dateTime_10ms(){
  Calendar calendar=Calendar.getInstance();
  calendar.clear();
  calendar.setTimeInMillis(CONTROL_DATE_TIME_10MS);
  String control="String_Node_Str";
  String test=(String)xcm.convertObject(calendar,String.class);
  this.assertEquals(control,test);
}

Fixed version (ground truth):
public void testCalendarToString_default_dateTime_10ms(){
  Calendar calendar=Calendar.getInstance();
  calendar.clear();
  calendar.setTimeInMillis(CONTROL_DATE_TIME_10MS);
  calendar.clear(Calendar.ZONE_OFFSET);
  String control="String_Node_Str";
  String test=(String)xcm.convertObject(calendar,String.class);
  this.assertEquals(control,test);
}
Program: 65999
Project: 65999
Buggy source:
public void testCalendarToString_default_dateTime_0ms(){
  Calendar calendar=Calendar.getInstance();
  calendar.clear();
  calendar.setTimeInMillis(CONTROL_DATE_TIME_0MS);
  String control="String_Node_Str";
  String test=(String)xcm.convertObject(calendar,String.class);
  this.assertEquals(control,test);
}

Fixed version (ground truth):
public void testCalendarToString_default_dateTime_0ms(){
  Calendar calendar=Calendar.getInstance();
  calendar.clear();
  calendar.setTimeInMillis(CONTROL_DATE_TIME_0MS);
  calendar.clear(Calendar.ZONE_OFFSET);
  String control="String_Node_Str";
  String test=(String)xcm.convertObject(calendar,String.class);
  this.assertEquals(control,test);
}
Program: 66000
Project: 66000
Buggy source:
public void testCalendarToString_default_dateTime_100ms(){
  Calendar calendar=Calendar.getInstance();
  calendar.clear();
  calendar.setTimeInMillis(CONTROL_DATE_TIME_100MS);
  String control="String_Node_Str";
  String test=(String)xcm.convertObject(calendar,String.class);
  this.assertEquals(control,test);
}

Fixed version (ground truth):
public void testCalendarToString_default_dateTime_100ms(){
  Calendar calendar=Calendar.getInstance();
  calendar.clear();
  calendar.setTimeInMillis(CONTROL_DATE_TIME_100MS);
  calendar.clear(Calendar.ZONE_OFFSET);
  String control="String_Node_Str";
  String test=(String)xcm.convertObject(calendar,String.class);
  this.assertEquals(control,test);
}
Program: 66001
Project: 66001
Buggy source:
/** 
 * Convert from a Calendar to a String representation of the YearMonth type.
 * @param calendar the calendar to convert
 * @return a Calendar to a String representation of the YearMonth type.
 */
public String toYearMonth(Calendar calendar){
  if (calendar == null) {
    return null;
  }
  return getXMLConversionManager().stringFromCalendar(calendar,XMLConstants.G_YEAR_MONTH_QNAME);
}

Fixed version (ground truth):
/** 
 * Convert from a Calendar to a String representation of the YearMonth type.
 * @param calendar the calendar to convert
 * @return a Calendar to a String representation of the YearMonth type.
 */
public String toYearMonth(Calendar calendar){
  if (calendar == null) {
    return null;
  }
  boolean wasTimezoneQualified=getXMLConversionManager().isTimeZoneQualified();
  getXMLConversionManager().setTimeZoneQualified(false);
  String s=getXMLConversionManager().stringFromCalendar(calendar,XMLConstants.G_YEAR_MONTH_QNAME);
  getXMLConversionManager().setTimeZoneQualified(wasTimezoneQualified);
  return s;
}
Program: 66002
Project: 66002
Buggy source:
/** 
 * Convert from a Calendar to a String representation of the YearMonthDay type.
 * @param calendar the calendar to convert
 * @return a Calendar to a String representation of the YearMonthDay type.
 */
public String toYearMonthDay(Calendar calendar){
  if (calendar == null) {
    return null;
  }
  return getXMLConversionManager().stringFromCalendar(calendar,XMLConstants.DATE_QNAME);
}

Fixed version (ground truth):
/** 
 * Convert from a Calendar to a String representation of the YearMonthDay type.
 * @param calendar the calendar to convert
 * @return a Calendar to a String representation of the YearMonthDay type.
 */
public String toYearMonthDay(Calendar calendar){
  if (calendar == null) {
    return null;
  }
  boolean wasTimezoneQualified=getXMLConversionManager().isTimeZoneQualified();
  getXMLConversionManager().setTimeZoneQualified(false);
  String s=getXMLConversionManager().stringFromCalendar(calendar,XMLConstants.DATE_QNAME);
  getXMLConversionManager().setTimeZoneQualified(wasTimezoneQualified);
  return s;
}
Program: 66003
Project: 66003
Buggy source:
@Override protected java.sql.Date convertObjectToDate(Object sourceObject) throws ConversionException {
  Object o=sourceObject;
  if (sourceObject instanceof Calendar) {
    o=((Calendar)sourceObject).clone();
  }
  return super.convertObjectToDate(o);
}

Fixed version (ground truth):
protected java.sql.Date convertObjectToDate(Object sourceObject) throws ConversionException {
  Object o=sourceObject;
  if (sourceObject instanceof Calendar) {
    o=((Calendar)sourceObject).clone();
  }
  return super.convertObjectToDate(o);
}
Program: 66006
Project: 66006
Buggy source:
public void testDetachRemovedObject(){
  Employee emp=new Employee();
  emp.setFirstName("String_Node_Str");
  emp.setId(71);
  EntityManager em=createEntityManager();
  try {
    beginTransaction(em);
    em.persist(emp);
    commitTransaction(em);
  }
 catch (  RuntimeException re) {
    if (isTransactionActive(em)) {
      rollbackTransaction(em);
    }
    throw re;
  }
  beginTransaction(em);
  em.remove(em.find(Employee.class,emp.getId()));
  commitTransaction(em);
  beginTransaction(em);
  EntityManagerImpl em1=(EntityManagerImpl)em.getDelegate();
  try {
    em.detach(emp);
    UnitOfWork uow=em1.getUnitOfWork();
    UnitOfWorkImpl uowImpl=(UnitOfWorkImpl)uow;
    boolean afterClear=uowImpl.getDeletedObjects().containsKey(emp);
    assertFalse("String_Node_Str",afterClear);
  }
 catch (  IllegalArgumentException iae) {
    return;
  }
 finally {
    if (isTransactionActive(em)) {
      rollbackTransaction(em);
    }
    closeEntityManager(em);
  }
}

Fixed version (ground truth):
public void testDetachRemovedObject(){
  Employee emp=new Employee();
  emp.setFirstName("String_Node_Str");
  EntityManager em=createEntityManager();
  try {
    beginTransaction(em);
    em.persist(emp);
    commitTransaction(em);
  }
 catch (  RuntimeException re) {
    if (isTransactionActive(em)) {
      rollbackTransaction(em);
    }
    throw re;
  }
  beginTransaction(em);
  em.remove(em.find(Employee.class,emp.getId()));
  commitTransaction(em);
  beginTransaction(em);
  EntityManagerImpl em1=(EntityManagerImpl)em.getDelegate();
  try {
    em.detach(emp);
    UnitOfWork uow=em1.getUnitOfWork();
    UnitOfWorkImpl uowImpl=(UnitOfWorkImpl)uow;
    boolean afterClear=uowImpl.getDeletedObjects().containsKey(emp);
    assertFalse("String_Node_Str",afterClear);
  }
 catch (  IllegalArgumentException iae) {
    return;
  }
 finally {
    if (isTransactionActive(em)) {
      rollbackTransaction(em);
    }
    closeEntityManager(em);
  }
}
Program: 66010
Project: 66010
Buggy source:
/** 
 * Process @XmlElement annotation on a given property.
 * @param property
 */
private void processXmlElement(Property property,TypeInfo info){
  if (helper.isAnnotationPresent(property.getElement(),XmlElement.class)) {
    XmlElement element=(XmlElement)helper.getAnnotation(property.getElement(),XmlElement.class);
    property.setIsRequired(element.required());
    property.setNillable(element.nillable());
    if (element.type() != XmlElement.DEFAULT.class) {
      property.setOriginalType(property.getType());
      if (isCollectionType(property.getType())) {
        property.setGenericType(helper.getJavaClass(element.type()));
      }
 else {
        property.setType(helper.getJavaClass(element.type()));
      }
      property.setHasXmlElementType(true);
    }
    if (!element.defaultValue().equals(ELEMENT_DECL_DEFAULT)) {
      property.setDefaultValue(element.defaultValue());
    }
    validateElementIsInPropOrder(info,property.getPropertyName());
  }
}

Fixed version (ground truth):
/** 
 * Process @XmlElement annotation on a given property.
 * @param property
 */
private void processXmlElement(Property property,TypeInfo info){
  if (helper.isAnnotationPresent(property.getElement(),XmlElement.class)) {
    XmlElement element=(XmlElement)helper.getAnnotation(property.getElement(),XmlElement.class);
    property.setIsRequired(element.required());
    property.setNillable(element.nillable());
    if (element.type() != XmlElement.DEFAULT.class && !(property.isSwaAttachmentRef())) {
      property.setOriginalType(property.getType());
      if (isCollectionType(property.getType())) {
        property.setGenericType(helper.getJavaClass(element.type()));
      }
 else {
        property.setType(helper.getJavaClass(element.type()));
      }
      property.setHasXmlElementType(true);
    }
    if (!element.defaultValue().equals(ELEMENT_DECL_DEFAULT)) {
      property.setDefaultValue(element.defaultValue());
    }
    validateElementIsInPropOrder(info,property.getPropertyName());
  }
}
Program: 66012
Project: 66012
Buggy source:
public AnnotationsProcessor(Helper helper){
  this.helper=helper;
  isDefaultNamespaceAllowed=true;
}

Fixed version (ground truth):
public AnnotationsProcessor(Helper helper){
  this.helper=helper;
  isDefaultNamespaceAllowed=true;
  hasSwaRef=false;
}
Program: 66018
Project: 66018
Buggy source:
/** 
 * Convert from a Date to a String representation of the Month type.
 * @param date the date
 * @return a Date to a String representation of the Month type.
 */
public String toMonth(Date date){
  if (date == null) {
    return null;
  }
  return getXMLConversionManager().stringFromDate(date,XMLConstants.G_MONTH_QNAME);
}

Fixed version (ground truth):
/** 
 * Convert from a Date to a String representation of the Month type.
 * @param date the date
 * @return a Date to a String representation of the Month type.
 */
public String toMonth(Date date){
  if (date == null) {
    return null;
  }
  boolean wasTimezoneQualified=getXMLConversionManager().isTimeZoneQualified();
  getXMLConversionManager().setTimeZoneQualified(false);
  String s=getXMLConversionManager().stringFromDate(date,XMLConstants.G_MONTH_QNAME);
  getXMLConversionManager().setTimeZoneQualified(wasTimezoneQualified);
  return s;
}
Program: 66020
Project: 66020
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)) {
      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;
}

Fixed version (ground truth):
public ArrayList getNoAccessTypePropertiesForClass(JavaClass cls,TypeInfo info){
  ArrayList<Property> list=new ArrayList<Property>();
  if (cls == null) {
    return list;
  }
  List<Property> fieldProperties=getFieldPropertiesForClass(cls,info,false);
  Map<String,Property> fields=new HashMap<String,Property>(fieldProperties.size());
  for (  Property next : fieldProperties) {
    JavaHasAnnotations elem=next.getElement();
    if (!hasJAXBAnnotations(elem)) {
      next.setTransient(true);
    }
    list.add(next);
    fields.put(next.getPropertyName(),next);
  }
  List<Property> methodProperties=getPropertyPropertiesForClass(cls,info,false);
  for (  Property next : methodProperties) {
    JavaHasAnnotations elem=next.getElement();
    if (hasJAXBAnnotations(elem)) {
      Property fieldProperty=fields.get(next.getPropertyName());
      list.remove(fieldProperty);
      list.add(next);
    }
 else {
      next.setTransient(true);
      if (fields.get(next.getPropertyName()) == null) {
        list.add(next);
      }
    }
  }
  return list;
}
Program: 66021
Project: 66021
Buggy source:
private XMLRoot wrapObjectInXMLRoot(JAXBElement wrapperElement,Object value){
  XMLRoot xmlroot=new XMLRoot();
  Object objectValue=value;
  xmlroot.setObject(objectValue);
  QName qname=wrapperElement.getName();
  xmlroot.setLocalName(qname.getLocalPart());
  xmlroot.setNamespaceURI(qname.getNamespaceURI());
  xmlroot.setDeclaredType(wrapperElement.getDeclaredType());
  return xmlroot;
}

Fixed version (ground truth):
private XMLRoot wrapObjectInXMLRoot(JAXBElement wrapperElement,Object value){
  XMLRoot xmlroot=new XMLRoot();
  Object objectValue=value;
  xmlroot.setObject(objectValue);
  QName qname=wrapperElement.getName();
  xmlroot.setLocalName(qname.getLocalPart());
  xmlroot.setNamespaceURI(qname.getNamespaceURI());
  xmlroot.setDeclaredType(wrapperElement.getDeclaredType());
  if (value.getClass() == ClassConstants.ABYTE || value.getClass() == ClassConstants.APBYTE || value.getClass().getCanonicalName().equals("String_Node_Str")) {
    xmlroot.setSchemaType(XMLConstants.BASE_64_BINARY_QNAME);
  }
  return xmlroot;
}
Program: 66022
Project: 66022
Buggy source:
protected String getStringForQName(QName qName,MarshalRecord marshalRecord){
  if (null == qName) {
    return null;
  }
  String namespaceURI=qName.getNamespaceURI();
  if (null == namespaceURI || 0 == namespaceURI.length()) {
    return qName.getLocalPart();
  }
 else {
    NamespaceResolver namespaceResolver=marshalRecord.getNamespaceResolver();
    if (namespaceResolver == null) {
      throw XMLMarshalException.namespaceResolverNotSpecified(namespaceURI);
    }
    if (namespaceURI.equals(namespaceResolver.getDefaultNamespaceURI())) {
      return qName.getLocalPart();
    }
    String prefix=namespaceResolver.resolveNamespaceURI(namespaceURI);
    if (null == prefix) {
      prefix=namespaceResolver.generatePrefix();
      marshalRecord.attribute(XMLConstants.XMLNS_URL,prefix,XMLConstants.XMLNS + XMLConstants.COLON + prefix,namespaceURI);
    }
    return prefix + XMLConstants.COLON + qName.getLocalPart();
  }
}

Fixed version (ground truth):
protected String getStringForQName(QName qName,MarshalRecord marshalRecord){
  if (null == qName) {
    return null;
  }
  String namespaceURI=qName.getNamespaceURI();
  if (null == namespaceURI || 0 == namespaceURI.length()) {
    if (marshalRecord.getNamespaceResolver() != null && marshalRecord.getNamespaceResolver().getDefaultNamespaceURI() != null) {
      marshalRecord.attribute(XMLConstants.XMLNS_URL,XMLConstants.XMLNS,XMLConstants.XMLNS,namespaceURI);
    }
    return qName.getLocalPart();
  }
 else {
    NamespaceResolver namespaceResolver=marshalRecord.getNamespaceResolver();
    if (namespaceResolver == null) {
      throw XMLMarshalException.namespaceResolverNotSpecified(namespaceURI);
    }
    if (namespaceURI.equals(namespaceResolver.getDefaultNamespaceURI())) {
      return qName.getLocalPart();
    }
    String prefix=namespaceResolver.resolveNamespaceURI(namespaceURI);
    if (null == prefix) {
      prefix=namespaceResolver.generatePrefix();
      marshalRecord.attribute(XMLConstants.XMLNS_URL,prefix,XMLConstants.XMLNS + XMLConstants.COLON + prefix,namespaceURI);
    }
    return prefix + XMLConstants.COLON + qName.getLocalPart();
  }
}
Program: 66025
Project: 66025
Buggy source:
public SDODataObjectType(SDOTypeHelper sdoTypeHelper){
  super(SDOConstants.SDO_URL,SDOConstants.DATAOBJECT,sdoTypeHelper);
  setInstanceClass(DataObject.class);
  setAbstract(true);
}

Fixed version (ground truth):
public SDODataObjectType(SDOTypeHelper sdoTypeHelper){
  super(SDOConstants.SDO_URL,SDOConstants.DATAOBJECT,sdoTypeHelper);
  setInstanceClass(DataObject.class);
  javaImplClass=DataObject.class;
  xmlDescriptor.setJavaClass(javaImplClass);
  setAbstract(true);
}
Program: 66026
Project: 66026
Buggy source:
public SDOOpenSequencedType(SDOTypeHelper sdoTypeHelper){
  super(SDOConstants.ORACLE_SDO_URL,"String_Node_Str",sdoTypeHelper);
  this.xmlDescriptor.setNamespaceResolver(new NamespaceResolver());
  this.xmlDescriptor.setInstantiationPolicy(new TypeInstantiationPolicy(this));
  setInstanceClass(OpenSequencedType.class);
  setImplClassName(ORACLE_SDO_DO_URL + "String_Node_Str");
  Class implClass=getImplClass();
  xmlDescriptor.setJavaClass(implClass);
  setMixed(true);
  setSequenced(true);
  setOpen(true);
  setFinalized(true);
}

Fixed version (ground truth):
public SDOOpenSequencedType(SDOTypeHelper sdoTypeHelper){
  super(SDOConstants.ORACLE_SDO_URL,"String_Node_Str",sdoTypeHelper);
  this.xmlDescriptor.setNamespaceResolver(new NamespaceResolver());
  this.xmlDescriptor.setInstantiationPolicy(new TypeInstantiationPolicy(this));
  setInstanceClass(OpenSequencedType.class);
  javaImplClass=OpenSequencedTypeImpl.class;
  xmlDescriptor.setJavaClass(javaImplClass);
  setMixed(true);
  setSequenced(true);
  setOpen(true);
  setFinalized(true);
}
Program: 66029
Project: 66029
Buggy source:
/** 
 * Build up a Type with given name and uri
 * @param uri           the URI of this type
 * @param type_name     the unique of this Type
 * @param aContext      the current HelperContext
 */
public SDOType(String uri,String name,SDOTypeHelper sdoTypeHelper){
  this(sdoTypeHelper);
  this.qName=new QName(uri,name);
}

Fixed version (ground truth):
protected SDOType(String uri,String name,SDOTypeHelper sdoTypeHelper,XMLDescriptor xmlDescriptor){
  this(sdoTypeHelper,xmlDescriptor);
  this.qName=new QName(uri,name);
}
Program: 66031
Project: 66031
Buggy source:
void processPropertyTypes(JavaClass[] classes){
  for (  JavaClass next : classes) {
    TypeInfo info=getTypeInfo().get(next.getQualifiedName());
    if (info != null) {
      for (      Property property : info.getPropertyList()) {
        JavaClass type=property.getActualType();
        if (!(this.typeInfo.containsKey(type.getQualifiedName())) && shouldGenerateTypeInfo(type)) {
          CompilerHelper.addClassToClassLoader(type,helper.getClassLoader());
          JavaClass[] jClassArray=new JavaClass[]{type};
          buildNewTypeInfo(jClassArray);
        }
        if (property.isChoice()) {
          processChoiceProperty(property,info,next,type);
          for (          Property choiceProp : property.getChoiceProperties()) {
            type=choiceProp.getActualType();
            if (!(this.typeInfo.containsKey(type.getQualifiedName())) && shouldGenerateTypeInfo(type)) {
              CompilerHelper.addClassToClassLoader(type,helper.getClassLoader());
              JavaClass[] jClassArray=new JavaClass[]{type};
              buildNewTypeInfo(jClassArray);
            }
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
void processPropertyTypes(JavaClass[] classes){
  for (  JavaClass next : classes) {
    TypeInfo info=getTypeInfo().get(next.getQualifiedName());
    if (info != null) {
      for (      Property property : info.getPropertyList()) {
        if (property.isTransient()) {
          continue;
        }
        JavaClass type=property.getActualType();
        if (!(this.typeInfo.containsKey(type.getQualifiedName())) && shouldGenerateTypeInfo(type)) {
          CompilerHelper.addClassToClassLoader(type,helper.getClassLoader());
          JavaClass[] jClassArray=new JavaClass[]{type};
          buildNewTypeInfo(jClassArray);
        }
        if (property.isChoice()) {
          processChoiceProperty(property,info,next,type);
          for (          Property choiceProp : property.getChoiceProperties()) {
            type=choiceProp.getActualType();
            if (!(this.typeInfo.containsKey(type.getQualifiedName())) && shouldGenerateTypeInfo(type)) {
              CompilerHelper.addClassToClassLoader(type,helper.getClassLoader());
              JavaClass[] jClassArray=new JavaClass[]{type};
              buildNewTypeInfo(jClassArray);
            }
          }
        }
      }
    }
  }
}
Program: 66033
Project: 66033
Buggy source:
/** 
 * INTERNAL: Private function to process or create an entry in the NamespaceResolver for the xsi prefix.
 * @param namespaceResolver
 * @return xsi prefix
 */
protected String processNamespaceResolverForXSIPrefix(NamespaceResolver namespaceResolver){
  String xsiPrefix;
  if (null == namespaceResolver) {
    xsiPrefix=XMLConstants.SCHEMA_INSTANCE_PREFIX;
    namespaceResolver=new NamespaceResolver();
    namespaceResolver.put(xsiPrefix,XMLConstants.SCHEMA_INSTANCE_URL);
  }
 else {
    xsiPrefix=namespaceResolver.resolveNamespaceURI(XMLConstants.SCHEMA_INSTANCE_URL);
    if (null == xsiPrefix) {
      xsiPrefix=namespaceResolver.generatePrefix();
    }
  }
  return xsiPrefix;
}

Fixed version (ground truth):
/** 
 * INTERNAL: Private function to process or create an entry in the NamespaceResolver for the xsi prefix.
 * @param namespaceResolver
 * @return xsi prefix
 */
protected String processNamespaceResolverForXSIPrefix(NamespaceResolver namespaceResolver,MarshalRecord marshalRecord){
  String xsiPrefix;
  if (null == namespaceResolver) {
    xsiPrefix=XMLConstants.SCHEMA_INSTANCE_PREFIX;
    namespaceResolver=new NamespaceResolver();
    namespaceResolver.put(xsiPrefix,XMLConstants.SCHEMA_INSTANCE_URL);
    marshalRecord.attribute(XMLConstants.XMLNS_URL,xsiPrefix,XMLConstants.XMLNS + XMLConstants.COLON + xsiPrefix,XMLConstants.SCHEMA_INSTANCE_URL);
  }
 else {
    xsiPrefix=namespaceResolver.resolveNamespaceURI(XMLConstants.SCHEMA_INSTANCE_URL);
    if (null == xsiPrefix) {
      xsiPrefix=namespaceResolver.generatePrefix(XMLConstants.SCHEMA_INSTANCE_PREFIX);
      marshalRecord.attribute(XMLConstants.XMLNS_URL,xsiPrefix,XMLConstants.XMLNS + XMLConstants.COLON + xsiPrefix,XMLConstants.SCHEMA_INSTANCE_URL);
    }
  }
  return xsiPrefix;
}
Program: 66034
Project: 66034
Buggy source:
/** 
 * Indicates if the javaType map contains a key equal to the provided JavaClass' raw name.
 * @param jClass
 * @return
 */
public boolean isBuiltInJavaType(JavaClass jClass){
  return getXMLToJavaTypeMap().containsKey(jClass.getRawName()) || jClass.getRawName().startsWith("String_Node_Str") || jClass.getRawName().startsWith("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Indicates if a given JavaClass is a built-in Java type.  A JavaClass is considered to be a built-in type if: 1 - the XMLToJavaTypeMap map contains a key equal to the provided  JavaClass' raw name 2 - the provided JavaClass' raw name starts with "java." 3 - the provided JavaClass' raw name starts with "javax.", with the exception of "javax.xml.ws." 
 * @param jClass
 * @return
 */
public boolean isBuiltInJavaType(JavaClass jClass){
  String rawName=jClass.getRawName();
  return (getXMLToJavaTypeMap().containsKey(rawName) || rawName.startsWith(JAVA_PKG) || (rawName.startsWith(JAVAX_PKG) && !rawName.startsWith(JAVAX_WS_PKG)));
}