Program: 118416
Project: 118416
Buggy source:
/** 
 * DOC nrousseau Comment method "updateSubProperties".
 * @param properties
 * @param newProperties
 */
private void updateSubProperties(ComponentProperties properties,ComponentProperties newProperties){
  if (newProperties == null) {
    return;
  }
  for (  NamedThing nt : properties.getProperties()) {
    if (nt instanceof Property) {
      Property property=(Property)nt;
      Object storedValue=property.getStoredValue();
      if (storedValue instanceof String) {
        String stringValue=(String)storedValue;
        if (ContextParameterUtils.isContainContextParam(stringValue)) {
          continue;
        }
        Property newProperty=(Property)newProperties.getProperty(property.getName());
        if (newProperty != null) {
          if (GenericTypeUtils.isBooleanType(newProperty)) {
            if (stringValue.isEmpty()) {
              property.setValue(Boolean.FALSE);
            }
 else {
              property.setValue(new Boolean(stringValue));
            }
          }
 else           if (GenericTypeUtils.isEnumType(newProperty) && (!(newProperty instanceof EnumProperty))) {
            property.setStoredValue(TalendQuoteUtils.removeQuotes(stringValue));
          }
 else           if (GenericTypeUtils.isEnumType(property)) {
            List<?> propertyPossibleValues=((Property<?>)newProperty).getPossibleValues();
            if (propertyPossibleValues != null) {
              for (              Object possibleValue : propertyPossibleValues) {
                if (possibleValue.toString().equals(storedValue)) {
                  property.setStoredValue(possibleValue);
                  break;
                }
              }
            }
          }
        }
      }
 else {
        Property newProperty=(Property)newProperties.getProperty(property.getName());
        if (GenericTypeUtils.isBooleanType(newProperty)) {
          property.setValue(Boolean.FALSE);
        }
      }
    }
 else     if (nt instanceof ComponentProperties) {
      updateSubProperties((ComponentProperties)nt,(ComponentProperties)newProperties.getProperty(nt.getName()));
    }
  }
}

Fixed version (ground truth):
/** 
 * DOC nrousseau Comment method "updateSubProperties".
 * @param properties
 * @param newProperties
 */
private void updateSubProperties(ComponentProperties properties,ComponentProperties newProperties){
  if (newProperties == null) {
    return;
  }
  for (  NamedThing nt : properties.getProperties()) {
    if (nt instanceof Property) {
      Property property=(Property)nt;
      Object storedValue=property.getStoredValue();
      if (storedValue instanceof String) {
        String stringValue=(String)storedValue;
        if (ContextParameterUtils.isContainContextParam(stringValue)) {
          continue;
        }
        Property newProperty=(Property)newProperties.getProperty(property.getName());
        if (newProperty != null) {
          if (GenericTypeUtils.isBooleanType(newProperty)) {
            if (stringValue.isEmpty()) {
              property.setValue(Boolean.FALSE);
            }
 else {
              property.setValue(new Boolean(stringValue));
            }
          }
 else           if (GenericTypeUtils.isEnumType(newProperty) && (!(newProperty instanceof EnumProperty))) {
            property.setStoredValue(TalendQuoteUtils.removeQuotes(stringValue));
          }
 else           if (GenericTypeUtils.isEnumType(newProperty)) {
            List<?> propertyPossibleValues=((Property<?>)newProperty).getPossibleValues();
            if (propertyPossibleValues != null) {
              for (              Object possibleValue : propertyPossibleValues) {
                if (possibleValue.toString().equals(storedValue)) {
                  property.setStoredValue(possibleValue);
                  break;
                }
              }
            }
          }
        }
      }
 else {
        Property newProperty=(Property)newProperties.getProperty(property.getName());
        if (GenericTypeUtils.isBooleanType(newProperty)) {
          property.setValue(Boolean.FALSE);
        }
      }
    }
 else     if (nt instanceof ComponentProperties) {
      updateSubProperties((ComponentProperties)nt,(ComponentProperties)newProperties.getProperty(nt.getName()));
    }
  }
}