nus-yam/ex-repair huggingface dataset:
Program: 66949
Project: 66949
Buggy source:
/** 
 * Process @XmlID annotation on a given property
 * @param property
 * @param info
 */
private void processXmlID(Property property,TypeInfo info){
  if (helper.isAnnotationPresent(property.getElement(),XmlID.class)) {
    if (!areEquals(property.getType(),String.class)) {
      throw JAXBException.invalidId(property.getPropertyName());
    }
    if (info.isIDSet()) {
      throw JAXBException.idAlreadySet(property.getPropertyName(),info.getIDProperty().getPropertyName(),info.getDescriptor().getAlias());
    }
    info.setIDProperty(property);
  }
}

Fixed version (ground truth):
/** 
 * Process @XmlID annotation on a given property
 * @param property
 * @param info
 */
private void processXmlID(Property property,TypeInfo info){
  if (helper.isAnnotationPresent(property.getElement(),XmlID.class)) {
    if (info.isIDSet()) {
      throw JAXBException.idAlreadySet(property.getPropertyName(),info.getIDProperty().getPropertyName(),info.getDescriptor().getAlias());
    }
    info.setIDProperty(property);
  }
}
Program: 66950
Project: 66950
Buggy source:
public void endElement(String namespaceURI,String localName,String qName) throws SAXException {
  if (super.nodes.size() == 2) {
    Element endedElement=(Element)nodes.peek();
    if (stringBuffer.length() > 0) {
      Text text=getInitializedDocument().createTextNode(stringBuffer.toString());
      endedElement.appendChild(text);
      stringBuffer.reset();
    }
    owningRecord.getXMLReader().setContentHandler(owningRecord);
    owningRecord.endElement(namespaceURI,localName,qName);
  }
 else {
    super.endElement(namespaceURI,localName,qName);
  }
}

Fixed version (ground truth):
public void endElement(String namespaceURI,String localName,String qName) throws SAXException {
  if (super.nodes.size() == 2) {
    Element endedElement=(Element)nodes.get(nodes.size() - 1);
    if (stringBuffer.length() > 0) {
      Text text=getInitializedDocument().createTextNode(stringBuffer.toString());
      endedElement.appendChild(text);
      stringBuffer.reset();
    }
    owningRecord.getXMLReader().setContentHandler(owningRecord);
    owningRecord.endElement(namespaceURI,localName,qName);
  }
 else {
    super.endElement(namespaceURI,localName,qName);
  }
}
Program: 66951
Project: 66951
Buggy source:
public Stack getNodes(){
  return super.nodes;
}

Fixed version (ground truth):
public List<Node> getNodes(){
  return super.nodes;
}
Program: 66953
Project: 66953
Buggy source:
public void endSelfElement(String namespaceURI,String localName,String qName) throws SAXException {
  if (super.nodes.size() == 2) {
    Element endedElement=(Element)nodes.peek();
    if (stringBuffer.length() > 0) {
      Text text=getInitializedDocument().createTextNode(stringBuffer.toString());
      endedElement.appendChild(text);
      stringBuffer.reset();
    }
  }
 else {
    super.endElement(namespaceURI,localName,qName);
  }
}

Fixed version (ground truth):
public void endSelfElement(String namespaceURI,String localName,String qName) throws SAXException {
  if (super.nodes.size() == 2) {
    Element endedElement=(Element)nodes.get(nodes.size() - 1);
    if (stringBuffer.length() > 0) {
      Text text=getInitializedDocument().createTextNode(stringBuffer.toString());
      endedElement.appendChild(text);
      stringBuffer.reset();
    }
  }
 else {
    super.endElement(namespaceURI,localName,qName);
  }
}
Program: 66954
Project: 66954
Buggy source:
public boolean marshalAttributes(MarshalRecord marshalRecord,Object object,AbstractSession session){
  boolean hasValue=false;
  NamespaceResolver namespaceResolver=((XMLDescriptor)this.getDescriptor()).getNamespaceResolver();
  List attributeChildren=rootXPathNode.getAttributeChildren();
  if (null != attributeChildren) {
    for (int x=0, attributeChildrenSize=attributeChildren.size(); x < attributeChildrenSize; x++) {
      XPathNode attributeNode=(XPathNode)rootXPathNode.getAttributeChildren().get(x);
      hasValue=attributeNode.marshal(marshalRecord,object,session,namespaceResolver,ObjectMarshalContext.getInstance()) || hasValue;
    }
  }
  if (rootXPathNode.getAnyAttributeNode() != null) {
    hasValue=rootXPathNode.getAnyAttributeNode().marshal(marshalRecord,object,session,namespaceResolver,ObjectMarshalContext.getInstance()) || hasValue;
  }
  List selfChildren=rootXPathNode.getSelfChildren();
  if (null != selfChildren) {
    for (int x=0, selfChildrenSize=selfChildren.size(); x < selfChildrenSize; x++) {
      XPathNode childNode=(XPathNode)selfChildren.get(x);
      childNode.marshalSelfAttributes(marshalRecord,object,session,namespaceResolver,marshalRecord.getMarshaller());
    }
  }
  return hasValue;
}

Fixed version (ground truth):
public boolean marshalAttributes(MarshalRecord marshalRecord,Object object,AbstractSession session){
  boolean hasValue=false;
  NamespaceResolver namespaceResolver=((XMLDescriptor)this.getDescriptor()).getNamespaceResolver();
  List attributeChildren=rootXPathNode.getAttributeChildren();
  if (null != attributeChildren) {
    for (int x=0, attributeChildrenSize=attributeChildren.size(); x < attributeChildrenSize; x++) {
      XPathNode attributeNode=(XPathNode)rootXPathNode.getAttributeChildren().get(x);
      hasValue=attributeNode.marshal(marshalRecord,object,session,namespaceResolver,null,ObjectMarshalContext.getInstance()) || hasValue;
    }
  }
  if (rootXPathNode.getAnyAttributeNode() != null) {
    hasValue=rootXPathNode.getAnyAttributeNode().marshal(marshalRecord,object,session,namespaceResolver,null,ObjectMarshalContext.getInstance()) || hasValue;
  }
  List selfChildren=rootXPathNode.getSelfChildren();
  if (null != selfChildren) {
    for (int x=0, selfChildrenSize=selfChildren.size(); x < selfChildrenSize; x++) {
      XPathNode childNode=(XPathNode)selfChildren.get(x);
      childNode.marshalSelfAttributes(marshalRecord,object,session,namespaceResolver,marshalRecord.getMarshaller());
    }
  }
  return hasValue;
}
Program: 66955
Project: 66955
Buggy source:
public AbstractRecord buildRow(AbstractRecord record,Object object,org.eclipse.persistence.internal.sessions.AbstractSession session,XMLMarshaller marshaller){
  if (null == getRootXPathNode().getNonAttributeChildren()) {
    return record;
  }
  XMLDescriptor xmlDescriptor=(XMLDescriptor)this.getDescriptor();
  NamespaceResolver namespaceResolver=xmlDescriptor.getNamespaceResolver();
  MarshalContext marshalContext=null;
  if (xmlDescriptor.isSequencedObject()) {
    SequencedObject sequencedObject=(SequencedObject)object;
    marshalContext=new SequencedMarshalContext(sequencedObject.getSettings());
  }
 else {
    marshalContext=ObjectMarshalContext.getInstance();
  }
  int size=marshalContext.getNonAttributeChildrenSize(getRootXPathNode());
  for (int x=0; x < size; x++) {
    XPathNode xPathNode=(XPathNode)marshalContext.getNonAttributeChild(x,getRootXPathNode());
    xPathNode.marshal((MarshalRecord)record,object,session,namespaceResolver,marshaller,marshalContext.getMarshalContext(x));
  }
  return record;
}

