nus-yam/ex-repair huggingface dataset:
Program: 65007
Project: 65007
Buggy source:
public boolean marshal(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,AbstractSession session,NamespaceResolver namespaceResolver){
  if (xmlCompositeCollectionMapping.isReadOnly()) {
    return false;
  }
  ContainerPolicy cp=getContainerPolicy();
  Object collection=xmlCompositeCollectionMapping.getAttributeAccessor().getAttributeValueFromObject(object);
  if (null == collection) {
    AbstractNullPolicy wrapperNP=xmlCompositeCollectionMapping.getWrapperNullPolicy();
    if (wrapperNP != null && wrapperNP.getMarshalNullRepresentation().equals(XMLNullRepresentationType.XSI_NIL)) {
      marshalRecord.nilSimple(namespaceResolver);
      return true;
    }
 else {
      return false;
    }
  }
  Object iterator=cp.iteratorFor(collection);
  if (null != iterator && cp.hasNext(iterator)) {
    XPathFragment groupingFragment=marshalRecord.openStartGroupingElements(namespaceResolver);
    marshalRecord.closeStartGroupingElements(groupingFragment);
  }
 else {
    return marshalRecord.emptyCollection(xPathFragment,namespaceResolver,xmlCompositeCollectionMapping.getWrapperNullPolicy() != null);
  }
  marshalRecord.startCollection();
  while (cp.hasNext(iterator)) {
    Object objectValue=cp.next(iterator,session);
    marshalSingleValue(xPathFragment,marshalRecord,object,objectValue,session,namespaceResolver,ObjectMarshalContext.getInstance());
  }
  marshalRecord.endCollection();
  return true;
}

Fixed version (ground truth):
public boolean marshal(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,AbstractSession session,NamespaceResolver namespaceResolver){
  if (xmlCompositeCollectionMapping.isReadOnly()) {
    return false;
  }
  Object collection=xmlCompositeCollectionMapping.getAttributeAccessor().getAttributeValueFromObject(object);
  if (null == collection) {
    AbstractNullPolicy wrapperNP=xmlCompositeCollectionMapping.getWrapperNullPolicy();
    if (wrapperNP != null && wrapperNP.getMarshalNullRepresentation().equals(XMLNullRepresentationType.XSI_NIL)) {
      marshalRecord.nilSimple(namespaceResolver);
      return true;
    }
 else {
      return false;
    }
  }
  ContainerPolicy cp=getContainerPolicy();
  Object iterator=cp.iteratorFor(collection);
  if (null != iterator && cp.hasNext(iterator)) {
    XPathFragment groupingFragment=marshalRecord.openStartGroupingElements(namespaceResolver);
    marshalRecord.closeStartGroupingElements(groupingFragment);
  }
 else {
    return marshalRecord.emptyCollection(xPathFragment,namespaceResolver,xmlCompositeCollectionMapping.getWrapperNullPolicy() != null);
  }
  marshalRecord.startCollection();
  while (cp.hasNext(iterator)) {
    Object objectValue=cp.next(iterator,session);
    marshalSingleValue(xPathFragment,marshalRecord,object,objectValue,session,namespaceResolver,ObjectMarshalContext.getInstance());
  }
  marshalRecord.endCollection();
  return true;
}
Program: 65009
Project: 65009
Buggy source:
/** 
 * Replaces any CR, Tab or LF characters in the string with a single ' ' character.
 */
public String normalizeStringValue(String value){
  int i=0;
  while (i < value.length()) {
    if (isWhitespace(value.charAt(i),false)) {
      break;
    }
    i++;
  }
  if (i == value.length()) {
    return value;
  }
  char[] buffer=value.toCharArray();
  buffer[i]=' ';
  i++;
  for (; i < value.length(); i++) {
    if (isWhitespace(buffer[i],false)) {
      buffer[i]=' ';
    }
  }
  return new String(buffer);
}

Fixed version (ground truth):
/** 
 * Replaces any CR, Tab or LF characters in the string with a single ' ' character.
 */
public String normalizeStringValue(String value){
  int i=0;
  int length=value.length();
  while (i < length) {
    if (isWhitespace(value.charAt(i),false)) {
      break;
    }
    i++;
  }
  if (i == length) {
    return value;
  }
  char[] buffer=value.toCharArray();
  buffer[i]=' ';
  i++;
  for (; i < length; i++) {
    if (isWhitespace(buffer[i],false)) {
      buffer[i]=' ';
    }
  }
  return new String(buffer);
}
Program: 65010
Project: 65010
Buggy source:
public boolean hasLeafElementType(){
  return getLeafElementType() != null;
}

Fixed version (ground truth):
public boolean hasLeafElementType(){
  return leafElementType != null;
}
Program: 65011
Project: 65011
Buggy source:
public boolean qNameEquals(Object object){
  try {
    if (this == object) {
      return true;
    }
    XPathFragment xPathFragment=(XPathFragment)object;
    return ((localName == xPathFragment.getLocalName()) || ((localName != null) && localName.equals(xPathFragment.getLocalName()))) && ((namespaceURI == xPathFragment.getNamespaceURI()) || ((namespaceURI != null) && namespaceURI.equals(xPathFragment.getNamespaceURI()))) && (nameIsText == xPathFragment.nameIsText());
  }
 catch (  ClassCastException e) {
    return false;
  }
}

Fixed version (ground truth):
public boolean qNameEquals(Object object){
  try {
    if (this == object) {
      return true;
    }
    XPathFragment xPathFragment=(XPathFragment)object;
    return ((localName == xPathFragment.localName) || ((localName != null) && localName.equals(xPathFragment.localName))) && ((namespaceURI == xPathFragment.namespaceURI) || ((namespaceURI != null) && namespaceURI.equals(xPathFragment.namespaceURI))) && (nameIsText == xPathFragment.nameIsText);
  }
 catch (  ClassCastException e) {
    return false;
  }
}
Program: 65012
Project: 65012
Buggy source:
public boolean equals(Object object){
  try {
    if (null == object) {
      return false;
    }
 else     if (this == object) {
      return true;
    }
    XPathFragment xPathFragment=(XPathFragment)object;
    if (null == predicate && null != xPathFragment.getPredicate()) {
      return false;
    }
    if (null != predicate && !predicate.equals(xPathFragment.getPredicate())) {
      return false;
    }
    if (namespaceAware && xPathFragment.isNamespaceAware()) {
      if (namespaceURI == null) {
        if (xPathFragment.getNamespaceURI() != null) {
          return false;
        }
      }
 else {
        if (xPathFragment.getNamespaceURI() == null) {
          return false;
        }
 else         if (namespaceURI != xPathFragment.getNamespaceURI() && !(namespaceURI.equals(xPathFragment.getNamespaceURI()))) {
          return false;
        }
      }
    }
    return ((nameIsText && xPathFragment.nameIsText()) || (getLocalName() == xPathFragment.getLocalName()) || ((getLocalName() != null) && getLocalName().equals(xPathFragment.getLocalName()))) && (this.indexValue == xPathFragment.getIndexValue()) && (nameIsText == xPathFragment.nameIsText());
  }
 catch (  ClassCastException e) {
    return false;
  }
}

