Program: 125526
Project: 125526
Buggy source:
static void setLDAPSchemaPropertiesForExistContextMode(LDAPSchemaConnection ldapConn,Set<IConnParamName> paramSet,Map<ContextItem,List<ConectionAdaptContextVariableModel>> map){
  if (ldapConn == null) {
    return;
  }
  String ldapVariableName=null;
  for (  IConnParamName param : paramSet) {
    if (param instanceof EParamName) {
      ldapVariableName="String_Node_Str";
      EParamName ldapParam=(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(ldapParam.name())) {
              ldapVariableName=model.getName();
              break;
            }
          }
        }
      }
switch (ldapParam) {
case Host:
        ldapConn.setHost(ContextParameterUtils.getNewScriptCode(ldapVariableName,LANGUAGE));
      break;
case Port:
    ldapConn.setPort(ContextParameterUtils.getNewScriptCode(ldapVariableName,LANGUAGE));
  break;
case BindPrincipal:
ldapConn.setBindPrincipal(ContextParameterUtils.getNewScriptCode(ldapVariableName,LANGUAGE));
case BindPassword:
ldapConn.setBindPassword(ContextParameterUtils.getNewScriptCode(ldapVariableName,LANGUAGE));
case CountLimit:
ldapConn.setCountLimit(ContextParameterUtils.getNewScriptCode(ldapVariableName,LANGUAGE));
case TimeOutLimit:
ldapConn.setTimeOutLimit(ContextParameterUtils.getNewScriptCode(ldapVariableName,LANGUAGE));
case Filter:
ldapConn.setFilter(ContextParameterUtils.getNewScriptCode(ldapVariableName,LANGUAGE));
case BaseDN:
ldapConn.setSelectedDN(ContextParameterUtils.getNewScriptCode(ldapVariableName,LANGUAGE));
default :
}
}
}
}

Fixed version (ground truth):
static void setLDAPSchemaPropertiesForExistContextMode(LDAPSchemaConnection ldapConn,Set<IConnParamName> paramSet,Map<ContextItem,List<ConectionAdaptContextVariableModel>> map){
  if (ldapConn == null) {
    return;
  }
  String ldapVariableName=null;
  for (  IConnParamName param : paramSet) {
    if (param instanceof EParamName) {
      ldapVariableName="String_Node_Str";
      EParamName ldapParam=(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(ldapParam.name())) {
              ldapVariableName=model.getName();
              break;
            }
          }
        }
      }
switch (ldapParam) {
case Host:
        ldapConn.setHost(ContextParameterUtils.getNewScriptCode(ldapVariableName,LANGUAGE));
      break;
case Port:
    ldapConn.setPort(ContextParameterUtils.getNewScriptCode(ldapVariableName,LANGUAGE));
  break;
case BindPrincipal:
ldapConn.setBindPrincipal(ContextParameterUtils.getNewScriptCode(ldapVariableName,LANGUAGE));
break;
case BindPassword:
ldapConn.setBindPassword(ContextParameterUtils.getNewScriptCode(ldapVariableName,LANGUAGE));
break;
case CountLimit:
ldapConn.setCountLimit(ContextParameterUtils.getNewScriptCode(ldapVariableName,LANGUAGE));
break;
case TimeOutLimit:
ldapConn.setTimeOutLimit(ContextParameterUtils.getNewScriptCode(ldapVariableName,LANGUAGE));
break;
case Filter:
ldapConn.setFilter(ContextParameterUtils.getNewScriptCode(ldapVariableName,LANGUAGE));
break;
case BaseDN:
ldapConn.setSelectedDN(ContextParameterUtils.getNewScriptCode(ldapVariableName,LANGUAGE));
break;
default :
}
}
}
}