Fixed version (ground truth):
public AbstractRecord buildRow(AbstractRecord record,Object object,org.eclipse.persistence.internal.sessions.AbstractSession session,XMLMarshaller marshaller){
  if (null == getRootXPathNode().getNonAttributeChildren()) {
    return record;
  }
  XMLDescriptor xmlDescriptor=(XMLDescriptor)this.descriptor;
  NamespaceResolver namespaceResolver=xmlDescriptor.getNamespaceResolver();
  MarshalContext marshalContext=null;
  if (xmlDescriptor.isSequencedObject()) {
    SequencedObject sequencedObject=(SequencedObject)object;
    marshalContext=new SequencedMarshalContext(sequencedObject.getSettings());
  }
 else {
    marshalContext=ObjectMarshalContext.getInstance();
  }
  for (int x=0, size=marshalContext.getNonAttributeChildrenSize(getRootXPathNode()); x < size; x++) {
    XPathNode xPathNode=(XPathNode)marshalContext.getNonAttributeChild(x,getRootXPathNode());
    xPathNode.marshal((MarshalRecord)record,object,session,namespaceResolver,marshaller,marshalContext.getMarshalContext(x));
  }
  return record;
}
Program: 66957
Project: 66957
Buggy source:
public void endElement(XPathFragment xPathFragment,UnmarshalRecord unmarshalRecord){
  SAXFragmentBuilder builder=unmarshalRecord.getFragmentBuilder();
  Object value=builder.getNodes().pop();
  unmarshalRecord.addAttributeValue(this,value);
}

Fixed version (ground truth):
public void endElement(XPathFragment xPathFragment,UnmarshalRecord unmarshalRecord){
  SAXFragmentBuilder builder=unmarshalRecord.getFragmentBuilder();
  Object value=builder.getNodes().remove(builder.getNodes().size() - 1);
  unmarshalRecord.addAttributeValue(this,value);
}
Program: 66958
Project: 66958
Buggy source:
public void endElement(XPathFragment xPathFragment,UnmarshalRecord unmarshalRecord){
  unmarshalRecord.removeNullCapableValue(this);
  XPathFragment lastFrag=((XMLField)xmlFragmentMapping.getField()).getLastXPathFragment();
  SAXFragmentBuilder builder=unmarshalRecord.getFragmentBuilder();
  if (lastFrag.nameIsText()) {
    Object attributeValue=builder.buildTextNode(unmarshalRecord.getStringBuffer().toString());
    unmarshalRecord.resetStringBuffer();
    xmlFragmentMapping.setAttributeValueInObject(unmarshalRecord.getCurrentObject(),attributeValue);
  }
 else   if (!lastFrag.isAttribute()) {
    Object value=builder.getNodes().pop();
    unmarshalRecord.setAttributeValue(value,xmlFragmentMapping);
  }
}

Fixed version (ground truth):
public void endElement(XPathFragment xPathFragment,UnmarshalRecord unmarshalRecord){
  unmarshalRecord.removeNullCapableValue(this);
  XPathFragment lastFrag=((XMLField)xmlFragmentMapping.getField()).getLastXPathFragment();
  SAXFragmentBuilder builder=unmarshalRecord.getFragmentBuilder();
  if (lastFrag.nameIsText()) {
    Object attributeValue=builder.buildTextNode(unmarshalRecord.getStringBuffer().toString());
    unmarshalRecord.resetStringBuffer();
    xmlFragmentMapping.setAttributeValueInObject(unmarshalRecord.getCurrentObject(),attributeValue);
  }
 else   if (!lastFrag.isAttribute()) {
    Object value=builder.getNodes().remove(builder.getNodes().size() - 1);
    unmarshalRecord.setAttributeValue(value,xmlFragmentMapping);
  }
}
Program: 66959
Project: 66959
Buggy source:
protected List addExtraNamespacesToNamespaceResolver(XMLDescriptor desc,XMLRecord marshalRecord,AbstractSession session){
  if (((XMLLogin)session.getDatasourceLogin()).hasEqualNamespaceResolvers()) {
    return null;
  }
  List returnList=new ArrayList();
  List namespaces=desc.getNonNullNamespaceResolver().getNamespaces();
  for (int i=0; i < namespaces.size(); i++) {
    Namespace next=(Namespace)namespaces.get(i);
    String prefix=marshalRecord.getNamespaceResolver().resolveNamespaceURI(next.getNamespaceURI());
    if (prefix == null || prefix.length() == 0) {
      marshalRecord.getNamespaceResolver().put(next.getPrefix(),next.getNamespaceURI());
      returnList.add(next);
    }
 else {
      if (!prefix.equals(next.getPrefix())) {
        marshalRecord.getNamespaceResolver().put(next.getPrefix(),next.getNamespaceURI());
        returnList.add(next);
      }
    }
  }
  return returnList;
}

