nus-yam/ex-repair huggingface dataset:
Program: 66682
Project: 66682
Buggy source:
protected ResultInfo getResultInfo(String schema,String name,String method,String methodNo) throws SQLException {
  Iterator<ViewRow> iter=null;
  if (methodNo == null) {
    iter=m_viewCache.getRows(ALL_ARGUMENTS,new String[0],new String[]{OWNER,PACKAGE_NAME,PACKAGE_NAME,OBJECT_NAME,DATA_LEVEL,POSITION},new Object[]{schema,method,null,method,new Integer(0),new Integer(0)},new String[0]);
  }
 else {
    iter=m_viewCache.getRows(ALL_ARGUMENTS,new String[0],new String[]{OWNER,PACKAGE_NAME,PACKAGE_NAME,OBJECT_NAME,OVERLOAD,DATA_LEVEL,POSITION},new Object[]{schema,method,null,method,methodNo,new Integer(0),new Integer(0)},new String[0]);
  }
  return ResultInfo.getResultInfo(iter);
}

Fixed version (ground truth):
protected ResultInfo getResultInfo(String schema,String name,String method,String methodNo) throws SQLException {
  Iterator<ViewRow> iter=null;
  if (methodNo == null) {
    iter=m_viewCache.getRows(ALL_ARGUMENTS,new String[0],new String[]{OWNER,PACKAGE_NAME,PACKAGE_NAME,OBJECT_NAME,DATA_LEVEL,POSITION},new Object[]{schema,method,null,method,Integer.valueOf(0),Integer.valueOf(0)},new String[0]);
  }
 else {
    iter=m_viewCache.getRows(ALL_ARGUMENTS,new String[0],new String[]{OWNER,PACKAGE_NAME,PACKAGE_NAME,OBJECT_NAME,OVERLOAD,DATA_LEVEL,POSITION},new Object[]{schema,method,null,method,methodNo,Integer.valueOf(0),Integer.valueOf(0)},new String[0]);
  }
  return ResultInfo.getResultInfo(iter);
}
Program: 66683
Project: 66683
Buggy source:
protected ParamInfo[] getParamInfo(String schema,String name,String method,String methodNo) throws SQLException {
  Iterator<ViewRow> iter=null;
  if (methodNo == null) {
    iter=m_viewCache.getRows(ALL_ARGUMENTS,new String[0],new String[]{OWNER,PACKAGE_NAME,PACKAGE_NAME,OBJECT_NAME,DATA_LEVEL,ARGUMENT_NAME},new Object[]{schema,method,null,method,new Integer(0),NOT_NULL},new String[]{POSITION});
  }
 else {
    iter=m_viewCache.getRows(ALL_ARGUMENTS,new String[0],new String[]{OWNER,PACKAGE_NAME,PACKAGE_NAME,OBJECT_NAME,OVERLOAD,DATA_LEVEL,ARGUMENT_NAME},new Object[]{schema,method,null,method,methodNo,new Integer(0),NOT_NULL},new String[]{POSITION});
  }
  return ParamInfo.getParamInfo(iter);
}

Fixed version (ground truth):
protected ParamInfo[] getParamInfo(String schema,String name,String method,String methodNo) throws SQLException {
  Iterator<ViewRow> iter=null;
  if (methodNo == null) {
    iter=m_viewCache.getRows(ALL_ARGUMENTS,new String[0],new String[]{OWNER,PACKAGE_NAME,PACKAGE_NAME,OBJECT_NAME,DATA_LEVEL,ARGUMENT_NAME},new Object[]{schema,method,null,method,Integer.valueOf(0),NOT_NULL},new String[]{POSITION});
  }
 else {
    iter=m_viewCache.getRows(ALL_ARGUMENTS,new String[0],new String[]{OWNER,PACKAGE_NAME,PACKAGE_NAME,OBJECT_NAME,OVERLOAD,DATA_LEVEL,ARGUMENT_NAME},new Object[]{schema,method,null,method,methodNo,Integer.valueOf(0),NOT_NULL},new String[]{POSITION});
  }
  return ParamInfo.getParamInfo(iter);
}
Program: 66686
Project: 66686
Buggy source:
public void writeExternal(ObjectOutput out) throws IOException {
  if (m_viewCacheDebug) {
    System.out.println("String_Node_Str");
  }
  out.writeObject(m_user);
  out.writeObject(new Integer(m_hits));
  out.writeObject(new Integer(m_visits));
  out.writeObject(new Integer(m_rowsCache.size()));
  for (int i=0; i < m_rowsCache.size(); i++) {
    RowsCacheEntry rce=(RowsCacheEntry)m_rowsCache.get(i);
    out.writeObject(rce);
  }
  out.writeObject(new Integer(m_rowsCacheIndex.size()));
  Iterator keys=m_rowsCacheIndex.keySet().iterator();
  Iterator values=m_rowsCacheIndex.values().iterator();
  while (keys.hasNext()) {
    out.writeObject(keys.next());
    ArrayList rows=(ArrayList)values.next();
    out.writeObject(new Integer(rows.size()));
    for (int i=0; i < rows.size(); i++) {
      out.writeObject(rows.get(i));
    }
  }
}

Fixed version (ground truth):
public void writeExternal(ObjectOutput out) throws IOException {
  if (m_viewCacheDebug) {
    System.out.println("String_Node_Str");
  }
  out.writeObject(m_user);
  out.writeObject(Integer.valueOf(m_hits));
  out.writeObject(Integer.valueOf(m_visits));
  out.writeObject(Integer.valueOf(m_rowsCache.size()));
  for (int i=0; i < m_rowsCache.size(); i++) {
    RowsCacheEntry rce=(RowsCacheEntry)m_rowsCache.get(i);
    out.writeObject(rce);
  }
  out.writeObject(Integer.valueOf(m_rowsCacheIndex.size()));
  Iterator keys=m_rowsCacheIndex.keySet().iterator();
  Iterator values=m_rowsCacheIndex.values().iterator();
  while (keys.hasNext()) {
    out.writeObject(keys.next());
    ArrayList rows=(ArrayList)values.next();
    out.writeObject(Integer.valueOf(rows.size()));
    for (int i=0; i < rows.size(); i++) {
      out.writeObject(rows.get(i));
    }
  }
}
Program: 66687
Project: 66687
Buggy source:
public Object[] getOutParameters(String stmtText,Object[] inParams,int[] types) throws SQLException {
  m_visits++;
  Object[] objTypes=toObject(types);
  String cKey=makeKey(stmtText,new String[0],new String[0],inParams,new String[0]);
  ArrayList outParamList=(ArrayList)m_rowsCacheIndex.get(cKey);
  if (outParamList == null && m_conn != null) {
    outParamList=new ArrayList();
    CallableStatement stmt=m_conn.prepareCall(stmtText);
    int i=1;
    for (; i < inParams.length + 1; i++) {
      if (inParams[i - 1] instanceof byte[]) {
        stmt.setBytes(i,(byte[])inParams[i - 1]);
      }
 else {
        throw new SQLException("String_Node_Str" + inParams[i - 1].getClass().getName());
      }
    }
    for (; i < (inParams.length + types.length + 1); i++) {
      stmt.registerOutParameter(i,types[i - inParams.length - 1]);
    }
    stmt.executeUpdate();
    for (i=inParams.length; i < inParams.length + types.length; i++) {
      int index=i - inParams.length;
      if (types[index] == OracleTypes.INTEGER) {
        outParamList.add(new Integer(stmt.getInt(i + 1)));
      }
 else       if (types[index] == OracleTypes.VARCHAR) {
        outParamList.add(stmt.getString(i + 1));
      }
    }
    stmt.close();
    m_rowsCacheIndex.put(cKey,outParamList);
    m_rowsCache.add(new RowsCacheEntry(stmtText,new String[0],new String[0],objTypes,outParamList));
  }
  Object[] outParams=null;
  if (outParamList != null) {
    outParams=outParamList.toArray(new Object[0]);
  }
  return outParams;
}

