Program: 118670
Project: 118670
Buggy source:
private Object getGenericRepositoryValue(GenericConnection connection,String value,IMetadataTable table){
  ComponentProperties componentProperties=ComponentsUtils.getComponentPropertiesFromSerialized(connection.getCompProperties());
  String paramName=ComponentsUtils.getPropertyName(value);
  if (value != null && value.startsWith(componentProperties.getName())) {
    if (value.indexOf(IGenericConstants.EXP_SEPARATOR) != -1) {
      value=value.substring(componentProperties.getName().length() + 1,value.length());
    }
  }
  boolean found=false;
  List<Property> allValuedProperties=ComponentsUtils.getAllValuedProperties(componentProperties);
  for (  Property property : allValuedProperties) {
    if (paramName != null && paramName.equals(property.getName())) {
      found=true;
    }
  }
  Object object=null;
  if (found) {
    object=ComponentsUtils.getGenericPropertyValue(componentProperties,value);
  }
 else {
    String seletetedMetadataTableName=null;
    if (table != null) {
      if (table instanceof MetadataTableRepositoryObject) {
        MetadataTableRepositoryObject metaTableRepObj=(MetadataTableRepositoryObject)table;
        if (metaTableRepObj.getTable() != null) {
          seletetedMetadataTableName=metaTableRepObj.getTable().getName();
        }
      }
 else       if (table instanceof org.talend.core.model.metadata.MetadataTable) {
        seletetedMetadataTableName=table.getLabel();
      }
    }
    for (    ModelElement modelElement : connection.getOwnedElement()) {
      ComponentProperties subComponentProperties=null;
      if (modelElement instanceof SubContainer) {
        SubContainer subContainer=(SubContainer)modelElement;
        subComponentProperties=ComponentsUtils.getComponentPropertiesFromSerialized(subContainer.getCompProperties());
      }
 else       if (modelElement instanceof MetadataTable) {
        MetadataTable metadataTable=(MetadataTable)modelElement;
        for (        TaggedValue taggedValue : metadataTable.getTaggedValue()) {
          if (IComponentConstants.COMPONENT_PROPERTIES_TAG.equals(taggedValue.getTag())) {
            subComponentProperties=ComponentsUtils.getComponentPropertiesFromSerialized(taggedValue.getValue());
          }
        }
      }
      if (seletetedMetadataTableName != null) {
        if (!modelElement.getName().equals(seletetedMetadataTableName)) {
          continue;
        }
      }
      if (subComponentProperties != null) {
        if (value.indexOf(IGenericConstants.EXP_SEPARATOR) != -1) {
          value=value.substring(value.indexOf(IGenericConstants.EXP_SEPARATOR) + 1,value.length());
        }
        return ComponentsUtils.getGenericPropertyValue(subComponentProperties,value);
      }
    }
  }
  if (object != null) {
    if (object instanceof String && value != null && value.indexOf(IGenericConstants.EXP_SEPARATOR) != -1) {
      return getRepositoryValueOfStringType(connection,StringUtils.trimToNull(object.toString()));
    }
  }
  return ComponentsUtils.getGenericPropertyValue(componentProperties,value);
}

Fixed version (ground truth):
private Object getGenericRepositoryValue(List<ComponentProperties> componentProperties,String value,IMetadataTable table){
  if (componentProperties != null && value != null) {
    String seletetedMetadataTableName=getSeletetedMetadataTableName(table);
    for (    ComponentProperties compPro : componentProperties) {
      if (seletetedMetadataTableName != null) {
        if (!compPro.getName().equals(seletetedMetadataTableName)) {
          continue;
        }
      }
      Property property=compPro.getValuedProperty(value);
      if (property != null) {
        return property.getValue() != null ? property.getValue() : property.getDefaultValue();
      }
    }
    if (value.indexOf(IGenericConstants.EXP_SEPARATOR) != -1) {
      return getGenericRepositoryValue(componentProperties,value.substring(value.indexOf(IGenericConstants.EXP_SEPARATOR) + 1),table);
    }
  }
  return null;
}