nus-yam/ex-repair huggingface dataset:
Program: 66624
Project: 66624
Buggy source:
public Map<TypeMappingInfo,QName> getTypeMappingInfoToSchemaType(){
  if (typeMappingInfoToSchemaType == null) {
    initTypeMappingInfoToSchemaType();
  }
  return typeMappingInfoToSchemaType;
}

Fixed version (ground truth):
public Map<TypeMappingInfo,QName> getTypeMappingInfoToSchemaType(){
  if (typeToTypeMappingInfo != null && typeToTypeMappingInfo.size() > 0) {
    return new HashMap<TypeMappingInfo,QName>();
  }
  return generator.getAnnotationsProcessor().getTypeMappingInfoToSchemaType();
}
Program: 66628
Project: 66628
Buggy source:
/** 
 * INTERNAL: Add the accessor to the descriptor
 */
protected void addAccessor(MappingAccessor accessor){
  if (accessor != null) {
    accessor.addConverters();
    if (accessor.isEmbeddedId()) {
      getProject().addIdClass(accessor.getReferenceClassName());
    }
    addPotentialEmbeddableAccessor(accessor.getReferenceClass(),accessor.getClassAccessor());
    if (accessor.isMappedKeyMapAccessor()) {
      MappedKeyMapAccessor mapAccessor=(MappedKeyMapAccessor)accessor;
      MetadataClass mapKeyClass=mapAccessor.getMapKeyClass();
      if (mapKeyClass == null || mapKeyClass.equals(void.class)) {
        mapKeyClass=accessor.getAccessibleObject().getMapKeyClass(getDescriptor());
        if (mapKeyClass == null) {
          throw ValidationException.unableToDetermineMapKeyClass(accessor.getAttributeName(),accessor.getJavaClass());
        }
 else {
          mapAccessor.setMapKeyClass(mapKeyClass);
        }
      }
      addPotentialEmbeddableAccessor(mapKeyClass,accessor.getClassAccessor());
    }
    getDescriptor().addAccessor(accessor);
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: Add the accessor to the descriptor
 */
protected void addAccessor(MappingAccessor accessor){
  if (accessor != null) {
    accessor.addConverters();
    if (accessor.isEmbeddedId()) {
      getProject().addIdClass(accessor.getReferenceClassName());
    }
    addPotentialEmbeddableAccessor(accessor.getReferenceClass(),accessor.getClassAccessor());
    if (accessor.isMappedKeyMapAccessor()) {
      MappedKeyMapAccessor mapAccessor=(MappedKeyMapAccessor)accessor;
      MetadataClass mapKeyClass=mapAccessor.getMapKeyClass();
      if (mapKeyClass == null || mapKeyClass.equals(void.class)) {
        mapKeyClass=accessor.getMapKeyReferenceClass();
        mapAccessor.setMapKeyClass(mapKeyClass);
      }
      addPotentialEmbeddableAccessor(mapKeyClass,accessor.getClassAccessor());
    }
    getDescriptor().addAccessor(accessor);
  }
}
Program: 66629
Project: 66629
Buggy source:
/** 
 * INTERNAL:
 */
protected DirectToFieldMapping processDirectMapKeyClass(MappedKeyMapAccessor mappedKeyMapAccessor){
  DirectToFieldMapping keyMapping=new DirectToFieldMapping();
  DatabaseField mapKeyField=getDatabaseField(getReferenceDatabaseTable(),MetadataLogger.MAP_KEY_COLUMN);
  keyMapping.setField(mapKeyField);
  keyMapping.setIsReadOnly(mapKeyField.isReadOnly());
  processMappingKeyConverter(keyMapping,mappedKeyMapAccessor.getMapKeyConvert(),mappedKeyMapAccessor.getMapKeyClass());
  keyMapping.setAttributeClassificationName(getMapKeyReferenceClass().getName());
  keyMapping.setDescriptor(getDescriptor().getClassDescriptor());
  return keyMapping;
}

Fixed version (ground truth):
/** 
 * INTERNAL:
 */
protected DirectToFieldMapping processDirectMapKeyClass(MappedKeyMapAccessor mappedKeyMapAccessor){
  DirectToFieldMapping keyMapping=new DirectToFieldMapping();
  DatabaseField mapKeyField=getDatabaseField(getReferenceDatabaseTable(),MetadataLogger.MAP_KEY_COLUMN);
  keyMapping.setField(mapKeyField);
  keyMapping.setIsReadOnly(mapKeyField.isReadOnly());
  processMappingKeyConverter(keyMapping,mappedKeyMapAccessor.getMapKeyConvert(),mappedKeyMapAccessor.getMapKeyClass());
  keyMapping.setAttributeClassificationName(mappedKeyMapAccessor.getMapKeyClass().getName());
  keyMapping.setDescriptor(getDescriptor().getClassDescriptor());
  return keyMapping;
}
Program: 66631
Project: 66631
Buggy source:
public int getIndex(String uri,String localName){
  if (null == localName) {
    return -1;
  }
  int index=0;
  for (  Attribute attribute : attributes) {
    QName testQName=new QName(uri,localName);
    if (attribute.getQName().equals(testQName)) {
      return index;
    }
    index++;
  }
  return -1;
}

Fixed version (ground truth):
public int getIndex(String uri,String localName){
  if (null == localName) {
    return -1;
  }
  int index=0;
  for (  Attribute attribute : attributes()) {
    QName testQName=new QName(uri,localName);
    if (attribute.getQName().equals(testQName)) {
      return index;
    }
    index++;
  }
  return -1;
}
Program: 66632
Project: 66632
Buggy source:
public XMLStreamReaderReader(){
  unmarshalNamespaceContext=new UnmarshalNamespaceContext();
}

Fixed version (ground truth):
public XMLStreamReaderReader(){
  unmarshalNamespaceContext=new UnmarshalNamespaceContext();
  indexedAttributeList=new IndexedAttributeList();
}
Program: 66633
Project: 66633
Buggy source:
public String getLocalName(int index){
  return attributes.get(index).getQName().getLocalPart();
}

Fixed version (ground truth):
public String getLocalName(int index){
  return attributes().get(index).getQName().getLocalPart();
}
Program: 66634
Project: 66634
Buggy source:
@Override public void setContentHandler(ContentHandler handler){
  super.setContentHandler(handler);
  if (handler.getClass() == UnmarshalRecord.class) {
    ((UnmarshalRecord)handler).setUnmarshalNamespaceResolver(unmarshalNamespaceContext);
  }
 else   if (handler.getClass() == SAXUnmarshallerHandler.class) {
    ((SAXUnmarshallerHandler)handler).setUnmarshalNamespaceResolver(unmarshalNamespaceContext);
  }
}

Fixed version (ground truth):
@Override public void setContentHandler(ContentHandler handler){
  super.setContentHandler(handler);
  Class handlerClass=handler.getClass();
  if (handlerClass == UnmarshalRecord.class) {
    ((UnmarshalRecord)handler).setUnmarshalNamespaceResolver(unmarshalNamespaceContext);
    qNameAware=false;
  }
 else   if (handlerClass == SAXUnmarshallerHandler.class) {
    ((SAXUnmarshallerHandler)handler).setUnmarshalNamespaceResolver(unmarshalNamespaceContext);
    qNameAware=true;
  }
 else {
    qNameAware=true;
  }
}
Program: 66636
Project: 66636
Buggy source:
public int getLength(){
  return attributes.size();
}

Fixed version (ground truth):
public int getLength(){
  return attributes().size();
}
Program: 66637
Project: 66637
Buggy source:
public String getURI(int index){
  return attributes.get(index).getQName().getNamespaceURI();
}

Fixed version (ground truth):
public String getURI(int index){
  return attributes().get(index).getQName().getNamespaceURI();
}
Program: 66639
Project: 66639
Buggy source:
public String getLocalName(){
  throw XMLMarshalException.operationNotSupported("String_Node_Str");
}

Fixed version (ground truth):
@Override public String getLocalName(){
  return rootElementLocalName;
}
Program: 66640
Project: 66640
Buggy source:
/** 
 * Initialize the aggregate query with the settings from the source query.
 */
protected void buildAggregateModifyQuery(ObjectLevelModifyQuery sourceQuery,ObjectLevelModifyQuery aggregateQuery,Object sourceAttributeValue){
  if (sourceQuery.getSession().isUnitOfWork()) {
    Object backupAttributeValue=getAttributeValueFromBackupClone(sourceQuery.getBackupClone());
    if (backupAttributeValue == null) {
      backupAttributeValue=getObjectBuilder(sourceAttributeValue,sourceQuery.getSession()).buildNewInstance();
    }
    aggregateQuery.setBackupClone(backupAttributeValue);
  }
  aggregateQuery.setCascadePolicy(sourceQuery.getCascadePolicy());
  aggregateQuery.setObject(sourceAttributeValue);
  aggregateQuery.setTranslationRow(sourceQuery.getTranslationRow());
  aggregateQuery.setSession(sourceQuery.getSession());
  aggregateQuery.setProperties(sourceQuery.getProperties());
}

Fixed version (ground truth):
/** 
 * Initialize the aggregate query with the settings from the source query.
 */
protected void buildAggregateModifyQuery(ObjectLevelModifyQuery sourceQuery,ObjectLevelModifyQuery aggregateQuery,Object sourceAttributeValue){
  if (sourceQuery.getSession().isUnitOfWork() && !isMapKeyMapping()) {
    Object backupAttributeValue=getAttributeValueFromBackupClone(sourceQuery.getBackupClone());
    if (backupAttributeValue == null) {
      backupAttributeValue=getObjectBuilder(sourceAttributeValue,sourceQuery.getSession()).buildNewInstance();
    }
    aggregateQuery.setBackupClone(backupAttributeValue);
  }
  aggregateQuery.setCascadePolicy(sourceQuery.getCascadePolicy());
  aggregateQuery.setObject(sourceAttributeValue);
  aggregateQuery.setTranslationRow(sourceQuery.getTranslationRow());
  aggregateQuery.setSession(sourceQuery.getSession());
  aggregateQuery.setProperties(sourceQuery.getProperties());
}
Program: 66641
Project: 66641
Buggy source:
public void initialize(DatabaseMapping mapping,Session session){
  try {
    ConversionManager cMgr=session.getDatasourcePlatform().getConversionManager();
    Class<? extends DomHandler> domHandlerClass=cMgr.convertClassNameToClass(domHandlerClassName);
    this.domHandler=domHandlerClass.newInstance();
    Method createUnmarshallerMethod=PrivilegedAccessHelper.getDeclaredMethod(domHandlerClass,"String_Node_Str",new Class[]{ValidationEventHandler.class});
    resultType=createUnmarshallerMethod.getReturnType();
    Method getElementMethod=PrivilegedAccessHelper.getDeclaredMethod(domHandlerClass,"String_Node_Str",new Class[]{resultType});
    elementClass=getElementMethod.getReturnType();
    xmlTransformer=XMLPlatformFactory.getInstance().getXMLPlatform().newXMLTransformer();
    xmlTransformer.setFormattedOutput(true);
  }
 catch (  Exception ex) {
    throw JAXBException.couldNotInitializeDomHandlerConverter(ex,domHandlerClassName,mapping.getAttributeName());
  }
}

Fixed version (ground truth):
public void initialize(DatabaseMapping mapping,Session session){
  try {
    ConversionManager cMgr=session.getDatasourcePlatform().getConversionManager();
    Class<? extends DomHandler> domHandlerClass=cMgr.convertClassNameToClass(domHandlerClassName);
    this.domHandler=domHandlerClass.newInstance();
    Method createUnmarshallerMethod=PrivilegedAccessHelper.getDeclaredMethod(domHandlerClass,"String_Node_Str",new Class[]{ValidationEventHandler.class});
    resultType=PrivilegedAccessHelper.getMethodReturnType(createUnmarshallerMethod);
    Method getElementMethod=PrivilegedAccessHelper.getDeclaredMethod(domHandlerClass,"String_Node_Str",new Class[]{resultType});
    elementClass=PrivilegedAccessHelper.getMethodReturnType(getElementMethod);
    xmlTransformer=XMLPlatformFactory.getInstance().getXMLPlatform().newXMLTransformer();
    xmlTransformer.setFormattedOutput(true);
  }
 catch (  Exception ex) {
    throw JAXBException.couldNotInitializeDomHandlerConverter(ex,domHandlerClassName,mapping.getAttributeName());
  }
}
Program: 66643
Project: 66643
Buggy source:
private Class getBoundTypeForXmlAdapterClass(Class adapterClass){
  Class boundType=Object.class;
  for (  Method method : adapterClass.getDeclaredMethods()) {
    if (method.getName().equals("String_Node_Str")) {
      Class returnType=method.getReturnType();
      if (!returnType.getName().equals(boundType.getName())) {
        boundType=returnType;
        break;
      }
    }
  }
  return boundType;
}

Fixed version (ground truth):
private Class getBoundTypeForXmlAdapterClass(Class adapterClass){
  Class boundType=Object.class;
  for (  Method method : PrivilegedAccessHelper.getDeclaredMethods(adapterClass)) {
    if (method.getName().equals("String_Node_Str")) {
      Class returnType=PrivilegedAccessHelper.getMethodReturnType(method);
      if (!returnType.getName().equals(boundType.getName())) {
        boundType=returnType;
        break;
      }
    }
  }
  return boundType;
}
Program: 66644
Project: 66644
Buggy source:
/** 
 * INTERNAL: The fromString value on the enum class must be invoked with the field value specified as an argument.  The result returned should be an instance of the enum class.
 */
public Object convertDataValueToObjectValue(Object dataValue,Session session){
  Object result=null;
  try {
    result=fromStringMethod.invoke(enumClass,new Object[]{dataValue});
  }
 catch (  Exception ex) {
    throw XMLMarshalException.errorInvokingFromStringMethod(ex,enumClass.getName());
  }
  return result;
}

Fixed version (ground truth):
/** 
 * INTERNAL: The fromString value on the enum class must be invoked with the field value specified as an argument.  The result returned should be an instance of the enum class.
 */
public Object convertDataValueToObjectValue(Object dataValue,Session session){
  Object result=null;
  try {
    result=PrivilegedAccessHelper.invokeMethod(fromStringMethod,enumClass,new Object[]{dataValue});
  }
 catch (  Exception ex) {
    throw XMLMarshalException.errorInvokingFromStringMethod(ex,enumClass.getName());
  }
  return result;
}
Program: 66645
Project: 66645
Buggy source:
/** 
 * INTERNAL: Set the enum class.
 */
public void initialize(DatabaseMapping mapping,Session session){
  if (getEnumClass() == null) {
    if (getEnumClassName() == null) {
      throw XMLMarshalException.enumClassNotSpecified();
    }
 else {
      try {
        enumClass=session.getDatasourcePlatform().getConversionManager().getLoader().loadClass(enumClassName);
      }
 catch (      Exception e) {
        throw XMLMarshalException.invalidEnumClassSpecified(e,enumClassName);
      }
    }
  }
  try {
    fromStringMethod=enumClass.getMethod("String_Node_Str",new Class[]{String.class});
  }
 catch (  Exception ex) {
    throw XMLMarshalException.errorInvokingFromStringMethod(ex,enumClass.getName());
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: Set the enum class.
 */
public void initialize(DatabaseMapping mapping,Session session){
  if (getEnumClass() == null) {
    if (getEnumClassName() == null) {
      throw XMLMarshalException.enumClassNotSpecified();
    }
 else {
      try {
        enumClass=session.getDatasourcePlatform().getConversionManager().getLoader().loadClass(enumClassName);
      }
 catch (      Exception e) {
        throw XMLMarshalException.invalidEnumClassSpecified(e,enumClassName);
      }
    }
  }
  try {
    fromStringMethod=PrivilegedAccessHelper.getMethod(enumClass,"String_Node_Str",new Class[]{String.class},true);
  }
 catch (  Exception ex) {
    throw XMLMarshalException.errorInvokingFromStringMethod(ex,enumClass.getName());
  }
}
Program: 66647
Project: 66647
Buggy source:
/** 
 * Assumes JavaType[] contains JavaClassImpl instances
 */
public JavaMethod getMethod(String arg0,JavaClass[] arg1){
  if (arg1 == null) {
    arg1=new JavaClass[0];
  }
  Class[] params=new Class[arg1.length];
  for (int i=0; i < arg1.length; i++) {
    JavaClass jType=arg1[i];
    if (jType != null) {
      params[i]=((JavaClassImpl)jType).getJavaClass();
    }
  }
  try {
    return new JavaMethodImpl(jClass.getMethod(arg0,params));
  }
 catch (  NoSuchMethodException nsme) {
    return null;
  }
}

Fixed version (ground truth):
/** 
 * Assumes JavaType[] contains JavaClassImpl instances
 */
public JavaMethod getMethod(String arg0,JavaClass[] arg1){
  if (arg1 == null) {
    arg1=new JavaClass[0];
  }
  Class[] params=new Class[arg1.length];
  for (int i=0; i < arg1.length; i++) {
    JavaClass jType=arg1[i];
    if (jType != null) {
      params[i]=((JavaClassImpl)jType).getJavaClass();
    }
  }
  try {
    Method method=PrivilegedAccessHelper.getMethod(jClass,arg0,params,true);
    return new JavaMethodImpl(method);
  }
 catch (  NoSuchMethodException nsme) {
    return null;
  }
}
Program: 66648
Project: 66648
Buggy source:
public JavaField getField(String arg0){
  try {
    return new JavaFieldImpl(jClass.getField(arg0));
  }
 catch (  NoSuchFieldException nsfe) {
    return null;
  }
}

Fixed version (ground truth):
public JavaField getField(String arg0){
  try {
    Field field=PrivilegedAccessHelper.getField(jClass,arg0,true);
    return new JavaFieldImpl(field);
  }
 catch (  NoSuchFieldException nsfe) {
    return null;
  }
}
Program: 66649
Project: 66649
Buggy source:
public JavaConstructor getConstructor(JavaClass[] paramTypes){
  if (paramTypes == null) {
    paramTypes=new JavaClass[0];
  }
  Class[] params=new Class[paramTypes.length];
  for (int i=0; i < paramTypes.length; i++) {
    JavaClass jType=paramTypes[i];
    if (jType != null) {
      params[i]=((JavaClassImpl)jType).getJavaClass();
    }
  }
  try {
    return new JavaConstructorImpl(jClass.getConstructor(params));
  }
 catch (  NoSuchMethodException nsme) {
    return null;
  }
}

Fixed version (ground truth):
public JavaConstructor getConstructor(JavaClass[] paramTypes){
  if (paramTypes == null) {
    paramTypes=new JavaClass[0];
  }
  Class[] params=new Class[paramTypes.length];
  for (int i=0; i < paramTypes.length; i++) {
    JavaClass jType=paramTypes[i];
    if (jType != null) {
      params[i]=((JavaClassImpl)jType).getJavaClass();
    }
  }
  try {
    Constructor constructor=PrivilegedAccessHelper.getConstructorFor(jClass,params,true);
    return new JavaConstructorImpl(constructor);
  }
 catch (  NoSuchMethodException nsme) {
    return null;
  }
}
Program: 66650
Project: 66650
Buggy source:
public Collection getFields(){
  ArrayList<JavaField> fieldCollection=new ArrayList<JavaField>();
  Field[] fields=jClass.getFields();
  for (  Field field : fields) {
    fieldCollection.add(new JavaFieldImpl(field));
  }
  return fieldCollection;
}

Fixed version (ground truth):
public Collection getFields(){
  ArrayList<JavaField> fieldCollection=new ArrayList<JavaField>();
  Field[] fields=PrivilegedAccessHelper.getFields(jClass);
  for (  Field field : fields) {
    fieldCollection.add(new JavaFieldImpl(field));
  }
  return fieldCollection;
}
Program: 66651
Project: 66651
Buggy source:
public Collection getMethods(){
  ArrayList<JavaMethod> methodCollection=new ArrayList<JavaMethod>();
  Method[] methods=jClass.getMethods();
  for (  Method method : methods) {
    methodCollection.add(new JavaMethodImpl(method));
  }
  return methodCollection;
}

Fixed version (ground truth):
public Collection getMethods(){
  ArrayList<JavaMethod> methodCollection=new ArrayList<JavaMethod>();
  Method[] methods=PrivilegedAccessHelper.getMethods(jClass);
  for (  Method method : methods) {
    methodCollection.add(new JavaMethodImpl(method));
  }
  return methodCollection;
}
Program: 66652
Project: 66652
Buggy source:
public JavaClass[] getParameterTypes(){
  Class[] params=jMethod.getParameterTypes();
  JavaClass[] paramArray=new JavaClass[params.length];
  for (int i=0; i < params.length; i++) {
    paramArray[i]=new JavaClassImpl(params[i]);
  }
  return paramArray;
}

Fixed version (ground truth):
public JavaClass[] getParameterTypes(){
  Class[] params=PrivilegedAccessHelper.getMethodParameterTypes(jMethod);
  JavaClass[] paramArray=new JavaClass[params.length];
  for (int i=0; i < params.length; i++) {
    paramArray[i]=new JavaClassImpl(params[i]);
  }
  return paramArray;
}
Program: 66653
Project: 66653
Buggy source:
public JavaClass getReturnType(){
  Type type=jMethod.getGenericReturnType();
  if (type instanceof ParameterizedType) {
    ParameterizedType pType=(ParameterizedType)type;
    return new JavaClassImpl(pType,jMethod.getReturnType());
  }
  return new JavaClassImpl(jMethod.getReturnType());
}

Fixed version (ground truth):
public JavaClass getReturnType(){
  Type type=jMethod.getGenericReturnType();
  Class returnType=PrivilegedAccessHelper.getMethodReturnType(jMethod);
  if (type instanceof ParameterizedType) {
    ParameterizedType pType=(ParameterizedType)type;
    return new JavaClassImpl(pType,returnType);
  }
  return new JavaClassImpl(returnType);
}
Program: 66654
Project: 66654
Buggy source:
public JavaClass getResolvedType(){
  return new JavaClassImpl(jMethod.getReturnType());
}

Fixed version (ground truth):
public JavaClass getResolvedType(){
  Class returnType=PrivilegedAccessHelper.getMethodReturnType(jMethod);
  return new JavaClassImpl(returnType);
}
Program: 66656
Project: 66656
Buggy source:
public boolean startElement(XPathFragment xPathFragment,UnmarshalRecord unmarshalRecord,Attributes atts){
  try {
    XMLDescriptor workingDescriptor=findReferenceDescriptor(xPathFragment,unmarshalRecord,atts,xmlAnyObjectMapping,xmlAnyObjectMapping.getKeepAsElementPolicy());
    UnmarshalKeepAsElementPolicy policy=xmlAnyObjectMapping.getKeepAsElementPolicy();
    if (((workingDescriptor == null) && (policy == UnmarshalKeepAsElementPolicy.KEEP_UNKNOWN_AS_ELEMENT)) || (policy == UnmarshalKeepAsElementPolicy.KEEP_ALL_AS_ELEMENT)) {
      setupHandlerForKeepAsElementPolicy(unmarshalRecord,xPathFragment,atts);
    }
 else     if (workingDescriptor != null) {
      processChild(xPathFragment,unmarshalRecord,atts,workingDescriptor,xmlAnyObjectMapping);
    }
 else {
      AnyMappingContentHandler handler=new AnyMappingContentHandler(unmarshalRecord,xmlAnyObjectMapping.usesXMLRoot());
      String qnameString=xPathFragment.getLocalName();
      if (xPathFragment.getPrefix() != null) {
        qnameString=xPathFragment.getPrefix() + XMLConstants.COLON + qnameString;
      }
      handler.startElement(xPathFragment.getNamespaceURI(),xPathFragment.getLocalName(),qnameString,atts);
      unmarshalRecord.getXMLReader().setContentHandler(handler);
      return true;
    }
  }
 catch (  SAXException e) {
    throw XMLMarshalException.unmarshalException(e);
  }
  return true;
}

Fixed version (ground truth):
public boolean startElement(XPathFragment xPathFragment,UnmarshalRecord unmarshalRecord,Attributes atts){
  try {
    XMLDescriptor workingDescriptor=findReferenceDescriptor(xPathFragment,unmarshalRecord,atts,xmlAnyObjectMapping,xmlAnyObjectMapping.getKeepAsElementPolicy());
    UnmarshalKeepAsElementPolicy policy=xmlAnyObjectMapping.getKeepAsElementPolicy();
    if (((workingDescriptor == null) && (policy == UnmarshalKeepAsElementPolicy.KEEP_UNKNOWN_AS_ELEMENT)) || (policy == UnmarshalKeepAsElementPolicy.KEEP_ALL_AS_ELEMENT)) {
      setupHandlerForKeepAsElementPolicy(unmarshalRecord,xPathFragment,atts);
    }
 else     if (workingDescriptor != null) {
      processChild(xPathFragment,unmarshalRecord,atts,workingDescriptor,xmlAnyObjectMapping);
    }
 else {
      AnyMappingContentHandler handler=new AnyMappingContentHandler(unmarshalRecord,xmlAnyObjectMapping.usesXMLRoot());
      String qnameString=xPathFragment.getLocalName();
      if (xPathFragment.getPrefix() != null) {
        qnameString=xPathFragment.getPrefix() + XMLConstants.COLON + qnameString;
      }
      handler.startElement(xPathFragment.getNamespaceURI(),xPathFragment.getLocalName(),qnameString,atts);
      XMLReader xmlReader=unmarshalRecord.getXMLReader();
      xmlReader.setContentHandler(handler);
      xmlReader.setLexicalHandler(handler);
      return true;
    }
  }
 catch (  SAXException e) {
    throw XMLMarshalException.unmarshalException(e);
  }
  return true;
}
Program: 66658
Project: 66658
Buggy source:
@Override public void startElement(String namespaceURI,String localName,String qName,Attributes atts) throws SAXException {
  if (XMLConstants.XOP_URL.equals(namespaceURI) && (INCLUDE_ELEMENT_NAME.equals(localName) || INCLUDE_ELEMENT_NAME.equals(qName))) {
    this.c_id=atts.getValue("String_Node_Str",HREF_ATTRIBUTE_NAME);
  }
 else {
    record.getXMLReader().setContentHandler(record);
    record.startElement(namespaceURI,localName,qName,atts);
  }
}

Fixed version (ground truth):
@Override public void startElement(String namespaceURI,String localName,String qName,Attributes atts) throws SAXException {
  if (XMLConstants.XOP_URL.equals(namespaceURI) && (INCLUDE_ELEMENT_NAME.equals(localName) || INCLUDE_ELEMENT_NAME.equals(qName))) {
    this.c_id=atts.getValue("String_Node_Str",HREF_ATTRIBUTE_NAME);
  }
 else {
    XMLReader xmlReader=record.getXMLReader();
    xmlReader.setContentHandler(record);
    xmlReader.setLexicalHandler(record);
    record.startElement(namespaceURI,localName,qName,atts);
  }
}
Program: 66660
Project: 66660
Buggy source:
public boolean startElement(XPathFragment xPathFragment,UnmarshalRecord unmarshalRecord,Attributes atts){
  try {
    unmarshalRecord.removeNullCapableValue(this);
    XMLField xmlField=(XMLField)xmlBinaryDataMapping.getField();
    XPathFragment lastFragment=xmlField.getLastXPathFragment();
    BinaryMappingContentHandler handler=new BinaryMappingContentHandler(unmarshalRecord,this,this.xmlBinaryDataMapping);
    String qnameString=xPathFragment.getLocalName();
    if (xPathFragment.getPrefix() != null) {
      qnameString=xPathFragment.getPrefix() + XMLConstants.COLON + qnameString;
    }
    handler.startElement(xPathFragment.getNamespaceURI(),xPathFragment.getLocalName(),qnameString,atts);
    unmarshalRecord.getXMLReader().setContentHandler(handler);
    return true;
  }
 catch (  SAXException ex) {
    throw XMLMarshalException.unmarshalException(ex);
  }
}

Fixed version (ground truth):
public boolean startElement(XPathFragment xPathFragment,UnmarshalRecord unmarshalRecord,Attributes atts){
  try {
    unmarshalRecord.removeNullCapableValue(this);
    XMLField xmlField=(XMLField)xmlBinaryDataMapping.getField();
    XPathFragment lastFragment=xmlField.getLastXPathFragment();
    BinaryMappingContentHandler handler=new BinaryMappingContentHandler(unmarshalRecord,this,this.xmlBinaryDataMapping);
    String qnameString=xPathFragment.getLocalName();
    if (xPathFragment.getPrefix() != null) {
      qnameString=xPathFragment.getPrefix() + XMLConstants.COLON + qnameString;
    }
    handler.startElement(xPathFragment.getNamespaceURI(),xPathFragment.getLocalName(),qnameString,atts);
    XMLReader xmlReader=unmarshalRecord.getXMLReader();
    xmlReader.setContentHandler(handler);
    xmlReader.setLexicalHandler(handler);
    return true;
  }
 catch (  SAXException ex) {
    throw XMLMarshalException.unmarshalException(ex);
  }
}
Program: 66662
Project: 66662
Buggy source:
public boolean startElement(XPathFragment xPathFragment,UnmarshalRecord unmarshalRecord,Attributes atts){
  SAXFragmentBuilder builder=unmarshalRecord.getFragmentBuilder();
  builder.setOwningRecord(unmarshalRecord);
  try {
    String namespaceURI=XMLConstants.EMPTY_STRING;
    if (xPathFragment.getNamespaceURI() != null) {
      namespaceURI=xPathFragment.getNamespaceURI();
    }
    String qName=xPathFragment.getLocalName();
    if (xPathFragment.getPrefix() != null) {
      qName=xPathFragment.getPrefix() + XMLConstants.COLON + qName;
    }
    builder.startElement(namespaceURI,xPathFragment.getLocalName(),qName,atts);
    unmarshalRecord.getXMLReader().setContentHandler(builder);
  }
 catch (  SAXException ex) {
  }
  return true;
}

Fixed version (ground truth):
public boolean startElement(XPathFragment xPathFragment,UnmarshalRecord unmarshalRecord,Attributes atts){
  SAXFragmentBuilder builder=unmarshalRecord.getFragmentBuilder();
  builder.setOwningRecord(unmarshalRecord);
  try {
    String namespaceURI=XMLConstants.EMPTY_STRING;
    if (xPathFragment.getNamespaceURI() != null) {
      namespaceURI=xPathFragment.getNamespaceURI();
    }
    String qName=xPathFragment.getLocalName();
    if (xPathFragment.getPrefix() != null) {
      qName=xPathFragment.getPrefix() + XMLConstants.COLON + qName;
    }
    builder.startElement(namespaceURI,xPathFragment.getLocalName(),qName,atts);
    XMLReader xmlReader=unmarshalRecord.getXMLReader();
    xmlReader.setContentHandler(builder);
    xmlReader.setLexicalHandler(null);
  }
 catch (  SAXException ex) {
  }
  return true;
}
Program: 66663
Project: 66663
Buggy source:
public boolean startElement(XPathFragment xPathFragment,UnmarshalRecord unmarshalRecord,Attributes atts){
  unmarshalRecord.removeNullCapableValue(this);
  SAXFragmentBuilder builder=unmarshalRecord.getFragmentBuilder();
  builder.setOwningRecord(unmarshalRecord);
  try {
    String namespaceURI=XMLConstants.EMPTY_STRING;
    if (xPathFragment.getNamespaceURI() != null) {
      namespaceURI=xPathFragment.getNamespaceURI();
    }
    String qName=xPathFragment.getLocalName();
    if (xPathFragment.getPrefix() != null) {
      qName=xPathFragment.getPrefix() + XMLConstants.COLON + qName;
    }
    builder.startElement(namespaceURI,xPathFragment.getLocalName(),qName,atts);
    unmarshalRecord.getXMLReader().setContentHandler(builder);
  }
 catch (  SAXException ex) {
  }
  return true;
}

Fixed version (ground truth):
public boolean startElement(XPathFragment xPathFragment,UnmarshalRecord unmarshalRecord,Attributes atts){
  unmarshalRecord.removeNullCapableValue(this);
  SAXFragmentBuilder builder=unmarshalRecord.getFragmentBuilder();
  builder.setOwningRecord(unmarshalRecord);
  try {
    String namespaceURI=XMLConstants.EMPTY_STRING;
    if (xPathFragment.getNamespaceURI() != null) {
      namespaceURI=xPathFragment.getNamespaceURI();
    }
    String qName=xPathFragment.getLocalName();
    if (xPathFragment.getPrefix() != null) {
      qName=xPathFragment.getPrefix() + XMLConstants.COLON + qName;
    }
    builder.startElement(namespaceURI,xPathFragment.getLocalName(),qName,atts);
    XMLReader xmlReader=unmarshalRecord.getXMLReader();
    xmlReader.setContentHandler(builder);
    xmlReader.setLexicalHandler(null);
  }
 catch (  SAXException ex) {
  }
  return true;
}
Program: 66664
Project: 66664
Buggy source:
protected void setupHandlerForKeepAsElementPolicy(UnmarshalRecord unmarshalRecord,XPathFragment xPathFragment,Attributes atts){
  SAXFragmentBuilder builder=unmarshalRecord.getFragmentBuilder();
  builder.setOwningRecord(unmarshalRecord);
  try {
    String namespaceURI=XMLConstants.EMPTY_STRING;
    if (xPathFragment.getNamespaceURI() != null) {
      namespaceURI=xPathFragment.getNamespaceURI();
    }
    String qName=xPathFragment.getLocalName();
    if (xPathFragment.getPrefix() != null) {
      qName=xPathFragment.getPrefix() + XMLConstants.COLON + qName;
    }
    builder.startElement(namespaceURI,xPathFragment.getLocalName(),qName,atts);
    unmarshalRecord.getXMLReader().setContentHandler(builder);
  }
 catch (  SAXException ex) {
  }
}

Fixed version (ground truth):
protected void setupHandlerForKeepAsElementPolicy(UnmarshalRecord unmarshalRecord,XPathFragment xPathFragment,Attributes atts){
  SAXFragmentBuilder builder=unmarshalRecord.getFragmentBuilder();
  builder.setOwningRecord(unmarshalRecord);
  try {
    String namespaceURI=XMLConstants.EMPTY_STRING;
    if (xPathFragment.getNamespaceURI() != null) {
      namespaceURI=xPathFragment.getNamespaceURI();
    }
    String qName=xPathFragment.getLocalName();
    if (xPathFragment.getPrefix() != null) {
      qName=xPathFragment.getPrefix() + XMLConstants.COLON + qName;
    }
    builder.startElement(namespaceURI,xPathFragment.getLocalName(),qName,atts);
    XMLReader xmlReader=unmarshalRecord.getXMLReader();
    xmlReader.setContentHandler(builder);
    xmlReader.setLexicalHandler(null);
  }
 catch (  SAXException ex) {
  }
}
Program: 66666
Project: 66666
Buggy source:
public void testInheritanceQuery(){
  EntityManager em=createEntityManager();
  beginTransaction(em);
  em.persist(new LargeProject());
  commitTransaction(em);
  clearCache();
  ClassDescriptor descriptor=getServerSession().getClassDescriptor(Project.class);
  ReadAllQuery query=new ReadAllQuery(Project.class);
  ExpressionBuilder b=query.getExpressionBuilder();
  query.addArgument("String_Node_Str",Integer.class);
  ReportQuery subQuery=new ReportQuery();
  subQuery.setReferenceClass(Project.class);
  SQLCall selectIdsCall=new SQLCall();
  String subSelect="String_Node_Str";
  selectIdsCall.setSQLString(subSelect);
  subQuery.setCall(selectIdsCall);
  Expression expr=b.get("String_Node_Str").in(subQuery);
  query.setSelectionCriteria(expr);
  Vector params=new Vector(1);
  params.add(new Integer(1));
  List res=(List)getServerSession().executeQuery(query,params);
  assertTrue(res.size() == 1);
}

Fixed version (ground truth):
public void testInheritanceQuery(){
  EntityManager em=createEntityManager();
  beginTransaction(em);
  LargeProject project=new LargeProject();
  em.persist(project);
  commitTransaction(em);
  int id=project.getId();
  clearCache();
  ClassDescriptor descriptor=getServerSession().getClassDescriptor(Project.class);
  ReadAllQuery query=new ReadAllQuery(Project.class);
  ExpressionBuilder b=query.getExpressionBuilder();
  query.addArgument("String_Node_Str",Integer.class);
  ReportQuery subQuery=new ReportQuery();
  subQuery.setReferenceClass(Project.class);
  SQLCall selectIdsCall=new SQLCall();
  String subSelect="String_Node_Str";
  selectIdsCall.setSQLString(subSelect);
  subQuery.setCall(selectIdsCall);
  Expression expr=b.get("String_Node_Str").in(subQuery);
  query.setSelectionCriteria(expr);
  Vector params=new Vector(1);
  params.add(id);
  List res=(List)getServerSession().executeQuery(query,params);
  assertTrue(res.size() == 1);
}
Program: 66667
Project: 66667
Buggy source:
/** 
 * INTERNAL: This method provides an optimization in cases where the value has already been calculated.
 * @param xPathFragment
 * @param marshalRecord
 * @param object
 * @param objectValue
 * @param session
 * @param namespaceResolver
 * @param marshalContext
 * @return
 */
public abstract boolean marshalSingleValue(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,Object objectValue,AbstractSession session,NamespaceResolver namespaceResolver,MarshalContext marshalContext);

Fixed version (ground truth):
/** 
 * INTERNAL: This method provides an optimization in cases where the value has already been calculated.
 * @param xPathFragment
 * @param marshalRecord
 * @param object
 * @param objectValue
 * @param session
 * @param namespaceResolver
 * @param marshalContext
 * @return
 */
public boolean marshalSingleValue(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,Object objectValue,AbstractSession session,NamespaceResolver namespaceResolver,MarshalContext marshalContext,XPathFragment rootFragment){
  return this.marshalSingleValue(xPathFragment,marshalRecord,object,objectValue,session,namespaceResolver,marshalContext);
}
Program: 66668
Project: 66668
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.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;
}

Fixed version (ground truth):
public AbstractRecord buildRow(AbstractRecord record,Object object,org.eclipse.persistence.internal.sessions.AbstractSession session,XMLMarshaller marshaller,XPathFragment rootFragment){
  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),rootFragment);
  }
  return record;
}
Program: 66670
Project: 66670
Buggy source:
public boolean marshal(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,AbstractSession session,NamespaceResolver namespaceResolver,MarshalContext marshalContext){
  if (xmlBinaryDataMapping.isReadOnly()) {
    return false;
  }
  Object objectValue=marshalContext.getAttributeValue(object,xmlBinaryDataMapping);
  return this.marshalSingleValue(xPathFragment,marshalRecord,object,objectValue,session,namespaceResolver,marshalContext);
}