Fixed version (ground truth):
public Object[] getOutParameters(String stmtText,Object[] inParams,int[] types) throws SQLException {
  m_visits++;
  Object[] objTypes=toObject(types);
  String cKey=makeKey(stmtText,new String[0],new String[0],inParams,new String[0]);
  ArrayList outParamList=(ArrayList)m_rowsCacheIndex.get(cKey);
  if (outParamList == null && m_conn != null) {
    outParamList=new ArrayList();
    CallableStatement stmt=m_conn.prepareCall(stmtText);
    int i=1;
    for (; i < inParams.length + 1; i++) {
      if (inParams[i - 1] instanceof byte[]) {
        stmt.setBytes(i,(byte[])inParams[i - 1]);
      }
 else {
        throw new SQLException("String_Node_Str" + inParams[i - 1].getClass().getName());
      }
    }
    for (; i < (inParams.length + types.length + 1); i++) {
      stmt.registerOutParameter(i,types[i - inParams.length - 1]);
    }
    stmt.executeUpdate();
    for (i=inParams.length; i < inParams.length + types.length; i++) {
      int index=i - inParams.length;
      if (types[index] == OracleTypes.INTEGER) {
        outParamList.add(Integer.valueOf(stmt.getInt(i + 1)));
      }
 else       if (types[index] == OracleTypes.VARCHAR) {
        outParamList.add(stmt.getString(i + 1));
      }
    }
    stmt.close();
    m_rowsCacheIndex.put(cKey,outParamList);
    m_rowsCache.add(new RowsCacheEntry(stmtText,new String[0],new String[0],objTypes,outParamList));
  }
  Object[] outParams=null;
  if (outParamList != null) {
    outParams=outParamList.toArray(new Object[0]);
  }
  return outParams;
}
Program: 66688
Project: 66688
Buggy source:
private Object[] toObject(int[] types){
  Object[] obj=new Object[types.length];
  for (int i=0; i < types.length; i++) {
    obj[i]=new Integer(types[i]);
  }
  return obj;
}

Fixed version (ground truth):
private Object[] toObject(int[] types){
  Object[] obj=new Object[types.length];
  for (int i=0; i < types.length; i++) {
    obj[i]=Integer.valueOf(types[i]);
  }
  return obj;
}
Program: 66689
Project: 66689
Buggy source:
public void test(){
  UnitOfWork uow=getSession().acquireUnitOfWork();
  uow.addReadOnlyClass(Address.class);
  Address address=(Address)uow.readObject(Address.class);
  Employee employee=new Employee();
  employee=(Employee)uow.registerObject(employee);
  employee.setAddress(address);
  uow.commit();
}

Fixed version (ground truth):
public void test(){
  UnitOfWork uow=getSession().acquireUnitOfWork();
  Address address=(Address)uow.readObject(Address.class);
  Employee employee=new Employee();
  employee=(Employee)uow.registerObject(employee);
  employee.setAddress(address);
  uow.commit();
}
Program: 66690
Project: 66690
Buggy source:
/** 
 * Tests saving a new object with a reference to a read-only object.
 */
public TransactionalTestCase buildRefReadOnlyTest(){
  TransactionalTestCase test=new TransactionalTestCase(){
    public void test(){
      UnitOfWork uow=getSession().acquireUnitOfWork();
      uow.addReadOnlyClass(Address.class);
      Address address=(Address)uow.readObject(Address.class);
      Employee employee=new Employee();
      employee=(Employee)uow.registerObject(employee);
      employee.setAddress(address);
      uow.commit();
    }
  }
;
  test.setName("String_Node_Str");
  test.setDescription("String_Node_Str");
  return test;
}

Fixed version (ground truth):
/** 
 * Tests saving a new object with a reference to a read-only object.
 */
public TransactionalTestCase buildRefReadOnlyTest(){
  TransactionalTestCase test=new TransactionalTestCase(){
    public void setup(){
      super.setup();
      getSession().getDescriptor(Address.class).setReadOnly();
    }
    public void test(){
      UnitOfWork uow=getSession().acquireUnitOfWork();
      Address address=(Address)uow.readObject(Address.class);
      Employee employee=new Employee();
      employee=(Employee)uow.registerObject(employee);
      employee.setAddress(address);
      uow.commit();
    }
    public void reset(){
      super.reset();
      getSession().getDescriptor(Address.class).setShouldBeReadOnly(false);
    }
  }
;
  test.setName("String_Node_Str");
  test.setDescription("String_Node_Str");
  return test;
}
Program: 66691
Project: 66691
Buggy source:
/** 
 * INTERNAL: This method is used to determine if the clone is a new Object in the UnitOfWork
 */
public boolean isObjectNew(Object clone){
  return (isCloneNewObject(clone) || (!isObjectRegistered(clone) && !isClassReadOnly(clone.getClass(),null) && !isUnregisteredExistingObject(clone)));
}

Fixed version (ground truth):
/** 
 * INTERNAL: This method is used to determine if the clone is a new Object in the UnitOfWork
 */
