Program: 118767
Project: 118767
Buggy source:
static void setJSONFilePropertiesForExistContextMode(JSONFileConnection jsonConn,Set<IConnParamName> paramSet,Map<ContextItem,List<ConectionAdaptContextVariableModel>> map){
  if (jsonConn == null) {
    return;
  }
  String jsonVariableName=null;
  for (  IConnParamName param : paramSet) {
    if (param instanceof EParamName) {
      EParamName jsonParam=(EParamName)param;
      if (map != null && map.size() > 0) {
        for (        Map.Entry<ContextItem,List<ConectionAdaptContextVariableModel>> entry : map.entrySet()) {
          List<ConectionAdaptContextVariableModel> modelList=entry.getValue();
          for (          ConectionAdaptContextVariableModel model : modelList) {
            if (model.getValue().equals(jsonParam.name())) {
              jsonVariableName=model.getName();
              break;
            }
          }
        }
      }
      if (jsonConn.isInputModel()) {
switch (jsonParam) {
case XmlFilePath:
          jsonConn.setJSONFilePath(ContextParameterUtils.getNewScriptCode(jsonVariableName,LANGUAGE));
        break;
case Encoding:
      jsonConn.setEncoding(ContextParameterUtils.getNewScriptCode(jsonVariableName,LANGUAGE));
    break;
case XPathQuery:
  EList schema=jsonConn.getSchema();
if (schema != null) {
  if (schema.get(0) instanceof JSONXPathLoopDescriptor) {
    JSONXPathLoopDescriptor descriptor=(JSONXPathLoopDescriptor)schema.get(0);
    descriptor.setAbsoluteXPathQuery(ContextParameterUtils.getNewScriptCode(jsonVariableName,LANGUAGE));
  }
}
default :
}
}
 else {
if (jsonParam.equals(EParamName.OutputFilePath)) {
jsonConn.setOutputFilePath(ContextParameterUtils.getNewScriptCode(jsonVariableName,LANGUAGE));
}
}
}
}
}

Fixed version (ground truth):
static void setJSONFilePropertiesForExistContextMode(JSONFileConnection jsonConn,Set<IConnParamName> paramSet,Map<ContextItem,List<ConectionAdaptContextVariableModel>> map){
  if (jsonConn == null) {
    return;
  }
  String jsonVariableName=null;
  for (  IConnParamName param : paramSet) {
    if (param instanceof EParamName) {
      EParamName jsonParam=(EParamName)param;
      if (map != null && map.size() > 0) {
        for (        Map.Entry<ContextItem,List<ConectionAdaptContextVariableModel>> entry : map.entrySet()) {
          List<ConectionAdaptContextVariableModel> modelList=entry.getValue();
          for (          ConectionAdaptContextVariableModel model : modelList) {
            if (model.getValue().equals(jsonParam.name())) {
              jsonVariableName=model.getName();
              break;
            }
          }
        }
      }
      if (jsonConn.isInputModel()) {
switch (jsonParam) {
case FilePath:
          jsonConn.setJSONFilePath(ContextParameterUtils.getNewScriptCode(jsonVariableName,LANGUAGE));
        break;
case Encoding:
      jsonConn.setEncoding(ContextParameterUtils.getNewScriptCode(jsonVariableName,LANGUAGE));
    break;
case XPathQuery:
  EList schema=jsonConn.getSchema();
if (schema != null) {
  if (schema.get(0) instanceof JSONXPathLoopDescriptor) {
    JSONXPathLoopDescriptor descriptor=(JSONXPathLoopDescriptor)schema.get(0);
    descriptor.setAbsoluteXPathQuery(ContextParameterUtils.getNewScriptCode(jsonVariableName,LANGUAGE));
  }
}
default :
}
}
 else {
if (jsonParam.equals(EParamName.OutputFilePath)) {
jsonConn.setOutputFilePath(ContextParameterUtils.getNewScriptCode(jsonVariableName,LANGUAGE));
}
}
}
}
}