nus-yam/ex-repair huggingface dataset:
Program: 165072
Project: 165072
Buggy source:
private KeyDefinitionBuilder<S,K> populateKey(KeyDefinitionBuilder<S,K>[] keyDefinitions,ArrayList<MappingContextFactoryBuilder<S,K>> builders,MappingContextFactoryBuilder<S,K> builder){
  if (keyDefinitions[builder.currentIndex] != null) {
    return keyDefinitions[builder.currentIndex];
  }
  int parentIndex=builder.getNonEmptyParentIndex();
  KeyDefinitionBuilder<S,K> parent=null;
  if (parentIndex != -1) {
    parent=keyDefinitions[parentIndex];
    if (parent == null) {
      for (int i=0; i < builders.size(); i++) {
        MappingContextFactoryBuilder<S,K> potentialParent=builders.get(i);
        if (potentialParent.currentIndex == parentIndex) {
          parent=populateKey(keyDefinitions,builders,potentialParent);
          break;
        }
      }
      if (parent == null) {
        throw new IllegalArgumentException("String_Node_Str" + builder);
      }
    }
  }
  KeyDefinitionBuilder<S,K> keyDefinition;
  if (builder.effectiveKeys().isEmpty() && parent != null && !builder.newObjectOnEachRow()) {
    keyDefinition=parent.asChild(builder.currentIndex);
  }
 else {
    List<K> keys=new ArrayList<K>(builder.effectiveKeys());
    if (parentIndex > 0 && parent != null) {
      appendParentKeys(parent,keys);
    }
    keyDefinition=new KeyDefinitionBuilder<S,K>(keys,builder.keySourceGetter,builder.currentIndex);
  }
  keyDefinitions[builder.currentIndex]=keyDefinition;
  return keyDefinition;
}