public boolean isObjectNew(Object clone){
  return (isCloneNewObject(clone) || (!isObjectRegistered(clone) && !isClassReadOnly(clone.getClass()) && !isUnregisteredExistingObject(clone)));
}
Program: 66693
Project: 66693
Buggy source:
public static Test suite(){
  TestSuite suite=new TestSuite();
  suite.setName("String_Node_Str");
  suite.addTest(new JUnitCriteriaUnitTestSuite("String_Node_Str"));
  suite.addTest(new JUnitCriteriaUnitTestSuite("String_Node_Str"));
  suite.addTest(new JUnitCriteriaUnitTestSuite("String_Node_Str"));
  suite.addTest(new JUnitCriteriaUnitTestSuite("String_Node_Str"));
  suite.addTest(new JUnitCriteriaUnitTestSuite("String_Node_Str"));
  suite.addTest(new JUnitCriteriaUnitTestSuite("String_Node_Str"));
  suite.addTest(new JUnitCriteriaUnitTestSuite("String_Node_Str"));
  suite.addTest(new JUnitCriteriaUnitTestSuite("String_Node_Str"));
  suite.addTest(new JUnitCriteriaUnitTestSuite("String_Node_Str"));
  suite.addTest(new JUnitCriteriaUnitTestSuite("String_Node_Str"));
  suite.addTest(new JUnitCriteriaUnitTestSuite("String_Node_Str"));
  suite.addTest(new JUnitCriteriaUnitTestSuite("String_Node_Str"));
  suite.addTest(new JUnitCriteriaUnitTestSuite("String_Node_Str"));
  suite.addTest(new JUnitCriteriaUnitTestSuite("String_Node_Str"));
  suite.addTest(new JUnitCriteriaUnitTestSuite("String_Node_Str"));
  suite.addTest(new JUnitCriteriaUnitTestSuite("String_Node_Str"));
  return suite;
}

Fixed version (ground truth):
public static Test suite(){
  TestSuite suite=new TestSuite();
  suite.setName("String_Node_Str");
  suite.addTest(new JUnitCriteriaUnitTestSuite("String_Node_Str"));
  suite.addTest(new JUnitCriteriaUnitTestSuite("String_Node_Str"));
  suite.addTest(new JUnitCriteriaUnitTestSuite("String_Node_Str"));
  suite.addTest(new JUnitCriteriaUnitTestSuite("String_Node_Str"));
  suite.addTest(new JUnitCriteriaUnitTestSuite("String_Node_Str"));
  suite.addTest(new JUnitCriteriaUnitTestSuite("String_Node_Str"));
  suite.addTest(new JUnitCriteriaUnitTestSuite("String_Node_Str"));
  suite.addTest(new JUnitCriteriaUnitTestSuite("String_Node_Str"));
  suite.addTest(new JUnitCriteriaUnitTestSuite("String_Node_Str"));
  suite.addTest(new JUnitCriteriaUnitTestSuite("String_Node_Str"));
  suite.addTest(new JUnitCriteriaUnitTestSuite("String_Node_Str"));
  suite.addTest(new JUnitCriteriaUnitTestSuite("String_Node_Str"));
  suite.addTest(new JUnitCriteriaUnitTestSuite("String_Node_Str"));
  suite.addTest(new JUnitCriteriaUnitTestSuite("String_Node_Str"));
  suite.addTest(new JUnitCriteriaUnitTestSuite("String_Node_Str"));
  suite.addTest(new JUnitCriteriaUnitTestSuite("String_Node_Str"));
  suite.addTest(new JUnitCriteriaUnitTestSuite("String_Node_Str"));
  suite.addTest(new JUnitCriteriaUnitTestSuite("String_Node_Str"));
  return suite;
}
Program: 66694
Project: 66694
Buggy source:
public ConstructorReportItem translate(){
  ConstructorReportItem item=new ConstructorReportItem(this.getAlias());
  item.setResultType(this.getJavaType());
  for (  Selection selection : this.getCompoundSelectionItems()) {
    if (((SelectionImpl)selection).isCompoundSelection()) {
      item.addItem(((ConstructorSelectionImpl)selection).translate());
    }
 else {
      item.addAttribute(((SelectionImpl)selection).getCurrentNode());
    }
  }
  return item;
}

Fixed version (ground truth):
public ConstructorReportItem translate(){
  ConstructorReportItem item=new ConstructorReportItem(this.getAlias());
  item.setResultType(this.getJavaType());
  item.setConstructor(constructor);
  for (  Selection selection : this.getCompoundSelectionItems()) {
    if (((SelectionImpl)selection).isCompoundSelection()) {
      item.addItem(((ConstructorSelectionImpl)selection).translate());
    }
 else {
      ReportItem reportItem=new ReportItem(item.getName() + item.getReportItems().size(),((SelectionImpl)selection).getCurrentNode());
      reportItem.setResultType(selection.getJavaType());
      item.addItem(reportItem);
    }
  }
  return item;
}
Program: 66697
Project: 66697
Buggy source:
/** 
 * Set a property's value.
 * @param lastProperty      the property to queries.
 * @param lastDataObject    the DataObject, owner of the queried property
 * @param numInLastProperty the index number in the value list of the above property
 * @param value             the value to be set as the target property's value
 * @param convertValue     boolean used for set if we should convert the value 
 */
private void set(Property lastProperty,DataObject lastDataObject,int numInLastProperty,Object value,boolean convertValue){
  if (numInLastProperty == -1) {
    if (lastDataObject != null) {
      if (convertValue) {
        value=DataHelper.INSTANCE.convert(lastProperty,value);
      }
      lastDataObject.set(lastProperty,value);
    }
 else {
      throw new IllegalArgumentException("String_Node_Str");
    }
  }
 else {
    List objects=lastDataObject.getList(lastProperty);
    if (convertValue) {
      value=DataHelper.INSTANCE.convert(lastProperty.getType(),value);
    }
    Sequence seq=lastDataObject.getSequence();
    if (seq != null) {
      seq.setValue(numInLastProperty,value);
    }
 else {
      objects.set(numInLastProperty,value);
    }
  }
}

Fixed version (ground truth):
/** 
 * Set a property's value.
 * @param lastProperty      the property to queries.
 * @param lastDataObject    the DataObject, owner of the queried property
 * @param numInLastProperty the index number in the value list of the above property
 * @param value             the value to be set as the target property's value
 * @param convertValue     boolean used for set if we should convert the value 
 */
private void set(Property lastProperty,DataObject lastDataObject,int numInLastProperty,Object value,boolean convertValue){
  if (numInLastProperty == -1) {
    if (lastDataObject != null) {
      if (convertValue) {
        DataHelper dataHelper=((SDODataObject)lastDataObject).getType().getHelperContext().getDataHelper();
        value=dataHelper.convert(lastProperty,value);
      }
      lastDataObject.set(lastProperty,value);
    }
 else {
      throw new IllegalArgumentException("String_Node_Str");
    }
  }
 else {
    List objects=lastDataObject.getList(lastProperty);
    if (convertValue) {
      DataHelper dataHelper=((SDODataObject)lastDataObject).getType().getHelperContext().getDataHelper();
      value=dataHelper.convert(lastProperty.getType(),value);
    }
    Sequence seq=lastDataObject.getSequence();
    if (seq != null) {
      seq.setValue(numInLastProperty,value);
    }
 else {
      objects.set(numInLastProperty,value);
    }
  }
}
Program: 66698
Project: 66698
Buggy source:
public void setTypeMappingInfos(TypeMappingInfo[] newTypes) throws Exception {
  typeMappingInfos=newTypes;
  jaxbContext=new org.eclipse.persistence.jaxb.JAXBContextFactory().createContext(newTypes,null,Thread.currentThread().getContextClassLoader());
  jaxbMarshaller=jaxbContext.createMarshaller();
  jaxbUnmarshaller=jaxbContext.createUnmarshaller();
}

