Program: 117976
Project: 117976
Buggy source:
public void addItemsPropertyParameters(String paramName,ITEMSType items,ElementParameter param,EParameterFieldType type,INode node){
  ITEMType item;
  ElementParameter newParam;
  int nbItems=0;
  if (items != null) {
    if (items.isSetBASEDONSCHEMA()) {
      param.setBasedOnSchema(items.isBASEDONSCHEMA());
    }
    if (items.isSetBASEDONSUBJOBSTARTS()) {
      param.setBasedOnSubjobStarts(items.isBASEDONSUBJOBSTARTS());
    }
    if (items.isSetCOLUMNSBASEDONSCHEMA()) {
      param.setColumnsBasedOnSchema(items.isCOLUMNSBASEDONSCHEMA());
    }
    nbItems=items.getITEM().size();
    if (param.isBasedOnSchema() || param.isBasedOnSubjobStarts()) {
      nbItems++;
    }
  }
  String[] listRepositoryItem=new String[nbItems];
  String[] listItemsDisplayValue=new String[nbItems];
  String[] listItemsDisplayCodeValue=new String[nbItems];
  Object[] listItemsValue=new Object[nbItems];
  String[] listItemsShowIf=new String[nbItems];
  String[] listItemsNotShowIf=new String[nbItems];
  String[] listField=new String[nbItems];
  String[] listReadonlyIf=new String[nbItems];
  String[] listNotReadonlyIf=new String[nbItems];
  for (int k=0; k < nbItems; k++) {
    int currentItem=k;
    if (param.isBasedOnSchema() || param.isBasedOnSubjobStarts()) {
      if (k == 0) {
        if (param.isBasedOnSchema()) {
          listItemsDisplayCodeValue[k]="String_Node_Str";
          listItemsDisplayValue[k]="String_Node_Str";
          listField[k]="String_Node_Str";
          listRepositoryItem[k]="String_Node_Str";
          listItemsShowIf[k]=null;
          listItemsNotShowIf[k]=null;
          newParam=new ElementParameter(node);
          newParam.setName("String_Node_Str");
          newParam.setDisplayName("String_Node_Str");
          newParam.setFieldType(EParameterFieldType.TEXT);
          newParam.setValue("String_Node_Str");
          listItemsValue[k]=newParam;
          continue;
        }
 else {
          listItemsDisplayCodeValue[k]="String_Node_Str";
          listItemsDisplayValue[k]="String_Node_Str";
          listField[k]="String_Node_Str";
          listRepositoryItem[k]="String_Node_Str";
          listItemsShowIf[k]=null;
          listItemsNotShowIf[k]=null;
          newParam=new ElementParameter(node);
          newParam.setName("String_Node_Str");
          newParam.setDisplayName("String_Node_Str");
          newParam.setFieldType(EParameterFieldType.TEXT);
          newParam.setValue("String_Node_Str");
          listItemsValue[k]=newParam;
          continue;
        }
      }
 else {
        currentItem=k - 1;
      }
    }
    item=(ITEMType)items.getITEM().get(currentItem);
    listItemsDisplayCodeValue[k]=item.getNAME();
    boolean displayAsValue=item.isDISPLAYNAMEASVALUE();
    if (displayAsValue) {
      String value=item.getVALUE();
      if (value != null) {
        listItemsDisplayValue[k]=value;
      }
 else {
        listItemsDisplayValue[k]=getTranslatedValue(paramName + "String_Node_Str" + item.getNAME());
      }
    }
 else {
      listItemsDisplayValue[k]=getTranslatedValue(paramName + "String_Node_Str" + item.getNAME());
    }
    if (type == EParameterFieldType.ROUTE_COMPONENT_TYPE) {
      listItemsValue[k]=new String[]{item.getNAME(),item.getFILTER()};
    }
 else     if (type != EParameterFieldType.TABLE && type != EParameterFieldType.TREE_TABLE && type != EParameterFieldType.TABLE_BY_ROW) {
      listItemsValue[k]=item.getVALUE();
    }
 else {
      EParameterFieldType currentField=EParameterFieldType.getFieldTypeByName(item.getFIELD());
      newParam=new ElementParameter(node);
      newParam.setName(item.getNAME());
      newParam.setFilter(item.getFILTER());
      newParam.setDisplayName("String_Node_Str");
      newParam.setFieldType(currentField);
      newParam.setContext(item.getCONTEXT());
      newParam.setShowIf(item.getSHOWIF());
      newParam.setNotShowIf(item.getNOTSHOWIF());
      newParam.setReadOnlyIf(item.getREADONLYIF());
      newParam.setNotReadOnlyIf(item.getNOTREADONLYIF());
      newParam.setNoContextAssist(item.isNOCONTEXTASSIST());
      newParam.setRaw(item.isRAW());
      if (item.isSetREADONLY()) {
        newParam.setReadOnly(item.isREADONLY());
      }
switch (currentField) {
case CLOSED_LIST:
case OPENED_LIST:
case COLUMN_LIST:
case COMPONENT_LIST:
case CONNECTION_LIST:
case DBTYPE_LIST:
case LOOKUP_COLUMN_LIST:
case PREV_COLUMN_LIST:
case CONTEXT_PARAM_NAME_LIST:
case MODULE_LIST:
        addItemsPropertyParameters(paramName + "String_Node_Str" + item.getNAME(),item.getITEMS(),newParam,currentField,node);
      break;
case COLOR:
    newParam.setValue(DEFAULT_COLOR);
  break;
case CHECK:
case RADIO:
if (item.getVALUE() == null || item.getVALUE().equals("String_Node_Str")) {
  newParam.setValue(Boolean.FALSE);
}
 else {
  newParam.setValue(new Boolean(item.getVALUE()));
}
break;
case SCHEMA_TYPE:
newParam.setValue("String_Node_Str");
break;
case SAP_SCHEMA_TYPE:
newParam.setValue("String_Node_Str");
break;
case SCHEMA_XPATH_QUERYS:
newParam.setValue("String_Node_Str");
break;
case RULE_TYPE:
newParam.setFieldType(EParameterFieldType.RULE_TYPE);
break;
case MULTI_PATTERN:
newParam.setFieldType(EParameterFieldType.MULTI_PATTERN);
break;
default :
newParam.setFieldType(EParameterFieldType.TEXT);
if (item.getVALUE() == null || item.getVALUE().equals("String_Node_Str")) {
newParam.setValue("String_Node_Str");
}
 else {
newParam.setValue(item.getVALUE());
}
}
listItemsValue[k]=newParam;
}
listField[k]=item.getFIELD();
listRepositoryItem[k]=item.getREPOSITORYITEM();
listItemsShowIf[k]=item.getSHOWIF();
listItemsNotShowIf[k]=item.getNOTSHOWIF();
listReadonlyIf[k]=item.getREADONLYIF();
listNotReadonlyIf[k]=item.getNOTREADONLYIF();
}
param.setListItemsDisplayName(listItemsDisplayValue);
param.setListItemsDisplayCodeName(listItemsDisplayCodeValue);
param.setListItemsValue(listItemsValue);
param.setListRepositoryItems(listRepositoryItem);
param.setListItemsShowIf(listItemsShowIf);
param.setListItemsNotShowIf(listItemsNotShowIf);
param.setListItemsNotReadOnlyIf(listNotReadonlyIf);
param.setListItemsReadOnlyIf(listReadonlyIf);
if (type != EParameterFieldType.TABLE && type != EParameterFieldType.TREE_TABLE) {
Object defaultValue="String_Node_Str";
if (items != null) {
if (items.getDEFAULT() != null) {
boolean found=false;
String temp=items.getDEFAULT();
for (int i=0; i < listItemsDisplayCodeValue.length & !found; i++) {
if (listItemsDisplayCodeValue[i].equals(items.getDEFAULT())) {
found=true;
temp=(String)listItemsValue[i];
}
}
defaultValue=new String(temp);
}
}
param.setDefaultClosedListValue(defaultValue);
param.setValue(defaultValue);
}
}