Fixed version (ground truth):
public boolean marshal(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,AbstractSession session,NamespaceResolver namespaceResolver,MarshalContext marshalContext,XPathFragment rootFragment){
  if (xmlBinaryDataMapping.isReadOnly()) {
    return false;
  }
  Object objectValue=marshalContext.getAttributeValue(object,xmlBinaryDataMapping);
  return this.marshalSingleValue(xPathFragment,marshalRecord,object,objectValue,session,namespaceResolver,marshalContext,rootFragment);
}
Program: 66673
Project: 66673
Buggy source:
public boolean marshal(NodeValue nodeValue,XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,AbstractSession session,NamespaceResolver namespaceResolver){
  return nodeValue.marshal(xPathFragment,marshalRecord,object,session,namespaceResolver,this);
}

Fixed version (ground truth):
public boolean marshal(NodeValue nodeValue,XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,AbstractSession session,NamespaceResolver namespaceResolver,XPathFragment rootFragment){
  return nodeValue.marshal(xPathFragment,marshalRecord,object,session,namespaceResolver,this,rootFragment);
}
Program: 66677
Project: 66677
Buggy source:
protected MethodInfo[] getMethodInfo(String schema,String name) throws SQLException {
  String[] keys=null;
  Object[] values=null;
  if (m_methodFilter != null && m_methodFilter.isSingleMethod()) {
    keys=new String[]{OWNER,PACKAGE_NAME,OBJECT_NAME,DATA_LEVEL};
    values=new Object[]{schema,name,m_methodFilter.getSingleMethodName(),new Integer(0)};
  }
 else {
    keys=new String[]{OWNER,Util.PACKAGE_NAME,Util.DATA_LEVEL};
    values=new Object[]{schema,name,new Integer(0)};
  }
  Iterator<ViewRow> iter=m_viewCache.getRows(ALL_ARGUMENTS,new String[0],keys,values,new String[0]);
  MethodInfo[] minfo=MethodInfo.groupBy(iter);
  return minfo;
}

