Program: 125928
Project: 125928
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);
switch (nonnullable.getType()) {
case ARRAY:
    col.setTalendType(JavaTypesManager.LIST.getId());
  break;
case BOOLEAN:
col.setTalendType(JavaTypesManager.BOOLEAN.getId());
break;
case BYTES:
case FIXED:
col.setTalendType(JavaTypesManager.BYTE_ARRAY.getId());
break;
case DOUBLE:
col.setTalendType(JavaTypesManager.DOUBLE.getId());
break;
case FLOAT:
col.setTalendType(JavaTypesManager.FLOAT.getId());
break;
case INT:
col.setTalendType(JavaTypesManager.INTEGER.getId());
break;
case LONG:
String prop=null;
if (null != (prop=nonnullable.getProp(SchemaConstants.TALEND_COLUMN_PATTERN))) {
col.setTalendType(JavaTypesManager.DATE.getId());
col.setPattern(prop);
}
 else {
col.setTalendType(JavaTypesManager.LONG.getId());
}
break;
case ENUM:
case STRING:
col.setTalendType(JavaTypesManager.STRING.getId());
break;
case RECORD:
case NULL:
case MAP:
case UNION:
default :
break;
}
col.setNullable(AvroUtils.isNullable(in));
String prop;
if (null != (prop=in.getProp(Talend6SchemaConstants.TALEND6_ID))) {
col.setId(prop);
}
if (null != (prop=in.getProp(Talend6SchemaConstants.TALEND6_COMMENT))) {
col.setComment(in.getProp(Talend6SchemaConstants.TALEND6_ID));
}
if (null != (prop=in.getProp(Talend6SchemaConstants.TALEND6_LABEL))) {
col.setLabel(null);
}
if (null != (prop=in.getProp(Talend6SchemaConstants.TALEND6_IS_READ_ONLY))) {
col.setReadOnly(Boolean.parseBoolean(prop));
}
for (String key : in.getJsonProps().keySet()) {
if (key.startsWith(Talend6SchemaConstants.TALEND6_ADDITIONAL_PROPERTIES)) {
String originalKey=key.substring(Talend6SchemaConstants.TALEND6_ADDITIONAL_PROPERTIES.length());
TaggedValue tv=TaggedValueHelper.createTaggedValue(originalKey,in.getProp(key));
col.getTaggedValue().add(tv);
}
}
if (null != (prop=in.getProp(Talend6SchemaConstants.TALEND6_COLUMN_IS_KEY))) {
col.setKey(Boolean.parseBoolean(prop));
}
if (null != (prop=in.getProp(Talend6SchemaConstants.TALEND6_COLUMN_SOURCE_TYPE))) {
col.setSourceType(prop);
}
if (null != (prop=in.getProp(Talend6SchemaConstants.TALEND6_COLUMN_TALEND_TYPE))) {
col.setTalendType(prop);
}
if (null != (prop=in.getProp(Talend6SchemaConstants.TALEND6_COLUMN_PATTERN))) {
col.setPattern(prop);
}
if (null != (prop=in.getProp(Talend6SchemaConstants.TALEND6_COLUMN_LENGTH))) {
Long value=Long.parseLong(prop);
col.setLength(value > 0 ? value : -1);
}
if (null != (prop=in.getProp(Talend6SchemaConstants.TALEND6_COLUMN_ORIGINAL_LENGTH))) {
Long value=Long.parseLong(prop);
col.setOriginalLength(value > 0 ? value : -1);
}
if (null != (prop=in.getProp(Talend6SchemaConstants.TALEND6_COLUMN_IS_NULLABLE))) {
col.setNullable(Boolean.parseBoolean(prop));
}
if (null != (prop=in.getProp(Talend6SchemaConstants.TALEND6_COLUMN_PRECISION))) {
Long value=Long.parseLong(prop);
col.setPrecision(value > 0 ? value : -1);
}
if (null != (prop=in.getProp(Talend6SchemaConstants.TALEND6_COLUMN_DEFAULT))) {
col.setDefaultValue(prop);
}
if (null != (prop=in.getProp(Talend6SchemaConstants.TALEND6_COLUMN_ORIGINAL_DB_COLUMN_NAME))) {
col.setName(prop);
}
if (null != (prop=in.getProp(Talend6SchemaConstants.TALEND6_COLUMN_RELATED_ENTITY))) {
col.setRelatedEntity(prop);
}
if (null != (prop=in.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);
switch (nonnullable.getType()) {
case ARRAY:
    col.setTalendType(JavaTypesManager.LIST.getId());
  break;
case BOOLEAN:
col.setTalendType(JavaTypesManager.BOOLEAN.getId());
break;
case BYTES:
case FIXED:
col.setTalendType(JavaTypesManager.BYTE_ARRAY.getId());
break;
case DOUBLE:
col.setTalendType(JavaTypesManager.DOUBLE.getId());
break;
case FLOAT:
col.setTalendType(JavaTypesManager.FLOAT.getId());
break;
case INT:
col.setTalendType(JavaTypesManager.INTEGER.getId());
break;
case LONG:
String prop=null;
if (null != (prop=nonnullable.getProp(SchemaConstants.TALEND_COLUMN_PATTERN))) {
col.setTalendType(JavaTypesManager.DATE.getId());
col.setPattern(TalendQuoteUtils.addQuotesIfNotExist(prop));
}
 else {
col.setTalendType(JavaTypesManager.LONG.getId());
}
break;
case ENUM:
case STRING:
col.setTalendType(JavaTypesManager.STRING.getId());
break;
case RECORD:
case NULL:
case MAP:
case UNION:
default :
break;
}
col.setNullable(AvroUtils.isNullable(in));
String prop;
if (null != (prop=in.getProp(Talend6SchemaConstants.TALEND6_ID))) {
col.setId(prop);
}
if (null != (prop=in.getProp(Talend6SchemaConstants.TALEND6_COMMENT))) {
col.setComment(in.getProp(Talend6SchemaConstants.TALEND6_ID));
}
if (null != (prop=in.getProp(Talend6SchemaConstants.TALEND6_LABEL))) {
col.setLabel(null);
}
if (null != (prop=in.getProp(Talend6SchemaConstants.TALEND6_IS_READ_ONLY))) {
col.setReadOnly(Boolean.parseBoolean(prop));
}
for (String key : in.getJsonProps().keySet()) {
if (key.startsWith(Talend6SchemaConstants.TALEND6_ADDITIONAL_PROPERTIES)) {
String originalKey=key.substring(Talend6SchemaConstants.TALEND6_ADDITIONAL_PROPERTIES.length());
TaggedValue tv=TaggedValueHelper.createTaggedValue(originalKey,in.getProp(key));
col.getTaggedValue().add(tv);
}
}
if (null != (prop=in.getProp(Talend6SchemaConstants.TALEND6_COLUMN_IS_KEY))) {
col.setKey(Boolean.parseBoolean(prop));
}
if (null != (prop=in.getProp(Talend6SchemaConstants.TALEND6_COLUMN_SOURCE_TYPE))) {
col.setSourceType(prop);
}
if (null != (prop=in.getProp(Talend6SchemaConstants.TALEND6_COLUMN_TALEND_TYPE))) {
col.setTalendType(prop);
}
if (null != (prop=in.getProp(Talend6SchemaConstants.TALEND6_COLUMN_PATTERN))) {
col.setPattern(TalendQuoteUtils.addQuotesIfNotExist(prop));
}
if (null != (prop=in.getProp(Talend6SchemaConstants.TALEND6_COLUMN_LENGTH))) {
Long value=Long.parseLong(prop);
col.setLength(value > 0 ? value : -1);
}
if (null != (prop=in.getProp(Talend6SchemaConstants.TALEND6_COLUMN_ORIGINAL_LENGTH))) {
Long value=Long.parseLong(prop);
col.setOriginalLength(value > 0 ? value : -1);
}
if (null != (prop=in.getProp(Talend6SchemaConstants.TALEND6_COLUMN_IS_NULLABLE))) {
col.setNullable(Boolean.parseBoolean(prop));
}
if (null != (prop=in.getProp(Talend6SchemaConstants.TALEND6_COLUMN_PRECISION))) {
Long value=Long.parseLong(prop);
col.setPrecision(value > 0 ? value : -1);
}
if (null != (prop=in.getProp(Talend6SchemaConstants.TALEND6_COLUMN_DEFAULT))) {
col.setDefaultValue(prop);
}
if (null != (prop=in.getProp(Talend6SchemaConstants.TALEND6_COLUMN_ORIGINAL_DB_COLUMN_NAME))) {
col.setName(prop);
}
if (null != (prop=in.getProp(Talend6SchemaConstants.TALEND6_COLUMN_RELATED_ENTITY))) {
col.setRelatedEntity(prop);
}
if (null != (prop=in.getProp(Talend6SchemaConstants.TALEND6_COLUMN_RELATIONSHIP_TYPE))) {
col.setRelationshipType(prop);
}
if (col.getTalendType() == null) {
throw new UnsupportedOperationException("String_Node_Str" + in);
}
return col;
}