Program: 145044
Project: 145044
Buggy source:
public boolean startRestore(InputStream input){
  J2MEDisplay.setView(view);
  view.addToMessage(Localization.get("String_Node_Str"));
  final String[] restoreIDWrapper={null};
  errorsOccurred=false;
  boolean success=false;
  String restoreID=null;
  String[] parseErrors=new String[0];
  try {
    beginTransaction();
    DataModelPullParser parser=new DataModelPullParser(input,new TransactionParserFactory(){
      public TransactionParser getParser(      String name,      String namespace,      KXmlParser parser){
        if (name.toLowerCase().equals("String_Node_Str")) {
          return new CaseXmlParser(parser,caseTallies);
        }
 else         if (name.toLowerCase().equals("String_Node_Str")) {
          return new UserXmlParser(parser);
        }
 else         if (name.equalsIgnoreCase("String_Node_Str")) {
          return new TransactionParser<String>(parser,"String_Node_Str",null){
            public void commit(            String parsed) throws IOException {
            }
            public String parse() throws XmlPullParserException, IOException {
              String restoreID=parser.nextText().trim();
              restoreIDWrapper[0]=restoreID;
              return restoreID;
            }
          }
;
        }
        return null;
      }
    }
);
    success=parser.parse();
    restoreID=restoreIDWrapper[0];
    if (success) {
      PropertyManager._().setProperty(CommCareProperties.LAST_SUCCESSFUL_SYNC,restoreID);
      PropertyManager._().setProperty(CommCareProperties.LAST_SYNC_AT,DateUtils.formatDateTime(new Date(),DateUtils.FORMAT_ISO8601));
    }
    parseErrors=parser.getParseErrors();
  }
 catch (  IOException e) {
    fail(Localization.get("String_Node_Str"),e,null);
    return false;
  }
catch (  InvalidStructureException e) {
    fail(Localization.get("String_Node_Str"),e,null);
    return false;
  }
catch (  XmlPullParserException e) {
    fail(Localization.get("String_Node_Str"),e,null);
    return false;
  }
catch (  UnfullfilledRequirementsException e) {
    fail(Localization.get("String_Node_Str"),e,null);
    return false;
  }
catch (  RuntimeException e) {
    success=false;
  }
 finally {
    if (success) {
      commitTransaction();
    }
 else {
      rollbackTransaction();
    }
  }
  if (success) {
    view.addToMessage(Localization.get("String_Node_Str"));
    Logger.log("String_Node_Str","String_Node_Str" + (restoreID != null ? restoreID : "String_Node_Str"));
  }
 else {
    if (noPartial) {
      view.addToMessage(Localization.get("String_Node_Str"));
    }
 else {
      view.addToMessage(Localization.get("String_Node_Str") + "String_Node_Str" + parseErrors.length);
    }
    Logger.log("String_Node_Str",(noPartial ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str" + (restoreID != null ? restoreID : "String_Node_Str"));
    for (    String s : parseErrors) {
      Logger.log("String_Node_Str","String_Node_Str" + s);
    }
    errorsOccurred=true;
  }
  done();
  return success || !noPartial;
}

Fixed version (ground truth):
public boolean startRestore(InputStream input){
  J2MEDisplay.setView(view);
  view.addToMessage(Localization.get("String_Node_Str"));
  final String[] restoreIDWrapper={null};
  errorsOccurred=false;
  boolean success=false;
  String restoreID=null;
  String[] parseErrors=new String[0];
  try {
    beginTransaction();
    DataModelPullParser parser=new DataModelPullParser(input,new TransactionParserFactory(){
      public TransactionParser getParser(      String name,      String namespace,      KXmlParser parser){
        if (name.toLowerCase().equals("String_Node_Str")) {
          return new CaseXmlParser(parser,caseTallies,!noPartial);
        }
 else         if (name.toLowerCase().equals("String_Node_Str")) {
          return new UserXmlParser(parser);
        }
 else         if (name.equalsIgnoreCase("String_Node_Str")) {
          return new TransactionParser<String>(parser,"String_Node_Str",null){
            public void commit(            String parsed) throws IOException {
            }
            public String parse() throws XmlPullParserException, IOException {
              String restoreID=parser.nextText().trim();
              restoreIDWrapper[0]=restoreID;
              return restoreID;
            }
          }
;
        }
        return null;
      }
    }
);
    success=parser.parse();
    restoreID=restoreIDWrapper[0];
    if (success) {
      PropertyManager._().setProperty(CommCareProperties.LAST_SUCCESSFUL_SYNC,restoreID);
      PropertyManager._().setProperty(CommCareProperties.LAST_SYNC_AT,DateUtils.formatDateTime(new Date(),DateUtils.FORMAT_ISO8601));
    }
    parseErrors=parser.getParseErrors();
  }
 catch (  IOException e) {
    fail(Localization.get("String_Node_Str"),e,null);
    return false;
  }
catch (  InvalidStructureException e) {
    fail(Localization.get("String_Node_Str"),e,null);
    return false;
  }
catch (  XmlPullParserException e) {
    fail(Localization.get("String_Node_Str"),e,null);
    return false;
  }
catch (  UnfullfilledRequirementsException e) {
    fail(Localization.get("String_Node_Str"),e,null);
    return false;
  }
catch (  RuntimeException e) {
    success=false;
  }
 finally {
    if (success) {
      commitTransaction();
    }
 else {
      rollbackTransaction();
    }
  }
  if (success) {
    view.addToMessage(Localization.get("String_Node_Str"));
    Logger.log("String_Node_Str","String_Node_Str" + (restoreID != null ? restoreID : "String_Node_Str"));
  }
 else {
    if (noPartial) {
      view.addToMessage(Localization.get("String_Node_Str"));
    }
 else {
      view.addToMessage(Localization.get("String_Node_Str") + "String_Node_Str" + parseErrors.length);
    }
    Logger.log("String_Node_Str",(noPartial ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str" + (restoreID != null ? restoreID : "String_Node_Str"));
    for (    String s : parseErrors) {
      Logger.log("String_Node_Str","String_Node_Str" + s);
    }
    errorsOccurred=true;
  }
  done();
  return success || !noPartial;
}