Program: 144987
Project: 144987
Buggy source:
/** 
 * Get the workflow for how to manage each step in the pre/post processing workflow. TODO: This can/should be shared with JavaRosa core, probably. Safest way to stay in sync WRT SMS transport, etc.
 */
private FormTransportWorkflow getWorkflowFactory(final SubmissionProfile profile){
  if (CommCareProperties.SEND_STYLE_NONE.equals(profile.getMethod())) {
    return new FormTransportWorkflow(){
      public void preProcessing(      FormInstance instance){
      }
      public void postProcessing(){
        CommCareFormEntryState.this.goHome();
      }
    }
;
  }
 else   if (CommCareProperties.SEND_STYLE_FILE.equals(profile.getMethod())) {
    return new FormTransportWorkflow(){
      public void preProcessing(      FormInstance instance){
      }
      public void postProcessing(){
        CommCareFormEntryState.this.goHome();
      }
    }
;
  }
 else {
    return new FormTransportWorkflow(){
      TransportMessage message;
      boolean cacheable;
      public void preProcessing(      FormInstance instance){
        try {
          cacheable=profile.getMethod().equals(METHOD_POST);
          message=SubmissionTransportHelper.createMessage(instance,profile,cacheable);
          if (cacheable) {
            TransportService.send(message,0,0);
            Logger.log("String_Node_Str","String_Node_Str" + PropertyUtils.trim(message.getCacheIdentifier(),6));
          }
 else {
            Logger.log("String_Node_Str","String_Node_Str" + profile.getMethod() + "String_Node_Str");
            TransportService.send(message,3,0);
          }
        }
 catch (        IOException e) {
          e.printStackTrace();
          Logger.die("String_Node_Str",e);
          return;
        }
catch (        TransportException e) {
          e.printStackTrace();
          Logger.die("String_Node_Str",e);
          return;
        }
      }
      public void postProcessing(){
        CommCarePostFormEntryState httpAskSendState=new CommCarePostFormEntryState(message,CommCareSense.isAutoSendEnabled() || cacheable){
          public void goHome(){
            if (CommCareSense.isAutoSendEnabled()) {
              AutomatedSenderService.NotifyPending();
            }
            CommCareFormEntryState.this.goHome();
          }
        }
;
        J2MEDisplay.startStateWithLoadingScreen(httpAskSendState);
      }
    }
;
  }
}

Fixed version (ground truth):
/** 
 * Get the workflow for how to manage each step in the pre/post processing workflow. TODO: This can/should be shared with JavaRosa core, probably. Safest way to stay in sync WRT SMS transport, etc.
 */
private FormTransportWorkflow getWorkflowFactory(final SubmissionProfile profile){
  if (CommCareProperties.SEND_STYLE_NONE.equals(profile.getMethod())) {
    return new FormTransportWorkflow(){
      public void preProcessing(      FormInstance instance){
      }
      public void postProcessing(){
        CommCareFormEntryState.this.goHome();
      }
    }
;
  }
 else   if (CommCareProperties.SEND_STYLE_FILE.equals(profile.getMethod())) {
    return new FormTransportWorkflow(){
      public void preProcessing(      FormInstance instance){
      }
      public void postProcessing(){
        CommCareFormEntryState.this.goHome();
      }
    }
;
  }
 else {
    return new FormTransportWorkflow(){
      TransportMessage message;
      boolean cacheable;
      public void preProcessing(      FormInstance instance){
        try {
          cacheable=profile.getMethod().equals(METHOD_POST);
          message=SubmissionTransportHelper.createMessage(instance,profile,cacheable);
          if (cacheable) {
            TransportService.send(message,0,0);
            Logger.log("String_Node_Str","String_Node_Str" + PropertyUtils.trim(message.getCacheIdentifier(),6));
          }
 else {
            Logger.log("String_Node_Str","String_Node_Str" + profile.getMethod() + "String_Node_Str");
            TransportService.send(message,3,0);
          }
        }
 catch (        IOException e) {
          e.printStackTrace();
          Logger.die("String_Node_Str",e);
          return;
        }
catch (        TransportException e) {
          e.printStackTrace();
          Logger.die("String_Node_Str",e);
          return;
        }
      }
      public void postProcessing(){
        CommCarePostFormEntryState httpAskSendState=new CommCarePostFormEntryState(message,CommCareSense.isAutoSendEnabled() || !cacheable){
          public void goHome(){
            if (CommCareSense.isAutoSendEnabled()) {
              AutomatedSenderService.NotifyPending();
            }
            CommCareFormEntryState.this.goHome();
          }
        }
;
        J2MEDisplay.startStateWithLoadingScreen(httpAskSendState);
      }
    }
;
  }
}