Fixed version (ground truth):
protected List addExtraNamespacesToNamespaceResolver(XMLDescriptor desc,XMLRecord marshalRecord,AbstractSession session){
  if (((XMLLogin)session.getDatasourceLogin()).hasEqualNamespaceResolvers()) {
    return null;
  }
  List returnList=new ArrayList();
  for (  Entry<String,String> entry : desc.getNonNullNamespaceResolver().getPrefixesToNamespaces().entrySet()) {
    String prefix=marshalRecord.getNamespaceResolver().resolveNamespaceURI(entry.getValue());
    if (prefix == null || prefix.length() == 0) {
      marshalRecord.getNamespaceResolver().put(entry.getKey(),entry.getValue());
      returnList.add(new Namespace(entry.getKey(),entry.getValue()));
    }
 else {
      if (!prefix.equals(entry.getKey())) {
        marshalRecord.getNamespaceResolver().put(entry.getKey(),entry.getValue());
        returnList.add(new Namespace(entry.getKey(),entry.getValue()));
      }
    }
  }
  return returnList;
}
Program: 66960
Project: 66960
Buggy source:
protected void setOrAddAttributeValueForKeepAsElement(SAXFragmentBuilder builder,XMLMapping mapping,XMLConverter converter,UnmarshalRecord unmarshalRecord,boolean isCollection,Object collection){
  Object node=builder.getNodes().pop();
  if (converter != null) {
    node=converter.convertDataValueToObjectValue(node,unmarshalRecord.getSession(),unmarshalRecord.getUnmarshaller());
  }
  if (isCollection) {
    if (collection != null) {
      unmarshalRecord.addAttributeValue((ContainerValue)this,node,collection);
    }
 else {
      unmarshalRecord.addAttributeValue((ContainerValue)this,node);
    }
  }
 else {
    unmarshalRecord.setAttributeValue(node,(DatabaseMapping)mapping);
  }
}

Fixed version (ground truth):
protected void setOrAddAttributeValueForKeepAsElement(SAXFragmentBuilder builder,XMLMapping mapping,XMLConverter converter,UnmarshalRecord unmarshalRecord,boolean isCollection,Object collection){
  Object node=builder.getNodes().remove(builder.getNodes().size() - 1);
  if (converter != null) {
    node=converter.convertDataValueToObjectValue(node,unmarshalRecord.getSession(),unmarshalRecord.getUnmarshaller());
  }
  if (isCollection) {
    if (collection != null) {
      unmarshalRecord.addAttributeValue((ContainerValue)this,node,collection);
    }
 else {
      unmarshalRecord.addAttributeValue((ContainerValue)this,node);
    }
  }
 else {
    unmarshalRecord.setAttributeValue(node,(DatabaseMapping)mapping);
  }
}
Program: 66962
Project: 66962
Buggy source:
public boolean startElement(MarshalRecord marshalRecord,XPathFragment anXPathFragment,Object object,AbstractSession session,NamespaceResolver namespaceResolver,TreeObjectBuilder compositeObjectBuilder,Object compositeObject){
  if (null == anXPathFragment) {
    return false;
  }
  marshalRecord.openStartElement(anXPathFragment,namespaceResolver);
  XPathNode attributeNode;
  boolean hasValue=false;
  if (null != attributeChildren) {
    int size=attributeChildren.size();
    for (int x=0; x < size; x++) {
      attributeNode=(XPathNode)attributeChildren.get(x);
      hasValue=attributeNode.marshal(marshalRecord,object,session,namespaceResolver,ObjectMarshalContext.getInstance()) || hasValue;
    }
  }
  if (anyAttributeNode != null) {
    hasValue=anyAttributeNode.marshal(marshalRecord,object,session,namespaceResolver,ObjectMarshalContext.getInstance()) || hasValue;
  }
  if (null != compositeObjectBuilder) {
    hasValue=compositeObjectBuilder.marshalAttributes(marshalRecord,compositeObject,session) || hasValue;
  }
  marshalRecord.closeStartElement();
  return hasValue;
}

Fixed version (ground truth):
public boolean startElement(MarshalRecord marshalRecord,XPathFragment anXPathFragment,Object object,AbstractSession session,NamespaceResolver namespaceResolver,TreeObjectBuilder compositeObjectBuilder,Object compositeObject){
  if (null == anXPathFragment) {
    return false;
  }
  marshalRecord.openStartElement(anXPathFragment,namespaceResolver);
  boolean hasValue=false;
  if (null != attributeChildren) {
    for (int x=0, size=attributeChildren.size(); x < size; x++) {
      XPathNode attributeNode=(XPathNode)attributeChildren.get(x);
      hasValue=attributeNode.marshal(marshalRecord,object,session,namespaceResolver,null,ObjectMarshalContext.getInstance()) || hasValue;
    }
  }
  if (anyAttributeNode != null) {
    hasValue=anyAttributeNode.marshal(marshalRecord,object,session,namespaceResolver,null,ObjectMarshalContext.getInstance()) || hasValue;
  }
  if (null != compositeObjectBuilder) {
    hasValue=compositeObjectBuilder.marshalAttributes(marshalRecord,compositeObject,session) || hasValue;
  }
  marshalRecord.closeStartElement();
  return hasValue;
}
Program: 66963
Project: 66963
Buggy source:
public int getIndex(String uri,String localName){
  Attr item;
  int size=attrs.size();
  for (int i=0; i < size; i++) {
    item=attrs.get(i);
    try {
      if (item.getNamespaceURI().equals(uri) && item.getLocalName().equals(localName)) {
        return i;
      }
    }
 catch (    Exception x) {
    }
  }
  return -1;
}

Fixed version (ground truth):
public int getIndex(String uri,String localName){
  for (int i=0, size=attrs.size(); i < size; i++) {
    Attr item=attrs.get(i);
    try {
      if (item.getNamespaceURI().equals(uri) && item.getLocalName().equals(localName)) {
        return i;
      }
    }
 catch (    Exception x) {
    }
  }
  return -1;
}
Program: 66964
Project: 66964
Buggy source:
/** 
 * Process namespace declarations on parent elements if not the root. For each parent node from current to root push each onto a stack,  then pop each off, calling startPrefixMapping for each XMLNS  attribute.  Using a stack ensures that the parent nodes are  processed top down.
 * @param element
 */
