Program: 118768
Project: 118768
Buggy source:
static List<IContextParameter> getJSONFileVariables(String prefixName,JSONFileConnection conn){
  if (conn == null || prefixName == null) {
    return Collections.emptyList();
  }
  List<IContextParameter> varList=new ArrayList<IContextParameter>();
  prefixName=prefixName + LINE;
  String paramName=null;
  if (!conn.isInputModel()) {
    String outputFilePath=conn.getOutputFilePath();
    paramName=prefixName + EParamName.OutputFilePath;
    createParameters(varList,paramName,outputFilePath,JavaTypesManager.FILE);
  }
 else {
    String jsonFilePath=conn.getJSONFilePath();
    String encoding=conn.getEncoding();
    if (LANGUAGE.equals(ECodeLanguage.PERL)) {
      jsonFilePath=TalendQuoteUtils.addQuotes(jsonFilePath);
      encoding=TalendQuoteUtils.addQuotes(encoding);
    }
    paramName=prefixName + EParamName.XmlFilePath;
    createParameters(varList,paramName,jsonFilePath,JavaTypesManager.FILE);
    paramName=prefixName + EParamName.Encoding;
    createParameters(varList,paramName,encoding);
    EList schema=conn.getSchema();
    if (schema != null) {
      Object object=schema.get(0);
      if (object instanceof JSONXPathLoopDescriptor) {
        JSONXPathLoopDescriptor loopDesc=(JSONXPathLoopDescriptor)object;
        paramName=prefixName + EParamName.XPathQuery;
        String absoluteXPathQuery=loopDesc.getAbsoluteXPathQuery();
        if (LANGUAGE.equals(ECodeLanguage.PERL)) {
          absoluteXPathQuery=TalendQuoteUtils.addQuotes(absoluteXPathQuery);
        }
        createParameters(varList,paramName,absoluteXPathQuery);
      }
    }
  }
  return varList;
}

Fixed version (ground truth):
static List<IContextParameter> getJSONFileVariables(String prefixName,JSONFileConnection conn){
  if (conn == null || prefixName == null) {
    return Collections.emptyList();
  }
  List<IContextParameter> varList=new ArrayList<IContextParameter>();
  prefixName=prefixName + LINE;
  String paramName=null;
  if (!conn.isInputModel()) {
    String outputFilePath=conn.getOutputFilePath();
    paramName=prefixName + EParamName.OutputFilePath;
    createParameters(varList,paramName,outputFilePath,JavaTypesManager.FILE);
  }
 else {
    String jsonFilePath=conn.getJSONFilePath();
    String encoding=conn.getEncoding();
    if (LANGUAGE.equals(ECodeLanguage.PERL)) {
      jsonFilePath=TalendQuoteUtils.addQuotes(jsonFilePath);
      encoding=TalendQuoteUtils.addQuotes(encoding);
    }
    paramName=prefixName + EParamName.FilePath;
    createParameters(varList,paramName,jsonFilePath,JavaTypesManager.FILE);
    paramName=prefixName + EParamName.Encoding;
    createParameters(varList,paramName,encoding);
    EList schema=conn.getSchema();
    if (schema != null) {
      Object object=schema.get(0);
      if (object instanceof JSONXPathLoopDescriptor) {
        JSONXPathLoopDescriptor loopDesc=(JSONXPathLoopDescriptor)object;
        paramName=prefixName + EParamName.XPathQuery;
        String absoluteXPathQuery=loopDesc.getAbsoluteXPathQuery();
        if (LANGUAGE.equals(ECodeLanguage.PERL)) {
          absoluteXPathQuery=TalendQuoteUtils.addQuotes(absoluteXPathQuery);
        }
        createParameters(varList,paramName,absoluteXPathQuery);
      }
    }
  }
  return varList;
}