Source:
<code>private static TransactionParserFactory getFactory(final SQLiteDatabase db, final boolean bulkProcessingEnabled) { final Hashtable<String, String> formInstanceNamespaces; if (CommCareApplication.instance().getCurrentApp() != null) { formInstanceNamespaces = FormSaveUtil.getNamespaceToFilePathMap(CommCareApplication.instance()); } else { formInstanceNamespaces = null; } return new TransactionParserFactory() { @Override public TransactionParser getParser(KXmlParser parser) { String namespace = parser.getNamespace(); if (namespace != null && formInstanceNamespaces != null && formInstanceNamespaces.containsKey(namespace)) { return new FormInstanceXmlParser(parser, CommCareApplication.instance(), Collections.unmodifiableMap(formInstanceNamespaces), CommCareApplication.instance().getCurrentApp().fsPath(GlobalConstants.FILE_CC_FORMS)); } else if(CaseXmlParser.CASE_XML_NAMESPACE.equals(parser.getNamespace()) && "case".equalsIgnoreCase(parser.getName())) { if(bulkProcessingEnabled) { <START> return new AndroidBulkCaseXmlParser(parser, getCaseStorage(db), new EntityStorageCache("case", db, ReportingUtils.getAppId()), new AndroidCaseIndexTable(db)) { <END> @Override protected SQLiteDatabase getDbHandle() { return db; } }; } else { return new AndroidCaseXmlParser(parser, getCaseStorage(db), new EntityStorageCache("case", db, ReportingUtils.getAppId()), new AndroidCaseIndexTable(db)) { @Override protected SQLiteDatabase getDbHandle() { return db; } }; } } else if (LedgerXmlParsers.STOCK_XML_NAMESPACE.equals(namespace)) { return new LedgerXmlParsers(parser, getLedgerStorage(db)); } return null; } }; }</code><technical_language>Hm, guess is fundamental data type (EntityStoreCache) allowed get created App ID, if fail fail laziy, load entity cache if app ID available. operations app ID, case allow loaded in a functions work, relies appID fails if try in mode</technical_language>

Target:
private static TransactionParserFactory getFactory(final SQLiteDatabase db, final boolean bulkProcessingEnabled) { final Hashtable<String, String> formInstanceNamespaces; if (CommCareApplication.instance().getCurrentApp() != null) { formInstanceNamespaces = FormSaveUtil.getNamespaceToFilePathMap(CommCareApplication.instance()); } else { formInstanceNamespaces = null; } return new TransactionParserFactory() { @Override public TransactionParser getParser(KXmlParser parser) { String namespace = parser.getNamespace(); if (namespace != null && formInstanceNamespaces != null && formInstanceNamespaces.containsKey(namespace)) { return new FormInstanceXmlParser(parser, CommCareApplication.instance(), Collections.unmodifiableMap(formInstanceNamespaces), CommCareApplication.instance().getCurrentApp().fsPath(GlobalConstants.FILE_CC_FORMS)); } else if (CaseXmlParser.CASE_XML_NAMESPACE.equals(parser.getNamespace()) && "case".equalsIgnoreCase(parser.getName())) { EntityStorageCache entityStorageCache = null; if (CommCareApplication.instance().getCurrentApp() != null) { entityStorageCache = new EntityStorageCache("case", db, AppUtils.getCurrentAppId()); } if (bulkProcessingEnabled) { return new AndroidBulkCaseXmlParser(parser, getCaseStorage(db), entityStorageCache, new AndroidCaseIndexTable(db)) { @Override protected SQLiteDatabase getDbHandle() { return db; } }; } else { return new AndroidCaseXmlParser(parser, getCaseStorage(db), entityStorageCache, new AndroidCaseIndexTable(db)) { @Override protected SQLiteDatabase getDbHandle() { return db; } }; } } else if (LedgerXmlParsers.STOCK_XML_NAMESPACE.equals(namespace)) { return new LedgerXmlParsers(parser, getLedgerStorage(db)); } return null; } }; }