protected void processParentNamespaces(Element element) throws SAXException {
  Node parent=element.getParentNode();
  if (parent != null && parent.getNodeType() == Node.DOCUMENT_NODE) {
    return;
  }
  Stack<Node> parentElements=new Stack();
  while (parent != null && parent.getNodeType() != Node.DOCUMENT_NODE) {
    parentElements.push(parent);
    parent=parent.getParentNode();
  }
  for (Iterator stackIt=parentElements.iterator(); stackIt.hasNext(); ) {
    NamedNodeMap attrs=parentElements.pop().getAttributes();
    if (attrs != null) {
      int length=attrs.getLength();
      for (int i=0; i < length; i++) {
        Attr next=(Attr)attrs.item(i);
        String attrPrefix=next.getPrefix();
        if (attrPrefix != null && attrPrefix.equals(XMLConstants.XMLNS)) {
          getContentHandler().startPrefixMapping(next.getLocalName(),next.getValue());
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Process namespace declarations on parent elements if not the root. For each parent node from current to root push each onto a stack,  then pop each off, calling startPrefixMapping for each XMLNS  attribute.  Using a stack ensures that the parent nodes are  processed top down.
 * @param element
 */
protected void processParentNamespaces(Element element) throws SAXException {
  Node parent=element.getParentNode();
  if (parent != null && parent.getNodeType() == Node.DOCUMENT_NODE) {
    return;
  }
  List<Node> parentElements=new ArrayList();
  while (parent != null && parent.getNodeType() != Node.DOCUMENT_NODE) {
    parentElements.add(parent);
    parent=parent.getParentNode();
  }
  for (Iterator stackIt=parentElements.iterator(); stackIt.hasNext(); ) {
    NamedNodeMap attrs=parentElements.remove(parentElements.size() - 1).getAttributes();
    if (attrs != null) {
      for (int i=0, length=attrs.getLength(); i < length; i++) {
        Attr next=(Attr)attrs.item(i);
        String attrPrefix=next.getPrefix();
        if (attrPrefix != null && attrPrefix.equals(XMLConstants.XMLNS)) {
          getContentHandler().startPrefixMapping(next.getLocalName(),next.getValue());
        }
      }
    }
  }
}
Program: 66965
Project: 66965
Buggy source:
public String getValue(String uri,String localName){
  Attr item;
  int size=attrs.size();
  for (int i=0; i < size; i++) {
    item=attrs.get(i);
    if (item != null) {
      String itemNS=item.getNamespaceURI();
      if (item.getNamespaceURI() == null) {
        itemNS=XMLConstants.EMPTY_STRING;
      }
      if ((itemNS.equals(uri)) && (item.getLocalName() != null && item.getLocalName().equals(localName))) {
        return item.getValue();
      }
    }
  }
  return null;
}

Fixed version (ground truth):
public String getValue(String uri,String localName){
  for (int i=0, size=attrs.size(); i < size; i++) {
    Attr item=attrs.get(i);
    if (item != null) {
      String itemNS=item.getNamespaceURI();
      if (item.getNamespaceURI() == null) {
        itemNS=XMLConstants.EMPTY_STRING;
      }
      if ((itemNS.equals(uri)) && (item.getLocalName() != null && item.getLocalName().equals(localName))) {
        return item.getValue();
      }
    }
  }
  return null;
}
Program: 66966
Project: 66966
Buggy source:
public boolean handleEvent(ValidationEvent event){
  if (event.getSeverity() != ValidationEvent.ERROR) {
    return false;
  }
  Exception ex=(Exception)event.getLinkedException();
  String message=ex.getMessage();
  System.out.println("String_Node_Str" + message);
  if (message.indexOf("String_Node_Str") != -1) {
    System.out.println("String_Node_Str");
    return true;
  }
  return false;
}

Fixed version (ground truth):
public boolean handleEvent(ValidationEvent event){
  if (event.getSeverity() != ValidationEvent.ERROR) {
    return false;
  }
  errorCount++;
  if (errorCount == 1) {
    return true;
  }
  return false;
}
Program: 66968
Project: 66968
Buggy source:
/** 
 * INTERNAL: EJB 3.0 support. Returns the default listeners.
 */
public Vector getDefaultEventListeners(){
  if (defaultEventListeners == null) {
    defaultEventListeners=new Vector();
  }
  return defaultEventListeners;
}

Fixed version (ground truth):
/** 
 * INTERNAL: EJB 3.0 support. Returns the default listeners.
 */
public Vector getDefaultEventListeners(){
  if (defaultEventListeners == null) {
    defaultEventListeners=new NonSynchronizedVector();
  }
  return defaultEventListeners;
}
Program: 66969
Project: 66969
Buggy source:
/** 
 * INTERNAL: EJB 3.0 support. Builds our chains of descriptor event managers that will  need to be notified. The chains are cache so we only need to build them once.
 */
protected void initializeEJB30EventManagers(){
  entityEventManagers=new Vector();
  entityListenerEventManagers=new Vector();
  if (hasEntityEventListener()) {
    entityEventManagers.add(this);
  }
  if (hasEntityListenerEventListeners()) {
    entityListenerEventManagers.add(this);
  }
  ClassDescriptor currentDescriptor=getDescriptor();
  boolean excludeEntityListeners=excludeSuperclassListeners();
  while (currentDescriptor.isChildDescriptor()) {
    currentDescriptor=currentDescriptor.getInheritancePolicy().getParentDescriptor();
    DescriptorEventManager eventManager=currentDescriptor.getEventManager();
    if (eventManager.hasEntityEventListener()) {
      entityEventManagers.add(eventManager);
    }
    if (eventManager.hasEntityListenerEventListeners()) {
      if (!excludeEntityListeners) {
        entityListenerEventManagers.add(eventManager);
      }
    }
    excludeEntityListeners=eventManager.excludeSuperclassListeners();
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: EJB 3.0 support. Builds our chains of descriptor event managers that will  need to be notified. The chains are cache so we only need to build them once.
 */
protected void initializeEJB30EventManagers(){
  entityEventManagers=new NonSynchronizedVector();
  entityListenerEventManagers=new NonSynchronizedVector();
  if (hasEntityEventListener()) {
    entityEventManagers.add(this);
  }
  if (hasEntityListenerEventListeners()) {
    entityListenerEventManagers.add(this);
  }
  ClassDescriptor currentDescriptor=getDescriptor();
  boolean excludeEntityListeners=excludeSuperclassListeners();
  while (currentDescriptor.isChildDescriptor()) {
    currentDescriptor=currentDescriptor.getInheritancePolicy().getParentDescriptor();
    DescriptorEventManager eventManager=currentDescriptor.getEventManager();
    if (eventManager.hasEntityEventListener()) {
      entityEventManagers.add(eventManager);
    }
    if (eventManager.hasEntityListenerEventListeners()) {
      if (!excludeEntityListeners) {
        entityListenerEventManagers.add(eventManager);
      }
    }
    excludeEntityListeners=eventManager.excludeSuperclassListeners();
  }
}
Program: 66971
Project: 66971
Buggy source:
/** 
 * Add a Reference object to the list - these References will  be resolved after unmarshalling is complete.
 * @param ref
 */
public void addReference(Reference ref){
  references.add(ref);
}

Fixed version (ground truth):
/** 
 * Add a Reference object to the list - these References will be resolved after unmarshalling is complete.
 * @param ref
 */
public void addReference(Reference ref){
  references.add(ref);
}
Program: 66973
Project: 66973
Buggy source:
/** 
 * INTERNAL: Create vectors of primary key values to be used for cache lookup.  The map of vectors on the reference is keyed on the reference descriptors primary key field names.  Each of these vectors contains all of the values for a  particular key - in the order that they we read in from the document.  For example, if the key field names are A, B, and C, and there are three reference object instances, then the hashmap would have the following:   (A=[1,2,3], B=[X,Y,Z], C=[Jim, Joe, Jane]).  If the primary key field names on the reference descriptor contained [B, C, A], then the result of this method call would be reference.primaryKeys=([X, Jim, 1], [Y, Joe, 2], [Z, Jane, 3]).
 * @param reference
 */
private void createPKVectorsFromMap(Reference reference){
  XMLCollectionReferenceMapping mapping=(XMLCollectionReferenceMapping)reference.getMapping();
  Vector pks=new Vector();
  Vector pkFields=mapping.getReferenceDescriptor().getPrimaryKeyFieldNames();
  if (pkFields.size() <= 0) {
    return;
  }
  Vector pkVals;
  boolean init=true;
  for (Iterator pkFieldNameIt=pkFields.iterator(); pkFieldNameIt.hasNext(); ) {
    pkVals=(Vector)reference.getPrimaryKeyMap().get(pkFieldNameIt.next());
    if (pkVals == null) {
      return;
    }
    if (init) {
      for (int i=0; i < pkVals.size(); i++) {
        pks.add(new Vector());
      }
      init=false;
    }
    for (int i=0; i < pkVals.size(); i++) {
      Object val=pkVals.get(i);
      ((Vector)pks.get(i)).add(val);
    }
  }
  reference.primaryKeys=pks;
}

Fixed version (ground truth):
/** 
 * INTERNAL: Create vectors of primary key values to be used for cache lookup.  The map of vectors on the reference is keyed on the reference descriptors primary key field names.  Each of these vectors contains all of the values for a particular key - in the order that they we read in from the document.  For example, if the key field names are A, B, and C, and there are three reference object instances, then the hashmap would have the following: (A=[1,2,3], B=[X,Y,Z], C=[Jim, Joe, Jane]).  If the primary key field names on the reference descriptor contained [B, C, A], then the result of this method call would be reference.primaryKeys=([X, Jim, 1], [Y, Joe, 2], [Z, Jane, 3]).
 * @param reference
 */
private void createPKVectorsFromMap(Reference reference){
  XMLCollectionReferenceMapping mapping=(XMLCollectionReferenceMapping)reference.getMapping();
  Vector pks=new Vector();
  Vector pkFields=mapping.getReferenceDescriptor().getPrimaryKeyFieldNames();
  if (pkFields.size() <= 0) {
    return;
  }
  Vector pkVals;
  boolean init=true;
  for (Iterator pkFieldNameIt=pkFields.iterator(); pkFieldNameIt.hasNext(); ) {
    pkVals=(Vector)reference.getPrimaryKeyMap().get(pkFieldNameIt.next());
    if (pkVals == null) {
      return;
    }
    if (init) {
      for (int i=0; i < pkVals.size(); i++) {
        pks.add(new Vector());
      }
      init=false;
    }
    for (int i=0; i < pkVals.size(); i++) {
      Object val=pkVals.get(i);
      ((Vector)pks.get(i)).add(val);
    }
  }
  reference.primaryKeys=pks;
}
Program: 66974
Project: 66974
Buggy source:
/** 
 * Return true if the original container on the object should be used if  present.  If it is not present then the container policy will be used to create the container. 
 */
public boolean getReuseContainer(){
  return reuseContainer;
}

Fixed version (ground truth):
/** 
 * Return true if the original container on the object should be used if present.  If it is not present then the container policy will be used to create the container.
 */
public boolean getReuseContainer(){
  return reuseContainer;
}
Program: 66975
Project: 66975
Buggy source:
/** 
 * INTERNAL: Indicates the name of the Map class to be used.  
 * @param concreteMapClassName
 */
public void useMapClassName(String concreteMapClassName){
  this.setContainerPolicy(new DirectMapContainerPolicy());
  this.getContainerPolicy().setContainerClassName(concreteMapClassName);
}

Fixed version (ground truth):
/** 
 * INTERNAL: Indicates the name of the Map class to be used.
 * @param concreteMapClassName
 */
public void useMapClassName(String concreteMapClassName){
  this.setContainerPolicy(new DirectMapContainerPolicy());
  this.getContainerPolicy().setContainerClassName(concreteMapClassName);
}
Program: 66976
Project: 66976
Buggy source:
private Object buildObjectValuesFromDOMRecord(DOMRecord record,AbstractSession session,ObjectBuildingQuery query){
  DirectMapContainerPolicy cp=(DirectMapContainerPolicy)getContainerPolicy();
  Object container=cp.containerInstance();
  org.w3c.dom.Element root=(Element)record.getDOM();
  NamedNodeMap attributes=root.getAttributes();
  Attr next;
  String localName;
  int numberOfAtts=attributes.getLength();
  for (int i=0; i < numberOfAtts; i++) {
    next=(Attr)attributes.item(i);
    localName=next.getLocalName();
    if (null == localName) {
      localName=next.getName();
    }
    String namespaceURI=next.getNamespaceURI();
    boolean includeAttribute=true;
    if (!isNamespaceDeclarationIncluded && XMLConstants.XMLNS_URL.equals(namespaceURI)) {
      includeAttribute=false;
    }
 else     if (!isSchemaInstanceIncluded && XMLConstants.SCHEMA_INSTANCE_URL.equals(namespaceURI)) {
      includeAttribute=false;
    }
    if (includeAttribute) {
      String value=next.getValue();
      QName key=new QName(namespaceURI,localName);
      cp.addInto(key,value,container,session);
    }
  }
  return container;
}

Fixed version (ground truth):
private Object buildObjectValuesFromDOMRecord(DOMRecord record,AbstractSession session,ObjectBuildingQuery query){
  DirectMapContainerPolicy cp=(DirectMapContainerPolicy)getContainerPolicy();
  Object container=null;
  if (reuseContainer) {
    Object currentObject=record.getCurrentObject();
    Object value=getAttributeAccessor().getAttributeValueFromObject(currentObject);
    container=value != null ? value : cp.containerInstance();
  }
 else {
    container=cp.containerInstance();
  }
  org.w3c.dom.Element root=(Element)record.getDOM();
  NamedNodeMap attributes=root.getAttributes();
  Attr next;
  String localName;
  int numberOfAtts=attributes.getLength();
  for (int i=0; i < numberOfAtts; i++) {
    next=(Attr)attributes.item(i);
    localName=next.getLocalName();
    if (null == localName) {
      localName=next.getName();
    }
    String namespaceURI=next.getNamespaceURI();
    boolean includeAttribute=true;
    if (!isNamespaceDeclarationIncluded && XMLConstants.XMLNS_URL.equals(namespaceURI)) {
      includeAttribute=false;
    }
 else     if (!isSchemaInstanceIncluded && XMLConstants.SCHEMA_INSTANCE_URL.equals(namespaceURI)) {
      includeAttribute=false;
    }
    if (includeAttribute) {
      String value=next.getValue();
      QName key=new QName(namespaceURI,localName);
      cp.addInto(key,value,container,session);
    }
  }
  return container;
}
Program: 66977
Project: 66977
Buggy source:
/** 
 * Specify whether the original container on the object should be used if  present.  If it is not present then the container policy will be used to create the container. 
 */
public void setReuseContainer(boolean reuseContainer){
  this.reuseContainer=reuseContainer;
}

Fixed version (ground truth):
/** 
 * Specify whether the original container on the object should be used if present.  If it is not present then the container policy will be used to create the container.
 */
public void setReuseContainer(boolean reuseContainer){
  this.reuseContainer=reuseContainer;
}
Program: 66978
Project: 66978
Buggy source:
public void testTemporalOnClosedEm(){
  EntityManager em=createEntityManager();
  Query numericParameterQuery=em.createQuery("String_Node_Str");
  Query namedParameterQuery=em.createQuery("String_Node_Str");
  closeEntityManager(em);
  Exception caughtException=null;
  try {
    numericParameterQuery.setParameter(1,new Date(System.currentTimeMillis()),TemporalType.DATE);
  }
 catch (  Exception e) {
    caughtException=e;
  }
  assertTrue("String_Node_Str",caughtException instanceof IllegalStateException);
  try {
    numericParameterQuery.setParameter(1,Calendar.getInstance(),TemporalType.DATE);
  }
 catch (  Exception e) {
    caughtException=e;
  }
  assertTrue("String_Node_Str",caughtException instanceof IllegalStateException);
  try {
    namedParameterQuery.setParameter("String_Node_Str",new Date(System.currentTimeMillis()),TemporalType.DATE);
  }
 catch (  Exception e) {
    caughtException=e;
  }
  assertTrue("String_Node_Str",caughtException instanceof IllegalStateException);
  try {
    namedParameterQuery.setParameter("String_Node_Str",Calendar.getInstance(),TemporalType.DATE);
  }
 catch (  Exception e) {
    caughtException=e;
  }
  assertTrue("String_Node_Str",caughtException instanceof IllegalStateException);
}

Fixed version (ground truth):
public void testTemporalOnClosedEm(){
  if (isOnServer()) {
    return;
  }
  EntityManager em=createEntityManager();
  Query numericParameterQuery=em.createQuery("String_Node_Str");
  Query namedParameterQuery=em.createQuery("String_Node_Str");
  closeEntityManager(em);
  Exception caughtException=null;
  try {
    numericParameterQuery.setParameter(1,new Date(System.currentTimeMillis()),TemporalType.DATE);
  }
 catch (  Exception e) {
    caughtException=e;
  }
  assertTrue("String_Node_Str",caughtException instanceof IllegalStateException);
  try {
    numericParameterQuery.setParameter(1,Calendar.getInstance(),TemporalType.DATE);
  }
 catch (  Exception e) {
    caughtException=e;
  }
  assertTrue("String_Node_Str",caughtException instanceof IllegalStateException);
  try {
    namedParameterQuery.setParameter("String_Node_Str",new Date(System.currentTimeMillis()),TemporalType.DATE);
  }
 catch (  Exception e) {
    caughtException=e;
  }
  assertTrue("String_Node_Str",caughtException instanceof IllegalStateException);
  try {
    namedParameterQuery.setParameter("String_Node_Str",Calendar.getInstance(),TemporalType.DATE);
  }
 catch (  Exception e) {
    caughtException=e;
  }
  assertTrue("String_Node_Str",caughtException instanceof IllegalStateException);
}
Program: 66980
Project: 66980
Buggy source:
public XMLStreamReaderReader(){
}

Fixed version (ground truth):
public XMLStreamReaderReader(){
  unmarshalNamespaceContext=new UnmarshalNamespaceContext();
}
Program: 66981
Project: 66981
Buggy source:
@Override public void setContentHandler(ContentHandler aContentHandler){
  this.contentHandler=aContentHandler;
}

Fixed version (ground truth):
@Override public void setContentHandler(ContentHandler handler){
  this.contentHandler=handler;
  if (handler.getClass() == UnmarshalRecord.class) {
    ((UnmarshalRecord)handler).setUnmarshalNamespaceResolver(unmarshalNamespaceContext);
  }
 else   if (handler.getClass() == SAXUnmarshallerHandler.class) {
    ((SAXUnmarshallerHandler)handler).setUnmarshalNamespaceResolver(unmarshalNamespaceContext);
  }
}
Program: 66982
Project: 66982
Buggy source:
private Object selectSingleNode(Node contextNode,XPathFragment xPathFragment,XMLNamespaceResolver xmlNamespaceResolver){
  Node resultNode=getSingleNode(contextNode,xPathFragment,xmlNamespaceResolver);
  if (resultNode == null) {
    if (!xPathFragment.nameIsText()) {
      return XMLRecord.noEntry;
    }
    return null;
  }
  if (xPathFragment.getNextFragment() == null) {
    return resultNode;
  }
  return selectSingleNode(resultNode,xPathFragment.getNextFragment(),xmlNamespaceResolver);
}

Fixed version (ground truth):
private Object selectSingleNode(Node contextNode,XPathFragment xPathFragment,XMLNamespaceResolver xmlNamespaceResolver,boolean checkForXsiNil){
  Node resultNode=getSingleNode(contextNode,xPathFragment,xmlNamespaceResolver);
  if (resultNode == null) {
    if (checkForXsiNil) {
      String nil=((Element)contextNode).getAttributeNS(XMLConstants.SCHEMA_INSTANCE_URL,XMLConstants.SCHEMA_NIL_ATTRIBUTE);
      if (nil.equals(XMLConstants.BOOLEAN_STRING_TRUE)) {
        return XMLRecord.nil;
      }
    }
    if (!xPathFragment.nameIsText()) {
      return XMLRecord.noEntry;
    }
    return null;
  }
  if (xPathFragment.getNextFragment() == null) {
    return resultNode;
  }
  return selectSingleNode(resultNode,xPathFragment.getNextFragment(),xmlNamespaceResolver,checkForXsiNil);
}
Program: 66984
Project: 66984
Buggy source:
/** 
 * INTERNAL: Return the mapping's attribute value from the row. The execution session is passed for the case of building a UnitOfWork clone directly from a row, the session set in the query will not know which platform to use for converting the value.  Allows the correct session to be passed in.
 */
public Object valueFromRow(AbstractRecord row,JoinedAttributeManager joinManager,ObjectBuildingQuery query,AbstractSession executionSession){
  return getAttributeValue(row.getIndicatingNoEntry(this.field),executionSession,(XMLRecord)row);
}

Fixed version (ground truth):
/** 
 * INTERNAL: Return the mapping's attribute value from the row. The execution session is passed for the case of building a UnitOfWork clone directly from a row, the session set in the query will not know which platform to use for converting the value.  Allows the correct session to be passed in.
 */
public Object valueFromRow(AbstractRecord row,JoinedAttributeManager joinManager,ObjectBuildingQuery query,AbstractSession executionSession){
  boolean shouldCheckForXsiNil=getNullPolicy().isNullRepresentedByXsiNil();
  return getAttributeValue(((DOMRecord)row).getIndicatingNoEntry(this.field,false,shouldCheckForXsiNil),executionSession,(XMLRecord)row);
}
Program: 66985
Project: 66985
Buggy source:
public Object getIndicatingNoEntry(DatabaseField key,boolean shouldReturnNode){
  XMLField field=convertToXMLField(key);
  if (field.isSelfField()) {
    return this;
  }
  Object result=UnmarshalXPathEngine.getInstance().selectSingleNode(dom,field,field.getNamespaceResolver());
  if (result == noEntry) {
    if (shouldReturnNode) {
      return null;
    }
    return noEntry;
  }
  Node node=(Node)result;
  if (shouldReturnNode) {
    return node;
  }
  if (null == node) {
    return null;
  }
  if (Node.ELEMENT_NODE != node.getNodeType()) {
    if (node.getNodeType() == Node.ATTRIBUTE_NODE) {
      getValueFromAttribute((Attr)node,field);
    }
    return getValueFromElement((Element)node.getParentNode(),node,field);
  }
  return buildNestedRow((Element)node);
}

Fixed version (ground truth):
public Object getIndicatingNoEntry(DatabaseField key,boolean shouldReturnNode,boolean checkForXsiNil){
  XMLField field=convertToXMLField(key);
  if (field.isSelfField()) {
    return this;
  }
  Object result=UnmarshalXPathEngine.getInstance().selectSingleNode(dom,field,field.getNamespaceResolver(),checkForXsiNil);
  if (result == noEntry) {
    if (shouldReturnNode) {
      return null;
    }
    return noEntry;
  }
  if (result == nil) {
    return nil;
  }
  Node node=(Node)result;
  if (shouldReturnNode) {
    return node;
  }
  if (null == node) {
    return null;
  }
  if (Node.ELEMENT_NODE != node.getNodeType()) {
    if (node.getNodeType() == Node.ATTRIBUTE_NODE) {
      getValueFromAttribute((Attr)node,field);
    }
    return getValueFromElement((Element)node.getParentNode(),node,field);
  }
  return buildNestedRow((Element)node);
}
Program: 66986
Project: 66986
Buggy source:
public DirectNullPolicyElementSetNillableTestCases(String name) throws Exception {
  super(name);
  setControlDocument(XML_RESOURCE);
  AbstractNullPolicy aNullPolicy=new NullPolicy();
  aNullPolicy.setNullRepresentedByEmptyNode(true);
  aNullPolicy.setNullRepresentedByXsiNil(true);
  aNullPolicy.setMarshalNullRepresentation(XMLNullRepresentationType.XSI_NIL);
  Project aProject=new DirectNodeNullPolicyProject(true);
  XMLDescriptor employeeDescriptor=(XMLDescriptor)aProject.getDescriptor(Employee.class);
  NamespaceResolver namespaceResolver=new NamespaceResolver();
  namespaceResolver.put(XMLConstants.SCHEMA_INSTANCE_PREFIX,XMLConstants.SCHEMA_INSTANCE_URL);
  employeeDescriptor.setNamespaceResolver(namespaceResolver);
  XMLDirectMapping aMapping=(XMLDirectMapping)aProject.getDescriptor(Employee.class).getMappingForAttributeName("String_Node_Str");
  aMapping.setNullPolicy(aNullPolicy);
  setProject(aProject);
}

Fixed version (ground truth):
public DirectNullPolicyElementSetNillableTestCases(String name) throws Exception {
  super(name);
  setControlDocument(XML_RESOURCE);
  AbstractNullPolicy aNullPolicy=new NullPolicy();
  aNullPolicy.setNullRepresentedByEmptyNode(false);
  aNullPolicy.setNullRepresentedByXsiNil(true);
  aNullPolicy.setMarshalNullRepresentation(XMLNullRepresentationType.XSI_NIL);
  Project aProject=new DirectNodeNullPolicyProject(true);
  XMLDescriptor employeeDescriptor=(XMLDescriptor)aProject.getDescriptor(Employee.class);
  NamespaceResolver namespaceResolver=new NamespaceResolver();
  namespaceResolver.put(XMLConstants.SCHEMA_INSTANCE_PREFIX,XMLConstants.SCHEMA_INSTANCE_URL);
  employeeDescriptor.setNamespaceResolver(namespaceResolver);
  XMLDirectMapping aMapping=(XMLDirectMapping)aProject.getDescriptor(Employee.class).getMappingForAttributeName("String_Node_Str");
  aMapping.setNullPolicy(aNullPolicy);
  setProject(aProject);
}
Program: 66987
Project: 66987
Buggy source:
/** 
 * INTERNAL: Copy statements counts into UOW properties.
 */
private void copyStatementsCountIntoProperties(){
  try {
    Accessor accessor=getAccessor();
  }
 catch (  DatabaseException exception) {
  }
  if (accessor != null && accessor instanceof DatasourceAccessor) {
    getProperties().put(DatasourceAccessor.READ_STATEMENTS_COUNT_PROPERTY,new Integer(((DatasourceAccessor)accessor).getReadStatementsCount()));
    getProperties().put(DatasourceAccessor.WRITE_STATEMENTS_COUNT_PROPERTY,new Integer(((DatasourceAccessor)accessor).getWriteStatementsCount()));
    getProperties().put(DatasourceAccessor.STOREDPROCEDURE_STATEMENTS_COUNT_PROPERTY,new Integer(((DatasourceAccessor)accessor).getStoredProcedureStatementsCount()));
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: Copy statements counts into UOW properties.
 */
private void copyStatementsCountIntoProperties(){
  Accessor accessor=null;
  try {
    accessor=getAccessor();
  }
 catch (  DatabaseException exception) {
  }
  if (accessor != null && accessor instanceof DatasourceAccessor) {
    getProperties().put(DatasourceAccessor.READ_STATEMENTS_COUNT_PROPERTY,new Integer(((DatasourceAccessor)accessor).getReadStatementsCount()));
    getProperties().put(DatasourceAccessor.WRITE_STATEMENTS_COUNT_PROPERTY,new Integer(((DatasourceAccessor)accessor).getWriteStatementsCount()));
    getProperties().put(DatasourceAccessor.STOREDPROCEDURE_STATEMENTS_COUNT_PROPERTY,new Integer(((DatasourceAccessor)accessor).getStoredProcedureStatementsCount()));
  }
}
Program: 66988
Project: 66988
Buggy source:
/** 
 * PUBLIC: Return a new expression that aplies the function to the given expression.
 */
public static Expression atan(Expression expression){
  ExpressionOperator anOperator=expression.getOperator(ExpressionOperator.Atan);
  return anOperator.expressionFor(expression);
}

Fixed version (ground truth):
/** 
 * PUBLIC: Return a new expression that applies the function to the given expression.
 */
public static Expression atan(Expression expression){
  ExpressionOperator anOperator=expression.getOperator(ExpressionOperator.Atan);
  return anOperator.expressionFor(expression);
}
Program: 66989
Project: 66989
Buggy source:
/** 
 * PUBLIC: Return a new expression that aplies the function to the given expression.
 */
public static Expression add(Expression right,Object left){
  ExpressionOperator anOperator=right.getOperator(ExpressionOperator.Add);
  return anOperator.expressionFor(right,left);
}

Fixed version (ground truth):
/** 
 * PUBLIC: Return a new expression that applies the function to the given expression.
 */
public static Expression add(Expression right,Object left){
  ExpressionOperator anOperator=right.getOperator(ExpressionOperator.Add);
  return anOperator.expressionFor(right,left);
}
Program: 66990
Project: 66990
Buggy source:
/** 
 * PUBLIC: Return a new expression that aplies the function to the given expression.
 */
public static Expression acos(Expression expression){
  ExpressionOperator anOperator=expression.getOperator(ExpressionOperator.Acos);
  return anOperator.expressionFor(expression);
}

Fixed version (ground truth):
/** 
 * PUBLIC: Return a new expression that applies the function to the given expression.
 */
public static Expression acos(Expression expression){
  ExpressionOperator anOperator=expression.getOperator(ExpressionOperator.Acos);
  return anOperator.expressionFor(expression);
}
Program: 66991
Project: 66991
Buggy source:
/** 
 * PUBLIC: Return a new expression that aplies the function to the given expression. <p>Example: <pre><blockquote> Example: ExpressionMath.abs(builder.get("netWorth")).greaterThan(1000000); </blockquote></pre>
 */
public static Expression abs(Expression expression){
  ExpressionOperator anOperator=expression.getOperator(ExpressionOperator.Abs);
  return anOperator.expressionFor(expression);
}

Fixed version (ground truth):
/** 
 * PUBLIC: Return a new expression that applies the function to the given expression. <p>Example: <pre><blockquote> Example: ExpressionMath.abs(builder.get("netWorth")).greaterThan(1000000); </blockquote></pre>
 */
public static Expression abs(Expression expression){
  ExpressionOperator anOperator=expression.getOperator(ExpressionOperator.Abs);
  return anOperator.expressionFor(expression);
}
Program: 66992
Project: 66992
Buggy source:
/** 
 * PUBLIC: Return a new expression that aplies the function to the given expression.
 */
public static Expression asin(Expression expression){
  ExpressionOperator anOperator=expression.getOperator(ExpressionOperator.Asin);
  return anOperator.expressionFor(expression);
}

Fixed version (ground truth):
/** 
 * PUBLIC: Return a new expression that applies the function to the given expression.
 */
public static Expression asin(Expression expression){
  ExpressionOperator anOperator=expression.getOperator(ExpressionOperator.Asin);
  return anOperator.expressionFor(expression);
}
Program: 66993
Project: 66993
Buggy source:
/** 
 */
public boolean isAssignableFrom(Object left,Object right){
  if ((left == null) || (right == null)) {
    return true;
  }
  if (left == right) {
    return true;
  }
  if ((left == ClassConstants.OBJECT) || (right == ClassConstants.OBJECT)) {
    return true;
  }
 else   if (isNumericType(left) && isNumericType(right)) {
    return true;
  }
 else   if (isDateClass(left) && isDateClass(right)) {
    return true;
  }
 else   if (isBooleanType(left) && isBooleanType(right)) {
    return true;
  }
  return getJavaClass(left).isAssignableFrom(getJavaClass(right));
}

Fixed version (ground truth):
/** 
 * convenience method for java's isAssignableFrom that allows auto-boxing, taking java class or a descriptor as arguments.  It will return true if both sides are in the same category (Numberic, Date or Boolean) otherwise it will use java's  isAssignableFrom on the argument classes.    Returns true if either arguments is null.
 */
public boolean isAssignableFrom(Object left,Object right){
  if ((left == null) || (right == null)) {
    return true;
  }
  if (left == right) {
    return true;
  }
  if ((left == ClassConstants.OBJECT) || (right == ClassConstants.OBJECT)) {
    return true;
  }
 else   if (isNumericType(left) && isNumericType(right)) {
    return true;
  }
 else   if (isDateClass(left) && isDateClass(right)) {
    return true;
  }
 else   if (isBooleanType(left) && isBooleanType(right)) {
    return true;
  }
  return getJavaClass(left).isAssignableFrom(getJavaClass(right));
}
Program: 66994
Project: 66994
Buggy source:
/** 
 * Returns the primitive for the specified wrapper class. 
 */
protected Object getPrimitiveType(Object wrapper){
  return wrapperToPrimitive.get(wrapper);
}

Fixed version (ground truth):
/** 
 * Returns the primitive for the specified wrapper class. 
 */
protected Class getPrimitiveType(Object wrapper){
  return wrapperToPrimitive.get(wrapper);
}
Program: 66995
Project: 66995
Buggy source:
/** 
 * Returns the wrapper class for the specified primitive. 
 */
protected Object getWrapperClass(Object primitive){
  return primitiveToWrapper.get(primitive);
}

Fixed version (ground truth):
/** 
 * Returns the wrapper class for the specified primitive. 
 */
protected Class getWrapperClass(Object primitive){
  return primitiveToWrapper.get(primitive);
}