Program: 125883
Project: 125883
Buggy source:
/** 
 * @param in A field from an incoming schema
 * @return A MetadataColumn containing all the information from the Schema, including any information included theschema as JSON property annotations for Talend 6 generated schemas.
 */
public static org.talend.core.model.metadata.builder.connection.MetadataColumn convertFromAvro(Schema.Field field){
  org.talend.core.model.metadata.builder.connection.MetadataColumn col=ConnectionFactory.eINSTANCE.createMetadataColumn();
  Schema in=field.schema();
  col.setId(field.name());
  col.setLabel(field.name());
  col.setName(field.name());
  Schema nonnullable=AvroUtils.unwrapIfNullable(in);
  if (AvroTypes.isSameType(nonnullable,AvroTypes._boolean())) {
    col.setTalendType(JavaTypesManager.BOOLEAN.getId());
  }
 else   if (AvroTypes.isSameType(nonnullable,AvroTypes._byte())) {
    col.setTalendType(JavaTypesManager.BYTE.getId());
  }
 else   if (AvroTypes.isSameType(nonnullable,AvroTypes._bytes())) {
    col.setTalendType(JavaTypesManager.BYTE_ARRAY.getId());
  }
 else   if (AvroTypes.isSameType(nonnullable,AvroTypes._character())) {
    col.setTalendType(JavaTypesManager.CHARACTER.getId());
  }
 else   if (AvroTypes.isSameType(nonnullable,AvroTypes._date())) {
    col.setTalendType(JavaTypesManager.DATE.getId());
  }
 else   if (AvroTypes.isSameType(nonnullable,AvroTypes._decimal())) {
    col.setTalendType(JavaTypesManager.BIGDECIMAL.getId());
  }
 else   if (AvroTypes.isSameType(nonnullable,AvroTypes._double())) {
    col.setTalendType(JavaTypesManager.DOUBLE.getId());
  }
 else   if (AvroTypes.isSameType(nonnullable,AvroTypes._float())) {
    col.setTalendType(JavaTypesManager.FLOAT.getId());
  }
 else   if (AvroTypes.isSameType(nonnullable,AvroTypes._int())) {
    col.setTalendType(JavaTypesManager.INTEGER.getId());
  }
 else   if (AvroTypes.isSameType(nonnullable,AvroTypes._long())) {
    col.setTalendType(JavaTypesManager.LONG.getId());
  }
 else   if (AvroTypes.isSameType(nonnullable,AvroTypes._short())) {
    col.setTalendType(JavaTypesManager.SHORT.getId());
  }
 else   if (AvroTypes.isSameType(nonnullable,AvroTypes._string())) {
    col.setTalendType(JavaTypesManager.STRING.getId());
  }
  col.setNullable(AvroUtils.isNullable(in));
  String prop;
  if (null != (prop=field.getProp(Talend6SchemaConstants.TALEND6_ID))) {
    col.setId(prop);
  }
  if (null != (prop=field.getProp(Talend6SchemaConstants.TALEND6_COMMENT))) {
    col.setComment(field.getProp(Talend6SchemaConstants.TALEND6_ID));
  }
  if (null != (prop=field.getProp(Talend6SchemaConstants.TALEND6_LABEL))) {
    col.setLabel(null);
  }
  if (null != (prop=field.getProp(Talend6SchemaConstants.TALEND6_IS_READ_ONLY))) {
    col.setReadOnly(Boolean.parseBoolean(prop));
  }
  for (  String key : field.getJsonProps().keySet()) {
    if (key.startsWith(Talend6SchemaConstants.TALEND6_ADDITIONAL_PROPERTIES)) {
      String originalKey=key.substring(Talend6SchemaConstants.TALEND6_ADDITIONAL_PROPERTIES.length());
      TaggedValue tv=TaggedValueHelper.createTaggedValue(originalKey,field.getProp(key));
      col.getTaggedValue().add(tv);
    }
  }
  if (null != (prop=field.getProp(Talend6SchemaConstants.TALEND6_COLUMN_IS_KEY))) {
    col.setKey(Boolean.parseBoolean(prop));
  }
  if (null != (prop=field.getProp(Talend6SchemaConstants.TALEND6_COLUMN_SOURCE_TYPE))) {
    col.setSourceType(prop);
  }
  if (null != (prop=field.getProp(Talend6SchemaConstants.TALEND6_COLUMN_TALEND_TYPE))) {
    col.setTalendType(prop);
  }
  if (null != (prop=field.getProp(Talend6SchemaConstants.TALEND6_COLUMN_PATTERN))) {
    col.setPattern(TalendQuoteUtils.addQuotesIfNotExist(prop));
  }
  if (null != (prop=field.getProp(Talend6SchemaConstants.TALEND6_COLUMN_LENGTH))) {
    Long value=Long.parseLong(prop);
    col.setLength(value > 0 ? value : -1);
  }
  if (null != (prop=field.getProp(Talend6SchemaConstants.TALEND6_COLUMN_ORIGINAL_LENGTH))) {
    Long value=Long.parseLong(prop);
    col.setOriginalLength(value > 0 ? value : -1);
  }
  if (null != (prop=field.getProp(Talend6SchemaConstants.TALEND6_COLUMN_IS_NULLABLE))) {
    col.setNullable(Boolean.parseBoolean(prop));
  }
  if (null != (prop=field.getProp(Talend6SchemaConstants.TALEND6_COLUMN_PRECISION))) {
    Long value=Long.parseLong(prop);
    col.setPrecision(value > 0 ? value : -1);
  }
  if (null != (prop=field.getProp(Talend6SchemaConstants.TALEND6_COLUMN_DEFAULT))) {
    col.setDefaultValue(prop);
  }
  if (null != (prop=field.getProp(Talend6SchemaConstants.TALEND6_COLUMN_ORIGINAL_DB_COLUMN_NAME))) {
    col.setName(prop);
  }
  if (null != (prop=field.getProp(Talend6SchemaConstants.TALEND6_COLUMN_RELATED_ENTITY))) {
    col.setRelatedEntity(prop);
  }
  if (null != (prop=field.getProp(Talend6SchemaConstants.TALEND6_COLUMN_RELATIONSHIP_TYPE))) {
    col.setRelationshipType(prop);
  }
  if (col.getTalendType() == null) {
    throw new UnsupportedOperationException("String_Node_Str" + in);
  }
  return col;
}

