Program: 125349
Project: 125349
Buggy source:
private static Schema copyDynamicColumnProperties(Schema schema,org.talend.core.model.metadata.builder.connection.MetadataColumn in){
  Map<String,String> props=new HashMap<String,String>();
  if (in.getId() != null) {
    schema=AvroUtils.setProperty(schema,DiSchemaConstants.TALEND6_DYNAMIC_COLUMN_ID,in.getId());
  }
  if (in.getComment() != null) {
    schema=AvroUtils.setProperty(schema,DiSchemaConstants.TALEND6_DYNAMIC_COLUMN_COMMENT,in.getComment());
  }
  if (in.getLabel() != null) {
    schema=AvroUtils.setProperty(schema,DiSchemaConstants.TALEND6_DYNAMIC_COLUMN_NAME,in.getLabel());
  }
  for (  TaggedValue tv : in.getTaggedValue()) {
    if (DiSchemaConstants.TALEND6_IS_READ_ONLY.equals(tv.getTag())) {
      schema=AvroUtils.setProperty(schema,DiSchemaConstants.TALEND6_DYNAMIC_IS_READ_ONLY,tv.getValue());
    }
 else {
      String additionalTag=tv.getTag();
      if (tv.getValue() != null) {
        schema=AvroUtils.setProperty(schema,DiSchemaConstants.TALEND6_DYNAMIC_ADDITIONAL_PROPERTIES + additionalTag,tv.getValue());
      }
    }
  }
  if (in.isKey()) {
    schema=AvroUtils.setProperty(schema,DiSchemaConstants.TALEND6_COLUMN_IS_KEY,"String_Node_Str");
  }
  if (in.getType() != null) {
    schema=AvroUtils.setProperty(schema,DiSchemaConstants.TALEND6_COLUMN_SOURCE_TYPE,in.getSourceType());
  }
  if (in.getTalendType() != null) {
    schema=AvroUtils.setProperty(schema,DiSchemaConstants.TALEND6_COLUMN_TALEND_TYPE,in.getTalendType());
  }
  if (in.getPattern() != null) {
    schema=AvroUtils.setProperty(schema,DiSchemaConstants.TALEND6_COLUMN_PATTERN,TalendQuoteUtils.removeQuotesIfExist(in.getPattern()));
  }
  if (in.getLength() >= 0) {
    schema=AvroUtils.setProperty(schema,DiSchemaConstants.TALEND6_COLUMN_LENGTH,String.valueOf((int)in.getLength()));
  }
  if (in.getOriginalLength() >= 0) {
    schema=AvroUtils.setProperty(schema,DiSchemaConstants.TALEND6_COLUMN_ORIGINAL_LENGTH,String.valueOf(in.getOriginalLength()));
  }
  if (in.isNullable()) {
    schema=AvroUtils.setProperty(schema,DiSchemaConstants.TALEND6_COLUMN_IS_NULLABLE,"String_Node_Str");
  }
  if (in.getPrecision() >= 0) {
    schema=AvroUtils.setProperty(schema,DiSchemaConstants.TALEND6_COLUMN_PRECISION,String.valueOf(in.getPrecision()));
  }
  if (in.getScale() >= 0) {
    schema=AvroUtils.setProperty(schema,DiSchemaConstants.TALEND6_COLUMN_SCALE,String.valueOf(in.getScale()));
  }
  if (in.getInitialValue() != null && in.getInitialValue().getBody() != null) {
    schema=AvroUtils.setProperty(schema,DiSchemaConstants.TALEND6_COLUMN_DEFAULT,in.getInitialValue().getBody());
  }
  if (in.getName() != null) {
    schema=AvroUtils.setProperty(schema,DiSchemaConstants.TALEND6_COLUMN_ORIGINAL_DB_COLUMN_NAME,in.getName());
  }
  if (in.getRelatedEntity() != null) {
    schema=AvroUtils.setProperty(schema,DiSchemaConstants.TALEND6_COLUMN_RELATED_ENTITY,in.getRelatedEntity());
  }
  if (in.getRelationshipType() != null) {
    schema=AvroUtils.setProperty(schema,DiSchemaConstants.TALEND6_COLUMN_RELATIONSHIP_TYPE,in.getRelationshipType());
  }
  return schema;
}

