Program: 35565
Project: 35565
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void onPageRequest(final PageRequest request){
  currentMode=Mode.fromRequestParameterValue(request != null ? request.getParameter(RequestParameter.TYPE) : null);
  if (currentMode == null) {
    currentMode=Mode.DEFAULT_MODE;
  }
  baseProject=null;
  if (currentMode == Mode.FUNDED_BY_ANOTHER_PROJECT || currentMode == Mode.FUNDING_ANOTHER_PROJECT) {
    baseProject=(ProjectDTO)(request != null ? request.getData(RequestParameter.DTO) : null);
  }
  view.getFormPanel().clearAll();
  view.getModelsField().setEnabled(false);
  view.getOrgUnitsField().setEnabled(false);
  view.getTestProjectsField().getStore().removeAll();
  String preselectedModelName=null;
  if (request != null) {
    if (request.getData(RequestParameter.CODE) != null) {
      view.getNameField().setValue((String)request.getData(RequestParameter.CODE));
    }
    if (request.getData(RequestParameter.TITLE) != null) {
      view.getFullNameField().setValue((String)request.getData(RequestParameter.TITLE));
    }
    if (request.getData(RequestParameter.BUDGET) != null) {
      view.getBudgetField().setValue((Double)request.getData(RequestParameter.BUDGET));
    }
    if (request.getData(RequestParameter.MODEL) != null) {
      preselectedModelName=(String)request.getData(RequestParameter.MODEL);
    }
  }
  loadOrgUnits(currentMode);
  loadProjectModels(currentMode,preselectedModelName);
  loadTestProjects(currentMode);
  final boolean showBudgetField;
  final boolean showOrgUnitsField;
  final boolean showAmountField;
  final String amountFieldLabel;
  final boolean showTestProjectsField;
  final String viewTitle;
switch (currentMode) {
case FUNDED_BY_ANOTHER_PROJECT:
    showBudgetField=true;
  showOrgUnitsField=true;
showAmountField=true;
amountFieldLabel=I18N.MESSAGES.projectFinancesDetails(baseProject.getName()) + "String_Node_Str" + I18N.CONSTANTS.currencyEuro()+ ')';
showTestProjectsField=false;
viewTitle=I18N.CONSTANTS.createProjectTypePartnerCreateDetails();
break;
case FUNDING_ANOTHER_PROJECT:
showBudgetField=true;
showOrgUnitsField=true;
showAmountField=true;
amountFieldLabel=I18N.MESSAGES.projectFundedByDetails(baseProject.getName()) + "String_Node_Str" + I18N.CONSTANTS.currencyEuro()+ ')';
showTestProjectsField=false;
viewTitle=I18N.CONSTANTS.createProjectTypeFundingCreateDetails();
break;
case TEST_PROJECT:
showBudgetField=false;
showOrgUnitsField=false;
showAmountField=false;
amountFieldLabel=null;
showTestProjectsField=true;
viewTitle=I18N.CONSTANTS.createProjectTest();
break;
default :
showBudgetField=true;
showOrgUnitsField=true;
showAmountField=false;
amountFieldLabel=null;
showTestProjectsField=false;
viewTitle=I18N.CONSTANTS.createProject();
break;
}
view.getBudgetField().setVisible(showBudgetField);
view.getBudgetField().setAllowBlank(!showBudgetField);
view.getOrgUnitsField().setVisible(showOrgUnitsField);
view.getOrgUnitsField().setAllowBlank(!showOrgUnitsField);
view.getAmountField().setValue(ZERO);
view.getAmountField().setVisible(showAmountField);
view.getAmountField().setAllowBlank(!showAmountField);
view.getAmountField().setFieldLabel(amountFieldLabel);
view.getPercentageField().setVisible(showAmountField);
view.getTestProjectsField().setVisible(showTestProjectsField);
view.setTitle(viewTitle);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void onPageRequest(final PageRequest request){
  currentMode=Mode.fromRequestParameterValue(request != null ? request.getParameter(RequestParameter.TYPE) : null);
  if (currentMode == null) {
    currentMode=Mode.DEFAULT_MODE;
  }
  baseProject=null;
  if (currentMode == Mode.FUNDED_BY_ANOTHER_PROJECT || currentMode == Mode.FUNDING_ANOTHER_PROJECT) {
    baseProject=(ProjectDTO)(request != null ? request.getData(RequestParameter.DTO) : null);
  }
  view.getFormPanel().clearAll();
  view.getModelsField().setEnabled(false);
  view.getOrgUnitsField().setEnabled(false);
  view.getTestProjectsField().getStore().removeAll();
  String preselectedModelName=null;
  if (request != null) {
    if (request.getData(RequestParameter.CODE) != null) {
      view.getNameField().setValue((String)request.getData(RequestParameter.CODE));
    }
    if (request.getData(RequestParameter.TITLE) != null) {
      view.getFullNameField().setValue((String)request.getData(RequestParameter.TITLE));
    }
    if (request.getData(RequestParameter.BUDGET) != null) {
      view.getBudgetField().setValue((Double)request.getData(RequestParameter.BUDGET));
    }
    if (request.getData(RequestParameter.MODEL) != null) {
      preselectedModelName=(String)request.getData(RequestParameter.MODEL);
    }
  }
  loadOrgUnits(currentMode);
  loadProjectModels(currentMode,preselectedModelName);
  loadTestProjects(currentMode);
  final boolean showBudgetField;
  final boolean showOrgUnitsField;
  final boolean showAmountField;
  final String amountFieldLabel;
  final boolean showTestProjectsField;
  final String viewTitle;
  final String baseProjectBudgetLabel;
  final Double baseProjectBudget;
switch (currentMode) {
case FUNDED_BY_ANOTHER_PROJECT:
    showBudgetField=true;
  showOrgUnitsField=true;
showAmountField=true;
amountFieldLabel=I18N.MESSAGES.projectFinancesDetails(baseProject.getName()) + "String_Node_Str" + I18N.CONSTANTS.currencyEuro()+ ')';
baseProjectBudgetLabel=null;
baseProjectBudget=null;
showTestProjectsField=false;
viewTitle=I18N.CONSTANTS.createProjectTypePartnerCreateDetails();
break;
case FUNDING_ANOTHER_PROJECT:
showBudgetField=true;
showOrgUnitsField=true;
showAmountField=true;
amountFieldLabel=I18N.MESSAGES.projectFundedByDetails(baseProject.getName()) + "String_Node_Str" + I18N.CONSTANTS.currencyEuro()+ ')';
baseProjectBudgetLabel=I18N.MESSAGES.projectFundsDetails(baseProject.getName()) + "String_Node_Str" + I18N.CONSTANTS.currencyEuro()+ ')'+ I18N.CONSTANTS.form_label_separator();
baseProjectBudget=baseProject.getPlannedBudget();
showTestProjectsField=false;
viewTitle=I18N.CONSTANTS.createProjectTypeFundingCreateDetails();
break;
case TEST_PROJECT:
showBudgetField=false;
showOrgUnitsField=false;
showAmountField=false;
amountFieldLabel=null;
baseProjectBudgetLabel=null;
baseProjectBudget=null;
showTestProjectsField=true;
viewTitle=I18N.CONSTANTS.createProjectTest();
break;
default :
showBudgetField=true;
showOrgUnitsField=true;
showAmountField=false;
amountFieldLabel=null;
baseProjectBudgetLabel=null;
baseProjectBudget=null;
showTestProjectsField=false;
viewTitle=I18N.CONSTANTS.createProject();
break;
}
view.getBudgetField().setVisible(showBudgetField);
view.getBudgetField().setAllowBlank(!showBudgetField);
view.getOrgUnitsField().setVisible(showOrgUnitsField);
view.getOrgUnitsField().setAllowBlank(!showOrgUnitsField);
view.getBaseProjectBudgetField().setFieldLabel(baseProjectBudgetLabel);
view.getBaseProjectBudgetField().setValue(baseProjectBudget != null ? baseProjectBudget : ZERO);
view.getBaseProjectBudgetField().setVisible(baseProjectBudget != null);
view.getAmountField().setValue(ZERO);
view.getAmountField().setVisible(showAmountField);
view.getAmountField().setAllowBlank(!showAmountField);
view.getAmountField().setFieldLabel(amountFieldLabel);
view.getPercentageField().setVisible(showAmountField);
view.getTestProjectsField().setVisible(showTestProjectsField);
view.setTitle(viewTitle);
}