Fixed version (ground truth):
public boolean equals(Object object){
  try {
    if (null == object) {
      return false;
    }
 else     if (this == object) {
      return true;
    }
    XPathFragment xPathFragment=(XPathFragment)object;
    if (null == predicate && null != xPathFragment.predicate) {
      return false;
    }
    if (null != predicate && !predicate.equals(xPathFragment.predicate)) {
      return false;
    }
    if (namespaceAware && xPathFragment.isNamespaceAware()) {
      if (namespaceURI == null) {
        if (xPathFragment.namespaceURI != null) {
          return false;
        }
      }
 else {
        if (xPathFragment.namespaceURI == null) {
          return false;
        }
 else         if (namespaceURI != xPathFragment.namespaceURI && !(namespaceURI.equals(xPathFragment.namespaceURI))) {
          return false;
        }
      }
    }
    return ((nameIsText && xPathFragment.nameIsText) || (localName == xPathFragment.localName) || ((localName != null) && localName.equals(xPathFragment.localName))) && (this.indexValue == xPathFragment.indexValue) && (nameIsText == xPathFragment.nameIsText);
  }
 catch (  ClassCastException e) {
    return false;
  }
}
Program: 65014
Project: 65014
Buggy source:
/** 
 * INTERNAL: Convert the attribute value to a field value. Process any converter if defined, and check for null values.
 */
public Object getFieldValue(Object attributeValue,AbstractSession session,XMLRecord record){
  Object fieldValue=attributeValue;
  if ((this.nullValue != null) && (this.nullValue.equals(fieldValue)) && !((XMLField)getField()).isRequired()) {
    return null;
  }
  if (hasConverter()) {
    if (getConverter() instanceof XMLConverter) {
      fieldValue=((XMLConverter)getConverter()).convertObjectValueToDataValue(fieldValue,session,record.getMarshaller());
    }
 else {
      fieldValue=getConverter().convertObjectValueToDataValue(fieldValue,session);
    }
  }
  Class fieldClassification=getFieldClassification(getField());
  if ((fieldValue != null) && (fieldClassification != fieldValue.getClass())) {
    try {
      fieldValue=session.getPlatform(descriptor.getJavaClass()).convertObject(fieldValue,fieldClassification);
    }
 catch (    ConversionException exception) {
      throw ConversionException.couldNotBeConverted(this,descriptor,exception);
    }
  }
  return fieldValue;
}

Fixed version (ground truth):
/** 
 * INTERNAL: Convert the attribute value to a field value. Process any converter if defined, and check for null values.
 */
public Object getFieldValue(Object attributeValue,AbstractSession session,XMLRecord record){
  Object fieldValue=attributeValue;
  if ((this.nullValue != null) && (this.nullValue.equals(fieldValue)) && !((XMLField)field).isRequired()) {
    return null;
  }
  if (converter != null) {
    if (converter instanceof XMLConverter) {
      fieldValue=((XMLConverter)converter).convertObjectValueToDataValue(fieldValue,session,record.getMarshaller());
    }
 else {
      fieldValue=converter.convertObjectValueToDataValue(fieldValue,session);
    }
  }
  Class fieldClassification=getFieldClassification(field);
  if ((fieldValue != null) && (fieldClassification != fieldValue.getClass())) {
    try {
      fieldValue=session.getPlatform(descriptor.getJavaClass()).convertObject(fieldValue,fieldClassification);
    }
 catch (    ConversionException exception) {
      throw ConversionException.couldNotBeConverted(this,descriptor,exception);
    }
  }
  return fieldValue;
}
Program: 65015
Project: 65015
Buggy source:
/** 
 * INTERNAL: When using the DOM Platform, this method is responsible for marshalling null values for the XML Composite Object Mapping.
 * @param record
 * @param object
 * @param field
 * @return true if this method caused any objects to be marshaled, else false.
 */