Fixed version (ground truth):
protected MethodInfo[] getMethodInfo(String schema,String name) throws SQLException {
  String[] keys=null;
  Object[] values=null;
  if (m_methodFilter != null && m_methodFilter.isSingleMethod()) {
    keys=new String[]{OWNER,PACKAGE_NAME,OBJECT_NAME,DATA_LEVEL};
    values=new Object[]{schema,name,m_methodFilter.getSingleMethodName(),Integer.valueOf(0)};
  }
 else {
    keys=new String[]{OWNER,Util.PACKAGE_NAME,Util.DATA_LEVEL};
    values=new Object[]{schema,name,Integer.valueOf(0)};
  }
  Iterator<ViewRow> iter=m_viewCache.getRows(ALL_ARGUMENTS,new String[0],keys,values,new String[0]);
  MethodInfo[] minfo=MethodInfo.groupBy(iter);
  return minfo;
}
Program: 66678
Project: 66678
Buggy source:
public ResultInfoValues(String schema,String name,MethodFilter methodFilter,ViewCache viewCache) throws SQLException {
  super(schema,name);
  String[] keys=null;
  Object[] values=null;
  if (methodFilter != null && methodFilter.isSingleMethod()) {
    keys=new String[]{OWNER,PACKAGE_NAME,OBJECT_NAME,DATA_LEVEL,POSITION};
    values=new Object[]{schema,name,methodFilter.getSingleMethodName(),new Integer(0),new Integer(0)};
  }
 else {
    keys=new String[]{OWNER,PACKAGE_NAME,DATA_LEVEL,POSITION};
    values=new Object[]{schema,name,new Integer(0),new Integer(0)};
  }
  Iterator<ViewRow> iter=viewCache.getRows(ALL_ARGUMENTS,new String[0],keys,values,new String[0]);
  while (iter.hasNext()) {
    UserArguments item=(UserArguments)iter.next();
    String key=makeKey(item.OBJECT_NAME,item.OVERLOAD);
    if (m_ht.get(key) == null) {
      ArrayList<ViewRow> itemWrapper=new ArrayList<ViewRow>();
      itemWrapper.add(item);
      m_ht.put(key,itemWrapper);
    }
  }
}