Fixed version (ground truth):
public void addItemsPropertyParameters(String paramName,ITEMSType items,ElementParameter param,EParameterFieldType type,INode node){
  ITEMType item;
  ElementParameter newParam;
  int nbItems=0;
  if (items != null) {
    if (items.isSetBASEDONSCHEMA()) {
      param.setBasedOnSchema(items.isBASEDONSCHEMA());
    }
    if (items.isSetBASEDONSUBJOBSTARTS()) {
      param.setBasedOnSubjobStarts(items.isBASEDONSUBJOBSTARTS());
    }
    if (items.isSetCOLUMNSBASEDONSCHEMA()) {
      param.setColumnsBasedOnSchema(items.isCOLUMNSBASEDONSCHEMA());
    }
    nbItems=items.getITEM().size();
    if (param.isBasedOnSchema() || param.isBasedOnSubjobStarts()) {
      nbItems++;
    }
  }
  String[] listRepositoryItem=new String[nbItems];
  String[] listItemsDisplayValue=new String[nbItems];
  String[] listItemsDisplayCodeValue=new String[nbItems];
  Object[] listItemsValue=new Object[nbItems];
  String[] listItemsShowIf=new String[nbItems];
  String[] listItemsNotShowIf=new String[nbItems];
  String[] listField=new String[nbItems];
  String[] listReadonlyIf=new String[nbItems];
  String[] listNotReadonlyIf=new String[nbItems];
  for (int k=0; k < nbItems; k++) {
    int currentItem=k;
    if (param.isBasedOnSchema() || param.isBasedOnSubjobStarts()) {
      if (k == 0) {
        if (param.isBasedOnSchema()) {
          listItemsDisplayCodeValue[k]="String_Node_Str";
          listItemsDisplayValue[k]="String_Node_Str";
          listField[k]="String_Node_Str";
          listRepositoryItem[k]="String_Node_Str";
          listItemsShowIf[k]=null;
          listItemsNotShowIf[k]=null;
          newParam=new ElementParameter(node);
          newParam.setName("String_Node_Str");
          newParam.setDisplayName("String_Node_Str");
          newParam.setFieldType(EParameterFieldType.TEXT);
          newParam.setValue("String_Node_Str");
          listItemsValue[k]=newParam;
          continue;
        }
 else {
          listItemsDisplayCodeValue[k]="String_Node_Str";
          listItemsDisplayValue[k]="String_Node_Str";
          listField[k]="String_Node_Str";
          listRepositoryItem[k]="String_Node_Str";
          listItemsShowIf[k]=null;
          listItemsNotShowIf[k]=null;
          newParam=new ElementParameter(node);
          newParam.setName("String_Node_Str");
          newParam.setDisplayName("String_Node_Str");
          newParam.setFieldType(EParameterFieldType.TEXT);
          newParam.setValue("String_Node_Str");
          listItemsValue[k]=newParam;
          continue;
        }
      }
 else {
        currentItem=k - 1;
      }
    }
    item=(ITEMType)items.getITEM().get(currentItem);
    listItemsDisplayCodeValue[k]=item.getNAME();
    boolean displayAsValue=item.isDISPLAYNAMEASVALUE();
    if (displayAsValue) {
      String value=item.getVALUE();
      if (value != null) {
        listItemsDisplayValue[k]=value;
      }
 else {
        listItemsDisplayValue[k]=getTranslatedValue(paramName + "String_Node_Str" + item.getNAME());
      }
    }
 else {
      listItemsDisplayValue[k]=getTranslatedValue(paramName + "String_Node_Str" + item.getNAME());
    }
    if (type == EParameterFieldType.ROUTE_COMPONENT_TYPE) {
      listItemsValue[k]=new String[]{item.getNAME(),item.getFILTER()};
    }
 else     if (type != EParameterFieldType.TABLE && type != EParameterFieldType.TREE_TABLE && type != EParameterFieldType.TABLE_BY_ROW) {
      listItemsValue[k]=item.getVALUE();
    }
 else {
      EParameterFieldType currentField=EParameterFieldType.getFieldTypeByName(item.getFIELD());
      newParam=new ElementParameter(node);
      newParam.setName(item.getNAME());
      newParam.setFilter(item.getFILTER());
      newParam.setDisplayName("String_Node_Str");
      newParam.setFieldType(currentField);
      newParam.setContext(item.getCONTEXT());
      newParam.setShowIf(item.getSHOWIF());
      newParam.setNotShowIf(item.getNOTSHOWIF());
      newParam.setReadOnlyIf(item.getREADONLYIF());
      newParam.setNotReadOnlyIf(item.getNOTREADONLYIF());
      newParam.setNoContextAssist(item.isNOCONTEXTASSIST());
      newParam.setRaw(item.isRAW());
      if (item.isSetREADONLY()) {
        newParam.setReadOnly(item.isREADONLY());
      }
switch (currentField) {
case CLOSED_LIST:
case OPENED_LIST:
case COLUMN_LIST:
case COMPONENT_LIST:
case CONNECTION_LIST:
case DBTYPE_LIST:
case LOOKUP_COLUMN_LIST:
case PREV_COLUMN_LIST:
case CONTEXT_PARAM_NAME_LIST:
case MODULE_LIST:
        addItemsPropertyParameters(paramName + "String_Node_Str" + item.getNAME(),item.getITEMS(),newParam,currentField,node);
      break;
case COLOR:
    newParam.setValue(DEFAULT_COLOR);
  break;
case CHECK:
case RADIO:
if (item.getVALUE() == null || item.getVALUE().equals("String_Node_Str")) {
  newParam.setValue(Boolean.FALSE);
}
 else {
  newParam.setValue(new Boolean(item.getVALUE()));
}
break;
case SCHEMA_TYPE:
newParam.setValue("String_Node_Str");
break;
case SAP_SCHEMA_TYPE:
newParam.setValue("String_Node_Str");
break;
case SCHEMA_XPATH_QUERYS:
newParam.setValue("String_Node_Str");
break;
case RULE_TYPE:
newParam.setFieldType(EParameterFieldType.RULE_TYPE);
break;
case MULTI_PATTERN:
newParam.setFieldType(EParameterFieldType.MULTI_PATTERN);
break;
case PATTERN_PROPERTY:
newParam.setFieldType(EParameterFieldType.PATTERN_PROPERTY);
break;
default :
newParam.setFieldType(EParameterFieldType.TEXT);
if (item.getVALUE() == null || item.getVALUE().equals("String_Node_Str")) {
newParam.setValue("String_Node_Str");
}
 else {
newParam.setValue(item.getVALUE());
}
}
listItemsValue[k]=newParam;
}
listField[k]=item.getFIELD();
listRepositoryItem[k]=item.getREPOSITORYITEM();
listItemsShowIf[k]=item.getSHOWIF();
listItemsNotShowIf[k]=item.getNOTSHOWIF();
listReadonlyIf[k]=item.getREADONLYIF();
listNotReadonlyIf[k]=item.getNOTREADONLYIF();
}
param.setListItemsDisplayName(listItemsDisplayValue);
param.setListItemsDisplayCodeName(listItemsDisplayCodeValue);
param.setListItemsValue(listItemsValue);
param.setListRepositoryItems(listRepositoryItem);
param.setListItemsShowIf(listItemsShowIf);
param.setListItemsNotShowIf(listItemsNotShowIf);
param.setListItemsNotReadOnlyIf(listNotReadonlyIf);
param.setListItemsReadOnlyIf(listReadonlyIf);
if (type != EParameterFieldType.TABLE && type != EParameterFieldType.TREE_TABLE) {
Object defaultValue="String_Node_Str";
if (items != null) {
if (items.getDEFAULT() != null) {
boolean found=false;
String temp=items.getDEFAULT();
for (int i=0; i < listItemsDisplayCodeValue.length & !found; i++) {
if (listItemsDisplayCodeValue[i].equals(items.getDEFAULT())) {
found=true;
temp=(String)listItemsValue[i];
}
}
defaultValue=new String(temp);
}
}
param.setDefaultClosedListValue(defaultValue);
param.setValue(defaultValue);
}
}