Program: 27172
Project: 27172
Buggy source:
@SuppressWarnings("String_Node_Str") public static void putField(ContentValues values,FlowManager flowManager,Field field,String fieldName,Object value){
  Class<?> fieldType=field.getType();
  if (value != null && !StructureUtils.isForeignKey(field)) {
    final TypeConverter typeSerializer=flowManager.getTypeConverterForClass(fieldType);
    if (typeSerializer != null) {
      value=typeSerializer.getDBValue(value);
      if (value != null) {
        fieldType=value.getClass();
        if (!fieldType.equals(typeSerializer.getDatabaseType())) {
          FlowLog.log(FlowLog.Level.W,String.format(TypeConverter.class.getSimpleName() + "String_Node_Str",typeSerializer.getDatabaseType(),fieldType));
        }
      }
    }
  }
  if (value == null) {
    values.putNull(fieldName);
  }
 else   if (fieldType.equals(Byte.class) || fieldType.equals(byte.class)) {
    values.put(fieldName,(Byte)value);
  }
 else   if (fieldType.equals(Short.class) || fieldType.equals(short.class)) {
    values.put(fieldName,(Short)value);
  }
 else   if (fieldType.equals(Integer.class) || fieldType.equals(int.class)) {
    values.put(fieldName,(Integer)value);
  }
 else   if (fieldType.equals(Long.class) || fieldType.equals(long.class)) {
    values.put(fieldName,(Long)value);
  }
 else   if (fieldType.equals(Float.class) || fieldType.equals(float.class)) {
    values.put(fieldName,(Float)value);
  }
 else   if (fieldType.equals(Double.class) || fieldType.equals(double.class)) {
    values.put(fieldName,(Double)value);
  }
 else   if (fieldType.equals(Boolean.class) || fieldType.equals(boolean.class)) {
    values.put(fieldName,(Boolean)value);
  }
 else   if (fieldType.equals(Character.class) || fieldType.equals(char.class)) {
    values.put(fieldName,value.toString());
  }
 else   if (fieldType.equals(String.class)) {
    values.put(fieldName,value.toString());
  }
 else   if (fieldType.equals(Byte[].class) || fieldType.equals(byte[].class)) {
    values.put(fieldName,(byte[])value);
  }
 else   if (StructureUtils.isForeignKey(field) && ReflectionUtils.implementsModel(fieldType)) {
    Column key=field.getAnnotation(Column.class);
    Class<? extends Model> entityType=(Class<? extends Model>)fieldType;
    if (value instanceof JSONObject) {
      JSONObject jsonObject=((JSONObject)value);
      JSONModel<? extends Model> jsonModel=new JSONModel<Model>(jsonObject,(Class<Model>)entityType);
      jsonModel.save(false);
      TableStructure tableStructure=flowManager.getStructure().getTableStructureForClass(entityType);
      for (      ForeignKeyReference foreignKeyReference : key.references()) {
        Field foreignColumnField=tableStructure.getField(foreignKeyReference.foreignColumnName());
        Object jsonValue=jsonObject.opt(foreignKeyReference.foreignColumnName());
        field.setAccessible(true);
        SqlUtils.putField(values,flowManager,foreignColumnField,foreignKeyReference.columnName(),jsonValue);
      }
    }
 else {
      try {
        Model model=(Model)field.get(value);
        model.save(false);
      }
 catch (      IllegalAccessException e) {
        throw new RuntimeException(e);
      }
      TableStructure tableStructure=flowManager.getStructure().getTableStructureForClass(entityType);
      for (      ForeignKeyReference foreignKeyReference : key.references()) {
        Field foreignColumnField=tableStructure.getField(foreignKeyReference.foreignColumnName());
        foreignColumnField.setAccessible(true);
        try {
          putField(values,flowManager,foreignColumnField,foreignKeyReference.columnName(),foreignColumnField.get(value));
        }
 catch (        IllegalAccessException e) {
          FlowLog.logError(e);
        }
      }
    }
  }
 else   if (ReflectionUtils.isSubclassOf(fieldType,Enum.class)) {
    values.put(fieldName,((Enum<?>)value).name());
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public static void putField(ContentValues values,FlowManager flowManager,Field field,String fieldName,Object value){
  Class<?> fieldType=field.getType();
  if (value != null && !StructureUtils.isForeignKey(field)) {
    final TypeConverter typeSerializer=flowManager.getTypeConverterForClass(fieldType);
    if (typeSerializer != null) {
      value=typeSerializer.getDBValue(value);
      if (value != null) {
        fieldType=value.getClass();
        if (!fieldType.equals(typeSerializer.getDatabaseType())) {
          FlowLog.log(FlowLog.Level.W,String.format(TypeConverter.class.getSimpleName() + "String_Node_Str",typeSerializer.getDatabaseType(),fieldType));
        }
      }
    }
  }
  if (value == null) {
    values.putNull(fieldName);
  }
 else   if (fieldType.equals(Byte.class) || fieldType.equals(byte.class)) {
    values.put(fieldName,(Byte)value);
  }
 else   if (fieldType.equals(Short.class) || fieldType.equals(short.class)) {
    values.put(fieldName,(Short)value);
  }
 else   if (fieldType.equals(Integer.class) || fieldType.equals(int.class)) {
    values.put(fieldName,(Integer)value);
  }
 else   if (fieldType.equals(Long.class) || fieldType.equals(long.class)) {
    values.put(fieldName,(Long)value);
  }
 else   if (fieldType.equals(Float.class) || fieldType.equals(float.class)) {
    values.put(fieldName,(Float)value);
  }
 else   if (fieldType.equals(Double.class) || fieldType.equals(double.class)) {
    values.put(fieldName,(Double)value);
  }
 else   if (fieldType.equals(Boolean.class) || fieldType.equals(boolean.class)) {
    values.put(fieldName,(Boolean)value);
  }
 else   if (fieldType.equals(Character.class) || fieldType.equals(char.class)) {
    values.put(fieldName,value.toString());
  }
 else   if (fieldType.equals(String.class)) {
    values.put(fieldName,value.toString());
  }
 else   if (fieldType.equals(Byte[].class) || fieldType.equals(byte[].class)) {
    values.put(fieldName,(byte[])value);
  }
 else   if (StructureUtils.isForeignKey(field) && ReflectionUtils.implementsModel(fieldType)) {
    Column key=field.getAnnotation(Column.class);
    Class<? extends Model> entityType=(Class<? extends Model>)fieldType;
    if (value instanceof ModelContainer || ModelContainerMap.containsValue(value)) {
      ModelContainer<? extends Model,?> modelContainer=ModelContainerMap.getModelContainerInstance(entityType,value);
      modelContainer.save(false);
      TableStructure tableStructure=flowManager.getStructure().getTableStructureForClass(entityType);
      for (      ForeignKeyReference foreignKeyReference : key.references()) {
        Field foreignColumnField=tableStructure.getField(foreignKeyReference.foreignColumnName());
        Object jsonValue=modelContainer.getValue(foreignKeyReference.foreignColumnName());
        field.setAccessible(true);
        SqlUtils.putField(values,flowManager,foreignColumnField,foreignKeyReference.columnName(),jsonValue);
      }
    }
 else {
      try {
        Model model=(Model)field.get(value);
        model.save(false);
      }
 catch (      IllegalAccessException e) {
        throw new RuntimeException(e);
      }
      TableStructure tableStructure=flowManager.getStructure().getTableStructureForClass(entityType);
      for (      ForeignKeyReference foreignKeyReference : key.references()) {
        Field foreignColumnField=tableStructure.getField(foreignKeyReference.foreignColumnName());
        foreignColumnField.setAccessible(true);
        try {
          putField(values,flowManager,foreignColumnField,foreignKeyReference.columnName(),foreignColumnField.get(value));
        }
 catch (        IllegalAccessException e) {
          FlowLog.logError(e);
        }
      }
    }
  }
 else   if (ReflectionUtils.isSubclassOf(fieldType,Enum.class)) {
    values.put(fieldName,((Enum<?>)value).name());
  }
}