Program: 118197
Project: 118197
Buggy source:
protected boolean updateComponentProperties(Connection oldConnection,ComponentProperties componentProperties,Properties props){
  boolean modified=false;
  if (props != null) {
    for (    Object element : props.keySet()) {
      boolean changed=false;
      String propsKey=(String)element;
      String propsValue=props.getProperty(propsKey);
      if (propsValue != null && !"String_Node_Str".equals(propsValue.trim())) {
        try {
          String methodName=propsValue.substring(0,1).toUpperCase() + propsValue.substring(1);
          Object value=ReflectionUtils.invokeMethod(oldConnection,"String_Node_Str" + methodName,new Object[0]);
          if (value != null) {
            NamedThing namedThing=componentProperties.getProperty(propsKey);
            if (namedThing != null && namedThing instanceof org.talend.daikon.properties.property.Property) {
              org.talend.daikon.properties.property.Property<?> property=(org.talend.daikon.properties.property.Property<?>)namedThing;
              if (GenericTypeUtils.isEnumType(property)) {
                Object obj=props.get(propsKey + "String_Node_Str" + value);
                if (obj != null) {
                  List<?> propertyPossibleValues=property.getPossibleValues();
                  Object newValue=null;
                  if (propertyPossibleValues != null) {
                    for (                    Object possibleValue : propertyPossibleValues) {
                      if (possibleValue.toString().equals(obj)) {
                        newValue=possibleValue;
                        break;
                      }
                    }
                  }
                  if (newValue == null) {
                    newValue=propertyPossibleValues.get(0);
                  }
                  componentProperties.setValue(propsKey,newValue);
                  property.setTaggedValue(IGenericConstants.REPOSITORY_VALUE,property.getName());
                  changed=true;
                }
              }
              if (GenericTypeUtils.isBooleanType(property)) {
                if (value != null && value instanceof String) {
                  try {
                    value=new Boolean((String)value);
                  }
 catch (                  Exception e) {
                    value=Boolean.FALSE;
                  }
                }
              }
              if (GenericTypeUtils.isIntegerType(property) && !oldConnection.isContextMode()) {
                if (value != null && value instanceof String) {
                  try {
                    value=new Integer((String)value);
                  }
 catch (                  Exception e) {
                    value=0;
                  }
                }
              }
              if (property.isFlag(org.talend.daikon.properties.property.Property.Flags.ENCRYPT) && !oldConnection.isContextMode()) {
                componentProperties.setValue(propsKey,CryptoHelper.getDefault().decrypt(String.valueOf(value)));
                property.setTaggedValue(IGenericConstants.REPOSITORY_VALUE,property.getName());
                modified=true;
                changed=true;
              }
              if (!changed) {
                property.setStoredValue(value);
                property.setTaggedValue(IGenericConstants.REPOSITORY_VALUE,property.getName());
                modified=true;
              }
            }
          }
        }
 catch (        Exception e) {
        }
      }
    }
  }
  return modified;
}

Fixed version (ground truth):
protected boolean updateComponentProperties(Connection oldConnection,ComponentProperties componentProperties,Properties props){
  boolean modified=false;
  if (props != null) {
    for (    Object element : props.keySet()) {
      boolean changed=false;
      String propsKey=(String)element;
      String propsValue=props.getProperty(propsKey);
      if (propsValue != null && !"String_Node_Str".equals(propsValue.trim())) {
        Object value=getValueFromOldConnection(oldConnection,propsValue);
        if (value != null) {
          NamedThing namedThing=componentProperties.getProperty(propsKey);
          if (namedThing != null && namedThing instanceof org.talend.daikon.properties.property.Property) {
            org.talend.daikon.properties.property.Property<?> property=(org.talend.daikon.properties.property.Property<?>)namedThing;
            if (GenericTypeUtils.isEnumType(property)) {
              Object obj=props.get(propsKey + "String_Node_Str" + value);
              if (obj != null) {
                List<?> propertyPossibleValues=property.getPossibleValues();
                Object newValue=null;
                if (propertyPossibleValues != null) {
                  for (                  Object possibleValue : propertyPossibleValues) {
                    if (possibleValue.toString().equals(obj)) {
                      newValue=possibleValue;
                      break;
                    }
                  }
                }
                if (newValue == null) {
                  newValue=propertyPossibleValues.get(0);
                }
                componentProperties.setValue(propsKey,newValue);
                property.setTaggedValue(IGenericConstants.REPOSITORY_VALUE,property.getName());
                changed=true;
              }
            }
            if (GenericTypeUtils.isBooleanType(property)) {
              if (value != null && value instanceof String) {
                try {
                  value=new Boolean((String)value);
                }
 catch (                Exception e) {
                  value=Boolean.FALSE;
                }
              }
            }
            if (GenericTypeUtils.isIntegerType(property) && !oldConnection.isContextMode()) {
              if (value != null && value instanceof String) {
                try {
                  value=new Integer((String)value);
                }
 catch (                Exception e) {
                  value=0;
                }
              }
            }
            if (property.isFlag(org.talend.daikon.properties.property.Property.Flags.ENCRYPT) && !oldConnection.isContextMode()) {
              componentProperties.setValue(propsKey,CryptoHelper.getDefault().decrypt(String.valueOf(value)));
              property.setTaggedValue(IGenericConstants.REPOSITORY_VALUE,property.getName());
              modified=true;
              changed=true;
            }
            if (!changed) {
              property.setStoredValue(value);
              property.setTaggedValue(IGenericConstants.REPOSITORY_VALUE,property.getName());
              modified=true;
            }
          }
        }
      }
    }
  }
  return modified;
}