Fixed version (ground truth):
public void setTypeMappingInfos(TypeMappingInfo[] newTypes) throws Exception {
  typeMappingInfos=newTypes;
  jaxbContext=new org.eclipse.persistence.jaxb.JAXBContextFactory().createContext(newTypes,getProperties(),Thread.currentThread().getContextClassLoader());
  jaxbMarshaller=jaxbContext.createMarshaller();
  jaxbUnmarshaller=jaxbContext.createUnmarshaller();
}
Program: 66699
Project: 66699
Buggy source:
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTestSuite(DatahandlerWithAnnotationsTestCases.class);
  suite.addTestSuite(DatahandlerWithXMLTestCases.class);
  suite.addTestSuite(DuplicateListOfStringsTestCases.class);
  suite.addTestSuite(DuplicateListOfStringsTestCasesWithXML.class);
  suite.addTestSuite(MapStringIntegerTestCases.class);
  suite.addTestSuite(ConflictingQNamesTestCases.class);
  suite.addTestSuite(MultipleMapTestCases.class);
  return suite;
}

Fixed version (ground truth):
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTestSuite(DatahandlerWithAnnotationsTestCases.class);
  suite.addTestSuite(DatahandlerWithXMLTestCases.class);
  suite.addTestSuite(DuplicateListOfStringsTestCases.class);
  suite.addTestSuite(DuplicateListOfStringsTestCasesWithXML.class);
  suite.addTestSuite(MapStringIntegerTestCases.class);
  suite.addTestSuite(ConflictingQNamesTestCases.class);
  suite.addTestSuite(MultipleMapTestCases.class);
  suite.addTestSuite(MultipleMapWithBindingsTestCases.class);
  return suite;
}
Program: 66700
Project: 66700
Buggy source:
/** 
 * Convenience method for building a Map of package to classes.
 * @return
 */
private Map<String,ArrayList<JavaClass>> buildPackageToJavaClassMap(){
  Map<String,ArrayList<JavaClass>> theMap=new HashMap<String,ArrayList<JavaClass>>();
  XmlBindings xmlBindings;
  for (  String packageName : xmlBindingMap.keySet()) {
    xmlBindings=xmlBindingMap.get(packageName);
    ArrayList classes=new ArrayList<JavaClass>();
    JavaTypes jTypes=xmlBindings.getJavaTypes();
    if (jTypes != null) {
      for (      JavaType javaType : jTypes.getJavaType()) {
        classes.add(jModelInput.getJavaModel().getClass(javaType.getName()));
      }
    }
    theMap.put(packageName,classes);
  }
  for (  JavaClass jClass : jModelInput.getJavaClasses()) {
    String pkg=jClass.getPackageName();
    ArrayList<JavaClass> existingClasses=theMap.get(pkg);
    if (existingClasses != null) {
      if (!classExistsInArray(jClass,existingClasses)) {
        existingClasses.add(jClass);
      }
    }
 else {
      ArrayList classes=new ArrayList<JavaClass>();
      classes.add(jClass);
      theMap.put(pkg,classes);
    }
  }
  return theMap;
}

Fixed version (ground truth):
/** 
 * Convenience method for building a Map of package to classes.
 * @return
 */
private Map<String,ArrayList<JavaClass>> buildPackageToJavaClassMap(){
  Map<String,ArrayList<JavaClass>> theMap=new HashMap<String,ArrayList<JavaClass>>();
  Map<String,ArrayList<JavaClass>> xmlBindingsMap=new HashMap<String,ArrayList<JavaClass>>();
  XmlBindings xmlBindings;
  for (  String packageName : xmlBindingMap.keySet()) {
    xmlBindings=xmlBindingMap.get(packageName);
    ArrayList classes=new ArrayList<JavaClass>();
    JavaTypes jTypes=xmlBindings.getJavaTypes();
    if (jTypes != null) {
      for (      JavaType javaType : jTypes.getJavaType()) {
        classes.add(jModelInput.getJavaModel().getClass(javaType.getName()));
      }
    }
    theMap.put(packageName,classes);
    xmlBindingsMap.put(packageName,new ArrayList(classes));
  }
  for (  JavaClass jClass : jModelInput.getJavaClasses()) {
    String pkg=jClass.getPackageName();
    ArrayList<JavaClass> existingXmlBindingsClasses=xmlBindingsMap.get(pkg);
    ArrayList<JavaClass> allExistingClasses=theMap.get(pkg);
    if (existingXmlBindingsClasses != null) {
      if (!classExistsInArray(jClass,existingXmlBindingsClasses)) {
        allExistingClasses.add(jClass);
      }
    }
 else {
      if (allExistingClasses != null) {
        allExistingClasses.add(jClass);
      }
 else {
        ArrayList classes=new ArrayList<JavaClass>();
        classes.add(jClass);
        theMap.put(pkg,classes);
      }
    }
  }
  return theMap;
}
Program: 66701
Project: 66701
Buggy source:
public void setXPath(String xpathString){
  xpath=xpathString;
  shortName=xpathString;
  if (xpathString.length() > 0) {
    if ((xpath.indexOf('[') != -1) && (xpath.indexOf(']') == -1)) {
      setShouldExecuteSelectNodes(true);
      return;
    }
    if (xpath.indexOf("String_Node_Str") != -1) {
      setShouldExecuteSelectNodes(true);
      return;
    }
    if (xpathString.charAt(0) == '@') {
      hasAttribute=true;
      shortName=xpathString.substring(1);
      indexValue=hasIndex(xpathString);
      setupNamespaceInformation(shortName);
      return;
    }
    if (xpathString.charAt(0) == '/') {
      setShouldExecuteSelectNodes(true);
      shortName=xpathString;
      indexValue=hasIndex(xpathString);
      setupNamespaceInformation(shortName);
      return;
    }
  }
  if (xpathString.equals(XMLConstants.TEXT)) {
    nameIsText=true;
    shortName=xpathString;
    return;
  }
 else {
    nameIsText=false;
  }
  if (xpathString.equals(SELF_XPATH)) {
    isSelfFragment=true;
    shortName=xpathString;
    return;
  }
  indexValue=hasIndex(xpathString);
  setupNamespaceInformation(shortName);
  try {
    shortNameBytes=shortName.getBytes(XMLConstants.DEFAULT_XML_ENCODING);
  }
 catch (  UnsupportedEncodingException e) {
  }
}

