Program: 118173
Project: 118173
Buggy source:
public static List<IContextParameter> createContextParameters(String prefixName,Connection connection,Set<IConnParamName> paramSet){
  List<IContextParameter> varList=new ArrayList<>();
  if (connection instanceof GenericConnection) {
    GenericConnection conn=(GenericConnection)connection;
    if (conn == null || prefixName == null || paramSet == null || paramSet.isEmpty()) {
      return Collections.emptyList();
    }
    String paramPrefix=prefixName + ConnectionContextHelper.LINE;
    String paramName=null;
    for (    IConnParamName param : paramSet) {
      if (param instanceof GenericConnParamName) {
        GenericConnParamName connParamName=(GenericConnParamName)param;
        String name=connParamName.getName();
        ComponentProperties componentProperties=getComponentProperties((GenericConnection)connection);
        Property<?> property=componentProperties.getValuedProperty(name);
        paramName=paramPrefix + connParamName.getContextVar();
        JavaType type=JavaTypesManager.STRING;
        if (property.isFlag(Property.Flags.ENCRYPT)) {
          type=JavaTypesManager.PASSWORD;
        }
        if (GenericTypeUtils.isIntegerType(property)) {
          type=JavaTypesManager.INTEGER;
        }
        String value=property == null || property.getValue() == null ? null : StringEscapeUtils.escapeJava(String.valueOf(property.getValue()));
        ConnectionContextHelper.createParameters(varList,paramName,value,type);
      }
    }
  }
  return varList;
}

Fixed version (ground truth):
public static List<IContextParameter> createContextParameters(String prefixName,Connection connection,Set<IConnParamName> paramSet){
  List<IContextParameter> varList=new ArrayList<>();
  if (connection instanceof GenericConnection) {
    GenericConnection conn=(GenericConnection)connection;
    if (conn == null || prefixName == null || paramSet == null || paramSet.isEmpty()) {
      return Collections.emptyList();
    }
    String paramPrefix=prefixName + ConnectionContextHelper.LINE;
    String paramName=null;
    for (    IConnParamName param : paramSet) {
      if (param instanceof GenericConnParamName) {
        GenericConnParamName connParamName=(GenericConnParamName)param;
        String name=connParamName.getName();
        ComponentProperties componentProperties=getComponentProperties((GenericConnection)connection);
        Property<?> property=componentProperties.getValuedProperty(name);
        paramName=paramPrefix + connParamName.getContextVar();
        JavaType type=JavaTypesManager.STRING;
        if (property.isFlag(Property.Flags.ENCRYPT)) {
          type=JavaTypesManager.PASSWORD;
        }
        if (GenericTypeUtils.isIntegerType(property)) {
          type=JavaTypesManager.INTEGER;
        }
        String propertyValue=StringEscapeUtils.escapeJava(String.valueOf(property.getValue()));
        if (GenericTypeUtils.isStringType(property)) {
          propertyValue=TalendQuoteUtils.addPairQuotesIfNotExist(ComponentsUtils.unescapeForJava(propertyValue));
        }
        String value=property == null || property.getValue() == null ? null : propertyValue;
        ConnectionContextHelper.createParameters(varList,paramName,value,type);
      }
    }
  }
  return varList;
}