Fixed version (ground truth):
public ResultInfoValues(String schema,String name,MethodFilter methodFilter,ViewCache viewCache) throws SQLException {
  super(schema,name);
  String[] keys=null;
  Object[] values=null;
  if (methodFilter != null && methodFilter.isSingleMethod()) {
    keys=new String[]{OWNER,PACKAGE_NAME,OBJECT_NAME,DATA_LEVEL,POSITION};
    values=new Object[]{schema,name,methodFilter.getSingleMethodName(),Integer.valueOf(0),Integer.valueOf(0)};
  }
 else {
    keys=new String[]{OWNER,PACKAGE_NAME,DATA_LEVEL,POSITION};
    values=new Object[]{schema,name,Integer.valueOf(0),Integer.valueOf(0)};
  }
  Iterator<ViewRow> iter=viewCache.getRows(ALL_ARGUMENTS,new String[0],keys,values,new String[0]);
  while (iter.hasNext()) {
    UserArguments item=(UserArguments)iter.next();
    String key=makeKey(item.OBJECT_NAME,item.OVERLOAD);
    if (m_ht.get(key) == null) {
      ArrayList<ViewRow> itemWrapper=new ArrayList<ViewRow>();
      itemWrapper.add(item);
      m_ht.put(key,itemWrapper);
    }
  }
}
Program: 66679
Project: 66679
Buggy source:
public ParamInfoValues(String schema,String name,MethodFilter methodFilter,ViewCache viewCache) throws SQLException {
  super(schema,name);
  String[] keys=null;
  Object[] values=null;
  if (methodFilter != null && methodFilter.isSingleMethod()) {
    keys=new String[]{OWNER,PACKAGE_NAME,OBJECT_NAME,DATA_LEVEL};
    values=new Object[]{schema,name,methodFilter.getSingleMethodName(),new Integer(0)};
  }
 else {
    keys=new String[]{OWNER,PACKAGE_NAME,DATA_LEVEL};
    values=new Object[]{schema,name,new Integer(0)};
  }
  Iterator<ViewRow> iter=viewCache.getRows(ALL_ARGUMENTS,new String[0],keys,values,new String[0]);
  ArrayList<ViewRow> viewRows=new ArrayList<ViewRow>();
  while (iter.hasNext()) {
    UserArguments item=(UserArguments)iter.next();
    if (item.ARGUMENT_NAME != null) {
      viewRows.add(item);
    }
  }
  UserArguments.orderByPosition(viewRows);
  for (int i=0; i < viewRows.size(); i++) {
    UserArguments item=(UserArguments)viewRows.get(i);
    String key=makeKey(item.OBJECT_NAME,item.OVERLOAD);
    ArrayList<ViewRow> v=m_ht.get(key);
    if (v == null) {
      v=new ArrayList<ViewRow>();
      m_ht.put(key,v);
    }
    v.add(item);
  }
}

