Program: 60765
Project: 60765
Buggy source:
public AbstractSchedTaskModalPage(final ModalWindow window,final SchedTaskTO taskTO){
  super(taskTO);
  crontab=new WebMarkupContainer("String_Node_Str");
  crontab.setOutputMarkupId(true);
  form.add(crontab);
  final AjaxTextFieldPanel lastExec=new AjaxTextFieldPanel("String_Node_Str",getString("String_Node_Str"),new DateFormatROModel(new PropertyModel<String>(taskTO,"String_Node_Str")),false);
  lastExec.setEnabled(false);
  profile.add(lastExec);
  final AjaxTextFieldPanel nextExec=new AjaxTextFieldPanel("String_Node_Str",getString("String_Node_Str"),new DateFormatROModel(new PropertyModel<String>(taskTO,"String_Node_Str")),false);
  nextExec.setEnabled(false);
  profile.add(nextExec);
  final DropDownChoice<String> cronTemplateChooser=new DropDownChoice("String_Node_Str",new PropertyModel(taskTO,"String_Node_Str"),Arrays.asList(CRON_TEMPLATES),new SelectChoiceRenderer()){
    private static final long serialVersionUID=-5843424545478691442L;
    @Override protected CharSequence getDefaultChoice(    String selected){
      return "String_Node_Str" + getString("String_Node_Str") + "String_Node_Str";
    }
  }
;
  final TextField seconds=new TextField("String_Node_Str",new Model(getCronField(taskTO.getCronExpression(),0)));
  crontab.add(seconds);
  final TextField minutes=new TextField("String_Node_Str",new Model(getCronField(taskTO.getCronExpression(),1)));
  crontab.add(minutes);
  final TextField hours=new TextField("String_Node_Str",new Model(getCronField(taskTO.getCronExpression(),2)));
  crontab.add(hours);
  final TextField daysOfMonth=new TextField("String_Node_Str",new Model(getCronField(taskTO.getCronExpression(),3)));
  crontab.add(daysOfMonth);
  final TextField months=new TextField("String_Node_Str",new Model(getCronField(taskTO.getCronExpression(),4)));
  crontab.add(months);
  final TextField daysOfWeek=new TextField("String_Node_Str",new Model(getCronField(taskTO.getCronExpression(),5)));
  crontab.add(daysOfWeek);
  cronTemplateChooser.add(new AjaxFormComponentUpdatingBehavior("String_Node_Str"){
    private static final long serialVersionUID=-1107858522700306810L;
    @Override protected void onUpdate(    final AjaxRequestTarget target){
      seconds.setModelObject(getCronField(cronTemplateChooser,0));
      minutes.setModelObject(getCronField(cronTemplateChooser,1));
      hours.setModelObject(getCronField(cronTemplateChooser,2));
      daysOfMonth.setModelObject(getCronField(cronTemplateChooser,3));
      months.setModelObject(getCronField(cronTemplateChooser,4));
      daysOfWeek.setModelObject(getCronField(cronTemplateChooser,5));
      target.add(crontab);
    }
  }
);
  crontab.add(cronTemplateChooser);
  final IndicatingAjaxButton submit=new IndicatingAjaxButton("String_Node_Str",new ResourceModel("String_Node_Str")){
    private static final long serialVersionUID=-958724007591692537L;
    @Override protected void onSubmit(    final AjaxRequestTarget target,    final Form form){
      SchedTaskTO taskTO=(SchedTaskTO)form.getModelObject();
      if (!StringUtils.hasText(taskTO.getCronExpression()) || "String_Node_Str".equals(taskTO.getCronExpression())) {
        taskTO.setCronExpression(null);
      }
 else {
        taskTO.setCronExpression(getCron(seconds,minutes,hours,daysOfMonth,months,daysOfWeek));
      }
      try {
        if (taskTO.getId() > 0) {
          if (taskTO instanceof SyncTaskTO) {
            taskTO=taskRestClient.updateSyncTask((SyncTaskTO)taskTO);
          }
 else {
            taskTO=taskRestClient.updateSchedTask(taskTO);
          }
        }
 else {
          if (taskTO instanceof SyncTaskTO) {
            taskTO=taskRestClient.createSyncTask((SyncTaskTO)taskTO);
          }
 else {
            taskTO=taskRestClient.createSchedTask(taskTO);
          }
        }
        window.close(target);
      }
 catch (      SyncopeClientCompositeErrorException e) {
        LOG.error("String_Node_Str",e);
        error(getString("String_Node_Str") + "String_Node_Str" + e.getMessage());
      }
    }
    @Override protected void onError(    AjaxRequestTarget target,    Form form){
      target.add(feedbackPanel);
    }
  }
;
  if (taskTO.getId() > 0) {
    MetaDataRoleAuthorizationStrategy.authorize(submit,RENDER,xmlRolesReader.getAllAllowedRoles("String_Node_Str","String_Node_Str"));
  }
 else {
    MetaDataRoleAuthorizationStrategy.authorize(submit,RENDER,xmlRolesReader.getAllAllowedRoles("String_Node_Str","String_Node_Str"));
  }
  form.add(submit);
}