Fixed version (ground truth):
public void setXPath(String xpathString){
  xpath=xpathString;
  shortName=xpathString;
  if (xpathString.length() > 0) {
    if ((xpath.indexOf('[') != -1) && (xpath.indexOf(']') == -1)) {
      setShouldExecuteSelectNodes(true);
      return;
    }
    if (xpath.indexOf("String_Node_Str") != -1) {
      setShouldExecuteSelectNodes(true);
      return;
    }
    if (xpathString.charAt(0) == '@') {
      hasAttribute=true;
      shortName=xpathString.substring(1);
      indexValue=hasIndex(xpathString);
      setupNamespaceInformation(shortName);
      return;
    }
    if (xpathString.charAt(0) == '/') {
      setShouldExecuteSelectNodes(true);
      shortName=xpathString.substring(xpathString.lastIndexOf('/') + 1);
      indexValue=hasIndex(xpathString);
      setupNamespaceInformation(shortName);
      return;
    }
  }
  if (xpathString.equals(XMLConstants.TEXT)) {
    nameIsText=true;
    shortName=xpathString;
    return;
  }
 else {
    nameIsText=false;
  }
  if (xpathString.equals(SELF_XPATH)) {
    isSelfFragment=true;
    shortName=xpathString;
    return;
  }
  indexValue=hasIndex(xpathString);
  setupNamespaceInformation(shortName);
  try {
    shortNameBytes=shortName.getBytes(XMLConstants.DEFAULT_XML_ENCODING);
  }
 catch (  UnsupportedEncodingException e) {
  }
}
Program: 66702
Project: 66702
Buggy source:
/** 
 * INTERNAL:
 */
