Program: 177699
Project: 177699
Buggy source:
/** 
 * Extracts declared non-<code>transient</code> fields of a given Entity. Makes  property bindings for fields using their annotations and checks for their getter-and setters (finds them automatically) if they are non-public fields.
 * @return fields of this class.
 */
@SuppressWarnings("String_Node_Str") private List<Field> extractFields(){
  this.fields.clear();
  for (  java.lang.reflect.Field f : this.clazz.getDeclaredFields()) {
    if (!Modifier.isTransient(f.getModifiers())) {
      Class<?> fieldType=f.getType();
      boolean isList=false;
      if (fieldType.equals(List.class) || fieldType.equals(ArrayList.class) || fieldType.equals(LinkedList.class)) {
        if (f.isAnnotationPresent(OneToMany.class)) {
          fieldType=f.getAnnotation(OneToMany.class).toType();
        }
 else {
          throw new UnannotatedCollectionFieldException(f.getName(),this.clazz.getName());
        }
        isList=true;
      }
      Field newF=new Field(fieldType,f.getName());
      if (isList)       newF.setList(true);
      int accessibility=f.getModifiers();
      if (!(Modifier.isPublic(accessibility))) {
        Method setter=this.findSetterFor(this.clazz,f.getName());
        if (setter == null)         throw new NotDeclaredSetterException(f.getName(),this.clazz.getName());
 else         newF.setSetterMethod(setter);
        Method getter=this.findGetterFor(this.clazz,f.getName());
        if (getter == null)         throw new NotDeclaredGetterException(f.getName(),this.clazz.getName());
 else         newF.setGetterMethod(getter);
      }
      if (f.isAnnotationPresent(Index.class)) {
        Index ann=f.getAnnotation(Index.class);
        newF.setIndex(new FieldIndexHolder(ann.name(),ann.unique()));
        newF.setNullable(false);
      }
      if (f.isAnnotationPresent(NotNull.class)) {
        newF.setNullable(false);
      }
      if (f.isAnnotationPresent(Id.class)) {
        newF.makeId(true);
        if (!isSupportedForIdField(f.getType())) {
          throw new UnsupportedIdFieldTypeException(f.getType().getName(),clazz.getName());
        }
        if (newF.getIndex() == null)         newF.setIndex(new FieldIndexHolder(null,true));
      }
      if (f.isAnnotationPresent(OneToOne.class)) {
        if (newF.getIndex() == null)         newF.setIndex(new FieldIndexHolder(null,true));
      }
      if (f.isAnnotationPresent(ManyToOne.class)) {
        if (newF.getIndex() == null)         newF.setIndex(new FieldIndexHolder(null,false));
      }
      newF.setRawField(f);
      fields.add(newF);
    }
  }
  return this.fields;
}

Fixed version (ground truth):
/** 
 * Extracts declared non-<code>transient</code> fields of a given Entity. Makes  property bindings for fields using their annotations and checks for their getter-and setters (finds them automatically) if they are non-public fields.
 * @return fields of this class.
 */
@SuppressWarnings("String_Node_Str") private List<Field> extractFields(){
  this.fields.clear();
  for (  java.lang.reflect.Field f : this.clazz.getDeclaredFields()) {
    if (!Modifier.isTransient(f.getModifiers())) {
      Class<?> fieldType=f.getType();
      boolean isList=false;
      if (fieldType.equals(List.class) || fieldType.equals(ArrayList.class) || fieldType.equals(LinkedList.class)) {
        if (f.isAnnotationPresent(OneToMany.class)) {
          fieldType=f.getAnnotation(OneToMany.class).toType();
        }
 else {
          throw new UnannotatedCollectionFieldException(f.getName(),this.clazz.getName());
        }
        isList=true;
      }
      Field newF=new Field(fieldType,f);
      if (isList)       newF.setList(true);
      int accessibility=f.getModifiers();
      if (!(Modifier.isPublic(accessibility))) {
        Method setter=this.findSetterFor(this.clazz,f.getName());
        if (setter == null)         throw new NotDeclaredSetterException(f.getName(),this.clazz.getName());
 else         newF.setSetterMethod(setter);
        Method getter=this.findGetterFor(this.clazz,f.getName());
        if (getter == null)         throw new NotDeclaredGetterException(f.getName(),this.clazz.getName());
 else         newF.setGetterMethod(getter);
      }
      if (f.isAnnotationPresent(Index.class)) {
        Index ann=f.getAnnotation(Index.class);
        newF.setIndex(new FieldIndexHolder(ann.name(),ann.unique()));
        newF.setNullable(false);
      }
      if (f.isAnnotationPresent(NotNull.class)) {
        newF.setNullable(false);
      }
      if (f.isAnnotationPresent(Id.class)) {
        newF.makeId(true);
        if (!isSupportedForIdField(f.getType())) {
          throw new UnsupportedIdFieldTypeException(f.getType().getName(),clazz.getName());
        }
        if (newF.getIndex() == null)         newF.setIndex(new FieldIndexHolder(null,true));
      }
      if (f.isAnnotationPresent(OneToOne.class)) {
        if (newF.getIndex() == null)         newF.setIndex(new FieldIndexHolder(null,true));
      }
      if (f.isAnnotationPresent(ManyToOne.class)) {
        if (newF.getIndex() == null)         newF.setIndex(new FieldIndexHolder(null,false));
      }
      newF.setRawField(f);
      fields.add(newF);
    }
  }
  return this.fields;
}