nus-yam/ex-repair huggingface dataset:
Program: 80486
Project: 80486
Buggy source:
/** 
 * @param typ
 * @return true if the type was added to the compound,false if the type was already contained in the compound
 */
public boolean addType(Class<?> typ){
  CompoundObjectType cur=null;
  Iterator<CompoundObjectType> it=typeIterator();
  while (it.hasNext()) {
    cur=it.next();
    if (cur.type.equals(typ))     return false;
  }
  CompoundObjectType nextOne=new CompoundObjectType(typ);
  cur.next=nextOne;
  return true;
}

Fixed version (ground truth):
/** 
 * @param typ
 * @return true if the type was added to the compound,false if the type was already contained in the compound
 */
public boolean addType(Class<?> typ){
  CompoundObjectType cur=null;
  Iterator<CompoundObjectType> it=typeIterator();
  while (it.hasNext()) {
    cur=it.next();
    if (cur.type.equals(typ))     return false;
  }
  CompoundObjectType nextOne=new CompoundObjectType(typ);
  cur.next=nextOne;
  CType t=nextOne.cType;
  it=typeIterator();
  while (it.hasNext()) {
    cur=it.next();
    if (cur.cType != t)     cur.cType=CType.MIXED;
  }
  return true;
}
Program: 80487
Project: 80487
Buggy source:
public CompoundObjectType(Class<?> type){
  super();
  this.type=type;
}

Fixed version (ground truth):
public CompoundObjectType(Class<?> type){
  super();
  this.type=type;
  this.cType=MappingUtil.mapsToProperty(type) ? CType.SIMPLE : CType.COMPLEX;
}
Program: 80488
Project: 80488
Buggy source:
/** 
 * @return true, if this field cannot be mapped to a property,but must be mapped to a seperate node connected via a relation, else return false.
 */
public boolean needsRelation(){
  boolean needRelation=!MappingUtil.mapsToProperty(this.field.getType());
  if (needRelation) {
    String classField=getClassFieldName();
    CompoundObjectType cType=MappingUtil.internalDomainAccess.get().getConcreteFieldType(classField);
    if (cType != null && MappingUtil.mapsToProperty(cType.getType()))     return false;
 else {
      if (Collection.class.isAssignableFrom(this.field.getType())) {
        cType=MappingUtil.internalDomainAccess.get().getFieldComponentType(classField);
        if (cType != null) {
          needRelation=!MappingUtil.mapsToProperty(cType.getType());
        }
 else         needRelation=true;
      }
    }
  }
  return needRelation;
}

Fixed version (ground truth):
/** 
 * @return true, if this field cannot be mapped to a property,but must be mapped to a seperate node connected via a relation, else return false.
 */