@Override public void process(AbstractSession session,ClassLoader loader){
  Map<String,Object> hints=processQueryHints(session);
  if (m_resultClass.isVoid()) {
    if (hasResultSetMapping()) {
      session.addQuery(getName(),EJBQueryImpl.buildSQLDatabaseQuery(m_resultSetMapping,getQuery(),hints,loader,session));
    }
 else {
      session.addQuery(getName(),EJBQueryImpl.buildSQLDatabaseQuery(getQuery(),hints,loader,session));
    }
  }
 else {
    session.addQuery(getName(),EJBQueryImpl.buildSQLDatabaseQuery(MetadataHelper.getClassForName(m_resultClass.getName(),loader),getQuery(),hints,loader,session));
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL:
 */
@Override public void process(AbstractSession session,ClassLoader loader){
  Map<String,Object> hints=processQueryHints(session);
  if (m_resultClass.isVoid()) {
    if (hasResultSetMapping(session)) {
      session.addQuery(getName(),EJBQueryImpl.buildSQLDatabaseQuery(m_resultSetMapping,getQuery(),hints,loader,session));
    }
 else {
      session.addQuery(getName(),EJBQueryImpl.buildSQLDatabaseQuery(getQuery(),hints,loader,session));
    }
  }
 else {
    session.addQuery(getName(),EJBQueryImpl.buildSQLDatabaseQuery(MetadataHelper.getClassForName(m_resultClass.getName(),loader),getQuery(),hints,loader,session));
  }
}
Program: 66703
Project: 66703
Buggy source:
/** 
 * INTERNAL: Return true is a result set mapping has been specified.
 */
protected boolean hasResultSetMapping(){
  return m_resultSetMapping != null && !m_resultSetMapping.equals("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * INTERNAL: Return true is a result set mapping has been specified.
 */
protected boolean hasResultSetMapping(AbstractSession session){
  if (m_resultSetMapping != null && !m_resultSetMapping.equals("String_Node_Str")) {
    if (session.getProject().hasSQLResultSetMapping(m_resultSetMapping)) {
      return true;
    }
 else {
      throw ValidationException.invalidSQLResultSetMapping(m_resultSetMapping,getName(),getLocation());
    }
  }
  return false;
}
Program: 66704
Project: 66704
Buggy source:
/** 
 * INTERNAL:
 */
@Override public void process(AbstractSession session,ClassLoader loader){
  StoredProcedureCall call=new StoredProcedureCall();
  List<String> queryArguments=new ArrayList<String>();
  for (  StoredProcedureParameterMetadata parameter : m_parameters) {
    queryArguments.addAll(parameter.process(call));
  }
  call.setProcedureName(m_procedureName);
  call.setReturnsResultSet((m_returnsResultSet == null) ? false : m_returnsResultSet);
  Map<String,Object> hints=processQueryHints(session);
  if (getResultClass().isVoid()) {
    if (getResultSetMapping().equals("String_Node_Str")) {
      session.addQuery(getName(),EJBQueryImpl.buildStoredProcedureQuery(call,queryArguments,hints,loader,session));
    }
 else {
      session.addQuery(getName(),EJBQueryImpl.buildStoredProcedureQuery(getResultSetMapping(),call,queryArguments,hints,loader,session));
    }
  }
 else {
    session.addQuery(getName(),EJBQueryImpl.buildStoredProcedureQuery(MetadataHelper.getClassForName(getResultClass().getName(),loader),call,queryArguments,hints,loader,session));
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL:
 */
@Override public void process(AbstractSession session,ClassLoader loader){
  StoredProcedureCall call=new StoredProcedureCall();
  List<String> queryArguments=new ArrayList<String>();
  for (  StoredProcedureParameterMetadata parameter : m_parameters) {
    queryArguments.addAll(parameter.process(call));
  }
  call.setProcedureName(m_procedureName);
  call.setReturnsResultSet((m_returnsResultSet == null) ? false : m_returnsResultSet);
  Map<String,Object> hints=processQueryHints(session);
  if (getResultClass().isVoid()) {
    if (hasResultSetMapping(session)) {
      session.addQuery(getName(),EJBQueryImpl.buildStoredProcedureQuery(getResultSetMapping(),call,queryArguments,hints,loader,session));
    }
 else {
      session.addQuery(getName(),EJBQueryImpl.buildStoredProcedureQuery(call,queryArguments,hints,loader,session));
    }
  }
 else {
    session.addQuery(getName(),EJBQueryImpl.buildStoredProcedureQuery(MetadataHelper.getClassForName(getResultClass().getName(),loader),call,queryArguments,hints,loader,session));
  }
}
Program: 66705
Project: 66705
Buggy source:
/** 
 * INTERNAL:
 */
public StoredProcedureParameterMetadata(MetadataAnnotation storedProcedureParameter,MetadataAccessibleObject accessibleObject){
  super(storedProcedureParameter,accessibleObject);
  m_direction=(String)storedProcedureParameter.getAttribute("String_Node_Str");
  m_name=(String)storedProcedureParameter.getAttribute("String_Node_Str");
  m_queryParameter=(String)storedProcedureParameter.getAttribute("String_Node_Str");
  m_type=getMetadataClass((String)storedProcedureParameter.getAttribute("String_Node_Str"));
  m_jdbcType=(Integer)storedProcedureParameter.getAttribute("String_Node_Str");
  m_jdbcTypeName=(String)storedProcedureParameter.getAttribute("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * INTERNAL:
 */
public StoredProcedureParameterMetadata(MetadataAnnotation storedProcedureParameter,MetadataAccessibleObject accessibleObject){
  super(storedProcedureParameter,accessibleObject);
  m_direction=(String)storedProcedureParameter.getAttribute("String_Node_Str");
  m_name=(String)storedProcedureParameter.getAttribute("String_Node_Str");
  m_queryParameter=(String)storedProcedureParameter.getAttribute("String_Node_Str");
  m_type=getMetadataClass((String)storedProcedureParameter.getAttributeClass("String_Node_Str"));
  m_jdbcType=(Integer)storedProcedureParameter.getAttribute("String_Node_Str");
  m_jdbcTypeName=(String)storedProcedureParameter.getAttribute("String_Node_Str");
}
Program: 66707
Project: 66707
Buggy source:
protected TypeMappingInfo[] getTypeMappingInfos() throws Exception {
  if (typeMappingInfos == null) {
    typeMappingInfos=new TypeMappingInfo[1];
    TypeMappingInfo tpi=new TypeMappingInfo();
    tpi.setXmlTagName(new QName("String_Node_Str","String_Node_Str"));
    tpi.setElementScope(ElementScope.Global);
    tpi.setXmlElement(getXmlElement("String_Node_Str"));
    tpi.setType(DataHandler.class);
    typeMappingInfos[0]=tpi;
  }
  return typeMappingInfos;
}

Fixed version (ground truth):
protected TypeMappingInfo[] getTypeMappingInfos() throws Exception {
  if (typeMappingInfos == null) {
    typeMappingInfos=new TypeMappingInfo[1];
    TypeMappingInfo tpi=new TypeMappingInfo();
    tpi.setXmlTagName(new QName("String_Node_Str","String_Node_Str"));
    tpi.setElementScope(ElementScope.Global);
    Annotation[] annotations=new Annotation[2];
    annotations[0]=getClass().getField("String_Node_Str").getAnnotations()[0];
    annotations[1]=getClass().getField("String_Node_Str").getAnnotations()[0];
    tpi.setAnnotations(annotations);
    tpi.setXmlElement(getXmlElement("String_Node_Str"));
    tpi.setType(DataHandler.class);
    typeMappingInfos[0]=tpi;
  }
  return typeMappingInfos;
}
Program: 66708
Project: 66708
Buggy source:
protected TypeMappingInfo[] getTypeMappingInfos() throws Exception {
  if (typeMappingInfos == null) {
    typeMappingInfos=new TypeMappingInfo[4];
    TypeMappingInfo tpi=new TypeMappingInfo();
    tpi.setXmlTagName(new QName("String_Node_Str","String_Node_Str"));
    tpi.setElementScope(ElementScope.Global);
    tpi.setXmlElement(getXmlElement("String_Node_Str"));
    tpi.setType(List.class);
    typeMappingInfos[0]=tpi;
    TypeMappingInfo tpi2=new TypeMappingInfo();
    tpi2.setXmlTagName(new QName("String_Node_Str","String_Node_Str"));
    tpi2.setElementScope(ElementScope.Global);
    tpi2.setType(List.class);
    typeMappingInfos[1]=tpi2;
    TypeMappingInfo tpi3=new TypeMappingInfo();
    tpi3.setXmlTagName(new QName("String_Node_Str","String_Node_Str"));
    tpi3.setElementScope(ElementScope.Global);
    tpi3.setType(getClass().getField("String_Node_Str").getGenericType());
    typeMappingInfos[2]=tpi3;
    TypeMappingInfo tpi4=new TypeMappingInfo();
    tpi4.setXmlTagName(new QName("String_Node_Str","String_Node_Str"));
    tpi4.setElementScope(ElementScope.Global);
    tpi4.setType(List.class);
    typeMappingInfos[3]=tpi4;
  }
  return typeMappingInfos;
}

Fixed version (ground truth):
protected TypeMappingInfo[] getTypeMappingInfos() throws Exception {
  if (typeMappingInfos == null) {
    typeMappingInfos=new TypeMappingInfo[4];
    TypeMappingInfo tpi=new TypeMappingInfo();
    tpi.setXmlTagName(new QName("String_Node_Str","String_Node_Str"));
    tpi.setElementScope(ElementScope.Global);
    Annotation[] annotations=new Annotation[1];
    annotations[0]=getClass().getField("String_Node_Str").getAnnotations()[0];
    tpi.setAnnotations(annotations);
    tpi.setXmlElement(getXmlElement("String_Node_Str"));
    tpi.setType(List.class);
    typeMappingInfos[0]=tpi;
    TypeMappingInfo tpi2=new TypeMappingInfo();
    tpi2.setXmlTagName(new QName("String_Node_Str","String_Node_Str"));
    tpi2.setElementScope(ElementScope.Global);
    tpi2.setType(List.class);
    typeMappingInfos[1]=tpi2;
    TypeMappingInfo tpi3=new TypeMappingInfo();
    tpi3.setXmlTagName(new QName("String_Node_Str","String_Node_Str"));
    tpi3.setElementScope(ElementScope.Global);
    tpi3.setType(getClass().getField("String_Node_Str").getGenericType());
    typeMappingInfos[2]=tpi3;
    TypeMappingInfo tpi4=new TypeMappingInfo();
    tpi4.setXmlTagName(new QName("String_Node_Str","String_Node_Str"));
    tpi4.setElementScope(ElementScope.Global);
    tpi4.setType(List.class);
    typeMappingInfos[3]=tpi4;
  }
  return typeMappingInfos;
}
Program: 66709
Project: 66709
Buggy source:
public void init() throws Exception {
  setControlDocument(XML_RESOURCE);
  setTypeMappingInfos(getTypeMappingInfos());
  jaxbUnmarshaller.setAttachmentUnmarshaller(new MyAttachmentUnmarshaller());
  jaxbMarshaller.setAttachmentMarshaller(new MyAttachmentMarshaller());
  DataHandler data=new DataHandler("String_Node_Str","String_Node_Str");
  MyAttachmentMarshaller.attachments.put(MyAttachmentUnmarshaller.ATTACHMENT_TEST_ID,data);
}

Fixed version (ground truth):
public void init() throws Exception {
  setControlDocument(XML_RESOURCE);
  setupParser();
  setTypeMappingInfos(getTypeMappingInfos());
  jaxbUnmarshaller.setAttachmentUnmarshaller(new MyAttachmentUnmarshaller());
  jaxbMarshaller.setAttachmentMarshaller(new MyAttachmentMarshaller());
  DataHandler data=new DataHandler("String_Node_Str","String_Node_Str");
  MyAttachmentMarshaller.attachments.put(MyAttachmentUnmarshaller.ATTACHMENT_TEST_ID,data);
}
Program: 66710
Project: 66710
Buggy source:
public void init() throws Exception {
  setControlDocument(XML_RESOURCE);
  setTypeMappingInfos(getTypeMappingInfos());
  jaxbUnmarshaller.setAttachmentUnmarshaller(new MyAttachmentUnmarshaller());
  jaxbMarshaller.setAttachmentMarshaller(new MyAttachmentMarshaller());
  DataHandler data=new DataHandler("String_Node_Str","String_Node_Str");
  MyAttachmentMarshaller.attachments.put(MyAttachmentUnmarshaller.ATTACHMENT_TEST_ID,data);
}

Fixed version (ground truth):
public void init() throws Exception {
  setControlDocument(XML_RESOURCE);
  setupParser();
  setTypeMappingInfos(getTypeMappingInfos());
  jaxbUnmarshaller.setAttachmentUnmarshaller(new MyAttachmentUnmarshaller());
  jaxbMarshaller.setAttachmentMarshaller(new MyAttachmentMarshaller());
  DataHandler data=new DataHandler("String_Node_Str","String_Node_Str");
  MyAttachmentMarshaller.attachments.put(MyAttachmentUnmarshaller.ATTACHMENT_TEST_ID,data);
}
Program: 66711
Project: 66711
Buggy source:
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTestSuite(DatahandlerWithAnnotationsTestCases.class);
  suite.addTestSuite(DuplicateListOfStringsTestCases.class);
  return suite;
}

Fixed version (ground truth):
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTestSuite(DatahandlerWithAnnotationsTestCases.class);
  suite.addTestSuite(DatahandlerWithXMLTestCases.class);
  suite.addTestSuite(DuplicateListOfStringsTestCases.class);
  suite.addTestSuite(DuplicateListOfStringsTestCasesWithXML.class);
  return suite;
}
Program: 66716
Project: 66716
Buggy source:
public Class getCollectionContentType(){
  return collectionContentType;
}

Fixed version (ground truth):
public Class getCollectionContentType(){
  return getAttributeElementClass();
}
Program: 66718
Project: 66718
Buggy source:
public void setCollectionContentType(Class javaClass){
  collectionContentType=javaClass;
}

Fixed version (ground truth):
public void setCollectionContentType(Class javaClass){
  setAttributeElementClass(javaClass);
}
Program: 66719
Project: 66719
Buggy source:
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTestSuite(BinaryDataIdentifiedByNameXOPonNSRTestCases.class);
  suite.addTestSuite(BinaryDataIdentifiedByNameNullNSRTestCases.class);
  suite.addTestSuite(BinaryDataIdentifiedByNameEmptyNSRTestCases.class);
  suite.addTestSuite(BinaryDataIdentifiedByNameNullTestCases.class);
  suite.addTestSuite(BinaryDataEmptyElementTestCases.class);
  suite.addTestSuite(BinaryDataSelfTestCases.class);
  suite.addTestSuite(BinaryDataSelfDataHandlerTestCases.class);
  return suite;
}

Fixed version (ground truth):
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTestSuite(BinaryDataIdentifiedByNameXOPonNSRTestCases.class);
  suite.addTestSuite(BinaryDataIdentifiedByNameNullNSRTestCases.class);
  suite.addTestSuite(BinaryDataIdentifiedByNameEmptyNSRTestCases.class);
  suite.addTestSuite(BinaryDataIdentifiedByNameNullTestCases.class);
  suite.addTestSuite(BinaryDataEmptyElementTestCases.class);
  suite.addTestSuite(BinaryDataSelfTestCases.class);
  suite.addTestSuite(BinaryDataSelfDataHandlerTestCases.class);
  suite.addTestSuite(BinaryDataByteObjectArrayTestCases.class);
  return suite;
}
Program: 66720
Project: 66720
Buggy source:
public void setInt(Property property,int value){
  convertValueAndSet(property,new Integer(value));
}

Fixed version (ground truth):
public void setInt(Property property,int value){
  convertValueAndSet(property,value);
}
Program: 66721
Project: 66721
Buggy source:
public void setBoolean(Property property,boolean value){
  convertValueAndSet(property,new Boolean(value));
}

Fixed version (ground truth):
public void setBoolean(Property property,boolean value){
  convertValueAndSet(property,value);
}
Program: 66722
Project: 66722
Buggy source:
public void setShort(Property property,short value){
  convertValueAndSet(property,new Short(value));
}

Fixed version (ground truth):
public void setShort(Property property,short value){
  convertValueAndSet(property,value);
}
Program: 66723
Project: 66723
Buggy source:
public void setChar(Property property,char value){
  convertValueAndSet(property,new Character(value));
}

Fixed version (ground truth):
public void setChar(Property property,char value){
  convertValueAndSet(property,value);
}
Program: 66724
Project: 66724
Buggy source:
public void setDouble(Property property,double value){
  convertValueAndSet(property,new Double(value));
}

Fixed version (ground truth):
public void setDouble(Property property,double value){
  convertValueAndSet(property,value);
}
Program: 66725
Project: 66725
Buggy source:
public void setLong(Property property,long value){
  convertValueAndSet(property,new Long(value));
}

Fixed version (ground truth):
public void setLong(Property property,long value){
  convertValueAndSet(property,value);
}
Program: 66726
Project: 66726
Buggy source:
public void setByte(Property property,byte value){
  convertValueAndSet(property,new Byte(value));
}

Fixed version (ground truth):
public void setByte(Property property,byte value){
  convertValueAndSet(property,value);
}
Program: 66727
Project: 66727
Buggy source:
public void setFloat(Property property,float value){
  convertValueAndSet(property,new Float(value));
}

Fixed version (ground truth):
public void setFloat(Property property,float value){
  convertValueAndSet(property,value);
}
Program: 66728
Project: 66728
Buggy source:
public DynamicClassWriter(String className,SDOType type,HelperContext aContext){
  this.aHelperContext=aContext;
  this.parentClass=SDODataObject.class;
  this.typeImplClassDescriptor=className.replace('.','/');
  this.type=type;
  initializeParentClass();
  if (type.isSubType()) {
    try {
      Field parentEndPropertyIndexField=PrivilegedAccessHelper.getField(parentClass,END_PROPERTY_INDEX,true);
      Integer parentEndPropertyIndex=(Integer)PrivilegedAccessHelper.getValueFromField(parentEndPropertyIndexField,parentClass);
      startPropertyIndex=parentEndPropertyIndex + 1;
    }
 catch (    NoSuchFieldException e) {
      startPropertyIndex=new Integer(0);
    }
catch (    IllegalAccessException e) {
      startPropertyIndex=new Integer(0);
    }
  }
 else {
    startPropertyIndex=new Integer(0);
  }
}

Fixed version (ground truth):
public DynamicClassWriter(String className,SDOType type,HelperContext aContext){
  this.aHelperContext=aContext;
  this.parentClass=SDODataObject.class;
  this.typeImplClassDescriptor=className.replace('.','/');
  this.type=type;
  initializeParentClass();
  if (type.isSubType()) {
    try {
      Field parentEndPropertyIndexField=PrivilegedAccessHelper.getField(parentClass,END_PROPERTY_INDEX,true);
      Integer parentEndPropertyIndex=(Integer)PrivilegedAccessHelper.getValueFromField(parentEndPropertyIndexField,parentClass);
      startPropertyIndex=parentEndPropertyIndex + 1;
    }
 catch (    NoSuchFieldException e) {
      startPropertyIndex=0;
    }
catch (    IllegalAccessException e) {
      startPropertyIndex=0;
    }
  }
 else {
    startPropertyIndex=0;
  }
}
Program: 66729
Project: 66729
Buggy source:
public void handleNotification(Notification notification,Object handback){
  if (notification instanceof AttributeChangeNotification) {
    try {
      AttributeChangeNotification acn=(AttributeChangeNotification)notification;
      if (acn.getAttributeName().equals(WLS_ACTIVE_VERSION_STATE)) {
        if (acn.getNewValue().equals(new Integer(0))) {
          resetHelperContext(mapKey);
        }
      }
    }
 catch (    Exception x) {
    }
  }
}

Fixed version (ground truth):
public void handleNotification(Notification notification,Object handback){
  if (notification instanceof AttributeChangeNotification) {
    try {
      AttributeChangeNotification acn=(AttributeChangeNotification)notification;
      if (acn.getAttributeName().equals(WLS_ACTIVE_VERSION_STATE)) {
        if (acn.getNewValue().equals(0)) {
          resetHelperContext(mapKey);
        }
      }
    }
 catch (    Exception x) {
    }
  }
}
Program: 66735
Project: 66735
Buggy source:
public HashMap<java.lang.reflect.Type,QName> getTypeToSchemaType(){
  HashMap<TypeMappingInfo,QName> typeMappingInfoToSchemaType=(HashMap)getTypeMappingInfoToSchemaType();
  HashMap<Type,QName> typeToSchemaTypeMap=new HashMap<Type,QName>(typeMappingInfoToSchemaType.size());
  java.util.Set<Entry<TypeMappingInfo,QName>> entrySet=typeMappingInfoToSchemaType.entrySet();
  for (  Entry<TypeMappingInfo,QName> entry : entrySet) {
    typeToSchemaTypeMap.put(entry.getKey().getType(),entry.getValue());
  }
  return typeToSchemaTypeMap;
}

Fixed version (ground truth):
public HashMap<java.lang.reflect.Type,QName> getTypeToSchemaType(){
  if (typeToSchemaType == null) {
    initTypeToSchemaType();
  }
  return typeToSchemaType;
}
Program: 66736
Project: 66736
Buggy source:
public Map<TypeMappingInfo,QName> getTypeMappingInfoToSchemaType(){
  if (typeMappingInfoToSchemaType == null) {
    initTypeToSchemaType();
  }
  return typeMappingInfoToSchemaType;
}

Fixed version (ground truth):
public Map<TypeMappingInfo,QName> getTypeMappingInfoToSchemaType(){
  if (typeMappingInfoToSchemaType == null) {
    initTypeMappingInfoToSchemaType();
  }
  return typeMappingInfoToSchemaType;
}
Program: 66738
Project: 66738
Buggy source:
private void writeTypeAttribute(MarshalRecord marshalRecord,XMLDescriptor descriptor,String xsiPrefix){
  String typeValue=descriptor.getSchemaReference().getSchemaContext();
  if (typeValue == null) {
    QName contextAsQName=descriptor.getSchemaReference().getSchemaContextAsQName();
    if (contextAsQName == null) {
      return;
    }
    String uri=contextAsQName.getNamespaceURI();
    String localPart=contextAsQName.getLocalPart();
    String prefix=marshalRecord.getNamespaceResolver().resolveNamespaceURI(uri);
    if (prefix == null) {
      String defaultUri=marshalRecord.getNamespaceResolver().getDefaultNamespaceURI();
      if (defaultUri != null && defaultUri.equals(uri)) {
        typeValue=localPart;
      }
 else {
        prefix=marshalRecord.getNamespaceResolver().generatePrefix();
        marshalRecord.attribute(XMLConstants.XMLNS_URL,prefix,XMLConstants.XMLNS + XMLConstants.COLON + prefix,uri);
        typeValue=prefix + XMLConstants.COLON + localPart;
      }
    }
 else {
      typeValue=prefix + XMLConstants.COLON + localPart;
    }
  }
 else {
    typeValue=typeValue.substring(1);
  }
  marshalRecord.attribute(XMLConstants.SCHEMA_INSTANCE_URL,XMLConstants.SCHEMA_TYPE_ATTRIBUTE,xsiPrefix + XMLConstants.COLON + XMLConstants.SCHEMA_TYPE_ATTRIBUTE,typeValue);
}

Fixed version (ground truth):
private void writeTypeAttribute(MarshalRecord marshalRecord,XMLDescriptor descriptor,String xsiPrefix){
  if (descriptor.getSchemaReference() == null) {
    return;
  }
  String typeValue=descriptor.getSchemaReference().getSchemaContext();
  if (typeValue == null) {
    QName contextAsQName=descriptor.getSchemaReference().getSchemaContextAsQName();
    if (contextAsQName == null) {
      return;
    }
    String uri=contextAsQName.getNamespaceURI();
    String localPart=contextAsQName.getLocalPart();
    String prefix=marshalRecord.getNamespaceResolver().resolveNamespaceURI(uri);
    if (prefix == null) {
      String defaultUri=marshalRecord.getNamespaceResolver().getDefaultNamespaceURI();
      if (defaultUri != null && defaultUri.equals(uri)) {
        typeValue=localPart;
      }
 else {
        prefix=marshalRecord.getNamespaceResolver().generatePrefix();
        marshalRecord.attribute(XMLConstants.XMLNS_URL,prefix,XMLConstants.XMLNS + XMLConstants.COLON + prefix,uri);
        typeValue=prefix + XMLConstants.COLON + localPart;
      }
    }
 else {
      typeValue=prefix + XMLConstants.COLON + localPart;
    }
  }
 else {
    typeValue=typeValue.substring(1);
  }
  marshalRecord.attribute(XMLConstants.SCHEMA_INSTANCE_URL,XMLConstants.SCHEMA_TYPE_ATTRIBUTE,xsiPrefix + XMLConstants.COLON + XMLConstants.SCHEMA_TYPE_ATTRIBUTE,typeValue);
}