public boolean compositeObjectMarshal(XMLRecord record,Object object,XMLField field,AbstractSession session){
  if (getMarshalNullRepresentation().equals(XMLNullRepresentationType.XSI_NIL)) {
    record.put(field,XMLRecord.NIL);
    return true;
  }
 else {
    if (getMarshalNullRepresentation().equals(XMLNullRepresentationType.EMPTY_NODE)) {
      Node element=XPathEngine.getInstance().createUnownedElement(record.getDOM(),field);
      DOMRecord nestedRow=new DOMRecord(element);
      record.put(field,nestedRow);
      return true;
    }
 else {
      return false;
    }
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: When using the DOM Platform, this method is responsible for marshalling null values for the XML Composite Object Mapping.
 * @param record
 * @param object
 * @param field
 * @return true if this method caused any objects to be marshaled, else false.
 */
public boolean compositeObjectMarshal(XMLRecord record,Object object,XMLField field,AbstractSession session){
  if (marshalNullRepresentation.equals(XMLNullRepresentationType.XSI_NIL)) {
    record.put(field,XMLRecord.NIL);
    return true;
  }
 else {
    if (marshalNullRepresentation.equals(XMLNullRepresentationType.EMPTY_NODE)) {
      Node element=XPathEngine.getInstance().createUnownedElement(record.getDOM(),field);
      DOMRecord nestedRow=new DOMRecord(element);
      record.put(field,nestedRow);
      return true;
    }
 else {
      return false;
    }
  }
}
Program: 65016
Project: 65016
Buggy source:
public void directMarshal(DatabaseField field,XMLRecord record,Object object){
  Object fieldValue=null;
  if (getMarshalNullRepresentation() == XMLNullRepresentationType.EMPTY_NODE) {
    fieldValue=XMLConstants.EMPTY_STRING;
  }
 else {
    if (!(((XMLField)field).getLastXPathFragment().isAttribute())) {
      if (getMarshalNullRepresentation() == XMLNullRepresentationType.XSI_NIL) {
        fieldValue=XMLRecord.NIL;
      }
    }
  }
  record.put(field,fieldValue);
}

Fixed version (ground truth):
public void directMarshal(DatabaseField field,XMLRecord record,Object object){
  Object fieldValue=null;
  if (marshalNullRepresentation == XMLNullRepresentationType.EMPTY_NODE) {
    fieldValue=XMLConstants.EMPTY_STRING;
  }
 else {
    if (!(((XMLField)field).getLastXPathFragment().isAttribute())) {
      if (marshalNullRepresentation == XMLNullRepresentationType.XSI_NIL) {
        fieldValue=XMLRecord.NIL;
      }
    }
  }
  record.put(field,fieldValue);
}
Program: 65017
Project: 65017
Buggy source:
public void xPathNode(XPathNode xPathNode,NullCapableValue nullCapableValue){
  if (!(isNullRepresentedByXsiNil() || getMarshalNullRepresentation().equals(XMLNullRepresentationType.XSI_NIL))) {
    if (xPathNode.getXPathFragment().isAttribute()) {
      return;
    }
  }
  XPathNode parentNode=xPathNode.getParent();
  if (isNullRepresentedByXsiNil() || getMarshalNullRepresentation().equals(XMLNullRepresentationType.XSI_NIL)) {
    XPathFragment xPathFragment=new XPathFragment();
    xPathFragment.setXPath('@' + XMLConstants.SCHEMA_NIL_ATTRIBUTE);
    xPathFragment.setNamespaceURI(XMLConstants.SCHEMA_INSTANCE_URL);
    NodeValue aNodeValue=new NillableNodeValue(nullCapableValue);
    parentNode.addChild(xPathFragment,aNodeValue,null);
  }
 else {
    NodeValue aNodeValue=new OptionalNodeValue(nullCapableValue);
    parentNode.setNodeValue(aNodeValue);
  }
}

Fixed version (ground truth):
public void xPathNode(XPathNode xPathNode,NullCapableValue nullCapableValue){
  if (!(isNullRepresentedByXsiNil() || marshalNullRepresentation.equals(XMLNullRepresentationType.XSI_NIL))) {
    if (xPathNode.getXPathFragment().isAttribute()) {
      return;
    }
  }
  XPathNode parentNode=xPathNode.getParent();
  if (isNullRepresentedByXsiNil() || marshalNullRepresentation.equals(XMLNullRepresentationType.XSI_NIL)) {
    XPathFragment xPathFragment=new XPathFragment();
    xPathFragment.setXPath('@' + XMLConstants.SCHEMA_NIL_ATTRIBUTE);
    xPathFragment.setNamespaceURI(XMLConstants.SCHEMA_INSTANCE_URL);
    NodeValue aNodeValue=new NillableNodeValue(nullCapableValue);
    parentNode.addChild(xPathFragment,aNodeValue,null);
  }
 else {
    NodeValue aNodeValue=new OptionalNodeValue(nullCapableValue);
    parentNode.setNodeValue(aNodeValue);
  }
}
Program: 65020
Project: 65020
Buggy source:
public Object get(DatabaseField key){
  XMLField xmlField=this.convertToXMLField(key);
  XPathFragment lastFragment=xmlField.getLastXPathFragment();
  NamespaceResolver namespaceResolver=xmlField.getNamespaceResolver();
  String namespaceURI=lastFragment.getNamespaceURI();
  if (namespaceURI == null) {
    namespaceURI=XMLConstants.EMPTY_STRING;
    if (null != namespaceResolver && !(lastFragment.isAttribute() && lastFragment.getPrefix() == null)) {
      namespaceURI=namespaceResolver.resolveNamespacePrefix(lastFragment.getPrefix());
      if (null == namespaceURI) {
        namespaceURI=XMLConstants.EMPTY_STRING;
      }
    }
  }
  if (isNamespaceAware()) {
    return attributes.getValue(namespaceURI,lastFragment.getLocalName());
  }
  return attributes.getValue(lastFragment.getLocalName());
}

Fixed version (ground truth):
public Object get(DatabaseField key){
  XMLField xmlField=this.convertToXMLField(key);
  XPathFragment lastFragment=xmlField.getLastXPathFragment();
  String namespaceURI=lastFragment.getNamespaceURI();
  if (namespaceURI == null) {
    NamespaceResolver namespaceResolver=xmlField.getNamespaceResolver();
    namespaceURI=XMLConstants.EMPTY_STRING;
    if (null != namespaceResolver && !(lastFragment.isAttribute() && lastFragment.getPrefix() == null)) {
      namespaceURI=namespaceResolver.resolveNamespacePrefix(lastFragment.getPrefix());
      if (null == namespaceURI) {
        namespaceURI=XMLConstants.EMPTY_STRING;
      }
    }
  }
  if (isNamespaceAware()) {
    return attributes.getValue(namespaceURI,lastFragment.getLocalName());
  }
  return attributes.getValue(lastFragment.getLocalName());
}
Program: 65021
Project: 65021
Buggy source:
public static SOAPElement getSOAPBodyElement(SOAPEnvelope envelope) throws SOAPException {
  NodeList nodes=envelope.getBody().getChildNodes();
  for (int i=0; i < nodes.getLength(); i++) {
    Node node=nodes.item(i);
    if (node instanceof SOAPBodyElement) {
      return (SOAPElement)node;
    }
  }
  return null;
}

Fixed version (ground truth):
public static SOAPElement getSOAPBodyElement(SOAPEnvelope envelope) throws SOAPException {
  for (@SuppressWarnings("String_Node_Str") Iterator it=envelope.getBody().getChildElements(); it.hasNext(); ) {
    Object node=it.next();
    if (node instanceof SOAPBodyElement) {
      return (SOAPElement)node;
    }
  }
  return null;
}
Program: 65023
Project: 65023
Buggy source:
/** 
 * This method will return true for all inputs.  This means that  <i>MOXyJsonProvider</i> will always be used for the JSON binding.
 * @return true
 */
public boolean isReadable(Class<?> type,Type genericType,Annotation[] annotations,MediaType mediaType){
  return true;
}

Fixed version (ground truth):
/** 
 * This method will return true for all inputs.  This means that  <i>MOXyJsonProvider</i> will always be used for the JSON binding.
 * @return true
 */
public boolean isReadable(Class<?> type,Type genericType,Annotation[] annotations,MediaType mediaType){
  return supportsMediaType(mediaType);
}
Program: 65024
Project: 65024
Buggy source:
/** 
 * This method will return true for all inputs.  This means that  <i>MOXyJsonProvider</i> will always be used for the JSON binding.
 * @return true
 */
public boolean isWriteable(Class<?> type,Type genericType,Annotation[] annotations,MediaType mediaType){
  return true;
}

Fixed version (ground truth):
/** 
 * This method will return true for all inputs.  This means that  <i>MOXyJsonProvider</i> will always be used for the JSON binding.
 * @return true
 */
public boolean isWriteable(Class<?> type,Type genericType,Annotation[] annotations,MediaType mediaType){
  return supportsMediaType(mediaType);
}
Program: 65027
Project: 65027
Buggy source:
/** 
 * This method collects the Joined Mappings from the descriptor and initializes them. Excludes the mapping that are not in the passed mappingsAllowedToJoin set (if it's not null). 
 */
public void processJoinedMappings(AbstractSession session){
  Set<String> fetchGroupAttributes=null;
  FetchGroup fetchGroup=getBaseQuery().getExecutionFetchGroup();
  if (fetchGroup != null) {
    fetchGroupAttributes=fetchGroup.getAttributeNames();
  }
  ObjectBuilder objectBuilder=getDescriptor().getObjectBuilder();
  if (objectBuilder.hasJoinedAttributes()) {
    List mappingJoinedAttributes=objectBuilder.getJoinedAttributes();
    if (!hasJoinedAttributeExpressions()) {
      for (int i=0; i < mappingJoinedAttributes.size(); i++) {
        ForeignReferenceMapping mapping=(ForeignReferenceMapping)mappingJoinedAttributes.get(i);
        if (fetchGroupAttributes == null || fetchGroupAttributes.contains(mapping.getAttributeName())) {
          Expression expression=addJoinedMapping(mapping);
          if (expression != null) {
            prepareJoinExpression(expression,session);
          }
        }
      }
    }
 else {
      for (int i=0; i < mappingJoinedAttributes.size(); i++) {
        ForeignReferenceMapping mapping=(ForeignReferenceMapping)mappingJoinedAttributes.get(i);
        if (!isAttributeExpressionJoined(mapping)) {
          if (fetchGroupAttributes == null || fetchGroupAttributes.contains(mapping.getAttributeName())) {
            Expression expression=addJoinedMapping(mapping);
            if (expression != null) {
              prepareJoinExpression(expression,session);
            }
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * This method collects the Joined Mappings from the descriptor and initializes them. Excludes the mapping that are not in the passed mappingsAllowedToJoin set (if it's not null). 
 */
public void processJoinedMappings(AbstractSession session){
  Set<String> fetchGroupAttributes=null;
  FetchGroup fetchGroup=getBaseQuery().getExecutionFetchGroup();
  if (fetchGroup != null) {
    fetchGroupAttributes=fetchGroup.getAttributeNames();
  }
  ObjectBuilder objectBuilder=getDescriptor().getObjectBuilder();
  if (objectBuilder.hasJoinedAttributes()) {
    List mappingJoinedAttributes=objectBuilder.getJoinedAttributes();
    if (!hasJoinedAttributeExpressions()) {
      for (int i=0; i < mappingJoinedAttributes.size(); i++) {
        ForeignReferenceMapping mapping=(ForeignReferenceMapping)mappingJoinedAttributes.get(i);
        if (fetchGroupAttributes == null || fetchGroupAttributes.contains(mapping.getAttributeName())) {
          addAndPrepareJoinedMapping(mapping,session);
        }
      }
    }
 else {
      for (int i=0; i < mappingJoinedAttributes.size(); i++) {
        ForeignReferenceMapping mapping=(ForeignReferenceMapping)mappingJoinedAttributes.get(i);
        if (!isAttributeExpressionJoined(mapping)) {
          if (fetchGroupAttributes == null || fetchGroupAttributes.contains(mapping.getAttributeName())) {
            addAndPrepareJoinedMapping(mapping,session);
          }
        }
      }
    }
  }
}
Program: 65028
Project: 65028
Buggy source:
/** 
 * Validate and prepare the join expression.
 */
protected void prepareJoinExpression(Expression expression,AbstractSession session){
  if (!expression.isQueryKeyExpression()) {
    throw QueryException.mappingForExpressionDoesNotSupportJoining(expression);
  }
  QueryKeyExpression objectExpression=(QueryKeyExpression)expression;
  objectExpression.getBuilder().setSession(session.getRootSession(null));
  if (objectExpression.getBuilder().getQueryClass() == null) {
    objectExpression.getBuilder().setQueryClass(this.descriptor.getJavaClass());
  }
  if ((objectExpression.getMapping() == null) || (!objectExpression.getMapping().isJoiningSupported())) {
    throw QueryException.mappingForExpressionDoesNotSupportJoining(objectExpression);
  }
  ObjectExpression baseExpression=objectExpression;
  while (!baseExpression.isExpressionBuilder()) {
    baseExpression.setShouldUseOuterJoinForMultitableInheritance(true);
    if (((QueryKeyExpression)baseExpression).shouldQueryToManyRelationship()) {
      setIsToManyJoinQuery(true);
    }
    if (baseExpression.shouldUseOuterJoin()) {
      setIsOuterJoinedAttributeQuery(true);
    }
    baseExpression=(ObjectExpression)baseExpression.getBaseExpression();
  }
}

Fixed version (ground truth):
/** 
 * Validate and prepare the join expression.
 */
protected Expression prepareJoinExpression(Expression expression,AbstractSession session){
  if (!expression.isQueryKeyExpression()) {
    throw QueryException.mappingForExpressionDoesNotSupportJoining(expression);
  }
  QueryKeyExpression objectExpression=(QueryKeyExpression)expression;
  if (objectExpression.getBuilder().getQueryClass() == null) {
    objectExpression=(QueryKeyExpression)objectExpression.rebuildOn(this.baseExpressionBuilder);
    if (objectExpression.getBuilder().getQueryClass() == null) {
      objectExpression.getBuilder().setQueryClass(this.descriptor.getJavaClass());
    }
  }
  objectExpression.getBuilder().setSession(session.getRootSession(null));
  if ((objectExpression.getMapping() == null) || (!objectExpression.getMapping().isJoiningSupported())) {
    throw QueryException.mappingForExpressionDoesNotSupportJoining(objectExpression);
  }
  ObjectExpression baseExpression=objectExpression;
  while (!baseExpression.isExpressionBuilder()) {
    baseExpression.setShouldUseOuterJoinForMultitableInheritance(true);
    if (((QueryKeyExpression)baseExpression).shouldQueryToManyRelationship()) {
      setIsToManyJoinQuery(true);
    }
    if (baseExpression.shouldUseOuterJoin()) {
      setIsOuterJoinedAttributeQuery(true);
    }
    baseExpression=(ObjectExpression)baseExpression.getBaseExpression();
  }
  return objectExpression;
}
Program: 65029
Project: 65029
Buggy source:
/** 
 * Validate and prepare join expressions.
 */
public void prepareJoinExpressions(AbstractSession session){
  setIsOuterJoinedAttributeQuery(false);
  Expression lastJoinedAttributeBaseExpression=null;
  List groupedExpressionList=new ArrayList(getJoinedAttributeExpressions().size());
  for (int index=0; index < getJoinedAttributeExpressions().size(); index++) {
    Expression expression=getJoinedAttributeExpressions().get(index);
    prepareJoinExpression(expression,session);
    lastJoinedAttributeBaseExpression=addExpressionAndBaseToGroupedList(expression,groupedExpressionList,lastJoinedAttributeBaseExpression);
  }
  this.setJoinedAttributeExpressions_(groupedExpressionList);
  for (int index=0; index < getJoinedMappingExpressions().size(); index++) {
    Expression expression=getJoinedMappingExpressions().get(index);
    prepareJoinExpression(expression,session);
  }
}

Fixed version (ground truth):
/** 
 * Validate and prepare join expressions.
 */
public void prepareJoinExpressions(AbstractSession session){
  setIsOuterJoinedAttributeQuery(false);
  Expression lastJoinedAttributeBaseExpression=null;
  List groupedExpressionList=new ArrayList(getJoinedAttributeExpressions().size());
  for (int index=0; index < getJoinedAttributeExpressions().size(); index++) {
    Expression expression=getJoinedAttributeExpressions().get(index);
    expression=prepareJoinExpression(expression,session);
    lastJoinedAttributeBaseExpression=addExpressionAndBaseToGroupedList(expression,groupedExpressionList,lastJoinedAttributeBaseExpression);
  }
  this.setJoinedAttributeExpressions_(groupedExpressionList);
  for (int index=0; index < getJoinedMappingExpressions().size(); index++) {
    Expression expression=getJoinedMappingExpressions().get(index);
    expression=prepareJoinExpression(expression,session);
    getJoinedMappingExpressions().set(index,expression);
  }
}
Program: 65030
Project: 65030
Buggy source:
/** 
 * Add the mapping for join fetch and return the expression being used.  
 */
public Expression addJoinedMapping(ForeignReferenceMapping mapping){
  Expression joinMappingExpression=null;
  if (mapping.isCollectionMapping()) {
    if (mapping.isInnerJoinFetched()) {
      joinMappingExpression=getBaseExpressionBuilder().anyOf(mapping.getAttributeName(),false);
    }
 else     if (mapping.isOuterJoinFetched()) {
      joinMappingExpression=getBaseExpressionBuilder().anyOfAllowingNone(mapping.getAttributeName(),false);
    }
    if (joinMappingExpression != null) {
      addJoinedMappingExpression(joinMappingExpression);
    }
  }
 else {
    if (mapping.isInnerJoinFetched()) {
      joinMappingExpression=getBaseExpressionBuilder().get(mapping.getAttributeName());
    }
 else     if (mapping.isOuterJoinFetched()) {
      joinMappingExpression=getBaseExpressionBuilder().getAllowingNull(mapping.getAttributeName());
    }
    addJoinedMappingExpression(joinMappingExpression);
  }
  return joinMappingExpression;
}

Fixed version (ground truth):
/** 
 * Add an attribute represented by the given attribute name to the list of joins for this query. Note: Mapping level joins are represented separately from query level joins.
 */
public void addJoinedMapping(String attributeName){
  addJoinedMappingExpression(this.baseExpressionBuilder.get(attributeName));
}
Program: 65031
Project: 65031
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override protected void initialize(){
  super.initialize();
  registerChild(SimpleConditionalExpressionBNF.ID);
  registerChild(ConditionalExpressionBNF.ID);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override protected void initialize(){
  super.initialize();
  setFallbackBNFId(PreLiteralExpressionBNF.ID);
  registerChild(SimpleConditionalExpressionBNF.ID);
  registerChild(ConditionalExpressionBNF.ID);
}
Program: 65032
Project: 65032
Buggy source:
/** 
 * {@inheritDoc}
 */
public JPQLQueryBNF getQueryBNF(){
  return queryBNF;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public JPQLQueryBNF getQueryBNF(){
  return getQueryBNF(ConditionalPrimaryBNF.ID);
}
Program: 65033
Project: 65033
Buggy source:
/** 
 * Creates a new <code>NotExpression</code>.
 * @param parent The parent of this expression
 * @param queryBNF The BNF coming from the parent expression that was used to parse the query
 */
public NotExpression(AbstractExpression parent,JPQLQueryBNF queryBNF){
  super(parent,NOT);
  this.queryBNF=queryBNF;
}

Fixed version (ground truth):
/** 
 * Creates a new <code>NotExpression</code>.
 * @param parent The parent of this expression
 * @param queryBNF The BNF coming from the parent expression that was used to parse the query
 */
public NotExpression(AbstractExpression parent){
  super(parent,NOT);
}
Program: 65034
Project: 65034
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override protected void parse(WordParser wordParser,boolean tolerant){
  identifier=wordParser.moveForward(NOT);
  hasSpaceAfterNot=wordParser.skipLeadingWhitespace() > 0;
  expression=parse(wordParser,queryBNF.getId(),tolerant);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override protected void parse(WordParser wordParser,boolean tolerant){
  identifier=wordParser.moveForward(NOT);
  hasSpaceAfterNot=wordParser.skipLeadingWhitespace() > 0;
  expression=parse(wordParser,ConditionalPrimaryBNF.ID,tolerant);
}
Program: 65035
Project: 65035
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override protected AbstractExpression buildExpression(AbstractExpression parent,WordParser wordParser,String word,JPQLQueryBNF queryBNF,AbstractExpression expression,boolean tolerant){
  int index=wordParser.position() + 3;
  index+=wordParser.whitespaceCount(index);
  if (wordParser.startsWithIdentifier(Expression.IN,index)) {
    expression=new InExpression(parent,expression);
  }
 else   if (wordParser.startsWithIdentifier(Expression.LIKE,index)) {
    expression=new LikeExpression(parent,expression);
  }
 else   if (wordParser.startsWithIdentifier(Expression.MEMBER,index)) {
    expression=new CollectionMemberExpression(parent,expression);
  }
 else   if (wordParser.startsWithIdentifier(Expression.BETWEEN,index)) {
    expression=new BetweenExpression(parent,expression);
  }
 else   if (wordParser.startsWithIdentifier(Expression.EXISTS,index)) {
    expression=new ExistsExpression(parent);
  }
 else {
    expression=new NotExpression(parent,queryBNF);
  }
  expression.parse(wordParser,tolerant);
  return expression;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override protected AbstractExpression buildExpression(AbstractExpression parent,WordParser wordParser,String word,JPQLQueryBNF queryBNF,AbstractExpression expression,boolean tolerant){
  int index=wordParser.position() + 3;
  index+=wordParser.whitespaceCount(index);
  if (wordParser.startsWithIdentifier(Expression.IN,index)) {
    expression=new InExpression(parent,expression);
  }
 else   if (wordParser.startsWithIdentifier(Expression.LIKE,index)) {
    expression=new LikeExpression(parent,expression);
  }
 else   if (wordParser.startsWithIdentifier(Expression.MEMBER,index)) {
    expression=new CollectionMemberExpression(parent,expression);
  }
 else   if (wordParser.startsWithIdentifier(Expression.BETWEEN,index)) {
    expression=new BetweenExpression(parent,expression);
  }
 else   if (wordParser.startsWithIdentifier(Expression.EXISTS,index)) {
    expression=new ExistsExpression(parent);
  }
 else {
    expression=new NotExpression(parent);
  }
  expression.parse(wordParser,tolerant);
  return expression;
}
Program: 65036
Project: 65036
Buggy source:
private JAXBContextState createContextState(Generator generator,JaxbClassLoader loader,TypeMappingInfo[] typesToBeBound,Map properties) throws Exception {
  Project proj=generator.generateProject();
  ConversionManager conversionManager=null;
  if (classLoader != null) {
    conversionManager=new ConversionManager();
    conversionManager.setLoader(loader);
  }
 else {
    conversionManager=ConversionManager.getDefaultManager();
  }
  proj.convertClassNamesToClasses(conversionManager.getLoader());
  for (Iterator<ClassDescriptor> descriptorIt=proj.getOrderedDescriptors().iterator(); descriptorIt.hasNext(); ) {
    ClassDescriptor descriptor=descriptorIt.next();
    if (descriptor.getJavaClass() == null) {
      descriptor.setJavaClass(conversionManager.convertClassNameToClass(descriptor.getJavaClassName()));
    }
  }
  XMLPlatform platform=new SAXPlatform();
  platform.getConversionManager().setLoader(loader);
  XMLContext xmlContext=new XMLContext(proj,loader,sessionEventListeners());
  ((XMLLogin)xmlContext.getSession(0).getDatasourceLogin()).setEqualNamespaceResolvers(true);
  return new JAXBContextState(xmlContext,generator,typesToBeBound,properties);
}

Fixed version (ground truth):
private JAXBContextState createContextState(Generator generator,JaxbClassLoader loader,TypeMappingInfo[] typesToBeBound,Map properties) throws Exception {
  Project proj=generator.generateProject();
  ConversionManager conversionManager=null;
  if (classLoader != null) {
    conversionManager=new ConversionManager();
    conversionManager.setLoader(loader);
  }
 else {
    conversionManager=ConversionManager.getDefaultManager();
  }
  proj.convertClassNamesToClasses(conversionManager.getLoader());
  for (Iterator<ClassDescriptor> descriptorIt=proj.getOrderedDescriptors().iterator(); descriptorIt.hasNext(); ) {
    ClassDescriptor descriptor=descriptorIt.next();
    if (descriptor.getJavaClass() == null) {
      descriptor.setJavaClass(conversionManager.convertClassNameToClass(descriptor.getJavaClassName()));
    }
  }
  XMLPlatform platform=new SAXPlatform();
  platform.getConversionManager().setLoader(loader);
  XMLContext xmlContext=new XMLContext(proj,loader,sessionEventListeners());
  ((XMLLogin)xmlContext.getSession(0).getDatasourceLogin()).setEqualNamespaceResolvers(true);
  for (  TypeMappingInfo typeMappingInfo : typesToBeBound) {
    Type typeMappingInfoType=typeMappingInfo.getType();
    if (typeMappingInfoType.getClass() == Class.class) {
      XMLDescriptor xmlDescriptor=(XMLDescriptor)proj.getClassDescriptor((Class)typeMappingInfoType);
      typeMappingInfo.setXmlDescriptor(xmlDescriptor);
    }
  }
  return new JAXBContextState(xmlContext,generator,typesToBeBound,properties);
}
Program: 65037
Project: 65037
Buggy source:
/** 
 * INTERNAL: Build a valid instance of java.util.Date from the given source object.
 * @param sourceObject    Valid instance of java.util.Date, String, java.sql.Timestamp, or Long
 */
protected java.util.Date convertObjectToUtilDate(Object sourceObject) throws ConversionException {
  java.util.Date date=null;
  if (sourceObject.getClass() == java.util.Date.class) {
    date=(java.util.Date)sourceObject;
  }
 else   if (sourceObject instanceof java.sql.Date) {
    date=Helper.utilDateFromSQLDate((java.sql.Date)sourceObject);
  }
 else   if (sourceObject instanceof java.sql.Time) {
    date=Helper.utilDateFromTime((java.sql.Time)sourceObject);
  }
 else   if (sourceObject instanceof String) {
    date=Helper.utilDateFromTimestamp(Helper.timestampFromString((String)sourceObject));
  }
 else   if (sourceObject instanceof java.sql.Timestamp) {
    date=Helper.utilDateFromTimestamp((java.sql.Timestamp)sourceObject);
  }
 else   if (sourceObject instanceof Calendar) {
    return ((Calendar)sourceObject).getTime();
  }
 else   if (sourceObject instanceof Long) {
    date=Helper.utilDateFromLong((Long)sourceObject);
  }
 else {
    throw ConversionException.couldNotBeConverted(sourceObject,ClassConstants.UTILDATE);
  }
  return date;
}

Fixed version (ground truth):
/** 
 * INTERNAL: Build a valid instance of java.util.Date from the given source object.
 * @param sourceObject    Valid instance of java.util.Date, String, java.sql.Timestamp, or Long
 */
protected java.util.Date convertObjectToUtilDate(Object sourceObject) throws ConversionException {
  java.util.Date date=null;
  if (sourceObject.getClass() == java.util.Date.class) {
    date=(java.util.Date)sourceObject;
  }
 else   if (sourceObject instanceof java.sql.Date) {
    date=Helper.utilDateFromSQLDate((java.sql.Date)sourceObject);
  }
 else   if (sourceObject instanceof java.sql.Time) {
    date=Helper.utilDateFromTime((java.sql.Time)sourceObject);
  }
 else   if (sourceObject instanceof String) {
    date=Helper.utilDateFromTimestamp(Helper.timestampFromString((String)sourceObject));
  }
 else   if (sourceObject instanceof java.sql.Timestamp) {
    date=Helper.utilDateFromTimestamp((java.sql.Timestamp)sourceObject);
  }
 else   if (sourceObject instanceof Calendar) {
    return ((Calendar)sourceObject).getTime();
  }
 else   if (sourceObject instanceof Long) {
    date=Helper.utilDateFromLong((Long)sourceObject);
  }
 else   if (sourceObject instanceof java.util.Date) {
    date=new java.util.Date(((java.util.Date)sourceObject).getTime());
  }
 else {
    throw ConversionException.couldNotBeConverted(sourceObject,ClassConstants.UTILDATE);
  }
  return date;
}
Program: 65038
Project: 65038
Buggy source:
/** 
 * Build descriptor and mappings for an OracleTableType argument.  The newly created descriptor will be added to the given OX project.
 */
protected void addToOXProjectForObjectTableTypeArg(DatabaseType dbType,Project oxProject,String objectTableName,String objectTableAlias){
  XMLDescriptor xdesc=(XMLDescriptor)oxProject.getDescriptorForAlias(objectTableAlias);
  if (xdesc == null) {
    xdesc=buildAndAddNewXMLDescriptor(oxProject,objectTableAlias,objectTableName + COLLECTION_WRAPPER_SUFFIX,nct.generateSchemaAlias(objectTableAlias),buildCustomQName(objectTableName,dbwsBuilder).getNamespaceURI());
  }
  boolean itemsMappingFound=xdesc.getMappingForAttributeName(ITEMS_MAPPING_ATTRIBUTE_NAME) == null ? false : true;
  if (!itemsMappingFound) {
    ObjectType nestedType=(ObjectType)((ObjectTableType)dbType).getEnclosedType();
    String nestedTypeAlias=nestedType.getTypeName().toLowerCase();
    String nestedTypeName=getGeneratedJavaClassName(nestedTypeAlias,dbwsBuilder.getProjectName());
    addToOXProjectForObjectTypeArg(nestedType,oxProject,nestedTypeName,nestedTypeAlias);
    buildAndAddXMLCompositeCollectionMapping(xdesc,nestedTypeName);
  }
}

Fixed version (ground truth):
/** 
 * Build descriptor and mappings for an OracleTableType argument.  The newly created descriptor will be added to the given OX project.
 */
protected void addToOXProjectForObjectTableTypeArg(DatabaseType dbType,Project oxProject,String objectTableName,String objectTableAlias){
  XMLDescriptor xdesc=(XMLDescriptor)oxProject.getDescriptorForAlias(objectTableAlias);
  if (xdesc == null) {
    xdesc=buildAndAddNewXMLDescriptor(oxProject,objectTableAlias,objectTableName + COLLECTION_WRAPPER_SUFFIX,nct.generateSchemaAlias(objectTableAlias),buildCustomQName(objectTableName,dbwsBuilder).getNamespaceURI());
  }
  boolean itemsMappingFound=xdesc.getMappingForAttributeName(ITEMS_MAPPING_ATTRIBUTE_NAME) == null ? false : true;
  if (!itemsMappingFound) {
    DatabaseType nType=((ObjectTableType)dbType).getEnclosedType();
    if (nType.isObjectType()) {
      ObjectType oType=(ObjectType)nType;
      String nestedTypeAlias=oType.getTypeName().toLowerCase();
      String nestedTypeName=getGeneratedJavaClassName(nestedTypeAlias,dbwsBuilder.getProjectName());
      addToOXProjectForObjectTypeArg(oType,oxProject,nestedTypeName,nestedTypeAlias);
      buildAndAddXMLCompositeCollectionMapping(xdesc,nestedTypeName);
    }
 else {
      buildAndAddXMLCompositeDirectCollectionMapping(xdesc,ITEMS_MAPPING_ATTRIBUTE_NAME,ITEM_MAPPING_NAME + SLASH + TEXT,getAttributeClassForDatabaseType(nType));
    }
  }
}
Program: 65039
Project: 65039
Buggy source:
/** 
 * Build descriptor and mappings for an OracleTableType argument.  The newly created descriptor will be added to the given OR project.
 */
protected void addToORProjectForObjectTableTypeArg(DatabaseType dbType,Project orProject,String objectTableName,String objectTableAlias){
  ObjectRelationalDataTypeDescriptor ordt=(ObjectRelationalDataTypeDescriptor)orProject.getDescriptorForAlias(objectTableAlias);
  if (ordt == null) {
    ordt=buildAndAddNewObjectRelationalDataTypeDescriptor(orProject,objectTableAlias,objectTableName + COLLECTION_WRAPPER_SUFFIX);
  }
  boolean itemsMappingFound=ordt.getMappingForAttributeName(ITEMS_MAPPING_ATTRIBUTE_NAME) == null ? false : true;
  if (!itemsMappingFound) {
    ObjectType nestedType=(ObjectType)((ObjectTableType)dbType).getEnclosedType();
    String nestedTypeAlias=nestedType.getTypeName().toLowerCase();
    String nestedTypeName=getGeneratedJavaClassName(nestedTypeAlias,dbwsBuilder.getProjectName());
    addToORProjectForObjectTypeArg(nestedType,orProject,nestedTypeName,nestedTypeAlias);
    buildAndAddObjectArrayMapping(ordt,ITEMS_MAPPING_ATTRIBUTE_NAME,ITEMS_MAPPING_FIELD_NAME,nestedTypeName,nestedTypeAlias.toUpperCase());
  }
}

Fixed version (ground truth):
/** 
 * Build descriptor and mappings for an OracleTableType argument.  The newly created descriptor will be added to the given OR project.
 */
protected void addToORProjectForObjectTableTypeArg(DatabaseType dbType,Project orProject,String objectTableName,String objectTableAlias){
  ObjectRelationalDataTypeDescriptor ordt=(ObjectRelationalDataTypeDescriptor)orProject.getDescriptorForAlias(objectTableAlias);
  if (ordt == null) {
    ordt=buildAndAddNewObjectRelationalDataTypeDescriptor(orProject,objectTableAlias,objectTableName + COLLECTION_WRAPPER_SUFFIX);
  }
  boolean itemsMappingFound=ordt.getMappingForAttributeName(ITEMS_MAPPING_ATTRIBUTE_NAME) == null ? false : true;
  if (!itemsMappingFound) {
    DatabaseType nestedType=((ObjectTableType)dbType).getEnclosedType();
    if (nestedType.isObjectType()) {
      ObjectType oType=(ObjectType)nestedType;
      String nestedTypeAlias=oType.getTypeName().toLowerCase();
      String nestedTypeName=getGeneratedJavaClassName(nestedTypeAlias,dbwsBuilder.getProjectName());
      addToORProjectForObjectTypeArg(oType,orProject,nestedTypeName,nestedTypeAlias);
      buildAndAddObjectArrayMapping(ordt,ITEMS_MAPPING_ATTRIBUTE_NAME,ITEMS_MAPPING_FIELD_NAME,nestedTypeName,nestedTypeAlias.toUpperCase());
    }
 else {
      buildAndAddArrayMapping(ordt,ITEMS_MAPPING_ATTRIBUTE_NAME,ITEMS_MAPPING_FIELD_NAME,objectTableAlias.toUpperCase());
    }
  }
}
Program: 65042
Project: 65042
Buggy source:
public boolean startElement(XPathFragment xPathFragment,UnmarshalRecord unmarshalRecord,Attributes atts){
  XMLField xmlField=(XMLField)xmlCompositeDirectCollectionMapping.getField();
  if (xmlField.getLastXPathFragment().nameIsText()) {
    String type=atts.getValue(XMLConstants.SCHEMA_INSTANCE_URL,XMLConstants.SCHEMA_TYPE_ATTRIBUTE);
    if (null != type) {
      String namespaceURI=null;
      int colonIndex=type.indexOf(XMLConstants.COLON);
      if (colonIndex > -1) {
        String prefix=type.substring(0,colonIndex);
        namespaceURI=unmarshalRecord.resolveNamespacePrefix(prefix);
        type=type.substring(colonIndex + 1);
      }
      unmarshalRecord.setTypeQName(new QName(namespaceURI,type));
    }
    if (xmlCompositeDirectCollectionMapping.getNullPolicy().isNullRepresentedByXsiNil() && xmlCompositeDirectCollectionMapping.getNullPolicy().valueIsNull(atts)) {
      getContainerPolicy().addInto(null,unmarshalRecord.getContainerInstance(this),unmarshalRecord.getSession());
    }
  }
 else   if (xmlField.getLastXPathFragment().isAttribute()) {
    if (!this.xmlCompositeDirectCollectionMapping.usesSingleNode()) {
      String namespaceURI=xmlField.getLastXPathFragment().getNamespaceURI();
      if (namespaceURI == null) {
        namespaceURI=XMLConstants.EMPTY_STRING;
      }
      String value=atts.getValue(namespaceURI,xmlField.getLastXPathFragment().getLocalName());
      Object collection=unmarshalRecord.getContainerInstance(this);
      addUnmarshalValue(unmarshalRecord,value,collection);
    }
  }
  return true;
}

Fixed version (ground truth):
public boolean startElement(XPathFragment xPathFragment,UnmarshalRecord unmarshalRecord,Attributes atts){
  XMLField xmlField=(XMLField)xmlCompositeDirectCollectionMapping.getField();
  if (xmlField.getLastXPathFragment().nameIsText()) {
    String type=atts.getValue(XMLConstants.SCHEMA_INSTANCE_URL,XMLConstants.SCHEMA_TYPE_ATTRIBUTE);
    if (null != type) {
      String namespaceURI=null;
      int colonIndex=type.indexOf(XMLConstants.COLON);
      if (colonIndex > -1) {
        String prefix=type.substring(0,colonIndex);
        namespaceURI=unmarshalRecord.resolveNamespacePrefix(prefix);
        type=type.substring(colonIndex + 1);
      }
      unmarshalRecord.setTypeQName(new QName(namespaceURI,type));
    }
    if (xmlCompositeDirectCollectionMapping.getNullPolicy().isNullRepresentedByXsiNil() && unmarshalRecord.isNil()) {
      getContainerPolicy().addInto(null,unmarshalRecord.getContainerInstance(this),unmarshalRecord.getSession());
    }
  }
 else   if (xmlField.getLastXPathFragment().isAttribute()) {
    if (!this.xmlCompositeDirectCollectionMapping.usesSingleNode()) {
      String namespaceURI=xmlField.getLastXPathFragment().getNamespaceURI();
      if (namespaceURI == null) {
        namespaceURI=XMLConstants.EMPTY_STRING;
      }
      String value=atts.getValue(namespaceURI,xmlField.getLastXPathFragment().getLocalName());
      Object collection=unmarshalRecord.getContainerInstance(this);
      addUnmarshalValue(unmarshalRecord,value,collection);
    }
  }
  return true;
}
Program: 65046
Project: 65046
Buggy source:
@Test public final void test_TypeExpression_InvalidExpression() throws Exception {
  String jpqlQuery="String_Node_Str";
  int startPosition="String_Node_Str".length();
  int endPosition="String_Node_Str".length();
  List<JPQLQueryProblem> problems=validate(jpqlQuery);
  testHasOnlyOneProblem(problems,TypeExpression_InvalidExpression,startPosition,endPosition);
}

Fixed version (ground truth):
@Test public final void test_TypeExpression_InvalidExpression() throws Exception {
  String jpqlQuery="String_Node_Str";
  List<JPQLQueryProblem> problems=validate(jpqlQuery);
  testDoesNotHaveProblem(problems,TypeExpression_InvalidExpression);
}
Program: 65048
Project: 65048
Buggy source:
public void testCursorFromOtherPkgFunc(){
  Invocation invocation=new Invocation("String_Node_Str");
  Operation op=xrService.getOperation(invocation.getName());
  Object result=op.invoke(xrService,invocation);
  assertNotNull("String_Node_Str",result);
  Document doc=xmlPlatform.createDocument();
  XMLMarshaller marshaller=xrService.getXMLContext().createMarshaller();
  marshaller.marshal(result,doc);
  Document controlDoc=xmlParser.parse(new StringReader(EMP_TABLE_XML));
  assertTrue("String_Node_Str" + documentToString(controlDoc) + "String_Node_Str"+ documentToString(doc),comparer.isNodeEqual(controlDoc,doc));
}

Fixed version (ground truth):
@Test public void testCursorFromOtherPkgFunc(){
  Invocation invocation=new Invocation("String_Node_Str");
  invocation.setParameter("String_Node_Str",101);
  Operation op=xrService.getOperation(invocation.getName());
  Object result=op.invoke(xrService,invocation);
  assertNotNull("String_Node_Str",result);
  Document doc=xmlPlatform.createDocument();
  XMLMarshaller marshaller=xrService.getXMLContext().createMarshaller();
  marshaller.marshal(result,doc);
  Document controlDoc=xmlParser.parse(new StringReader(EMP_101_XML));
  assertTrue("String_Node_Str" + documentToString(controlDoc) + "String_Node_Str"+ documentToString(doc),comparer.isNodeEqual(controlDoc,doc));
}