public boolean needsRelation(){
  boolean needRelation=!MappingUtil.mapsToProperty(this.field.getType());
  if (needRelation) {
    String classField=getClassFieldName();
    CompoundObjectType cType=MappingUtil.internalDomainAccess.get().getConcreteFieldType(classField);
    if (cType != null && cType.getCType() == CType.SIMPLE)     return false;
 else {
      if (Collection.class.isAssignableFrom(this.field.getType())) {
        cType=MappingUtil.internalDomainAccess.get().getFieldComponentType(classField);
        if (cType != null) {
          needRelation=cType.getCType() != CType.SIMPLE;
        }
 else         needRelation=true;
      }
    }
  }
  return needRelation;
}
Program: 80489
Project: 80489
Buggy source:
public void mapPropertyFromField(Object domainObject,GrNode rNode){
  try {
    prepare(domainObject);
    if (getObjectNeedingRelation(domainObject) == null) {
      Object value=this.field.get(domainObject);
      value=MappingUtil.convertToProperty(value);
      GrProperty prop=rNode.getProperty(this.propertyName);
      if (value != null) {
        if (prop != null) {
          Object propValue=MappingUtil.convertFromProperty(prop.getValue(),value.getClass(),getListComponentType());
          if (!propValue.equals(value)) {
            prop.setValue(value);
          }
        }
 else         rNode.addProperty(this.propertyName,value);
      }
 else {
        if (prop != null)         prop.setValue(null);
      }
    }
 else {
      if (Collection.class.isAssignableFrom(getFieldType())) {
        GrProperty prop=rNode.getProperty(this.propertyName);
        if (prop != null)         prop.setValue(null);
      }
    }
  }
 catch (  Throwable e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
public void mapPropertyFromField(Object domainObject,GrNode rNode){
  try {
    prepare(domainObject);
    if (getObjectNeedingRelation(domainObject) == null) {
      Object value=this.field.get(domainObject);
      value=MappingUtil.convertToProperty(value);
      GrProperty prop=rNode.getProperty(this.propertyName);
      if (value != null) {
        if (prop != null) {
          Object propValue=MappingUtil.convertFromProperty(prop.getValue(),value.getClass(),getListComponentType());
          if (!propValue.equals(value)) {
            addSimpleListComponentType2DomainInfo(value);
            prop.setValue(value);
          }
        }
 else         rNode.addProperty(this.propertyName,value);
      }
 else {
        if (prop != null)         prop.setValue(null);
      }
    }
 else {
      if (Collection.class.isAssignableFrom(getFieldType())) {
        GrProperty prop=rNode.getProperty(this.propertyName);
        if (prop != null)         prop.setValue(null);
      }
    }
  }
 catch (  Throwable e) {
    throw new RuntimeException(e);
  }
}
Program: 80490
Project: 80490
Buggy source:
public void testMapAny2Any(){
  List<JcError> errors;
  DomainAccess da=new DomainAccess(dbAccess,domainName);
  DomainAccess da1;
  MapContainer mapContainer=new MapContainer();
  MapContainer mapContainer_1;
  boolean equals;
  buildMapTestAny2Any(mapContainer);
  errors=dbAccess.clearDatabase();
  if (errors.size() > 0) {
    printErrors(errors);
    throw new JcResultException(errors);
  }
  errors=da.store(mapContainer);
  if (errors.size() > 0) {
    printErrors(errors);
    throw new JcResultException(errors);
  }
  SyncInfo syncInfo_1=da.getSyncInfo(mapContainer);
  da1=new DomainAccess(dbAccess,domainName);
  mapContainer_1=da1.loadById(MapContainer.class,syncInfo_1.getId());
  equals=CompareUtil_3.equalsMapContainer(mapContainer,mapContainer_1);
  assertTrue(equals);
  if (true)   return;
  mapContainer.getString2IntegerMap().put("String_Node_Str",2);
  mapContainer.getString2IntegerMap().put("String_Node_Str",3);
  mapContainer.getString2IntegerMap().remove("String_Node_Str");
  errors=da.store(mapContainer);
  if (errors.size() > 0) {
    printErrors(errors);
    throw new JcResultException(errors);
  }
  mapContainer.getString2IntegerMap().remove("String_Node_Str");
  mapContainer.getString2IntegerMap().remove("String_Node_Str");
  errors=da.store(mapContainer);
  if (errors.size() > 0) {
    printErrors(errors);
    throw new JcResultException(errors);
  }
  return;
}

Fixed version (ground truth):
@Test public void testMapAny2Any(){
  List<JcError> errors;
  DomainAccess da=new DomainAccess(dbAccess,domainName);
  DomainAccess da1;
  MapContainer mapContainer=new MapContainer();
  MapContainer mapContainer_1;
  boolean equals;
  buildMapTestAny2Any(mapContainer);
  errors=dbAccess.clearDatabase();
  if (errors.size() > 0) {
    printErrors(errors);
    throw new JcResultException(errors);
  }
  errors=da.store(mapContainer);
  if (errors.size() > 0) {
    printErrors(errors);
    throw new JcResultException(errors);
  }
  SyncInfo syncInfo_1=da.getSyncInfo(mapContainer);
  da1=new DomainAccess(dbAccess,domainName);
  mapContainer_1=da1.loadById(MapContainer.class,syncInfo_1.getId());
  equals=CompareUtil_3.equalsMapContainer(mapContainer,mapContainer_1);
  assertTrue(equals);
  if (true)   return;
  mapContainer.getString2IntegerMap().put("String_Node_Str",2);
  mapContainer.getString2IntegerMap().put("String_Node_Str",3);
  mapContainer.getString2IntegerMap().remove("String_Node_Str");
  errors=da.store(mapContainer);
  if (errors.size() > 0) {
    printErrors(errors);
    throw new JcResultException(errors);
  }
  mapContainer.getString2IntegerMap().remove("String_Node_Str");
  mapContainer.getString2IntegerMap().remove("String_Node_Str");
  errors=da.store(mapContainer);
  if (errors.size() > 0) {
    printErrors(errors);
    throw new JcResultException(errors);
  }
  return;
}
Program: 80494
Project: 80494
Buggy source:
ClosureQueryContext(Class<?> domainObjectClass){
  super();
  this.domainObjectClass=domainObjectClass;
  this.path=new ArrayList<PathElement>();
  this.queryEndNodes=new ArrayList<String>();
}

Fixed version (ground truth):
private ClosureQueryContext(Class<?> domainObjectClass){
  super();
  this.domainObjectClass=domainObjectClass;
  this.path=new ArrayList<PathElement>();
  this.queryEndNodes=new ArrayList<String>();
  this.recursionExitNodes=new ArrayList<String>();
}
Program: 80495
Project: 80495
Buggy source:
<T>List<T> loadByIds(Class<T> domainObjectClass,long... ids){
  List<T> resultList;
  InternalDomainAccess internalAccess=null;
  ClosureQueryContext context=new ClosureQueryContext(domainObjectClass);
  try {
    internalAccess=MappingUtil.internalDomainAccess.get();
    MappingUtil.internalDomainAccess.set(new InternalDomainAccess());
    updateMappingsIfNeeded();
    new ClosureCalculator().calculateClosureQuery(context);
    boolean repeat=context.matchClauses != null && context.matchClauses.size() > 0;
    if (repeat) {
      resultList=loadByIdsWithMatches(domainObjectClass,context,ids);
    }
 else {
      resultList=loadByIdsSimple(domainObjectClass,ids);
    }
  }
  finally {
    if (internalAccess != null)     MappingUtil.internalDomainAccess.set(internalAccess);
 else     MappingUtil.internalDomainAccess.remove();
  }
  return resultList;
}

Fixed version (ground truth):
<T>List<T> loadByIds(Class<T> domainObjectClass,long... ids){
  List<T> resultList;
  InternalDomainAccess internalAccess=null;
  ClosureQueryContext context=new ClosureQueryContext(domainObjectClass);
  try {
    internalAccess=MappingUtil.internalDomainAccess.get();
    MappingUtil.internalDomainAccess.set(new InternalDomainAccess());
    updateMappingsIfNeeded();
    new ClosureCalculator().calculateClosureQuery(context);
    boolean repeat=context.matchClauses != null && context.matchClauses.size() > 0;
    if (repeat) {
      resultList=loadByIdsWithMatches(domainObjectClass,context,ids);
    }
 else {
      resultList=loadByIdsSimple(domainObjectClass,ids);
    }
  }
 catch (  Throwable e) {
    if (!(e instanceof RuntimeException))     throw new RuntimeException(e);
 else     throw e;
  }
 finally {
    if (internalAccess != null)     MappingUtil.internalDomainAccess.set(internalAccess);
 else     MappingUtil.internalDomainAccess.remove();
  }
  return resultList;
}
Program: 80497
Project: 80497
Buggy source:
FillModelContext(Class<T> domainObjectClass,JcQueryResult qResult,List<String> queryEndNds){
  super();
  this.domainObjectClass=domainObjectClass;
  this.qResult=qResult;
  this.path=new ArrayList<PathElement>();
  this.queryEndNodes=queryEndNds;
  this.clauseRepetitionNumber=0;
  this.maxClauseRepetitionNumber=0;
  this.terminatesClause=false;
  this.alreadyTested=new ArrayList<String>();
}

Fixed version (ground truth):
FillModelContext(Class<T> domainObjectClass,JcQueryResult qResult,List<String> queryEndNds,List<String> recursionExitNds){
  super();
  this.domainObjectClass=domainObjectClass;
  this.qResult=qResult;
  this.path=new ArrayList<PathElement>();
  this.queryEndNodes=queryEndNds;
  this.recursionExitNodes=recursionExitNds;
  this.clauseRepetitionNumber=0;
  this.maxClauseRepetitionNumber=0;
  this.terminatesClause=false;
  this.alreadyTested=new ArrayList<String>();
}
Program: 80500
Project: 80500
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) @Test public void testUpdateComplex_EmptyList2NotEmptyList(){
  List<JcError> errors;
  DomainAccess da=new DomainAccess(dbAccess,domainName);
  Person john=new Person();
  buildInitialDomainObjects_2(john);
  List addresses=john.getAddresses();
  john.setAddresses(new ArrayList());
  errors=dbAccess.clearDatabase();
  if (errors.size() > 0) {
    printErrors(errors);
    throw new JcResultException(errors);
  }
  errors=da.store(john);
  if (errors.size() > 0) {
    printErrors(errors);
    throw new JcResultException(errors);
  }
  SyncInfo syncInfo=da.getSyncInfo(john);
  john.setAddresses(addresses);
  errors=da.store(john);
  if (errors.size() > 0) {
    printErrors(errors);
    throw new JcResultException(errors);
  }
  da=new DomainAccess(dbAccess,domainName);
  Person john_1;
  john_1=da.loadById(Person.class,syncInfo.getId());
  return;
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) public void testUpdateComplex_EmptyList2NotEmptyList(){
  List<JcError> errors;
  DomainAccess da=new DomainAccess(dbAccess,domainName);
  Person john=new Person();
  buildInitialDomainObjects_2(john);
  List addresses=john.getAddresses();
  john.setAddresses(new ArrayList());
  errors=dbAccess.clearDatabase();
  if (errors.size() > 0) {
    printErrors(errors);
    throw new JcResultException(errors);
  }
  errors=da.store(john);
  if (errors.size() > 0) {
    printErrors(errors);
    throw new JcResultException(errors);
  }
  SyncInfo syncInfo=da.getSyncInfo(john);
  john.setAddresses(addresses);
  errors=da.store(john);
  if (errors.size() > 0) {
    printErrors(errors);
    throw new JcResultException(errors);
  }
  da=new DomainAccess(dbAccess,domainName);
  Person john_1;
  john_1=da.loadById(Person.class,syncInfo.getId());
  return;
}
Program: 80502
Project: 80502
Buggy source:
private void handleObjectInClosureCalc(Object relatedObject,Object domainObject,UpdateContext context,FieldMapping fm){
  IRelation relat=new Relation(fm.getPropertyOrRelationName(),domainObject,relatedObject);
  if (!domainAccessHandler.domainState.existsRelation(relat)) {
    context.relations.add(relat);
    relat=domainAccessHandler.domainState.findRelation(domainObject,fm.getPropertyOrRelationName());
    if (relat != null) {
      context.relationsToRemove.add(relat);
    }
  }
  recursiveCalculateClosure(relatedObject,context);
}

Fixed version (ground truth):
private void handleObjectInClosureCalc(Object relatedObject,Object domainObject,UpdateContext context,FieldMapping fm){
  IRelation relat=new Relation(fm.getPropertyOrRelationName(),domainObject,relatedObject);
  if (!domainAccessHandler.domainState.existsRelation(relat)) {
    context.relations.add(relat);
    relat=domainAccessHandler.domainState.findRelation(domainObject,fm.getPropertyOrRelationName());
    if (relat != null) {
      context.relationsToRemove.add(relat);
    }
  }
  String classField=fm.getClassFieldName();
  MappingUtil.internalDomainAccess.get().addConcreteFieldType(classField,relatedObject.getClass());
  recursiveCalculateClosure(relatedObject,context);
}
Program: 80503
Project: 80503
Buggy source:
private void handleListInClosureCalc(Collection<?> coll,Object domainObject,UpdateContext context,FieldMapping fm){
  String typ=fm.getPropertyOrRelationName();
  Map<SourceField2TargetKey,List<IndexedRelation>> indexedRelations=new HashMap<SourceField2TargetKey,List<IndexedRelation>>();
  int idx=0;
  for (  Object elem : coll) {
    SourceField2TargetKey key=new SourceField2TargetKey(domainObject,fm.getFieldName(),elem);
    List<IndexedRelation> relats=indexedRelations.get(key);
    if (relats == null) {
      relats=new ArrayList<IndexedRelation>();
      indexedRelations.put(key,relats);
    }
    relats.add(new IndexedRelation(typ,idx,domainObject,elem));
    idx++;
  }
  Iterator<Entry<SourceField2TargetKey,List<IndexedRelation>>> it=indexedRelations.entrySet().iterator();
  while (it.hasNext()) {
    Entry<SourceField2TargetKey,List<IndexedRelation>> entry=it.next();
    List<IndexedRelation> existingRels=domainAccessHandler.domainState.getIndexedRelations(entry.getKey());
    RelationsToModify toModify=calculateIndexedRelationsToModify(entry.getValue(),existingRels);
    context.relations.addAll(toModify.toChange);
    context.relations.addAll(toModify.toCreate);
    context.relationsToRemove.addAll(toModify.toRemove);
  }
  for (  Object elem : coll) {
    recursiveCalculateClosure(elem,context);
  }
}

Fixed version (ground truth):
private void handleListInClosureCalc(Collection<?> coll,Object domainObject,UpdateContext context,FieldMapping fm){
  String typ=fm.getPropertyOrRelationName();
  Map<SourceField2TargetKey,List<IndexedRelation>> indexedRelations=new HashMap<SourceField2TargetKey,List<IndexedRelation>>();
  String classField=fm.getClassFieldName();
  MappingUtil.internalDomainAccess.get().addConcreteFieldType(classField,coll.getClass());
  int idx=0;
  for (  Object elem : coll) {
    SourceField2TargetKey key=new SourceField2TargetKey(domainObject,fm.getFieldName(),elem);
    List<IndexedRelation> relats=indexedRelations.get(key);
    if (relats == null) {
      relats=new ArrayList<IndexedRelation>();
      indexedRelations.put(key,relats);
    }
    relats.add(new IndexedRelation(typ,idx,domainObject,elem));
    MappingUtil.internalDomainAccess.get().addFieldComponentType(classField,elem.getClass());
    idx++;
  }
  Iterator<Entry<SourceField2TargetKey,List<IndexedRelation>>> it=indexedRelations.entrySet().iterator();
  while (it.hasNext()) {
    Entry<SourceField2TargetKey,List<IndexedRelation>> entry=it.next();
    List<IndexedRelation> existingRels=domainAccessHandler.domainState.getIndexedRelations(entry.getKey());
    RelationsToModify toModify=calculateIndexedRelationsToModify(entry.getValue(),existingRels);
    context.relations.addAll(toModify.toChange);
    context.relations.addAll(toModify.toCreate);
    context.relationsToRemove.addAll(toModify.toRemove);
  }
  for (  Object elem : coll) {
    recursiveCalculateClosure(elem,context);
  }
}
Program: 80504
Project: 80504
Buggy source:
/** 
 * @return the value of the field, if this value cannot be mapped to a property,but must be mapped to a seperate node connected via a relation, else return null.
 */
@SuppressWarnings("String_Node_Str") public Object getObjectNeedingRelation(Object domainObject){
  Object value=null;
  try {
    prepare(domainObject);
    if (needsRelation()) {
      value=this.field.get(domainObject);
      if (value != null) {
        String classField=getClassFieldName();
        MappingUtil.internalDomainAccess.get().addConcreteFieldType(classField,value.getClass());
        if (Collection.class.isAssignableFrom(this.field.getType())) {
          Collection coll=(Collection)this.field.getType().cast(value);
          if (coll.size() > 0) {
            Object elem=coll.iterator().next();
            Class<?> type=elem.getClass();
            classField=getClassFieldName();
            MappingUtil.internalDomainAccess.get().addFieldComponentType(classField,type);
            if (MappingUtil.isSimpleType(type)) {
              value=null;
            }
          }
 else {
            value=null;
          }
        }
      }
    }
  }
 catch (  Throwable e) {
    throw new RuntimeException(e);
  }
  return value;
}

Fixed version (ground truth):
/** 
 * @return the value of the field, if this value cannot be mapped to a property,but must be mapped to a seperate node connected via a relation, else return null.
 */
@SuppressWarnings("String_Node_Str") public Object getObjectNeedingRelation(Object domainObject){
  Object value=null;
  try {
    prepare(domainObject);
    if (needsRelation()) {
      value=this.field.get(domainObject);
      if (value != null) {
        if (Collection.class.isAssignableFrom(this.field.getType())) {
          Collection coll=(Collection)this.field.getType().cast(value);
          if (coll.size() > 0) {
            Object elem=coll.iterator().next();
            Class<?> type=elem.getClass();
            if (MappingUtil.isSimpleType(type)) {
              value=null;
            }
          }
 else {
            value=null;
          }
        }
      }
    }
  }
 catch (  Throwable e) {
    throw new RuntimeException(e);
  }
  return value;
}
Program: 80505
Project: 80505
Buggy source:
public static boolean equalsAddresses(List addresses1,List addresses2){
  if (addresses1 == addresses2)   return true;
  ListIterator e1=addresses1.listIterator();
  ListIterator e2=addresses2.listIterator();
  while (e1.hasNext() && e2.hasNext()) {
    Object o1=e1.next();
    Object o2=e2.next();
    if (!(o1 == null ? o2 == null : equalsAddress((Address)o1,(Address)o2)))     return false;
  }
  return !(e1.hasNext() || e2.hasNext());
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public static boolean equalsAddresses(List addresses1,List addresses2){
  if (addresses1 == addresses2)   return true;
  ListIterator e1=addresses1.listIterator();
  ListIterator e2=addresses2.listIterator();
  while (e1.hasNext() && e2.hasNext()) {
    Object o1=e1.next();
    Object o2=e2.next();
    if (!(o1 == null ? o2 == null : equalsAddress((Address)o1,(Address)o2)))     return false;
  }
  return !(e1.hasNext() || e2.hasNext());
}
Program: 80507
Project: 80507
Buggy source:
/** 
 * @param fm, null for the root step
 * @param context
 * @return true, if calculating query for the current path is done
 */
private boolean calculateQuery(FieldMapping fm,int fieldIndex,ClosureQueryContext context,int level){
  if (fm != null)   this.addToQuery(fm,fieldIndex,context,level);
  Class<?> doClass;
  if (fm == null)   doClass=context.domainObjectClass;
 else   doClass=fm.getFieldType();
  ObjectMapping objectMapping=domainAccessHandler.getObjectMappingFor(doClass);
  List<FieldMapping> fMappings=objectMapping.getFieldMappings();
  boolean walkedToIndex=this.subPathIndex == -1;
  boolean subPathWalked=false;
  int idx=-1;
  for (  FieldMapping fMap : fMappings) {
    idx++;
    if (!walkedToIndex) {
      if (idx != this.subPathIndex)       continue;
 else       walkedToIndex=true;
    }
    if (fMap.needsRelation()) {
      boolean needToComeBack=false;
      if (!subPathWalked) {
        if (this.next == null)         this.next=new Step();
        boolean isDone=this.next.calculateQuery(fMap,idx,context,level + 1);
        if (!isDone) {
          needToComeBack=true;
        }
 else {
          this.next=null;
          subPathWalked=true;
        }
      }
 else {
        needToComeBack=true;
      }
      if (needToComeBack) {
        this.subPathIndex=idx;
        return false;
      }
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * @param fm, null for the root step
 * @param context
 * @return true, if calculating query for the current path is done
 */
private boolean calculateQuery(FieldMapping fm,int fieldIndex,ClosureQueryContext context,int level){
  Class<?> doClass;
  if (fm == null)   doClass=context.domainObjectClass;
 else   doClass=fm.getFieldType();
  if (fm != null)   this.addToQuery(fm,fieldIndex,context,level);
  boolean walkedToIndex=this.subPathIndex == -1;
  if (!context.visitedTypes.contains(doClass) || !walkedToIndex) {
    if (walkedToIndex)     context.visitedTypes.add(doClass);
    ObjectMapping objectMapping=domainAccessHandler.getObjectMappingFor(doClass);
    List<FieldMapping> fMappings=objectMapping.getFieldMappings();
    boolean subPathWalked=false;
    int idx=-1;
    for (    FieldMapping fMap : fMappings) {
      idx++;
      if (!walkedToIndex) {
        if (idx != this.subPathIndex)         continue;
 else         walkedToIndex=true;
      }
      if (fMap.needsRelation()) {
        boolean needToComeBack=false;
        if (!subPathWalked) {
          if (this.next == null)           this.next=new Step();
          boolean isDone=this.next.calculateQuery(fMap,idx,context,level + 1);
          if (!isDone) {
            needToComeBack=true;
          }
 else {
            this.next=null;
            subPathWalked=true;
          }
        }
 else {
          needToComeBack=true;
        }
        if (needToComeBack) {
          this.subPathIndex=idx;
          return false;
        }
      }
    }
  }
  return true;
}
Program: 80508
Project: 80508
Buggy source:
private void addToQuery(FieldMapping fm,int fieldIndex,ClosureQueryContext context,int level){
  if (context.currentMatchClause == null) {
    JcNode n=new JcNode(DomainAccessHandler.NodePrefix.concat(String.valueOf(0)));
    context.currentMatchClause=OPTIONAL_MATCH.node(n);
  }
  JcNode n=new JcNode(this.buildNodeOrRelationName(fieldIndex,level,DomainAccessHandler.NodePrefix));
  JcRelation r=new JcRelation(this.buildNodeOrRelationName(fieldIndex,level,DomainAccessHandler.RelationPrefix));
  context.currentMatchClause.relation(r).out().type(fm.getPropertyOrRelationName()).node(n);
}

Fixed version (ground truth):
private void addToQuery(FieldMapping fm,int fieldIndex,ClosureQueryContext context,int level){
  if (context.currentMatchClause == null) {
    JcNode n=new JcNode(DomainAccessHandler.NodePrefix.concat(String.valueOf(0)));
    context.currentMatchClause=OPTIONAL_MATCH.node(n);
    if (context.matchClauses != null && context.matchClauses.size() > 0) {
      context.matchClauses.add(SEPARATE.nextClause());
    }
  }
  JcNode n=new JcNode(this.buildNodeOrRelationName(fieldIndex,level,DomainAccessHandler.NodePrefix));
  JcRelation r=new JcRelation(this.buildNodeOrRelationName(fieldIndex,level,DomainAccessHandler.RelationPrefix));
  context.currentMatchClause.relation(r).out().type(fm.getPropertyOrRelationName()).node(n);
}
Program: 80511
Project: 80511
Buggy source:
ClosureQueryContext(Class<?> domainObjectClass){
  super();
  this.domainObjectClass=domainObjectClass;
}

Fixed version (ground truth):
ClosureQueryContext(Class<?> domainObjectClass){
  super();
  this.domainObjectClass=domainObjectClass;
  this.visitedTypes=new ArrayList<Class<?>>();
}
Program: 80512
Project: 80512
Buggy source:
private void addTo_Object2IdMap(Object key,Long value){
  this.object2IdMap.put(key,value);
}

Fixed version (ground truth):
private void addTo_Object2IdMap(Object key,Long value){
  LoadInfo loadInfo=new LoadInfo();
  loadInfo.id=value;
  this.object2IdMap.put(key,loadInfo);
}
Program: 80513
Project: 80513
Buggy source:
public DomainState(){
  super();
  this.object2IdMap=new HashMap<Object,Long>();
  this.relation2IdMap=new HashMap<Relation,Long>();
  this.id2ObjectsMap=new HashMap<Long,List<Object>>();
  this.object2RelationsMap=new HashMap<Object,List<Relation>>();
}

Fixed version (ground truth):
public DomainState(){
  super();
  this.object2IdMap=new HashMap<Object,LoadInfo>();
  this.relation2IdMap=new HashMap<Relation,Long>();
  this.id2ObjectsMap=new HashMap<Long,List<Object>>();
  this.object2RelationsMap=new HashMap<Object,List<Relation>>();
}
Program: 80514
Project: 80514
Buggy source:
public void mapPropertyFromField(Object domainObject,GrNode rNode){
  try {
    prepare(domainObject);
    Object value=this.field.get(domainObject);
    Class<?> typ=this.field.getType();
    if (MappingUtil.mapsToProperty(typ)) {
      value=MappingUtil.convertToProperty(value);
      GrProperty prop=rNode.getProperty(this.propertyName);
      if (prop != null) {
        if (!prop.getValue().equals(value)) {
          prop.remove();
          prop=null;
        }
      }
      if (prop == null)       rNode.addProperty(this.propertyName,value);
    }
  }
 catch (  Throwable e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
public void mapPropertyFromField(Object domainObject,GrNode rNode){
  try {
    prepare(domainObject);
    Object value=this.field.get(domainObject);
    Class<?> typ=this.field.getType();
    if (MappingUtil.mapsToProperty(typ)) {
      value=MappingUtil.convertToProperty(value);
      GrProperty prop=rNode.getProperty(this.propertyName);
      if (value != null) {
        if (prop != null) {
          Object propValue=MappingUtil.convertFromProperty(prop.getValue(),value.getClass());
          if (!propValue.equals(value)) {
            prop.setValue(value);
          }
        }
 else         rNode.addProperty(this.propertyName,value);
      }
 else {
        if (prop != null)         prop.setValue(null);
      }
    }
  }
 catch (  Throwable e) {
    throw new RuntimeException(e);
  }
}
Program: 80515
Project: 80515
Buggy source:
public static Object convertFromProperty(Object value,Class<?> targetType){
  if (value != null) {
    if (Date.class.isAssignableFrom(targetType) && value instanceof Number) {
      return longToDate(((Number)value).longValue());
    }
 else     if (Enum.class.isAssignableFrom(targetType)) {
      Object[] enums=targetType.getEnumConstants();
      for (int i=0; i < enums.length; i++) {
        if (((Enum<?>)enums[i]).name().equals(value.toString()))         return enums[i];
      }
      return value;
    }
 else     if (targetType.equals(value.getClass())) {
      return value;
    }
 else     if (targetType.isPrimitive()) {
      return convertToPrimitive(value,targetType);
    }
 else     if (targetType.isAssignableFrom(value.getClass())) {
      return targetType.cast(value);
    }
  }
  return value;
}

Fixed version (ground truth):
public static Object convertFromProperty(Object value,Class<?> targetType){
  if (value != null) {
    if (Date.class.isAssignableFrom(targetType) && value instanceof Number) {
      return longToDate(((Number)value).longValue());
    }
 else     if (Enum.class.isAssignableFrom(targetType)) {
      Object[] enums=targetType.getEnumConstants();
      for (int i=0; i < enums.length; i++) {
        if (((Enum<?>)enums[i]).name().equals(value.toString()))         return enums[i];
      }
      return value;
    }
 else     if (targetType.equals(value.getClass())) {
      return value;
    }
 else     if (targetType.isPrimitive()) {
      return convertToPrimitive(value,targetType);
    }
 else     if (targetType.isAssignableFrom(value.getClass())) {
      return targetType.cast(value);
    }
 else     if (Number.class.isAssignableFrom(targetType)) {
      return convertToDistinctNumber(value,targetType);
    }
  }
  return value;
}
Program: 80516
Project: 80516
Buggy source:
public void setValue(Object value){
  Object val=value;
  if (val.getClass().isArray()) {
    int length=Array.getLength(val);
    ArrayList<Object> list=new ArrayList<>();
    for (int i=0; i < length; i++) {
      Object arrayElement=Array.get(val,i);
      list.add(arrayElement);
    }
    val=list;
  }
  Object oldVal=this.value;
  this.value=val;
  if (oldVal != null && oldVal != this.value) {
    SyncState oldState=this.syncState;
    if (this.syncState == SyncState.SYNC)     this.syncState=SyncState.CHANGED;
    if (oldState != this.syncState)     fireChanged(oldState,this.syncState);
  }
}

Fixed version (ground truth):
public void setValue(Object value){
  Object val=value;
  if (val != null && val.getClass().isArray()) {
    int length=Array.getLength(val);
    ArrayList<Object> list=new ArrayList<>();
    for (int i=0; i < length; i++) {
      Object arrayElement=Array.get(val,i);
      list.add(arrayElement);
    }
    val=list;
  }
  Object oldVal=this.value;
  this.value=val;
  if (oldVal != null && oldVal != this.value) {
    SyncState oldState=this.syncState;
    if (this.syncState == SyncState.SYNC)     this.syncState=SyncState.CHANGED;
    if (oldState != this.syncState)     fireChanged(oldState,this.syncState);
  }
}
Program: 80517
Project: 80517
Buggy source:
/** 
 * Update the underlying database with changes made on the graph
 * @return a list of errors, which is empty if no errors occurred
 */
public List<JcError> store(){
  if (isModified())   return this.resultHandler.store();
  return null;
}

Fixed version (ground truth):
/** 
 * Update the underlying database with changes made on the graph
 * @return a list of errors, which is empty if no errors occurred
 */
public List<JcError> store(){
  if (isModified())   return this.resultHandler.store();
  return Collections.emptyList();
}
Program: 80518
Project: 80518
Buggy source:
@Override public void onViewBind(View view,Cursor cr,ODataRow row){
  int to_read=cr.getInt(cr.getColumnIndex("String_Node_Str"));
  view.setBackgroundResource(background_resources[to_read]);
  ImageView imgStarred=(ImageView)view.findViewById(R.id.img_starred_mlist);
  int is_fav=cr.getInt(cr.getColumnIndex("String_Node_Str"));
  imgStarred.setColorFilter((is_fav == 1) ? Color.parseColor("String_Node_Str") : Color.parseColor("String_Node_Str"));
  OField totalChilds=(OField)view.findViewById(R.id.totalChilds);
  int replies=Integer.parseInt(cr.getString(cr.getColumnIndex("String_Node_Str")));
  String childs="String_Node_Str";
  if (replies > 0) {
    childs=replies + "String_Node_Str";
  }
  totalChilds.setText(childs);
}

Fixed version (ground truth):
@Override public void onViewBind(View view,Cursor cr,ODataRow row){
  int to_read=cr.getInt(cr.getColumnIndex("String_Node_Str"));
  view.setBackgroundResource(background_resources[to_read]);
  ImageView imgStarred=(ImageView)view.findViewById(R.id.img_starred_mlist);
  int is_fav=0;
  is_fav=cr.getInt(cr.getColumnIndex("String_Node_Str"));
  imgStarred.setColorFilter((is_fav == 1) ? Color.parseColor("String_Node_Str") : Color.parseColor("String_Node_Str"));
  OField totalChilds=(OField)view.findViewById(R.id.totalChilds);
  int replies=0;
  String total_childs=cr.getString(cr.getColumnIndex("String_Node_Str"));
  replies=Integer.parseInt(total_childs);
  String childs="String_Node_Str";
  if (replies > 0) {
    childs=replies + "String_Node_Str";
  }
  totalChilds.setText(childs);
}
Program: 80519
Project: 80519
Buggy source:
public Odoo createInstance(){
  Odoo odoo=null;
  OUser user=OUser.current(getApplicationContext());
  if (user != null) {
    try {
      if (user.isOAauthLogin()) {
        odoo=new Odoo(user.getInstanceUrl(),user.isAllowSelfSignedSSL());
        OdooInstance instance=new OdooInstance();
        instance.setInstanceUrl(user.getInstanceUrl());
        instance.setDatabaseName(user.getInstanceDatabase());
        instance.setClientId(user.getClientId());
        odoo.oauth_authenticate(instance,user.getUsername(),user.getPassword());
      }
 else {
        odoo=new Odoo(user.getHost(),user.isAllowSelfSignedSSL());
        odoo.authenticate(user.getUsername(),user.getPassword(),user.getDatabase());
      }
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
  return odoo;
}

Fixed version (ground truth):
public Odoo createInstance(){
  Odoo odoo=null;
  OUser user=OUser.current(getApplicationContext());
  if (user != null) {
    try {
      if (user.isOAauthLogin()) {
        odoo=new Odoo(user.getInstanceUrl(),user.isAllowSelfSignedSSL());
        OdooInstance instance=new OdooInstance();
        instance.setInstanceUrl(user.getInstanceUrl());
        instance.setDatabaseName(user.getInstanceDatabase());
        instance.setClientId(user.getClientId());
        odoo.oauth_authenticate(instance,user.getUsername(),user.getPassword());
      }
 else {
        odoo=new Odoo(user.getHost(),user.isAllowSelfSignedSSL());
        odoo.authenticate(user.getUsername(),user.getPassword(),user.getDatabase());
      }
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
  mOdooInstance=odoo;
  return odoo;
}
Program: 80520
Project: 80520
Buggy source:
/** 
 * Removes the account.
 * @param context the context
 * @param username the username
 */
public static void removeAccount(Context context,String username){
  AccountManager accMgr=AccountManager.get(context);
  accMgr.removeAccount(OpenERPAccountManager.getAccount(context,username),null,null);
  App app=(App)context.getApplicationContext();
  app.setOEInstance(null);
  current_user=null;
}

Fixed version (ground truth):
/** 
 * Removes the account.
 * @param context the context
 * @param username the username 
 */
public static void removeAccount(Context context,String username){
  AccountManager accMgr=AccountManager.get(context);
  accMgr.removeAccount(OpenERPAccountManager.getAccount(context,username),null,null);
  App app=(App)context.getApplicationContext();
  app.setOEInstance(null);
  current_user=null;
}
Program: 80521
Project: 80521
Buggy source:
private static boolean cancelAllSync(Account account){
  SyncWizardValues syncVals=new SyncWizardValues();
  boolean flag=false;
  for (  SyncValue sync : syncVals.syncValues()) {
    ContentResolver.cancelSync(account,sync.getAuthority());
    flag=true;
  }
  return flag;
}

Fixed version (ground truth):
private static boolean cancelAllSync(Account account){
  SyncWizardValues syncVals=new SyncWizardValues();
  for (  SyncValue sync : syncVals.syncValues()) {
    ContentResolver.cancelSync(account,sync.getAuthority());
  }
  return true;
}
Program: 80522
Project: 80522
Buggy source:
private void updateSyncSettings(){
  Log.d(TAG,"String_Node_Str");
  PreferenceManager mPref=new PreferenceManager(mContext);
  int sync_interval=mPref.getInt("String_Node_Str",1440);
  List<String> default_authorities=new ArrayList<String>();
  default_authorities.add("String_Node_Str");
  default_authorities.add("String_Node_Str");
  SyncAdapterType[] list=ContentResolver.getSyncAdapterTypes();
  Account mAccount=OpenERPAccountManager.getAccount(mContext,OEUser.current(mContext).getAndroidName());
  for (  SyncAdapterType lst : list) {
    if (lst.authority.contains("String_Node_Str")) {
      default_authorities.add(lst.authority);
    }
  }
  for (  String authority : default_authorities) {
    boolean isSyncActive=ContentResolver.getSyncAutomatically(mAccount,authority);
    if (isSyncActive) {
      setSyncPeriodic(authority,sync_interval,1,1);
    }
  }
  Toast.makeText(this,R.string.toast_setting_saved,Toast.LENGTH_LONG).show();
}

Fixed version (ground truth):
private void updateSyncSettings(){
  Log.d(TAG,"String_Node_Str");
  PreferenceManager mPref=new PreferenceManager(mContext);
  int sync_interval=mPref.getInt("String_Node_Str",1440);
  List<String> default_authorities=new ArrayList<String>();
  default_authorities.add("String_Node_Str");
  default_authorities.add("String_Node_Str");
  SyncAdapterType[] list=ContentResolver.getSyncAdapterTypes();
  Account mAccount=OpenERPAccountManager.getAccount(mContext,OEUser.current(mContext).getAndroidName());
  for (  SyncAdapterType lst : list) {
    if (lst.authority.contains("String_Node_Str") && lst.authority.contains("String_Node_Str")) {
      default_authorities.add(lst.authority);
    }
  }
  for (  String authority : default_authorities) {
    boolean isSyncActive=ContentResolver.getSyncAutomatically(mAccount,authority);
    if (isSyncActive) {
      setSyncPeriodic(authority,sync_interval,60,1);
    }
  }
  Toast.makeText(this,R.string.toast_setting_saved,Toast.LENGTH_LONG).show();
}
Program: 80523
Project: 80523
Buggy source:
private void initDrawer(List<DrawerItem> drawerItems){
  Res_PartnerDBHelper partner=new Res_PartnerDBHelper(context);
  Object obj=partner.search(partner,new String[]{"String_Node_Str"},new String[]{"String_Node_Str"},new String[]{OEUser.current(context).getPartner_id()}).get("String_Node_Str");
  String user_name="String_Node_Str";
  if (obj instanceof Boolean) {
    user_name=OEUser.current(context).getUsername();
  }
 else {
    user_name=((List<HashMap<String,Object>>)obj).get(0).get("String_Node_Str").toString();
  }
  mDrawerTitle=user_name;
  mDrawerSubtitle=OEUser.current(context).getHost();
  getActionBar().setHomeButtonEnabled(true);
  getActionBar().setDisplayHomeAsUpEnabled(true);
  setDrawerItems(drawerItems);
}

Fixed version (ground truth):
private void initDrawer(List<DrawerItem> drawerItems){
  Res_PartnerDBHelper partner=new Res_PartnerDBHelper(context);
  Object obj=partner.search(partner,new String[]{"String_Node_Str"},new String[]{"String_Node_Str"},new String[]{OEUser.current(context).getPartner_id()}).get("String_Node_Str");
  String user_name="String_Node_Str";
  if (obj instanceof Boolean) {
    user_name=OEUser.current(context).getUsername();
  }
 else {
    user_name=((List<HashMap<String,Object>>)obj).get(0).get("String_Node_Str").toString();
  }
  mDrawerTitle=user_name;
  mDrawerSubtitle=OEUser.current(context).getHost();
  getActionBar().setHomeButtonEnabled(true);
  getActionBar().setDisplayHomeAsUpEnabled(true);
  setDrawerItems(drawerItems);
  if (mDrawerItemSelectedPosition > 0) {
    mAppTitle=mDrawerListItems.get(mDrawerItemSelectedPosition).getTitle();
    setTitle(mAppTitle);
  }
}
Program: 80524
Project: 80524
Buggy source:
@Override public void onStart(){
  super.onStart();
  mDrawerListView.setOnItemClickListener(this);
  int position=-1;
  if (mDrawerListItems.size() > 0) {
    if (!mDrawerListItems.get(0).isGroupTitle()) {
      mDrawerListView.setItemChecked(0,true);
      position=0;
    }
 else {
      mDrawerListView.setItemChecked(1,true);
      position=1;
    }
  }
  if (mDrawerItemSelectedPosition >= 0) {
    position=mDrawerItemSelectedPosition;
  }
  if (getIntent().getAction() != null && !getIntent().getAction().toString().equalsIgnoreCase("String_Node_Str")) {
    if (getIntent().getAction().toString().equalsIgnoreCase("String_Node_Str")) {
      startActivity(new Intent(context,MessageComposeActivty.class));
    }
    if (getIntent().getAction().toString().equalsIgnoreCase("String_Node_Str")) {
      startActivity(new Intent(context,ComposeNoteActivity.class));
    }
  }
 else {
    if (position > 0) {
      loadFragment(mDrawerListItems.get(position));
    }
  }
}

Fixed version (ground truth):
@Override public void onStart(){
  super.onStart();
  mDrawerListView.setOnItemClickListener(this);
  int position=-1;
  if (mDrawerListItems.size() > 0) {
    if (!mDrawerListItems.get(0).isGroupTitle()) {
      mDrawerListView.setItemChecked(0,true);
      position=0;
    }
 else {
      mDrawerListView.setItemChecked(1,true);
      position=1;
    }
  }
  if (mDrawerItemSelectedPosition >= 0) {
    position=mDrawerItemSelectedPosition;
  }
  if (getIntent().getAction() != null && !getIntent().getAction().toString().equalsIgnoreCase("String_Node_Str")) {
    if (getIntent().getAction().toString().equalsIgnoreCase("String_Node_Str")) {
      startActivity(new Intent(context,MessageComposeActivty.class));
    }
    if (getIntent().getAction().toString().equalsIgnoreCase("String_Node_Str")) {
      startActivity(new Intent(context,ComposeNoteActivity.class));
    }
  }
 else {
    if (position > 0) {
      if (position != mDrawerItemSelectedPosition) {
        loadFragment(mDrawerListItems.get(position));
      }
    }
  }
}
Program: 80526
Project: 80526
Buggy source:
private void initDrawer(List<DrawerItem> drawerItems){
  Res_PartnerDBHelper partner=new Res_PartnerDBHelper(context);
  Object obj=partner.search(partner,new String[]{"String_Node_Str"},new String[]{"String_Node_Str"},new String[]{OEUser.current(context).getPartner_id()}).get("String_Node_Str");
  String user_name="String_Node_Str";
  if (obj instanceof Boolean) {
    user_name=OEUser.current(context).getUsername();
  }
 else {
    user_name=((List<HashMap<String,Object>>)obj).get(0).get("String_Node_Str").toString();
  }
  mDrawerTitle=user_name;
  mDrawerSubtitle=OEUser.current(context).getHost();
  getActionBar().setHomeButtonEnabled(true);
  getActionBar().setDisplayHomeAsUpEnabled(true);
  setDrawerItems(drawerItems);
  if (mDrawerItemSelectedPosition > 0) {
    mAppTitle=mDrawerListItems.get(mDrawerItemSelectedPosition).getTitle();
    setTitle(mAppTitle);
  }
}

Fixed version (ground truth):
private void initDrawer(List<DrawerItem> drawerItems){
  if (OEUser.current(context) != null) {
    Res_PartnerDBHelper partner=new Res_PartnerDBHelper(context);
    Object obj=partner.search(partner,new String[]{"String_Node_Str"},new String[]{"String_Node_Str"},new String[]{OEUser.current(context).getPartner_id()}).get("String_Node_Str");
    String user_name="String_Node_Str";
    if (obj instanceof Boolean) {
      user_name=OEUser.current(context).getUsername();
    }
 else {
      user_name=((List<HashMap<String,Object>>)obj).get(0).get("String_Node_Str").toString();
    }
    mDrawerTitle=user_name;
    mDrawerSubtitle=OEUser.current(context).getHost();
    getActionBar().setHomeButtonEnabled(true);
    getActionBar().setDisplayHomeAsUpEnabled(true);
    setDrawerItems(drawerItems);
    if (mDrawerItemSelectedPosition > 0) {
      mAppTitle=mDrawerListItems.get(mDrawerItemSelectedPosition).getTitle();
      setTitle(mAppTitle);
    }
  }
}
Program: 80527
Project: 80527
Buggy source:
@Override public OEMenu menuHelper(Context context){
  OEMenu menu=new OEMenu();
  menu.setId(1);
  menu.setMenuTitle("String_Node_Str");
  setNoteStages(context);
  List<OEMenuItems> items=new ArrayList<OEMenuItems>();
  items.add(new OEMenuItems("String_Node_Str",getFragBundle("String_Node_Str","String_Node_Str"),getCount("String_Node_Str",context)));
  items.add(new OEMenuItems("String_Node_Str",getFragBundle("String_Node_Str","String_Node_Str"),0));
  if (stages != null) {
    int i=0;
    for (    String key : stages.keySet()) {
      if (i > tag_colors.length - 1) {
        i=0;
      }
      OEMenuItems stageMenu=new OEMenuItems(stages.get(key).toString(),getFragBundle("String_Node_Str",key),getCount(key,context));
      stageMenu.setAutoMenuTagColor(true);
      stageMenu.setMenuTagColor(Color.parseColor(tag_colors[i]));
      stage_colors.put("String_Node_Str" + key,stageMenu.getMenuTagColor());
      items.add(stageMenu);
      i++;
    }
  }
  menu.setMenuItems(items);
  return menu;
}

Fixed version (ground truth):
@Override public OEMenu menuHelper(Context context){
  db=(NoteDBHelper)databaseHelper(context);
  if (db.getOEInstance().isInstalled("String_Node_Str")) {
    OEMenu menu=new OEMenu();
    menu.setId(1);
    menu.setMenuTitle("String_Node_Str");
    setNoteStages(context);
    List<OEMenuItems> items=new ArrayList<OEMenuItems>();
    items.add(new OEMenuItems("String_Node_Str",getFragBundle("String_Node_Str","String_Node_Str"),getCount("String_Node_Str",context)));
    items.add(new OEMenuItems("String_Node_Str",getFragBundle("String_Node_Str","String_Node_Str"),0));
    if (stages != null) {
      int i=0;
      for (      String key : stages.keySet()) {
        if (i > tag_colors.length - 1) {
          i=0;
        }
        OEMenuItems stageMenu=new OEMenuItems(stages.get(key).toString(),getFragBundle("String_Node_Str",key),getCount(key,context));
        stageMenu.setAutoMenuTagColor(true);
        stageMenu.setMenuTagColor(Color.parseColor(tag_colors[i]));
        stage_colors.put("String_Node_Str" + key,stageMenu.getMenuTagColor());
        items.add(stageMenu);
        i++;
      }
    }
    menu.setMenuItems(items);
    return menu;
  }
 else {
    return null;
  }
}
Program: 80528
Project: 80528
Buggy source:
public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  setHasOptionsMenu(true);
  scope=new AppScope(MainActivity.userContext,(MainActivity)getActivity());
  db=(NoteDBHelper)getModel();
  rootView=inflater.inflate(R.layout.fragment_note,container,false);
  lstNotes=(ListView)rootView.findViewById(R.id.lstNotes);
  emptyNotesText=(TextView)rootView.findViewById(R.id.txvNoteAllArchive);
  handleArguments((Bundle)getArguments());
  return rootView;
}

Fixed version (ground truth):
public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  scope=new AppScope(MainActivity.userContext,(MainActivity)getActivity());
  db=(NoteDBHelper)getModel();
  setHasOptionsMenu(true);
  rootView=inflater.inflate(R.layout.fragment_note,container,false);
  lstNotes=(ListView)rootView.findViewById(R.id.lstNotes);
  emptyNotesText=(TextView)rootView.findViewById(R.id.txvNoteAllArchive);
  handleArguments((Bundle)getArguments());
  return rootView;
}
Program: 80529
Project: 80529
Buggy source:
/** 
 * Load base modules.
 */
private void loadBaseModules(){
  this.modules.add(new Module("String_Node_Str","String_Node_Str",new ResFragment(),0));
  this.modules.add(new Module("String_Node_Str","String_Node_Str",new AttachmentFragment(),0));
}

Fixed version (ground truth):
/** 
 * Load base modules.
 */
private void loadBaseModules(){
  this.modules.add(new Module("String_Node_Str","String_Node_Str",new ResFragment(),0));
  this.modules.add(new Module("String_Node_Str","String_Node_Str",new AttachmentFragment(),0));
  this.modules.add(new Module("String_Node_Str","String_Node_Str",new Ir_modelFragment(),0));
}