Program: 35397
Project: 35397
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void initialize(){
  nameField=new HtmlEditor();
  nameField.hide();
  nameField.setEnableAlignments(false);
  nameField.setEnableLinks(false);
  nameField.setEnableFont(false);
  nameField.setEnableLists(false);
  nameField.setEnableColors(false);
  nameField.setSourceEditMode(false);
  nameField.setHeight(75);
  nameField.setBorders(true);
  nameField.setFieldLabel(I18N.CONSTANTS.adminFlexibleName());
  nameReadOnlyField=Forms.label(I18N.CONSTANTS.adminFlexibleName());
  typeField=Forms.combobox(I18N.CONSTANTS.adminFlexibleType(),true,EnumModel.VALUE_FIELD,EnumModel.DISPLAY_FIELD);
  typeField.setEmptyText(I18N.CONSTANTS.adminFlexibleType());
  containerField=Forms.combobox(I18N.CONSTANTS.adminFlexibleContainer(),true,EntityDTO.ID,PhaseModelDTO.NAME);
  containerField.setEmptyText(I18N.CONSTANTS.adminFlexibleContainerChoice());
  containerField.setFireChangeEventOnSetValue(true);
  layoutGroupField=Forms.combobox(I18N.CONSTANTS.adminFlexibleGroup(),true,LayoutGroupDTO.ID,LayoutGroupDTO.TITLE);
  orderField=Forms.number(I18N.CONSTANTS.adminFlexibleOrder(),true);
  mandatoryField=Forms.checkbox("String_Node_Str",null,I18N.CONSTANTS.adminFlexibleCompulsory(),false);
  privacyGroupField=Forms.combobox(I18N.CONSTANTS.adminPrivacyGroups(),false,PrivacyGroupDTO.ID,PrivacyGroupDTO.TITLE);
  privacyGroupField.setEmptyText(I18N.CONSTANTS.adminPrivacyGroupChoice());
  amendableField=Forms.checkbox("String_Node_Str",null,I18N.CONSTANTS.partOfProjectCore(),false);
  exportableField=Forms.checkbox("String_Node_Str",null,I18N.CONSTANTS.adminFlexibleExportable(),false);
  commonForm=Forms.panel(130);
  commonForm.add(nameField);
  commonForm.add(nameReadOnlyField);
  commonForm.add(typeField);
  commonForm.add(containerField);
  commonForm.add(layoutGroupField);
  commonForm.add(orderField);
  commonForm.add(mandatoryField);
  commonForm.add(new ClearableField<PrivacyGroupDTO>(privacyGroupField));
  commonForm.add(amendableField);
  commonForm.add(exportableField);
  textAreaFields=new HashSet<Field<?>>();
  bannerField=Forms.checkbox("String_Node_Str",null,"String_Node_Str",false);
  bannerField.setFireChangeEventOnSetValue(true);
  bannerPositionField=Forms.simpleCombobox("String_Node_Str",false);
  bannerPositionField.disable();
  lengthField=Forms.number(I18N.CONSTANTS.adminFlexibleLength(),false);
  codeField=Forms.text(I18N.CONSTANTS.adminFlexibleCode(),false);
  decimalField=Forms.checkbox("String_Node_Str",null,I18N.CONSTANTS.adminFlexibleDecimal(),false);
  minLimitField=Forms.number(I18N.CONSTANTS.adminFlexibleMinLimit(),false);
  maxLimitField=Forms.number(I18N.CONSTANTS.adminFlexibleMaxLimit(),false);
  minDateField=Forms.date(I18N.CONSTANTS.adminFlexible_form_minDate(),false);
  maxDateField=Forms.date(I18N.CONSTANTS.adminFlexible_form_maxDate(),false);
  textAreaFields.add(lengthField);
  textAreaFields.add(codeField);
  textAreaFields.add(decimalField);
  textAreaFields.add(minLimitField);
  textAreaFields.add(maxLimitField);
  textAreaFields.add(minDateField);
  textAreaFields.add(maxDateField);
  reportModelField=Forms.combobox(I18N.CONSTANTS.adminReportName(),true,ReportModelDTO.ID,ReportModelDTO.NAME);
  multipleChoicesField=Forms.checkbox("String_Node_Str",null,I18N.CONSTANTS.adminFlexibleMultipleQ(),false);
  qualityLinkField=Forms.checkbox("String_Node_Str",null,I18N.CONSTANTS.adminFlexibleLinkedToQuality(),false);
  categoryTypeField=Forms.combobox(I18N.CONSTANTS.adminFlexibleLinkedCategory(),false,CategoryTypeDTO.ID,CategoryTypeDTO.LABEL);
  categoryTypeField.setFireChangeEventOnSetValue(true);
  customChoiceAddField=new TextButtonField(I18N.CONSTANTS.adminFlexibleQChoices());
  customChoicesPanel=new FlowPanel();
  customChoicesField=Forms.adapter(null,customChoicesPanel);
  formulaField=Forms.text(I18N.CONSTANTS.adminFlexibleComputationFormula(),false);
  formulaHintLabel=new com.extjs.gxt.ui.client.widget.Label(I18N.CONSTANTS.adminFlexibleComputationFormulaHint());
  formulaHintLabel.addStyleName(STYLE_FORM_HINT);
  budgetFields=new FlexTable();
  budgetFields.setVisible(false);
  budgetFields.setCellSpacing(5);
  budgetFields.setCellPadding(5);
  budgetFields.addStyleName("String_Node_Str");
  Text subFieldTitle=new Text(I18N.CONSTANTS.adminBudgetSubField());
  subFieldTitle.addStyleName("String_Node_Str");
  budgetFields.setWidget(0,0,subFieldTitle);
  budgetFields.getFlexCellFormatter().setColSpan(0,0,3);
  anchorAddSubField=new Anchor();
  anchorAddSubField.setHTML(IconImageBundle.ICONS.add().getHTML() + I18N.CONSTANTS.adminAddBudgetSubField());
  anchorAddSubField.setVisible(false);
  ratioFlexTable=new FlexTable();
  budgetSubFieldSpentStore=new ListStore<FlexibleElementDTO>();
  budgetSubFieldPlannedStore=new ListStore<FlexibleElementDTO>();
  budgetSubFieldSpentCombo=Forms.combobox(I18N.CONSTANTS.flexibleElementBudgetDistributionRatio(),true,FlexibleElementDTO.ID,FlexibleElementDTO.LABEL,budgetSubFieldSpentStore);
  budgetSubFieldPlannedCombo=Forms.combobox(I18N.CONSTANTS.projectPlannedBudget(),true,FlexibleElementDTO.ID,FlexibleElementDTO.LABEL,budgetSubFieldPlannedStore);
  upBudgetSubFieldCombo=new ComboBox<BudgetSubFieldDTO>();
  upBudgetSubFieldCombo.setDisplayField("String_Node_Str");
  downBudgetSubFieldCombo=new ComboBox<BudgetSubFieldDTO>();
  downBudgetSubFieldCombo.setDisplayField("String_Node_Str");
  upBudgetSubFieldStore=new ListStore<BudgetSubFieldDTO>();
  downBudgetSubFieldStore=new ListStore<BudgetSubFieldDTO>();
  upBudgetSubFieldCombo.setStore(upBudgetSubFieldStore);
  downBudgetSubFieldCombo.setStore(downBudgetSubFieldStore);
  upBudgetSubFieldCombo.setTriggerAction(TriggerAction.ALL);
  upBudgetSubFieldCombo.setEditable(false);
  downBudgetSubFieldCombo.setTriggerAction(TriggerAction.ALL);
  downBudgetSubFieldCombo.setEditable(false);
  ratioFlexTable.setWidget(0,0,new Text(I18N.CONSTANTS.adminBudgetRatio() + "String_Node_Str"));
  ratioFlexTable.setWidget(0,1,upBudgetSubFieldCombo);
  ratioFlexTable.setWidget(0,2,new Text("String_Node_Str"));
  ratioFlexTable.setWidget(0,3,downBudgetSubFieldCombo);
  ratioFlexTable.setVisible(false);
  codeGrid=new com.extjs.gxt.ui.client.widget.grid.Grid<FlexibleElementDTO>(new ListStore<FlexibleElementDTO>(),createCodeGridColumnModel());
  codeGrid.setAutoHeight(false);
  codeGrid.setAutoExpandColumn(FlexibleElementDTO.CODE);
  codeGrid.setHeight(200);
  codeGridHeaderLabel=new com.extjs.gxt.ui.client.widget.Label(I18N.CONSTANTS.adminFlexibleComputationCodeGridHeader());
  codeGridHeaderLabel.addStyleName(STYLE_FORM_ITEM);
  contactTypeField=Forms.combobox(I18N.CONSTANTS.adminFlexibleElementContactListTypeFilter(),false,EnumModel.VALUE_FIELD,EnumModel.DISPLAY_FIELD);
  contactTypeClearableField=new ClearableField<EnumModel<ContactModelType>>(contactTypeField);
  contactModelsField=new ListComboBox<ContactModelDTO>(ContactModelDTO.ID,ContactModelDTO.NAME);
  contactModelsField.initComponent();
  contactModelsContainer=Forms.adapter(I18N.CONSTANTS.adminFlexibleElementContactListModelFilter(),contactModelsField);
  contactNumberLimit=Forms.number(I18N.CONSTANTS.adminFlexibleElementContactListLimit(),false,false,false);
  contactIsMember=Forms.checkbox("String_Node_Str",null,I18N.CONSTANTS.adminFlexibleElementContactListIsMember(),false);
  specificForm=Forms.panel(150);
  specificForm.add(bannerField);
  specificForm.add(bannerPositionField);
  specificForm.add(formulaField);
  specificForm.add(formulaHintLabel);
  specificForm.add(codeField);
  specificForm.add(lengthField);
  specificForm.add(decimalField);
  specificForm.add(minLimitField);
  specificForm.add(maxLimitField);
  specificForm.add(minDateField);
  specificForm.add(maxDateField);
  specificForm.add(reportModelField);
  specificForm.add(multipleChoicesField);
  specificForm.add(qualityLinkField);
  specificForm.add(categoryTypeField);
  specificForm.add(customChoiceAddField);
  specificForm.add(customChoicesField);
  specificForm.add(codeGridHeaderLabel);
  specificForm.add(codeGrid);
  specificForm.add(contactNumberLimit);
  specificForm.add(contactTypeClearableField);
  specificForm.add(contactIsMember);
  specificForm.add(contactModelsContainer);
  specificForm.add(budgetFields);
  specificForm.add(anchorAddSubField);
  specificForm.add(ratioFlexTable);
  specificForm.add(budgetSubFieldSpentCombo);
  specificForm.add(budgetSubFieldPlannedCombo);
  saveButton=Forms.button(I18N.CONSTANTS.save(),IconImageBundle.ICONS.save());
  final FormPanel buttonFormPanel=Forms.panel();
  buttonFormPanel.addButton(saveButton);
  final Grid mainContainer=new Grid(3,2);
  mainContainer.setWidth("String_Node_Str");
  mainContainer.getElement().getStyle().setTableLayout(TableLayout.FIXED);
  mainContainer.getColumnFormatter().getElement(0).getStyle().setProperty("String_Node_Str","String_Node_Str");
  mainContainer.getColumnFormatter().getElement(1).getStyle().setProperty("String_Node_Str","String_Node_Str");
  mainContainer.getRowFormatter().setVerticalAlign(1,HasVerticalAlignment.ALIGN_TOP);
  mainContainer.setWidget(0,0,Forms.header(I18N.CONSTANTS.adminFlexible_form_header_common()));
  mainContainer.setWidget(0,1,Forms.header(I18N.CONSTANTS.adminFlexible_form_header_specific()));
  mainContainer.setWidget(1,0,commonForm);
  mainContainer.setWidget(1,1,specificForm);
  mainContainer.setWidget(2,1,buttonFormPanel);
  initPopup(mainContainer);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void initialize(){
  nameField=new HtmlEditor();
  nameField.hide();
  nameField.setEnableAlignments(false);
  nameField.setEnableLinks(false);
  nameField.setEnableFont(false);
  nameField.setEnableLists(false);
  nameField.setEnableColors(false);
  nameField.setSourceEditMode(false);
  nameField.setHeight(75);
  nameField.setBorders(true);
  nameField.setFieldLabel(I18N.CONSTANTS.adminFlexibleName());
  nameReadOnlyField=Forms.label(I18N.CONSTANTS.adminFlexibleName());
  typeField=Forms.combobox(I18N.CONSTANTS.adminFlexibleType(),true,EnumModel.VALUE_FIELD,EnumModel.DISPLAY_FIELD);
  typeField.setEmptyText(I18N.CONSTANTS.adminFlexibleType());
  containerField=Forms.combobox(I18N.CONSTANTS.adminFlexibleContainer(),true,EntityDTO.ID,PhaseModelDTO.NAME);
  containerField.setEmptyText(I18N.CONSTANTS.adminFlexibleContainerChoice());
  containerField.setFireChangeEventOnSetValue(true);
  layoutGroupField=Forms.combobox(I18N.CONSTANTS.adminFlexibleGroup(),true,LayoutGroupDTO.ID,LayoutGroupDTO.TITLE);
  orderField=Forms.number(I18N.CONSTANTS.adminFlexibleOrder(),true);
  mandatoryField=Forms.checkbox("String_Node_Str",null,I18N.CONSTANTS.adminFlexibleCompulsory(),false);
  privacyGroupField=Forms.combobox(I18N.CONSTANTS.adminPrivacyGroups(),false,PrivacyGroupDTO.ID,PrivacyGroupDTO.TITLE);
  privacyGroupField.setEmptyText(I18N.CONSTANTS.adminPrivacyGroupChoice());
  amendableField=Forms.checkbox("String_Node_Str",null,IconImageBundle.ICONS.DNABrownGreen().getHTML() + I18N.CONSTANTS.partOfProjectCore(),false);
  exportableField=Forms.checkbox("String_Node_Str",null,I18N.CONSTANTS.adminFlexibleExportable(),false);
  commonForm=Forms.panel(130);
  commonForm.add(nameField);
  commonForm.add(nameReadOnlyField);
  commonForm.add(typeField);
  commonForm.add(containerField);
  commonForm.add(layoutGroupField);
  commonForm.add(orderField);
  commonForm.add(mandatoryField);
  commonForm.add(new ClearableField<PrivacyGroupDTO>(privacyGroupField));
  commonForm.add(amendableField);
  commonForm.add(exportableField);
  textAreaFields=new HashSet<Field<?>>();
  bannerField=Forms.checkbox("String_Node_Str",null,"String_Node_Str",false);
  bannerField.setFireChangeEventOnSetValue(true);
  bannerPositionField=Forms.simpleCombobox("String_Node_Str",false);
  bannerPositionField.disable();
  lengthField=Forms.number(I18N.CONSTANTS.adminFlexibleLength(),false);
  codeField=Forms.text(I18N.CONSTANTS.adminFlexibleCode(),false);
  decimalField=Forms.checkbox("String_Node_Str",null,I18N.CONSTANTS.adminFlexibleDecimal(),false);
  minLimitField=Forms.number(I18N.CONSTANTS.adminFlexibleMinLimit(),false);
  maxLimitField=Forms.number(I18N.CONSTANTS.adminFlexibleMaxLimit(),false);
  minDateField=Forms.date(I18N.CONSTANTS.adminFlexible_form_minDate(),false);
  maxDateField=Forms.date(I18N.CONSTANTS.adminFlexible_form_maxDate(),false);
  textAreaFields.add(lengthField);
  textAreaFields.add(codeField);
  textAreaFields.add(decimalField);
  textAreaFields.add(minLimitField);
  textAreaFields.add(maxLimitField);
  textAreaFields.add(minDateField);
  textAreaFields.add(maxDateField);
  reportModelField=Forms.combobox(I18N.CONSTANTS.adminReportName(),true,ReportModelDTO.ID,ReportModelDTO.NAME);
  multipleChoicesField=Forms.checkbox("String_Node_Str",null,I18N.CONSTANTS.adminFlexibleMultipleQ(),false);
  qualityLinkField=Forms.checkbox("String_Node_Str",null,I18N.CONSTANTS.adminFlexibleLinkedToQuality(),false);
  categoryTypeField=Forms.combobox(I18N.CONSTANTS.adminFlexibleLinkedCategory(),false,CategoryTypeDTO.ID,CategoryTypeDTO.LABEL);
  categoryTypeField.setFireChangeEventOnSetValue(true);
  customChoiceAddField=new TextButtonField(I18N.CONSTANTS.adminFlexibleQChoices());
  customChoicesPanel=new FlowPanel();
  customChoicesField=Forms.adapter(null,customChoicesPanel);
  formulaField=Forms.text(I18N.CONSTANTS.adminFlexibleComputationFormula(),false);
  formulaHintLabel=new com.extjs.gxt.ui.client.widget.Label(I18N.CONSTANTS.adminFlexibleComputationFormulaHint());
  formulaHintLabel.addStyleName(STYLE_FORM_HINT);
  budgetFields=new FlexTable();
  budgetFields.setVisible(false);
  budgetFields.setCellSpacing(5);
  budgetFields.setCellPadding(5);
  budgetFields.addStyleName("String_Node_Str");
  Text subFieldTitle=new Text(I18N.CONSTANTS.adminBudgetSubField());
  subFieldTitle.addStyleName("String_Node_Str");
  budgetFields.setWidget(0,0,subFieldTitle);
  budgetFields.getFlexCellFormatter().setColSpan(0,0,3);
  anchorAddSubField=new Anchor();
  anchorAddSubField.setHTML(IconImageBundle.ICONS.add().getHTML() + I18N.CONSTANTS.adminAddBudgetSubField());
  anchorAddSubField.setVisible(false);
  ratioFlexTable=new FlexTable();
  budgetSubFieldSpentStore=new ListStore<FlexibleElementDTO>();
  budgetSubFieldPlannedStore=new ListStore<FlexibleElementDTO>();
  budgetSubFieldSpentCombo=Forms.combobox(I18N.CONSTANTS.flexibleElementBudgetDistributionRatio(),true,FlexibleElementDTO.ID,FlexibleElementDTO.LABEL,budgetSubFieldSpentStore);
  budgetSubFieldPlannedCombo=Forms.combobox(I18N.CONSTANTS.projectPlannedBudget(),true,FlexibleElementDTO.ID,FlexibleElementDTO.LABEL,budgetSubFieldPlannedStore);
  upBudgetSubFieldCombo=new ComboBox<BudgetSubFieldDTO>();
  upBudgetSubFieldCombo.setDisplayField("String_Node_Str");
  downBudgetSubFieldCombo=new ComboBox<BudgetSubFieldDTO>();
  downBudgetSubFieldCombo.setDisplayField("String_Node_Str");
  upBudgetSubFieldStore=new ListStore<BudgetSubFieldDTO>();
  downBudgetSubFieldStore=new ListStore<BudgetSubFieldDTO>();
  upBudgetSubFieldCombo.setStore(upBudgetSubFieldStore);
  downBudgetSubFieldCombo.setStore(downBudgetSubFieldStore);
  upBudgetSubFieldCombo.setTriggerAction(TriggerAction.ALL);
  upBudgetSubFieldCombo.setEditable(false);
  downBudgetSubFieldCombo.setTriggerAction(TriggerAction.ALL);
  downBudgetSubFieldCombo.setEditable(false);
  ratioFlexTable.setWidget(0,0,new Text(I18N.CONSTANTS.adminBudgetRatio() + "String_Node_Str"));
  ratioFlexTable.setWidget(0,1,upBudgetSubFieldCombo);
  ratioFlexTable.setWidget(0,2,new Text("String_Node_Str"));
  ratioFlexTable.setWidget(0,3,downBudgetSubFieldCombo);
  ratioFlexTable.setVisible(false);
  codeGrid=new com.extjs.gxt.ui.client.widget.grid.Grid<FlexibleElementDTO>(new ListStore<FlexibleElementDTO>(),createCodeGridColumnModel());
  codeGrid.setAutoHeight(false);
  codeGrid.setAutoExpandColumn(FlexibleElementDTO.CODE);
  codeGrid.setHeight(200);
  codeGridHeaderLabel=new com.extjs.gxt.ui.client.widget.Label(I18N.CONSTANTS.adminFlexibleComputationCodeGridHeader());
  codeGridHeaderLabel.addStyleName(STYLE_FORM_ITEM);
  contactTypeField=Forms.combobox(I18N.CONSTANTS.adminFlexibleElementContactListTypeFilter(),false,EnumModel.VALUE_FIELD,EnumModel.DISPLAY_FIELD);
  contactTypeClearableField=new ClearableField<EnumModel<ContactModelType>>(contactTypeField);
  contactModelsField=new ListComboBox<ContactModelDTO>(ContactModelDTO.ID,ContactModelDTO.NAME);
  contactModelsField.initComponent();
  contactModelsContainer=Forms.adapter(I18N.CONSTANTS.adminFlexibleElementContactListModelFilter(),contactModelsField);
  contactNumberLimit=Forms.number(I18N.CONSTANTS.adminFlexibleElementContactListLimit(),false,false,false);
  contactIsMember=Forms.checkbox("String_Node_Str",null,I18N.CONSTANTS.adminFlexibleElementContactListIsMember(),false);
  specificForm=Forms.panel(150);
  specificForm.add(bannerField);
  specificForm.add(bannerPositionField);
  specificForm.add(formulaField);
  specificForm.add(formulaHintLabel);
  specificForm.add(codeField);
  specificForm.add(lengthField);
  specificForm.add(decimalField);
  specificForm.add(minLimitField);
  specificForm.add(maxLimitField);
  specificForm.add(minDateField);
  specificForm.add(maxDateField);
  specificForm.add(reportModelField);
  specificForm.add(multipleChoicesField);
  specificForm.add(qualityLinkField);
  specificForm.add(categoryTypeField);
  specificForm.add(customChoiceAddField);
  specificForm.add(customChoicesField);
  specificForm.add(codeGridHeaderLabel);
  specificForm.add(codeGrid);
  specificForm.add(contactNumberLimit);
  specificForm.add(contactTypeClearableField);
  specificForm.add(contactIsMember);
  specificForm.add(contactModelsContainer);
  specificForm.add(budgetFields);
  specificForm.add(anchorAddSubField);
  specificForm.add(ratioFlexTable);
  specificForm.add(budgetSubFieldSpentCombo);
  specificForm.add(budgetSubFieldPlannedCombo);
  saveButton=Forms.button(I18N.CONSTANTS.save(),IconImageBundle.ICONS.save());
  final FormPanel buttonFormPanel=Forms.panel();
  buttonFormPanel.addButton(saveButton);
  final Grid mainContainer=new Grid(3,2);
  mainContainer.setWidth("String_Node_Str");
  mainContainer.getElement().getStyle().setTableLayout(TableLayout.FIXED);
  mainContainer.getColumnFormatter().getElement(0).getStyle().setProperty("String_Node_Str","String_Node_Str");
  mainContainer.getColumnFormatter().getElement(1).getStyle().setProperty("String_Node_Str","String_Node_Str");
  mainContainer.getRowFormatter().setVerticalAlign(1,HasVerticalAlignment.ALIGN_TOP);
  mainContainer.setWidget(0,0,Forms.header(I18N.CONSTANTS.adminFlexible_form_header_common()));
  mainContainer.setWidget(0,1,Forms.header(I18N.CONSTANTS.adminFlexible_form_header_specific()));
  mainContainer.setWidget(1,0,commonForm);
  mainContainer.setWidget(1,1,specificForm);
  mainContainer.setWidget(2,1,buttonFormPanel);
  initPopup(mainContainer);
}