Fixed version (ground truth):
public AbstractSchedTaskModalPage(final ModalWindow window,final SchedTaskTO taskTO,final PageReference callerPageRef){
  super(taskTO);
  crontab=new WebMarkupContainer("String_Node_Str");
  crontab.setOutputMarkupId(true);
  form.add(crontab);
  final AjaxTextFieldPanel lastExec=new AjaxTextFieldPanel("String_Node_Str",getString("String_Node_Str"),new DateFormatROModel(new PropertyModel<String>(taskTO,"String_Node_Str")),false);
  lastExec.setEnabled(false);
  profile.add(lastExec);
  final AjaxTextFieldPanel nextExec=new AjaxTextFieldPanel("String_Node_Str",getString("String_Node_Str"),new DateFormatROModel(new PropertyModel<String>(taskTO,"String_Node_Str")),false);
  nextExec.setEnabled(false);
  profile.add(nextExec);
  final DropDownChoice<String> cronTemplateChooser=new DropDownChoice("String_Node_Str",new PropertyModel(taskTO,"String_Node_Str"),Arrays.asList(CRON_TEMPLATES),new SelectChoiceRenderer()){
    private static final long serialVersionUID=-5843424545478691442L;
    @Override protected CharSequence getDefaultChoice(    String selected){
      return "String_Node_Str" + getString("String_Node_Str") + "String_Node_Str";
    }
  }
;
  final TextField seconds=new TextField("String_Node_Str",new Model(getCronField(taskTO.getCronExpression(),0)));
  crontab.add(seconds);
  final TextField minutes=new TextField("String_Node_Str",new Model(getCronField(taskTO.getCronExpression(),1)));
  crontab.add(minutes);
  final TextField hours=new TextField("String_Node_Str",new Model(getCronField(taskTO.getCronExpression(),2)));
  crontab.add(hours);
  final TextField daysOfMonth=new TextField("String_Node_Str",new Model(getCronField(taskTO.getCronExpression(),3)));
  crontab.add(daysOfMonth);
  final TextField months=new TextField("String_Node_Str",new Model(getCronField(taskTO.getCronExpression(),4)));
  crontab.add(months);
  final TextField daysOfWeek=new TextField("String_Node_Str",new Model(getCronField(taskTO.getCronExpression(),5)));
  crontab.add(daysOfWeek);
  cronTemplateChooser.add(new AjaxFormComponentUpdatingBehavior("String_Node_Str"){
    private static final long serialVersionUID=-1107858522700306810L;
    @Override protected void onUpdate(    final AjaxRequestTarget target){
      seconds.setModelObject(getCronField(cronTemplateChooser,0));
      minutes.setModelObject(getCronField(cronTemplateChooser,1));
      hours.setModelObject(getCronField(cronTemplateChooser,2));
      daysOfMonth.setModelObject(getCronField(cronTemplateChooser,3));
      months.setModelObject(getCronField(cronTemplateChooser,4));
      daysOfWeek.setModelObject(getCronField(cronTemplateChooser,5));
      target.add(crontab);
    }
  }
);
  crontab.add(cronTemplateChooser);
  final IndicatingAjaxButton submit=new IndicatingAjaxButton("String_Node_Str",new ResourceModel("String_Node_Str")){
    private static final long serialVersionUID=-958724007591692537L;
    @Override protected void onSubmit(    final AjaxRequestTarget target,    final Form form){
      SchedTaskTO taskTO=(SchedTaskTO)form.getModelObject();
      if (!StringUtils.hasText(taskTO.getCronExpression()) || "String_Node_Str".equals(taskTO.getCronExpression())) {
        taskTO.setCronExpression(null);
      }
 else {
        taskTO.setCronExpression(getCron(seconds,minutes,hours,daysOfMonth,months,daysOfWeek));
      }
      try {
        if (taskTO.getId() > 0) {
          if (taskTO instanceof SyncTaskTO) {
            taskTO=taskRestClient.updateSyncTask((SyncTaskTO)taskTO);
          }
 else {
            taskTO=taskRestClient.updateSchedTask(taskTO);
          }
        }
 else {
          if (taskTO instanceof SyncTaskTO) {
            taskTO=taskRestClient.createSyncTask((SyncTaskTO)taskTO);
          }
 else {
            taskTO=taskRestClient.createSchedTask(taskTO);
          }
        }
        ((BasePage)callerPageRef.getPage()).setModalResult(true);
        window.close(target);
      }
 catch (      SyncopeClientCompositeErrorException e) {
        LOG.error("String_Node_Str",e);
        error(getString("String_Node_Str") + "String_Node_Str" + e.getMessage());
        target.add(feedbackPanel);
      }
    }
    @Override protected void onError(    final AjaxRequestTarget target,    final Form form){
      target.add(feedbackPanel);
    }
  }
;
  if (taskTO.getId() > 0) {
    MetaDataRoleAuthorizationStrategy.authorize(submit,RENDER,xmlRolesReader.getAllAllowedRoles("String_Node_Str","String_Node_Str"));
  }
 else {
    MetaDataRoleAuthorizationStrategy.authorize(submit,RENDER,xmlRolesReader.getAllAllowedRoles("String_Node_Str","String_Node_Str"));
  }
  form.add(submit);
}