Fixed version (ground truth):
public ParamInfoValues(String schema,String name,MethodFilter methodFilter,ViewCache viewCache) throws SQLException {
  super(schema,name);
  String[] keys=null;
  Object[] values=null;
  if (methodFilter != null && methodFilter.isSingleMethod()) {
    keys=new String[]{OWNER,PACKAGE_NAME,OBJECT_NAME,DATA_LEVEL};
    values=new Object[]{schema,name,methodFilter.getSingleMethodName(),Integer.valueOf(0)};
  }
 else {
    keys=new String[]{OWNER,PACKAGE_NAME,DATA_LEVEL};
    values=new Object[]{schema,name,Integer.valueOf(0)};
  }
  Iterator<ViewRow> iter=viewCache.getRows(ALL_ARGUMENTS,new String[0],keys,values,new String[0]);
  ArrayList<ViewRow> viewRows=new ArrayList<ViewRow>();
  while (iter.hasNext()) {
    UserArguments item=(UserArguments)iter.next();
    if (item.ARGUMENT_NAME != null) {
      viewRows.add(item);
    }
  }
  UserArguments.orderByPosition(viewRows);
  for (int i=0; i < viewRows.size(); i++) {
    UserArguments item=(UserArguments)viewRows.get(i);
    String key=makeKey(item.OBJECT_NAME,item.OVERLOAD);
    ArrayList<ViewRow> v=m_ht.get(key);
    if (v == null) {
      v=new ArrayList<ViewRow>();
      m_ht.put(key,v);
    }
    v.add(item);
  }
}
Program: 66680
Project: 66680
Buggy source:
public boolean isPre920(){
  if (m_isPre920 == null) {
    try {
      String v=m_conn.getMetaData().getDatabaseProductVersion().toUpperCase();
      if (v.startsWith("String_Node_Str") || v.startsWith("String_Node_Str")) {
        m_isPre920=new Boolean(false);
        return false;
      }
      int pos=v.indexOf("String_Node_Str");
      if (0 < pos) {
        v=v.substring(pos);
      }
      String vp=v.substring(0,"String_Node_Str".length()).toUpperCase();
      if (vp.equals("String_Node_Str") || vp.equals("String_Node_Str") || vp.equals("String_Node_Str")|| (vp.equals("String_Node_Str") && (v.indexOf("String_Node_Str") > 0 || v.indexOf("String_Node_Str") > 0 || v.indexOf("String_Node_Str") > 0))) {
        m_isPre920=new Boolean(false);
      }
    }
 catch (    Exception e) {
    }
    if (m_isPre920 == null) {
      m_isPre920=new Boolean(true);
    }
  }
  return m_isPre920.booleanValue();
}

