Program: 118555
Project: 118555
Buggy source:
@Override public void transform(NodeType nodeType){
  if (nodeType == null || props == null) {
    return;
  }
  boolean modified=false;
  String currComponentName=nodeType.getComponentName();
  String newComponentName=props.getProperty(currComponentName);
  nodeType.setComponentName(newComponentName);
  IComponent component=ComponentsFactoryProvider.getInstance().get(newComponentName,category.getName());
  ComponentProperties compProperties=ComponentsUtils.getComponentProperties(newComponentName);
  FakeNode fNode=new FakeNode(component);
  for (  IElementParameter param : fNode.getElementParameters()) {
    if (param instanceof GenericElementParameter) {
      NamedThing currNamedThing=ComponentsUtils.getGenericSchemaElement(compProperties,param.getName());
      String oldParamName=props.getProperty(currComponentName + IGenericConstants.EXP_SEPARATOR + param.getName());
      if (oldParamName != null) {
        oldParamName=oldParamName.trim();
        ElementParameterType paramType=ParameterUtilTool.findParameterType(nodeType,oldParamName);
        if (paramType != null) {
          ((Property)currNamedThing).setValue(ParameterUtilTool.convertParameterValue(paramType));
          ParameterUtilTool.removeParameterType(nodeType,paramType);
          modified=true;
        }
        if (EParameterFieldType.SCHEMA_REFERENCE.equals(param.getFieldType())) {
          String schemaTypeName="String_Node_Str" + EParameterName.SCHEMA_TYPE.getName();
          String repSchemaTypeName="String_Node_Str" + EParameterName.REPOSITORY_SCHEMA_TYPE.getName();
          paramType=ParameterUtilTool.findParameterType(nodeType,oldParamName + schemaTypeName);
          if (paramType != null) {
            paramType.setName(param.getName() + schemaTypeName);
          }
          paramType=ParameterUtilTool.findParameterType(nodeType,oldParamName + repSchemaTypeName);
          if (paramType != null) {
            paramType.setName(param.getName() + repSchemaTypeName);
          }
        }
      }
    }
  }
  if (modified) {
    String serializedProperties=compProperties.toSerialized();
    if (serializedProperties != null) {
      ElementParameterType pType=ParameterUtilTool.createParameterType(null,"String_Node_Str",serializedProperties);
      nodeType.getElementParameter().add(pType);
    }
  }
}

Fixed version (ground truth):
@Override public void transform(NodeType nodeType){
  if (nodeType == null || props == null) {
    return;
  }
  boolean modified=false;
  String currComponentName=nodeType.getComponentName();
  String newComponentName=props.getProperty(currComponentName);
  nodeType.setComponentName(newComponentName);
  IComponent component=ComponentsFactoryProvider.getInstance().get(newComponentName,category.getName());
  ComponentProperties compProperties=ComponentsUtils.getComponentProperties(newComponentName);
  FakeNode fNode=new FakeNode(component);
  for (  IElementParameter param : fNode.getElementParameters()) {
    if (param instanceof GenericElementParameter) {
      NamedThing currNamedThing=ComponentsUtils.getGenericSchemaElement(compProperties,param.getName());
      String oldParamName=props.getProperty(currComponentName + IGenericConstants.EXP_SEPARATOR + param.getName());
      if (oldParamName != null && !(oldParamName=oldParamName.trim()).isEmpty()) {
        ElementParameterType paramType=getParameterType(nodeType,oldParamName);
        if (paramType != null) {
          if (currNamedThing instanceof ComponentReferenceProperties) {
            ComponentReferenceProperties props=(ComponentReferenceProperties)currNamedThing;
            props.referenceType.setValue(ComponentReferenceProperties.ReferenceType.COMPONENT_INSTANCE);
            props.componentInstanceId.setValue(ParameterUtilTool.convertParameterValue(paramType));
            props.componentInstanceId.setTaggedValue(IGenericConstants.ADD_QUOTES,true);
          }
 else {
            ((Property)currNamedThing).setValue(ParameterUtilTool.convertParameterValue(paramType));
          }
          ParameterUtilTool.removeParameterType(nodeType,paramType);
          modified=true;
        }
        if (EParameterFieldType.SCHEMA_REFERENCE.equals(param.getFieldType())) {
          String schemaTypeName="String_Node_Str" + EParameterName.SCHEMA_TYPE.getName();
          String repSchemaTypeName="String_Node_Str" + EParameterName.REPOSITORY_SCHEMA_TYPE.getName();
          paramType=getParameterType(nodeType,oldParamName + schemaTypeName);
          if (paramType != null) {
            paramType.setName(param.getName() + schemaTypeName);
          }
          paramType=getParameterType(nodeType,oldParamName + repSchemaTypeName);
          if (paramType != null) {
            paramType.setName(param.getName() + repSchemaTypeName);
          }
        }
      }
 else {
        if (currNamedThing instanceof Property) {
          if (((Property)currNamedThing).isRequired() && Property.Type.STRING.equals(((Property)currNamedThing).getType())) {
            ((Property)currNamedThing).setValue("String_Node_Str");
          }
        }
      }
    }
  }
  if (modified) {
    String serializedProperties=compProperties.toSerialized();
    if (serializedProperties != null) {
      ElementParameterType pType=ParameterUtilTool.createParameterType(null,"String_Node_Str",serializedProperties);
      nodeType.getElementParameter().add(pType);
    }
  }
}