Fixed version (ground truth):
/** 
 * @param in A field from an incoming schema
 * @return A MetadataColumn containing all the information from the Schema, including any information included theschema as JSON property annotations for Talend 6 generated schemas.
 */
public static org.talend.core.model.metadata.builder.connection.MetadataColumn convertFromAvro(Schema.Field field){
  org.talend.core.model.metadata.builder.connection.MetadataColumn col=ConnectionFactory.eINSTANCE.createMetadataColumn();
  Schema in=field.schema();
  col.setId(field.name());
  col.setLabel(field.name());
  col.setName(field.name());
  Schema nonnullable=AvroUtils.unwrapIfNullable(in);
  if (AvroTypes.isSameType(nonnullable,AvroTypes._boolean())) {
    col.setTalendType(JavaTypesManager.BOOLEAN.getId());
  }
 else   if (AvroTypes.isSameType(nonnullable,AvroTypes._byte())) {
    col.setTalendType(JavaTypesManager.BYTE.getId());
  }
 else   if (AvroTypes.isSameType(nonnullable,AvroTypes._bytes())) {
    col.setTalendType(JavaTypesManager.BYTE_ARRAY.getId());
  }
 else   if (AvroTypes.isSameType(nonnullable,AvroTypes._character())) {
    col.setTalendType(JavaTypesManager.CHARACTER.getId());
  }
 else   if (AvroTypes.isSameType(nonnullable,AvroTypes._date())) {
    col.setTalendType(JavaTypesManager.DATE.getId());
  }
 else   if (AvroTypes.isSameType(nonnullable,AvroTypes._decimal())) {
    col.setTalendType(JavaTypesManager.BIGDECIMAL.getId());
  }
 else   if (AvroTypes.isSameType(nonnullable,AvroTypes._double())) {
    col.setTalendType(JavaTypesManager.DOUBLE.getId());
  }
 else   if (AvroTypes.isSameType(nonnullable,AvroTypes._float())) {
    col.setTalendType(JavaTypesManager.FLOAT.getId());
  }
 else   if (AvroTypes.isSameType(nonnullable,AvroTypes._int())) {
    col.setTalendType(JavaTypesManager.INTEGER.getId());
  }
 else   if (AvroTypes.isSameType(nonnullable,AvroTypes._long())) {
    col.setTalendType(JavaTypesManager.LONG.getId());
  }
 else   if (AvroTypes.isSameType(nonnullable,AvroTypes._short())) {
    col.setTalendType(JavaTypesManager.SHORT.getId());
  }
 else   if (AvroTypes.isSameType(nonnullable,AvroTypes._string())) {
    col.setTalendType(JavaTypesManager.STRING.getId());
  }
  col.setNullable(AvroUtils.isNullable(in));
  String prop;
  if (null != (prop=field.getProp(Talend6SchemaConstants.TALEND6_ID))) {
    col.setId(prop);
  }
  if (null != (prop=field.getProp(Talend6SchemaConstants.TALEND6_COMMENT))) {
    col.setComment(prop);
  }
  if (null != (prop=field.getProp(Talend6SchemaConstants.TALEND6_LABEL))) {
    col.setLabel(prop);
  }
  if (null != (prop=field.getProp(Talend6SchemaConstants.TALEND6_IS_READ_ONLY))) {
    col.setReadOnly(Boolean.parseBoolean(prop));
  }
  for (  String key : field.getJsonProps().keySet()) {
    if (key.startsWith(Talend6SchemaConstants.TALEND6_ADDITIONAL_PROPERTIES)) {
      String originalKey=key.substring(Talend6SchemaConstants.TALEND6_ADDITIONAL_PROPERTIES.length());
      TaggedValue tv=TaggedValueHelper.createTaggedValue(originalKey,field.getProp(key));
      col.getTaggedValue().add(tv);
    }
  }
  if (null != (prop=field.getProp(Talend6SchemaConstants.TALEND6_COLUMN_IS_KEY))) {
    col.setKey(Boolean.parseBoolean(prop));
  }
  if (null != (prop=field.getProp(Talend6SchemaConstants.TALEND6_COLUMN_SOURCE_TYPE))) {
    col.setSourceType(prop);
  }
  if (null != (prop=field.getProp(Talend6SchemaConstants.TALEND6_COLUMN_TALEND_TYPE))) {
    col.setTalendType(prop);
  }
  if (null != (prop=field.getProp(Talend6SchemaConstants.TALEND6_COLUMN_PATTERN))) {
    col.setPattern(prop);
  }
  if (null != (prop=field.getProp(Talend6SchemaConstants.TALEND6_COLUMN_LENGTH))) {
    Long value=Long.parseLong(prop);
    col.setLength(value > 0 ? value : -1);
  }
  if (null != (prop=field.getProp(Talend6SchemaConstants.TALEND6_COLUMN_ORIGINAL_LENGTH))) {
    Long value=Long.parseLong(prop);
    col.setOriginalLength(value > 0 ? value : -1);
  }
  if (null != (prop=field.getProp(Talend6SchemaConstants.TALEND6_COLUMN_IS_NULLABLE))) {
    col.setNullable(Boolean.parseBoolean(prop));
  }
  if (null != (prop=field.getProp(Talend6SchemaConstants.TALEND6_COLUMN_PRECISION))) {
    Long value=Long.parseLong(prop);
    col.setPrecision(value > 0 ? value : -1);
  }
  if (null != (prop=field.getProp(Talend6SchemaConstants.TALEND6_COLUMN_DEFAULT))) {
    col.setDefaultValue(prop);
  }
  if (null != (prop=field.getProp(Talend6SchemaConstants.TALEND6_COLUMN_ORIGINAL_DB_COLUMN_NAME))) {
    col.setName(prop);
  }
  if (null != (prop=field.getProp(Talend6SchemaConstants.TALEND6_COLUMN_RELATED_ENTITY))) {
    col.setRelatedEntity(prop);
  }
  if (null != (prop=field.getProp(Talend6SchemaConstants.TALEND6_COLUMN_RELATIONSHIP_TYPE))) {
    col.setRelationshipType(prop);
  }
  if (col.getTalendType() == null) {
    throw new UnsupportedOperationException("String_Node_Str" + in);
  }
  return col;
}