Fixed version (ground truth):
private static Schema copyDynamicColumnProperties(Schema schema,org.talend.core.model.metadata.builder.connection.MetadataColumn in){
  Map<String,String> props=new HashMap<String,String>();
  if (in.getId() != null) {
    schema=AvroUtils.setProperty(schema,DiSchemaConstants.TALEND6_DYNAMIC_COLUMN_ID,in.getId());
  }
  if (in.getComment() != null) {
    schema=AvroUtils.setProperty(schema,DiSchemaConstants.TALEND6_DYNAMIC_COLUMN_COMMENT,in.getComment());
  }
  if (in.getLabel() != null) {
    schema=AvroUtils.setProperty(schema,DiSchemaConstants.TALEND6_DYNAMIC_COLUMN_NAME,in.getLabel());
  }
  for (  TaggedValue tv : in.getTaggedValue()) {
    if (DiSchemaConstants.TALEND6_IS_READ_ONLY.equals(tv.getTag())) {
      schema=AvroUtils.setProperty(schema,DiSchemaConstants.TALEND6_DYNAMIC_IS_READ_ONLY,tv.getValue());
    }
 else {
      String additionalTag=tv.getTag();
      if (tv.getValue() != null) {
        schema=AvroUtils.setProperty(schema,DiSchemaConstants.TALEND6_DYNAMIC_ADDITIONAL_PROPERTIES + additionalTag,tv.getValue());
      }
    }
  }
  if (in.isKey()) {
    schema=AvroUtils.setProperty(schema,DiSchemaConstants.TALEND6_COLUMN_IS_KEY,"String_Node_Str");
  }
  if (in.getSourceType() != null) {
    schema=AvroUtils.setProperty(schema,DiSchemaConstants.TALEND6_COLUMN_SOURCE_TYPE,in.getSourceType());
  }
  if (in.getTalendType() != null) {
    schema=AvroUtils.setProperty(schema,DiSchemaConstants.TALEND6_COLUMN_TALEND_TYPE,in.getTalendType());
  }
  if (in.getPattern() != null) {
    schema=AvroUtils.setProperty(schema,DiSchemaConstants.TALEND6_COLUMN_PATTERN,TalendQuoteUtils.removeQuotesIfExist(in.getPattern()));
  }
  if (in.getLength() >= 0) {
    schema=AvroUtils.setProperty(schema,DiSchemaConstants.TALEND6_COLUMN_LENGTH,String.valueOf((int)in.getLength()));
  }
  if (in.getOriginalLength() >= 0) {
    schema=AvroUtils.setProperty(schema,DiSchemaConstants.TALEND6_COLUMN_ORIGINAL_LENGTH,String.valueOf(in.getOriginalLength()));
  }
  if (in.isNullable()) {
    schema=AvroUtils.setProperty(schema,DiSchemaConstants.TALEND6_COLUMN_IS_NULLABLE,"String_Node_Str");
  }
  if (in.getPrecision() >= 0) {
    schema=AvroUtils.setProperty(schema,DiSchemaConstants.TALEND6_COLUMN_PRECISION,String.valueOf(in.getPrecision()));
  }
  if (in.getScale() >= 0) {
    schema=AvroUtils.setProperty(schema,DiSchemaConstants.TALEND6_COLUMN_SCALE,String.valueOf(in.getScale()));
  }
  if (in.getInitialValue() != null && in.getInitialValue().getBody() != null) {
    schema=AvroUtils.setProperty(schema,DiSchemaConstants.TALEND6_COLUMN_DEFAULT,in.getInitialValue().getBody());
  }
  if (in.getName() != null) {
    schema=AvroUtils.setProperty(schema,DiSchemaConstants.TALEND6_COLUMN_ORIGINAL_DB_COLUMN_NAME,in.getName());
  }
  if (in.getRelatedEntity() != null) {
    schema=AvroUtils.setProperty(schema,DiSchemaConstants.TALEND6_COLUMN_RELATED_ENTITY,in.getRelatedEntity());
  }
  if (in.getRelationshipType() != null) {
    schema=AvroUtils.setProperty(schema,DiSchemaConstants.TALEND6_COLUMN_RELATIONSHIP_TYPE,in.getRelationshipType());
  }
  return schema;
}