Fixed version (ground truth):
public boolean isPre920(){
  if (m_isPre920 == null) {
    try {
      String v=m_conn.getMetaData().getDatabaseProductVersion().toUpperCase();
      if (v.startsWith("String_Node_Str") || v.startsWith("String_Node_Str")) {
        m_isPre920=Boolean.valueOf(false);
        return false;
      }
      int pos=v.indexOf("String_Node_Str");
      if (0 < pos) {
        v=v.substring(pos);
      }
      String vp=v.substring(0,"String_Node_Str".length()).toUpperCase();
      if (vp.equals("String_Node_Str") || vp.equals("String_Node_Str") || vp.equals("String_Node_Str")|| (vp.equals("String_Node_Str") && (v.indexOf("String_Node_Str") > 0 || v.indexOf("String_Node_Str") > 0 || v.indexOf("String_Node_Str") > 0))) {
        m_isPre920=Boolean.valueOf(false);
      }
    }
 catch (    Exception e) {
    }
    if (m_isPre920 == null) {
      m_isPre920=Boolean.valueOf(true);
    }
  }
  return m_isPre920.booleanValue();
}
Program: 66681
Project: 66681
Buggy source:
protected MethodInfo[] getMethodInfo(String schema,String name) throws SQLException {
  Iterator<ViewRow> iter;
  List<String> names=new ArrayList<String>();
  List<Object> values=new ArrayList<Object>();
  names.add(Util.OWNER);
  values.add(schema);
  names.add(Util.PACKAGE_NAME);
  values.add(null);
  names.add(Util.DATA_LEVEL);
  values.add(new Integer(0));
  if (m_methodFilter != null) {
    List<String> methodNames=m_methodFilter.getMethodNames();
    if (methodNames != null) {
      for (int i=0, len=methodNames.size(); i < len; i++) {
        names.add(Util.OBJECT_NAME);
        values.add(SqlName.dbifyName(methodNames.get(i),m_reflector));
      }
    }
  }
  iter=m_viewCache.getRows(ALL_ARGUMENTS,new String[0],(String[])names.toArray(new String[0]),values.toArray(new Object[0]),new String[0]);
  MethodInfo[] minfo=MethodInfo.groupBy(iter);
  return minfo;
}

Fixed version (ground truth):
protected MethodInfo[] getMethodInfo(String schema,String name) throws SQLException {
  Iterator<ViewRow> iter;
  List<String> names=new ArrayList<String>();
  List<Object> values=new ArrayList<Object>();
  names.add(Util.OWNER);
  values.add(schema);
  names.add(Util.PACKAGE_NAME);
  values.add(null);
  names.add(Util.DATA_LEVEL);
  values.add(Integer.valueOf(0));
  if (m_methodFilter != null) {
    List<String> methodNames=m_methodFilter.getMethodNames();
    if (methodNames != null) {
      for (int i=0, len=methodNames.size(); i < len; i++) {
        names.add(Util.OBJECT_NAME);
        values.add(SqlName.dbifyName(methodNames.get(i),m_reflector));
      }
    }
  }
  iter=m_viewCache.getRows(ALL_ARGUMENTS,new String[0],(String[])names.toArray(new String[0]),values.toArray(new Object[0]),new String[0]);
  MethodInfo[] minfo=MethodInfo.groupBy(iter);
  return minfo;
}