Fixed version (ground truth):
private KeyDefinitionBuilder<S,K> populateKey(KeyDefinitionBuilder<S,K>[] keyDefinitions,ArrayList<MappingContextFactoryBuilder<S,K>> builders,MappingContextFactoryBuilder<S,K> builder){
  if (keyDefinitions[builder.currentIndex] != null) {
    return keyDefinitions[builder.currentIndex];
  }
  int parentIndex=builder.getNonEmptyParentIndex();
  KeyDefinitionBuilder<S,K> parent=null;
  if (parentIndex != -1) {
    parent=keyDefinitions[parentIndex];
    if (parent == null) {
      for (int i=0; i < builders.size(); i++) {
        MappingContextFactoryBuilder<S,K> potentialParent=builders.get(i);
        if (potentialParent.currentIndex == parentIndex) {
          parent=populateKey(keyDefinitions,builders,potentialParent);
          break;
        }
      }
      if (parent == null) {
        throw new IllegalArgumentException("String_Node_Str" + builder);
      }
    }
  }
  KeyDefinitionBuilder<S,K> keyDefinition;
  if (parent != null && builder.inheritKeys(parentIndex)) {
    keyDefinition=parent.asChild(builder.currentIndex);
  }
 else {
    List<K> keys=new ArrayList<K>(builder.effectiveKeys());
    if (parentIndex > 0 && parent != null) {
      appendParentKeys(parent,keys);
    }
    keyDefinition=new KeyDefinitionBuilder<S,K>(keys,builder.keySourceGetter,builder.currentIndex);
  }
  keyDefinitions[builder.currentIndex]=keyDefinition;
  return keyDefinition;
}
Program: 165073
Project: 165073
Buggy source:
private boolean newObjectOnEachRow(){
  if (owner instanceof ArrayElementPropertyMeta) {
    ArrayElementPropertyMeta elementPropertyMeta=(ArrayElementPropertyMeta)owner;
    if (elementPropertyMeta.getSetter() instanceof AppendCollectionSetter) {
      return true;
    }
  }
 else   if (owner instanceof MapKeyValueElementPropertyMeta) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
private boolean newObjectOnEachRow(int parentIndex){
  if (owner instanceof ArrayElementPropertyMeta) {
    ArrayElementPropertyMeta elementPropertyMeta=(ArrayElementPropertyMeta)owner;
    if (elementPropertyMeta.getSetter() instanceof AppendCollectionSetter) {
      return true;
    }
  }
 else   if (owner instanceof MapKeyValueElementPropertyMeta) {
    return true;
  }
  if (parent != null && parent.currentIndex != parentIndex) {
    return parent.newObjectOnEachRow(parentIndex);
  }
  return false;
}
Program: 165074
Project: 165074
Buggy source:
private boolean isEligibleAsSubstituteKey(){
  return !(owner instanceof ArrayElementPropertyMeta) && !(owner instanceof MapElementPropertyMeta);
}

Fixed version (ground truth):
private boolean isEligibleAsSubstituteKey(){
  return !JoinUtils.isArrayElement(owner);
}
Program: 165075
Project: 165075
Buggy source:
@Override @SuppressWarnings("String_Node_Str") public <T,P>FieldMapper<S,T> newFieldMapper(PropertyMapping<T,P,K,FieldMapperColumnDefinition<K>> propertyMapping,MappingContextFactoryBuilder contextFactoryBuilder,MapperBuilderErrorHandler mappingErrorHandler){
  final PropertyMeta<T,P> propertyMeta=propertyMapping.getPropertyMeta();
  final Type propertyType=propertyMeta.getPropertyType();
  final Setter<? super T,? super P> setter=propertyMeta.getSetter();
  final K key=propertyMapping.getColumnKey();
  final Class<P> type=TypeHelper.toClass(propertyType);
  Getter<? super S,? extends P> getter=getGetterFromSource(key,propertyMapping.getPropertyMeta().getPropertyType(),propertyMapping.getColumnDefinition(),propertyMeta.getPropertyClassMetaSupplier());
  if (getter == null) {
    mappingErrorHandler.accessorNotFound("String_Node_Str" + key + "String_Node_Str"+ propertyType+ "String_Node_Str"+ propertyMapping.getPropertyMeta().getPath()+ "String_Node_Str"+ ErrorDoc.toUrl("String_Node_Str"));
    return null;
  }
 else {
    if (type.isPrimitive()) {
      return this.<T,P>primitiveIndexedFieldMapper(type,setter,getter);
    }
    if (propertyMapping.getColumnDefinition().isKey() && propertyMapping.getPropertyMeta() instanceof ArrayElementPropertyMeta) {
      return new FieldMapperImpl<S,T,P>(getter,new NullValueFilterSetter(setter));
    }
 else {
      return new FieldMapperImpl<S,T,P>(getter,setter);
    }
  }
}

Fixed version (ground truth):
@Override @SuppressWarnings("String_Node_Str") public <T,P>FieldMapper<S,T> newFieldMapper(PropertyMapping<T,P,K,FieldMapperColumnDefinition<K>> propertyMapping,MappingContextFactoryBuilder contextFactoryBuilder,MapperBuilderErrorHandler mappingErrorHandler){
  final PropertyMeta<T,P> propertyMeta=propertyMapping.getPropertyMeta();
  final Type propertyType=propertyMeta.getPropertyType();
  final Setter<? super T,? super P> setter=propertyMeta.getSetter();
  final K key=propertyMapping.getColumnKey();
  final Class<P> type=TypeHelper.toClass(propertyType);
  Getter<? super S,? extends P> getter=getGetterFromSource(key,propertyMapping.getPropertyMeta().getPropertyType(),propertyMapping.getColumnDefinition(),propertyMeta.getPropertyClassMetaSupplier());
  if (getter == null) {
    mappingErrorHandler.accessorNotFound("String_Node_Str" + key + "String_Node_Str"+ propertyType+ "String_Node_Str"+ propertyMapping.getPropertyMeta().getPath()+ "String_Node_Str"+ ErrorDoc.toUrl("String_Node_Str"));
    return null;
  }
 else {
    if (type.isPrimitive()) {
      return this.<T,P>primitiveIndexedFieldMapper(type,setter,getter);
    }
    if (propertyMapping.getColumnDefinition().isKey() && JoinUtils.isArrayElement(propertyMapping.getPropertyMeta())) {
      return new FieldMapperImpl<S,T,P>(getter,new NullValueFilterSetter(setter));
    }
 else {
      return new FieldMapperImpl<S,T,P>(getter,setter);
    }
  }
}
Program: 165076
Project: 165076
Buggy source:
private boolean isTargetForMapperFieldMapper(PropertyMapping pm){
  return pm.getPropertyMeta().isSubProperty() || (pm.getPropertyMeta() instanceof ArrayElementPropertyMeta && pm.getColumnDefinition().isKey());
}

Fixed version (ground truth):
private boolean isTargetForMapperFieldMapper(PropertyMapping pm){
  return pm.getPropertyMeta().isSubProperty() || (JoinUtils.isArrayElement(pm.getPropertyMeta()) && pm.getColumnDefinition().isKey());
}
Program: 165078
Project: 165078
Buggy source:
@SuppressWarnings("String_Node_Str") private List<K> getSubKeys(List<PropertyMapping<T,?,K,FieldMapperColumnDefinition<K>>> properties){
  List<K> keys=new ArrayList<K>();
  for (  PropertyMapping<T,?,K,FieldMapperColumnDefinition<K>> pm : properties) {
    if (pm.getPropertyMeta().isSubProperty()) {
      SubPropertyMeta<T,?,?> subPropertyMeta=(SubPropertyMeta<T,?,?>)pm.getPropertyMeta();
      if (!(subPropertyMeta.getSubProperty() instanceof ArrayElementPropertyMeta)) {
        if (pm.getColumnDefinition().isKey()) {
          if (pm.getColumnDefinition().keyAppliesTo().test(subPropertyMeta.getSubProperty())) {
            keys.add(pm.getColumnKey());
          }
        }
      }
    }
 else {
      if (pm.getColumnDefinition().isKey()) {
        if (pm.getColumnDefinition().keyAppliesTo().test(pm.getPropertyMeta())) {
          keys.add(pm.getColumnKey());
        }
      }
    }
  }
  return keys;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private List<K> getSubKeys(List<PropertyMapping<T,?,K,FieldMapperColumnDefinition<K>>> properties){
  List<K> keys=new ArrayList<K>();
  for (  PropertyMapping<T,?,K,FieldMapperColumnDefinition<K>> pm : properties) {
    if (pm.getPropertyMeta().isSubProperty()) {
      SubPropertyMeta<T,?,?> subPropertyMeta=(SubPropertyMeta<T,?,?>)pm.getPropertyMeta();
      if (!(JoinUtils.isArrayElement(subPropertyMeta.getSubProperty()))) {
        if (pm.getColumnDefinition().isKey()) {
          if (pm.getColumnDefinition().keyAppliesTo().test(subPropertyMeta.getSubProperty())) {
            keys.add(pm.getColumnKey());
          }
        }
      }
    }
 else {
      if (pm.getColumnDefinition().isKey()) {
        if (pm.getColumnDefinition().keyAppliesTo().test(pm.getPropertyMeta())) {
          keys.add(pm.getColumnKey());
        }
      }
    }
  }
  return keys;
}
Program: 165079
Project: 165079
Buggy source:
@SuppressWarnings("String_Node_Str") private FieldMapper<S,T>[] fields(){
  final List<FieldMapper<S,T>> fields=new ArrayList<FieldMapper<S,T>>();
  propertyMappingsBuilder.forEachProperties(new ForEachCallBack<PropertyMapping<T,?,K,FieldMapperColumnDefinition<K>>>(){
    @Override public void handle(    PropertyMapping<T,?,K,FieldMapperColumnDefinition<K>> t){
      if (t == null || isTargetForMapperFieldMapper(t))       return;
      PropertyMeta<T,?> meta=t.getPropertyMeta();
      if (meta == null || (meta instanceof SelfPropertyMeta))       return;
      if (!meta.isConstructorProperty() && !isTargetForMapperFieldMapper(t)) {
        fields.add(newFieldMapper(t));
      }
    }
  }
);
  for (  PropertyPerOwner e : getSubPropertyPerOwner()) {
    if (!e.owner.isConstructorProperty()) {
      final MappingContextFactoryBuilder currentBuilder=getMapperContextFactoryBuilder(e.owner,e.propertyMappings);
      final Mapper<S,?> mapper;
      if (e.propertyMappings.size() == 1 && e.propertyMappings.get(0).getPropertyMeta() instanceof ArrayElementPropertyMeta) {
        mapper=getterPropertyMapper(e.owner,e.propertyMappings.get(0));
      }
 else {
        mapper=subPropertyMapper(e.owner,e.propertyMappings,currentBuilder);
      }
      fields.add(newMapperFieldMapper(e.propertyMappings,e.owner,mapper,currentBuilder));
    }
  }
  for (  FieldMapper<S,T> mapper : additionalMappers) {
    fields.add(mapper);
  }
  return fields.toArray(new FieldMapper[0]);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private FieldMapper<S,T>[] fields(){
  final List<FieldMapper<S,T>> fields=new ArrayList<FieldMapper<S,T>>();
  propertyMappingsBuilder.forEachProperties(new ForEachCallBack<PropertyMapping<T,?,K,FieldMapperColumnDefinition<K>>>(){
    @Override public void handle(    PropertyMapping<T,?,K,FieldMapperColumnDefinition<K>> t){
      if (t == null || isTargetForMapperFieldMapper(t))       return;
      PropertyMeta<T,?> meta=t.getPropertyMeta();
      if (meta == null || (meta instanceof SelfPropertyMeta))       return;
      if (!meta.isConstructorProperty() && !isTargetForMapperFieldMapper(t)) {
        fields.add(newFieldMapper(t));
      }
    }
  }
);
  for (  PropertyPerOwner e : getSubPropertyPerOwner()) {
    if (!e.owner.isConstructorProperty()) {
      final MappingContextFactoryBuilder currentBuilder=getMapperContextFactoryBuilder(e.owner,e.propertyMappings);
      final Mapper<S,?> mapper;
      if (e.propertyMappings.size() == 1 && JoinUtils.isArrayElement(e.propertyMappings.get(0).getPropertyMeta())) {
        mapper=getterPropertyMapper(e.owner,e.propertyMappings.get(0));
      }
 else {
        mapper=subPropertyMapper(e.owner,e.propertyMappings,currentBuilder);
      }
      fields.add(newMapperFieldMapper(e.propertyMappings,e.owner,mapper,currentBuilder));
    }
  }
  for (  FieldMapper<S,T> mapper : additionalMappers) {
    fields.add(mapper);
  }
  return fields.toArray(new FieldMapper[0]);
}
Program: 165080
Project: 165080
Buggy source:
public KeyDefinition(K[] keys,KeySourceGetter<K,S> keySourceGetter,KeyDefinition<S,K>[] children,int index){
  this.singleKey=getSingleKey(keys);
  if (singleKey == null) {
    this.keys=keys;
  }
 else {
    this.keys=null;
  }
  this.keySourceGetter=keySourceGetter;
  this.empty=keys == null || keys.length == 0;
  this.index=index;
  this.children=children;
}

Fixed version (ground truth):
public KeyDefinition(K[] keys,KeySourceGetter<K,S> keySourceGetter,KeyDefinition<S,K>[] children,int index,boolean root){
  this.singleKey=getSingleKey(keys);
  this.root=root;
  if (singleKey == null) {
    this.keys=keys;
  }
 else {
    this.keys=null;
  }
  this.keySourceGetter=keySourceGetter;
  this.empty=keys == null || keys.length == 0;
  this.index=index;
  this.children=children;
}
Program: 165081
Project: 165081
Buggy source:
private KeyDefinitionBuilder<S,K> populateKey(KeyDefinitionBuilder<S,K>[] keyDefinitions,ArrayList<MappingContextFactoryBuilder<S,K>> builders,MappingContextFactoryBuilder<S,K> builder,int rootDetector){
  if (keyDefinitions[builder.currentIndex] != null) {
    return keyDefinitions[builder.currentIndex];
  }
  int parentIndex=builder.getParentNonEmptyIndex();
  if (parentIndex == -1 && rootDetector != builder.currentIndex()) {
    parentIndex=rootDetector;
  }
  KeyDefinitionBuilder<S,K> parent=null;
  if (parentIndex != -1) {
    parent=keyDefinitions[parentIndex];
    if (parent == null) {
      for (int i=0; i < builders.size(); i++) {
        MappingContextFactoryBuilder<S,K> potentialParent=builders.get(i);
        if (potentialParent.currentIndex == parentIndex) {
          parent=populateKey(keyDefinitions,builders,potentialParent,rootDetector);
          break;
        }
      }
      if (parent == null) {
        throw new IllegalArgumentException("String_Node_Str" + builder);
      }
    }
  }
  KeyDefinitionBuilder<S,K> keyDefinition;
  if (builder.keys.isEmpty() && parent != null && !builder.newObjectOnEachRow()) {
    keyDefinition=parent.asChild(builder.currentIndex);
  }
 else {
    keyDefinition=new KeyDefinitionBuilder<S,K>(builder.keys,builder.keySourceGetter,parent,builder.currentIndex);
  }
  keyDefinitions[builder.currentIndex]=keyDefinition;
  return keyDefinition;
}

Fixed version (ground truth):
private KeyDefinitionBuilder<S,K> populateKey(KeyDefinitionBuilder<S,K>[] keyDefinitions,ArrayList<MappingContextFactoryBuilder<S,K>> builders,MappingContextFactoryBuilder<S,K> builder,int rootDetector){
  if (keyDefinitions[builder.currentIndex] != null) {
    return keyDefinitions[builder.currentIndex];
  }
  int parentIndex=builder.getParentNonEmptyIndex();
  if (parentIndex == -1 && rootDetector != builder.currentIndex()) {
    parentIndex=rootDetector;
  }
  KeyDefinitionBuilder<S,K> parent=null;
  if (parentIndex != -1) {
    parent=keyDefinitions[parentIndex];
    if (parent == null) {
      for (int i=0; i < builders.size(); i++) {
        MappingContextFactoryBuilder<S,K> potentialParent=builders.get(i);
        if (potentialParent.currentIndex == parentIndex) {
          parent=populateKey(keyDefinitions,builders,potentialParent,rootDetector);
          break;
        }
      }
      if (parent == null) {
        throw new IllegalArgumentException("String_Node_Str" + builder);
      }
    }
  }
  KeyDefinitionBuilder<S,K> keyDefinition;
  if (builder.keys.isEmpty() && parent != null && !builder.newObjectOnEachRow()) {
    keyDefinition=parent.asChild(builder.currentIndex);
  }
 else {
    List<K> keys=new ArrayList<K>(builder.keys);
    if (parent != null && !builder.keys.isEmpty() && !parent.isRoot()) {
      keys.addAll(parent.getKeys());
    }
    keyDefinition=new KeyDefinitionBuilder<S,K>(keys,builder.keySourceGetter,parent,builder.currentIndex,builder.currentIndex == rootDetector);
  }
  keyDefinitions[builder.currentIndex]=keyDefinition;
  return keyDefinition;
}
Program: 165082
Project: 165082
Buggy source:
public boolean broke(S source) throws MappingException {
  if (definition == null) {
    return true;
  }
  boolean b=false;
  Key oldKey=currentKey;
  currentKey=definition.getValues(source);
  if (oldKey == null) {
    b=true;
  }
 else   if (!oldKey.equals(currentKey)) {
    b=true;
    markChildrenHasBroken();
  }
  callBrokeOnChildren(source);
  return b;
}

Fixed version (ground truth):
public boolean broke(S source) throws MappingException {
  if (definition == null) {
    return true;
  }
  boolean b=false;
  Key oldKey=currentKey;
  currentKey=definition.getValues(source);
  if (oldKey == null) {
    b=true;
  }
 else   if (!oldKey.equals(currentKey)) {
    b=true;
    markChildrenHasBroken(root);
  }
  callBrokeOnChildren(source);
  return b;
}
Program: 165083
Project: 165083
Buggy source:
public BreakDetector(KeyDefinition<S,?> definition,BreakDetector<S>[] siblings){
  this.definition=emptyToNull(definition);
  this.siblings=siblings;
  if (this.definition == null) {
    cache=null;
  }
 else {
    cache=new HashMap<Key,Object>();
  }
}

Fixed version (ground truth):
public BreakDetector(KeyDefinition<S,?> definition,BreakDetector<S>[] siblings){
  this.definition=emptyToNull(definition);
  this.siblings=siblings;
  this.root=definition.isRoot();
  if (this.definition == null) {
    cache=null;
  }
 else {
    cache=new HashMap<Key,Object>();
  }
}
Program: 165084
Project: 165084
Buggy source:
public void markAsBroken(){
  if (definition != null) {
    currentKey=null;
    cache.clear();
    markChildrenHasBroken();
  }
}

Fixed version (ground truth):
public void markAsBroken(boolean root){
  if (definition != null) {
    currentKey=null;
    if (root) {
      cache.clear();
    }
    markChildrenHasBroken(root);
  }
}
Program: 165085
Project: 165085
Buggy source:
private void markChildrenHasBroken(){
  KeyDefinition<S,?>[] children=definition.getChildren();
  if (children == null)   return;
  for (  KeyDefinition<S,?> keyDefinition : children) {
    siblings[keyDefinition.getIndex()].markAsBroken();
  }
}

Fixed version (ground truth):
private void markChildrenHasBroken(boolean root){
  KeyDefinition<S,?>[] children=definition.getChildren();
  if (children == null)   return;
  for (  KeyDefinition<S,?> keyDefinition : children) {
    siblings[keyDefinition.getIndex()].markAsBroken(root);
  }
}
Program: 165086
Project: 165086
Buggy source:
@Override public void markAsBroken(){
  rootDetector.markAsBroken();
}

Fixed version (ground truth):
@Override public void markAsBroken(){
  rootDetector.markAsBroken(true);
}
Program: 165087
Project: 165087
Buggy source:
public KeyDefinitionBuilder(List<K> keys,KeySourceGetter<K,S> keySourceGetter,KeyDefinitionBuilder<S,K> parent,int index){
  this.keys=keys;
  this.keySourceGetter=keySourceGetter;
  if (parent != null)   parent.addChild(this);
  this.index=index;
}

Fixed version (ground truth):
public KeyDefinitionBuilder(List<K> keys,KeySourceGetter<K,S> keySourceGetter,KeyDefinitionBuilder<S,K> parent,int index,boolean root){
  this.keys=keys;
  this.keySourceGetter=keySourceGetter;
  this.root=root;
  if (parent != null)   parent.addChild(this);
  this.index=index;
}
Program: 165088
Project: 165088
Buggy source:
public KeyDefinitionBuilder<S,K> asChild(int currentIndex){
  return new KeyDefinitionBuilder<S,K>(keys,keySourceGetter,this,currentIndex);
}

Fixed version (ground truth):
public KeyDefinitionBuilder<S,K> asChild(int currentIndex){
  return new KeyDefinitionBuilder<S,K>(keys,keySourceGetter,this,currentIndex,false);
}
Program: 165089
Project: 165089
Buggy source:
private static <S,K>KeyDefinition<S,K> defineBuilder(KeyDefinitionBuilder<S,K> builder,KeyDefinition<S,K>[] keyDefinitions){
  if (keyDefinitions[builder.index] != null) {
    return keyDefinitions[builder.index];
  }
  List<KeyDefinition<S,K>> children=new ArrayList<KeyDefinition<S,K>>();
  for (  KeyDefinitionBuilder<S,K> child : builder.children) {
    children.add(defineBuilder(child,keyDefinitions));
  }
  KeyDefinition[] keyChildren=null;
  if (!children.isEmpty())   keyChildren=children.toArray(new KeyDefinition[0]);
  KeyDefinition<S,K> keyDefinition=new KeyDefinition<S,K>(toK(builder.keys),builder.keySourceGetter,keyChildren,builder.index);
  keyDefinitions[builder.index]=keyDefinition;
  return keyDefinition;
}

Fixed version (ground truth):
private static <S,K>KeyDefinition<S,K> defineBuilder(KeyDefinitionBuilder<S,K> builder,KeyDefinition<S,K>[] keyDefinitions){
  if (keyDefinitions[builder.index] != null) {
    return keyDefinitions[builder.index];
  }
  List<KeyDefinition<S,K>> children=new ArrayList<KeyDefinition<S,K>>();
  for (  KeyDefinitionBuilder<S,K> child : builder.children) {
    children.add(defineBuilder(child,keyDefinitions));
  }
  KeyDefinition[] keyChildren=null;
  if (!children.isEmpty())   keyChildren=children.toArray(new KeyDefinition[0]);
  KeyDefinition<S,K> keyDefinition=new KeyDefinition<S,K>(toK(builder.keys),builder.keySourceGetter,keyChildren,builder.index,builder.root);
  keyDefinitions[builder.index]=keyDefinition;
  return keyDefinition;
}
Program: 165090
Project: 165090
Buggy source:
@Override public int hashCode(){
  return Arrays.deepHashCode(values);
}

Fixed version (ground truth):
@Override public int hashCode(){
  return _hashCode;
}
Program: 165091
Project: 165091
Buggy source:
public MultiValueKey(Object[] values){
  this.values=values;
}

Fixed version (ground truth):
public MultiValueKey(Object[] values){
  this.values=values;
  this._hashCode=Arrays.deepHashCode(values);
}
Program: 165092
Project: 165092
Buggy source:
public SingleValueKey(Object values){
  this.values=values;
  if (true)   return;
  throw new IllegalArgumentException("String_Node_Str");
}

Fixed version (ground truth):
public SingleValueKey(Object value){
  this.value=value;
  this._hashCode=_hashCode(value);
  if (true)   return;
  throw new IllegalArgumentException("String_Node_Str");
}
Program: 165093
Project: 165093
Buggy source:
@Override public int hashCode(){
  int valueHash=0;
  if (values instanceof Object[])   valueHash=Arrays.deepHashCode((Object[])values);
 else   if (values instanceof byte[])   valueHash=Arrays.hashCode((byte[])values);
 else   if (values instanceof short[])   valueHash=Arrays.hashCode((short[])values);
 else   if (values instanceof int[])   valueHash=Arrays.hashCode((int[])values);
 else   if (values instanceof long[])   valueHash=Arrays.hashCode((long[])values);
 else   if (values instanceof char[])   valueHash=Arrays.hashCode((char[])values);
 else   if (values instanceof float[])   valueHash=Arrays.hashCode((float[])values);
 else   if (values instanceof double[])   valueHash=Arrays.hashCode((double[])values);
 else   if (values instanceof boolean[])   valueHash=Arrays.hashCode((boolean[])values);
 else   if (values != null)   valueHash=values.hashCode();
  return valueHash;
}

Fixed version (ground truth):
@Override public int hashCode(){
  return _hashCode;
}
Program: 165094
Project: 165094
Buggy source:
@Override public boolean equals(Object o){
  if (this == o)   return true;
  if (o == null || getClass() != o.getClass())   return false;
  SingleValueKey keys=(SingleValueKey)o;
  if (true) {
    return Objects.deepEquals(values,keys.values);
  }
  throw new IllegalArgumentException("String_Node_Str");
}

Fixed version (ground truth):
@Override public boolean equals(Object o){
  if (this == o)   return true;
  if (o == null || getClass() != o.getClass())   return false;
  SingleValueKey keys=(SingleValueKey)o;
  if (true) {
    return Objects.deepEquals(value,keys.value);
  }
  throw new IllegalArgumentException("String_Node_Str");
}
Program: 165095
Project: 165095
Buggy source:
@Test public void testBreakDetector() throws Exception {
  KeySourceGetter<SampleFieldKey,Object> keySourceGetter=mock(KeySourceGetter.class);
  Object object=new Object();
  SampleFieldKey key=new SampleFieldKey("String_Node_Str",1);
  when(keySourceGetter.getValue(key,object)).thenReturn(new byte[]{1,2},new byte[]{1,2},new byte[]{1,3});
  KeyDefinition<Object,SampleFieldKey> keyDefinition=new KeyDefinition<Object,SampleFieldKey>(new SampleFieldKey[]{key},keySourceGetter,null,0);
  BreakDetector<Object> breakDetector=new BreakDetector<Object>(keyDefinition,new BreakDetector[0]);
  assertTrue(breakDetector.broke(object));
  assertFalse(breakDetector.broke(object));
  assertTrue(breakDetector.broke(object));
}

Fixed version (ground truth):
@Test public void testBreakDetector() throws Exception {
  KeySourceGetter<SampleFieldKey,Object> keySourceGetter=mock(KeySourceGetter.class);
  Object object=new Object();
  SampleFieldKey key=new SampleFieldKey("String_Node_Str",1);
  when(keySourceGetter.getValue(key,object)).thenReturn(new byte[]{1,2},new byte[]{1,2},new byte[]{1,3});
  KeyDefinition<Object,SampleFieldKey> keyDefinition=new KeyDefinition<Object,SampleFieldKey>(new SampleFieldKey[]{key},keySourceGetter,null,0,true);
  BreakDetector<Object> breakDetector=new BreakDetector<Object>(keyDefinition,new BreakDetector[0]);
  assertTrue(breakDetector.broke(object));
  assertFalse(breakDetector.broke(object));
  assertTrue(breakDetector.broke(object));
}
Program: 165096
Project: 165096
Buggy source:
@Test public void testMultiJoinSameIdDiffContent(){
  ClassMeta<Root> classMeta=ReflectionService.newInstance().getClassMeta(Root.class);
  AbstractMapperBuilderTest.SampleMapperBuilder<Root> builder=new AbstractMapperBuilderTest.SampleMapperBuilder<Root>(classMeta,mapperConfig());
  Mapper<Object[],Root> rowMapper=builder.addKey("String_Node_Str").addKey("String_Node_Str").addKey("String_Node_Str").addMapping("String_Node_Str").mapper();
  JoinMapper<Object[],Object[][],Root,RuntimeException> mapper=(JoinMapper<Object[],Object[][],Root,RuntimeException>)rowMapper;
  List<Root> list=mapper.forEach(data_diffvalue,new ListCollector<Root>()).getList();
  assertEquals(1,list.size());
  Root root=list.get(0);
  assertEquals(1,root.id);
  assertEquals(2,root.ll.size());
  assertEquals(1,root.ll.get(0).id);
  assertEquals(2,root.ll.get(1).id);
  assertEquals(1,root.ll.get(0).elements.size());
  assertEquals(1,root.ll.get(0).elements.get(0).id);
  assertEquals("String_Node_Str",root.ll.get(0).elements.get(0).value);
  assertEquals(1,root.ll.get(1).elements.size());
  assertEquals(1,root.ll.get(1).elements.get(0).id);
  assertEquals("String_Node_Str",root.ll.get(1).elements.get(0).value);
}

Fixed version (ground truth):
@Test public void testMultiJoinSameIdDiffContent(){
  ClassMeta<Root> classMeta=ReflectionService.newInstance().getClassMeta(Root.class);
  AbstractMapperBuilderTest.SampleMapperBuilder<Root> builder=new AbstractMapperBuilderTest.SampleMapperBuilder<Root>(classMeta,mapperConfig());
  Mapper<Object[],Root> rowMapper=builder.addKey("String_Node_Str").addKey("String_Node_Str").addKey("String_Node_Str").addMapping("String_Node_Str").mapper();
  JoinMapper<Object[],Object[][],Root,RuntimeException> mapper=(JoinMapper<Object[],Object[][],Root,RuntimeException>)rowMapper;
  List<Root> list=mapper.forEach(data_diffvalue,new ListCollector<Root>()).getList();
  assertEquals(1,list.size());
  Root root=list.get(0);
  assertEquals(1,root.id);
  assertEquals(2,root.ll.size());
  assertEquals(1,root.ll.get(0).id);
  assertEquals(2,root.ll.get(1).id);
  assertEquals(2,root.ll.get(0).elements.size());
  assertEquals(1,root.ll.get(0).elements.get(0).id);
  assertEquals("String_Node_Str",root.ll.get(0).elements.get(0).value);
  assertEquals(2,root.ll.get(0).elements.get(1).id);
  assertEquals("String_Node_Str",root.ll.get(0).elements.get(1).value);
  assertEquals(1,root.ll.get(1).elements.size());
  assertEquals(1,root.ll.get(1).elements.get(0).id);
  assertEquals("String_Node_Str",root.ll.get(1).elements.get(0).value);
}
Program: 165097
Project: 165097
Buggy source:
private <T,P>Getter<? super S,? extends P> getterFromFactory(PropertyMapping<T,P,K,FieldMapperColumnDefinition<K>> propertyMapping,Type propertyType){
  Getter<? super S,? extends P> getter=null;
  if (propertyMapping.getColumnDefinition().hasCustomFactory()) {
    GetterFactory<? super S,K> cGetterFactory=(GetterFactory<? super S,K>)propertyMapping.getColumnDefinition().getCustomGetterFactory();
    getter=cGetterFactory.newGetter(propertyType,propertyMapping.getColumnKey(),propertyMapping.getColumnDefinition());
  }
  if (getter == null) {
    getter=getterFactory.newGetter(propertyType,propertyMapping.getColumnKey(),propertyMapping.getColumnDefinition());
  }
  if (getter == null) {
    final ClassMeta<P> classMeta=propertyMapping.getPropertyMeta().getPropertyClassMeta();
    InstantiatorDefinitions.CompatibilityScorer scorer=InstantiatorDefinitions.getCompatibilityScorer(propertyMapping.getColumnKey());
    InstantiatorDefinition id=InstantiatorDefinitions.lookForCompatibleOneArgument(classMeta.getInstantiatorDefinitions(),scorer);
    if (id != null) {
      final Type sourceType=id.getParameters()[0].getGenericType();
      getter=getterFromFactory(propertyMapping,sourceType);
      if (getter != null) {
        Instantiator instantiator=classMeta.getReflectionService().getInstantiatorFactory().getOneArgIdentityInstantiator(id);
        getter=new InstantiatorOnGetter(instantiator,getter);
      }
    }
  }
  return getter;
}

Fixed version (ground truth):
private <T,P>Getter<? super S,? extends P> getterFromFactory(PropertyMapping<T,P,K,FieldMapperColumnDefinition<K>> propertyMapping,Type propertyType){
  Getter<? super S,? extends P> getter=null;
  if (propertyMapping.getColumnDefinition().hasCustomFactory()) {
    GetterFactory<? super S,K> cGetterFactory=(GetterFactory<? super S,K>)propertyMapping.getColumnDefinition().getCustomGetterFactory();
    getter=cGetterFactory.newGetter(propertyType,propertyMapping.getColumnKey(),propertyMapping.getColumnDefinition());
  }
  if (getter == null) {
    getter=getterFactory.newGetter(propertyType,propertyMapping.getColumnKey(),propertyMapping.getColumnDefinition());
  }
  if (getter == null) {
    final ClassMeta<P> classMeta=propertyMapping.getPropertyMeta().getPropertyClassMeta();
    InstantiatorDefinitions.CompatibilityScorer scorer=InstantiatorDefinitions.getCompatibilityScorer(propertyMapping.getColumnKey());
    InstantiatorDefinition id=InstantiatorDefinitions.lookForCompatibleOneArgument(classMeta.getInstantiatorDefinitions(),scorer);
    if (id != null) {
      final Type sourceType=id.getParameters()[0].getGenericType();
      getter=getterFactory.newGetter(sourceType,propertyMapping.getColumnKey(),propertyMapping.getColumnDefinition());
      if (getter != null) {
        Instantiator instantiator=classMeta.getReflectionService().getInstantiatorFactory().getOneArgIdentityInstantiator(id);
        getter=new InstantiatorOnGetter(instantiator,getter);
      }
    }
  }
  return getter;
}
Program: 165098
Project: 165098
Buggy source:
@Override public void insert(Connection connection,Collection<T> values,RowHandler<PreparedStatement> postExecute) throws SQLException {
  int lBatchSize=Math.min(batchSize.get(),values.size());
  try {
    if (values.size() <= lBatchSize) {
      delegate.insert(connection,values,postExecute);
    }
 else {
      splitBatches(connection,values,lBatchSize,postExecute);
    }
  }
 catch (  PacketTooBigException e) {
    if (lBatchSize <= 2) {
      throw e;
    }
    resize(lBatchSize);
    insert(connection,values,postExecute);
  }
}

Fixed version (ground truth):
@Override public void insert(Connection connection,Collection<T> values,RowHandler<PreparedStatement> postExecute) throws SQLException {
  int lBatchSize=Math.min(batchSize.get(),values.size());
  try {
    if (values.size() <= lBatchSize) {
      delegate.insert(connection,values,postExecute);
    }
 else {
      splitBatches(connection,values,lBatchSize,postExecute);
    }
  }
 catch (  PacketTooBigException e) {
    if (lBatchSize <= 2) {
      throw e;
    }
    resize(lBatchSize / 2);
    insert(connection,values,postExecute);
  }
}
Program: 165099
Project: 165099
Buggy source:
@Test public void testStaticMapperDbObjectToStringNoAsm() throws Exception {
  CsvMapperBuilder<DbObject> builder=csvMapperFactoryNoAsm.newBuilder(DbObject.class);
  addDbObjectFields(builder);
  assertEquals("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",builder.mapper().toString());
}

Fixed version (ground truth):
@Test public void testStaticMapperDbObjectToStringNoAsm() throws Exception {
  CsvMapperBuilder<DbObject> builder=csvMapperFactoryNoAsm.newBuilder(DbObject.class);
  addDbObjectFields(builder);
  assertTrue(builder.mapper().toString().startsWith("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"));
}
Program: 165100
Project: 165100
Buggy source:
public static void addDbObjectFields(CsvMapperBuilder<?> builder){
  builder.addMapping("String_Node_Str").addMapping("String_Node_Str").addMapping("String_Node_Str").addMapping("String_Node_Str",CsvColumnDefinition.timeZoneDefinition(TimeZone.getTimeZone("String_Node_Str"))).addMapping("String_Node_Str").addMapping("String_Node_Str");
}

Fixed version (ground truth):
public static void addDbObjectFields(CsvMapperBuilder<?> builder){
  builder.addMapping("String_Node_Str").addMapping("String_Node_Str").addMapping("String_Node_Str").addMapping("String_Node_Str").addMapping("String_Node_Str").addMapping("String_Node_Str");
}
Program: 165101
Project: 165101
Buggy source:
@Test public void testStaticMapperDbFinalObjectToString() throws Exception {
  CsvMapperBuilder<DbFinalObject> builder=csvMapperFactory.useAsm(false).newBuilder(DbFinalObject.class);
  addDbObjectFields(builder);
  assertEquals("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",builder.mapper().toString());
}

Fixed version (ground truth):
@Test public void testStaticMapperDbFinalObjectToString() throws Exception {
  CsvMapperBuilder<DbFinalObject> builder=csvMapperFactory.useAsm(false).newBuilder(DbFinalObject.class);
  addDbObjectFields(builder);
  assertTrue(builder.mapper().toString().startsWith("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"));
}
Program: 165102
Project: 165102
Buggy source:
public static void addDbObjectFields(CsvMapperBuilder<?> builder){
  builder.addMapping("String_Node_Str").addMapping("String_Node_Str").addMapping("String_Node_Str").addMapping("String_Node_Str",CsvColumnDefinition.timeZoneDefinition(TimeZone.getTimeZone("String_Node_Str"))).addMapping("String_Node_Str").addMapping("String_Node_Str");
}

Fixed version (ground truth):
public static void addDbObjectFields(CsvMapperBuilder<?> builder){
  builder.addMapping("String_Node_Str").addMapping("String_Node_Str").addMapping("String_Node_Str").addMapping("String_Node_Str").addMapping("String_Node_Str").addMapping("String_Node_Str");
}
Program: 165103
Project: 165103
Buggy source:
public static DateTimeFormatter getDateTimeFormatter(ColumnDefinition<?,?> columnDefinition){
  DateTimeFormatter dtf;
  if (columnDefinition.has(JodaDateTimeFormatterProperty.class)) {
    dtf=columnDefinition.lookFor(JodaDateTimeFormatterProperty.class).getFormatter();
  }
 else   if (columnDefinition.has(DateFormatProperty.class)) {
    dtf=DateTimeFormat.forPattern(columnDefinition.lookFor(DateFormatProperty.class).getPattern());
  }
 else {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (columnDefinition.has(JodaDateTimeZoneProperty.class)) {
    dtf=dtf.withZone(columnDefinition.lookFor(JodaDateTimeZoneProperty.class).getZone());
  }
 else   if (columnDefinition.has(TimeZoneProperty.class)) {
    dtf=dtf.withZone(DateTimeZone.forTimeZone(columnDefinition.lookFor(TimeZoneProperty.class).getTimeZone()));
  }
 else {
    dtf=dtf.withZone(DateTimeZone.getDefault());
  }
  return dtf;
}

Fixed version (ground truth):
public static DateTimeFormatter getDateTimeFormatter(ColumnDefinition<?,?> columnDefinition){
  DateTimeFormatter dtf;
  if (columnDefinition.has(JodaDateTimeFormatterProperty.class)) {
    dtf=columnDefinition.lookFor(JodaDateTimeFormatterProperty.class).getFormatter();
  }
 else   if (columnDefinition.has(DateFormatProperty.class)) {
    dtf=DateTimeFormat.forPattern(columnDefinition.lookFor(DateFormatProperty.class).getPattern());
  }
 else {
    throw new IllegalArgumentException("String_Node_Str");
  }
  final DateTimeZone dateTimeZone=getDateTimeZone(columnDefinition);
  if (dateTimeZone != null) {
    dtf=dtf.withZone(dateTimeZone);
  }
 else   if (dtf.getZone() == null) {
    dtf=dtf.withZone(DateTimeZone.getDefault());
  }
  return dtf;
}
Program: 165104
Project: 165104
Buggy source:
public static DateTimeFormatter getDateTimeFormatter(ColumnDefinition<?,?> columnDefinition){
  DateTimeFormatter dtf;
  if (columnDefinition.has(JodaDateTimeFormatterProperty.class)) {
    dtf=columnDefinition.lookFor(JavaDateTimeFormatterProperty.class).getFormatter();
  }
 else   if (columnDefinition.has(DateFormatProperty.class)) {
    dtf=DateTimeFormatter.ofPattern(columnDefinition.lookFor(DateFormatProperty.class).getPattern());
  }
 else {
    throw new IllegalArgumentException("String_Node_Str");
  }
  dtf=dtf.withZone(getZoneId(columnDefinition));
  return dtf;
}

Fixed version (ground truth):
public static DateTimeFormatter getDateTimeFormatter(ColumnDefinition<?,?> columnDefinition){
  DateTimeFormatter dtf;
  if (columnDefinition.has(JavaDateTimeFormatterProperty.class)) {
    dtf=columnDefinition.lookFor(JavaDateTimeFormatterProperty.class).getFormatter();
  }
 else   if (columnDefinition.has(DateFormatProperty.class)) {
    dtf=DateTimeFormatter.ofPattern(columnDefinition.lookFor(DateFormatProperty.class).getPattern());
  }
 else {
    throw new IllegalArgumentException("String_Node_Str");
  }
  final ZoneId zoneId=_getZoneId(columnDefinition);
  if (zoneId != null) {
    dtf=dtf.withZone(zoneId);
  }
 else   if (dtf.getZone() == null) {
    dtf=dtf.withZone(ZoneId.systemDefault());
  }
  return dtf;
}
Program: 165105
Project: 165105
Buggy source:
@Test public void testFormatterFromFormatterWithSpecifiedTZ(){
  final DateTimeFormatter yyyyMMdd=JodaHelper.getDateTimeFormatter(CsvColumnDefinition.IDENTITY.add(new JodaDateTimeFormatterProperty(DateTimeFormat.forPattern("String_Node_Str").withZone(DateTimeZone.forID("String_Node_Str")))).addTimeZone(TimeZone.getTimeZone("String_Node_Str")));
  final long instant=System.currentTimeMillis();
  assertEquals(DateTimeFormat.forPattern("String_Node_Str").print(instant),yyyyMMdd.print(instant));
  assertEquals(DateTimeZone.forID("String_Node_Str"),yyyyMMdd.getZone());
}

Fixed version (ground truth):
@Test public void testFormatterFromFormatterWithSpecifiedTZ(){
  final DateTimeFormatter yyyyMMdd=JodaHelper.getDateTimeFormatter(CsvColumnDefinition.IDENTITY.add(new JodaDateTimeFormatterProperty(DateTimeFormat.forPattern("String_Node_Str").withZone(CHICAGO_TZ))).addTimeZone(TimeZone.getTimeZone("String_Node_Str")));
  final long instant=System.currentTimeMillis();
  assertEquals(DateTimeFormat.forPattern("String_Node_Str").withZone(NY_TZ).print(instant),yyyyMMdd.print(instant));
  assertEquals(NY_TZ,yyyyMMdd.getZone());
}
Program: 165106
Project: 165106
Buggy source:
@Test public void testFormatterFromFormatterWithOwnTZ(){
  final DateTimeFormatter yyyyMMdd=JodaHelper.getDateTimeFormatter(CsvColumnDefinition.IDENTITY.add(new JodaDateTimeFormatterProperty(DateTimeFormat.forPattern("String_Node_Str").withZone(DateTimeZone.forID("String_Node_Str")))));
  final long instant=System.currentTimeMillis();
  assertEquals(DateTimeFormat.forPattern("String_Node_Str").print(instant),yyyyMMdd.print(instant));
  assertEquals(DateTimeZone.forID("String_Node_Str"),yyyyMMdd.getZone());
}

Fixed version (ground truth):
@Test public void testFormatterFromFormatterWithOwnTZ(){
  final DateTimeFormatter yyyyMMdd=JodaHelper.getDateTimeFormatter(CsvColumnDefinition.IDENTITY.add(new JodaDateTimeFormatterProperty(DateTimeFormat.forPattern("String_Node_Str").withZone(CHICAGO_TZ))));
  final long instant=System.currentTimeMillis();
  assertEquals(DateTimeFormat.forPattern("String_Node_Str").withZone(CHICAGO_TZ).print(instant),yyyyMMdd.print(instant));
  assertEquals(CHICAGO_TZ,yyyyMMdd.getZone());
}
Program: 165107
Project: 165107
Buggy source:
@Test public void testGetDateTimeZoneFromDateTimeZone(){
  assertEquals(DateTimeZone.forID("String_Node_Str"),JodaHelper.getDateTimeZone(CsvColumnDefinition.IDENTITY.add(new JodaDateTimeZoneProperty(DateTimeZone.forID("String_Node_Str")))));
}

Fixed version (ground truth):
@Test public void testGetDateTimeZoneFromDateTimeZone(){
  assertEquals(CHICAGO_TZ,JodaHelper.getDateTimeZone(CsvColumnDefinition.IDENTITY.add(new JodaDateTimeZoneProperty(CHICAGO_TZ))));
}
Program: 165108
Project: 165108
Buggy source:
@Test public void testGetDateTimeZoneFromTimeZone(){
  assertEquals(DateTimeZone.forID("String_Node_Str"),JodaHelper.getDateTimeZone(CsvColumnDefinition.IDENTITY.addTimeZone(TimeZone.getTimeZone("String_Node_Str"))));
}

Fixed version (ground truth):
@Test public void testGetDateTimeZoneFromTimeZone(){
  assertEquals(CHICAGO_TZ,JodaHelper.getDateTimeZone(CsvColumnDefinition.IDENTITY.addTimeZone(TimeZone.getTimeZone("String_Node_Str"))));
}
Program: 165109
Project: 165109
Buggy source:
public TupleClassMeta(Type type,ReflectionService reflectionService){
  this.type=type;
  this.reflectionService=reflectionService;
  try {
    this.constructorDefinitions=getConstructorDefinitions(type,reflectionService);
    if (constructorDefinitions.size() != 1) {
      throw new IllegalStateException("String_Node_Str");
    }
  }
 catch (  Exception e) {
    throw new MapperBuildingException(e.getMessage(),e);
  }
}

Fixed version (ground truth):
public TupleClassMeta(Type type,ReflectionService reflectionService){
  this.type=type;
  this.reflectionService=reflectionService;
  try {
    this.constructorDefinition=getConstructorDefinition(type,reflectionService);
  }
 catch (  RuntimeException e) {
    throw e;
  }
catch (  Exception e) {
    throw new MapperBuildingException(e.getMessage(),e);
  }
}
Program: 165110
Project: 165110
Buggy source:
public int getTupleSize(){
  return constructorDefinitions.get(0).getParameters().length;
}

Fixed version (ground truth):
public int getTupleSize(){
  return constructorDefinition.getParameters().length;
}
Program: 165111
Project: 165111
Buggy source:
public List<ConstructorDefinition<T>> getConstructorDefinitions(){
  return constructorDefinitions;
}

Fixed version (ground truth):
public List<ConstructorDefinition<T>> getConstructorDefinitions(){
  return Arrays.asList(constructorDefinition);
}
Program: 165112
Project: 165112
Buggy source:
@Override public String[] generateHeaders(){
  List<String> strings=new ArrayList<String>();
  int i=0;
  for (  ConstructorParameter cp : constructorDefinitions.get(0).getParameters()) {
    String prefix="String_Node_Str" + i;
    ClassMeta<?> classMeta=reflectionService.getClassMeta(cp.getResolvedType(),false);
    if (classMeta != null) {
      for (      String prop : classMeta.generateHeaders()) {
        strings.add(prefix + "String_Node_Str" + prop);
      }
    }
 else {
      strings.add(prefix);
    }
    i++;
  }
  return strings.toArray(EMPTY_STRING_ARRAY);
}

Fixed version (ground truth):
@Override public String[] generateHeaders(){
  List<String> strings=new ArrayList<String>();
  ElementNameGenerator nameGenerator=new SFMTupleNameGenerator();
  int i=0;
  for (  ConstructorParameter cp : constructorDefinition.getParameters()) {
    String prefix=nameGenerator.name(i);
    ClassMeta<?> classMeta=reflectionService.getClassMeta(cp.getResolvedType(),false);
    if (classMeta != null) {
      for (      String prop : classMeta.generateHeaders()) {
        strings.add(prefix + "String_Node_Str" + prop);
      }
    }
 else {
      strings.add(prefix);
    }
    i++;
  }
  return strings.toArray(EMPTY_STRING_ARRAY);
}
Program: 165113
Project: 165113
Buggy source:
private static boolean isJoolTuple(Class<?> clazz){
  while (clazz != null) {
    for (    Class<?> i : clazz.getInterfaces()) {
      if ("String_Node_Str".equals(i.getName())) {
        return true;
      }
    }
    clazz=clazz.getSuperclass();
  }
  return false;
}

Fixed version (ground truth):
public static boolean isJoolTuple(Class<?> clazz){
  while (clazz != null) {
    for (    Class<?> i : clazz.getInterfaces()) {
      if ("String_Node_Str".equals(i.getName())) {
        return true;
      }
    }
    clazz=clazz.getSuperclass();
  }
  return false;
}
Program: 165114
Project: 165114
Buggy source:
private Object[] getKeys(DelayedCellSetter<?,?>[] delayedCellSetters){
  Object[] currentKeys=new Object[keys.length];
  for (int i=0; i < keys.length; i++) {
    currentKeys[i]=delayedCellSetters[keys[i].getIndex()].getValue();
  }
  return currentKeys;
}

Fixed version (ground truth):
private Object[] getKeys(DelayedCellSetter<?,?>[] delayedCellSetters){
  Object[] currentKeys=new Object[keys.length];
  for (int i=0; i < keys.length; i++) {
    currentKeys[i]=delayedCellSetters[keys[i].getIndex()].peekValue();
  }
  return currentKeys;
}
Program: 165115
Project: 165115
Buggy source:
@Override public boolean isBroken(DelayedCellSetter<?,?>[] delayedCellSetters){
  if (!brokenCheck) {
    updateStatus(delayedCellSetters);
  }
  return broken;
}

Fixed version (ground truth):
@Override public boolean isBroken(DelayedCellSetter<?,?>[] delayedCellSetters){
  if (!brokenCheck) {
    updateStatus(delayedCellSetters);
    return broken;
  }
  return false;
}
Program: 165116
Project: 165116
Buggy source:
private void flush(){
  if (hasData) {
    createInstanceIfNeeded();
    this.cellIndex=-1;
    hasData=false;
  }
}

Fixed version (ground truth):
private void flush(){
  if (hasData) {
    createInstanceIfNeeded();
    this.cellIndex=-1;
    hasData=false;
  }
  breakDetector.reset();
}
Program: 165117
Project: 165117
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public T get(DelayedCellSetter<T,?>[] target) throws Exception {
  return (T)target[index].getValue();
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public T get(DelayedCellSetter<T,?>[] target) throws Exception {
  return (T)target[index].consumeValue();
}
Program: 165118
Project: 165118
Buggy source:
@Override public DelayedCellSetter<T,P> newCellSetter(){
  return new DelayedCellSetter<T,P>(){
    @Override public P getValue(){
      return value;
    }
    @Override public void set(    T t) throws Exception {
      marker.getSetter().set(t,value);
    }
    @Override public boolean isSettable(){
      return marker.getSetter() != null;
    }
    public void set(    char[] chars,    int offset,    int length,    ParsingContext parsingContext) throws Exception {
      handler.newCell(chars,offset,length,cellIndex);
    }
  }
;
}

Fixed version (ground truth):
@Override public DelayedCellSetter<T,P> newCellSetter(){
  return new DelayedCellSetter<T,P>(){
    @Override public P consumeValue(){
      return value;
    }
    @Override public P peekValue(){
      return value;
    }
    @Override public void set(    T t) throws Exception {
      marker.getSetter().set(t,value);
    }
    @Override public boolean isSettable(){
      return marker.getSetter() != null;
    }
    public void set(    char[] chars,    int offset,    int length,    ParsingContext parsingContext) throws Exception {
      handler.newCell(chars,offset,length,cellIndex);
    }
  }
;
}
Program: 165119
Project: 165119
Buggy source:
public static double parseDouble(char[] chars,int offset,int length){
  return Double.parseDouble(StringCellValueReader.readString(chars,offset,length));
}

Fixed version (ground truth):
public static double parseDouble(char[] chars,int offset,int length){
  if (length == 0)   return Double.NaN;
  return Double.parseDouble(StringCellValueReader.readString(chars,offset,length));
}