Source:
<code>public Response importBranches(BranchImportOptions options) { setUpHttpHeaders(); List<IOseeBranch> branches; if (!options.getBranchUuids().isEmpty()) { branches = getExportImportBranches(options.getBranchUuids()); } else { branches = Collections.emptyList(); } String path = options.getExchangeFile(); String exchangePath = asExchangeLocator(path); IResourceLocator locator = resourceManager.getResourceLocator(exchangePath); PropertyStore importOptions = new PropertyStore(); addOption(importOptions, ImportOptions.MIN_TXS, options.getMinTx()); addOption(importOptions, ImportOptions.MAX_TXS, options.getMaxTx()); addOption(importOptions, ImportOptions.USE_IDS_FROM_IMPORT_FILE, options.isUseIdsFromImportFile()); addOption(importOptions, ImportOptions.EXCLUDE_BASELINE_TXS, options.isExcludeBaselineTxs()); addOption(importOptions, ImportOptions.ALL_AS_ROOT_BRANCHES, options.isAllAsRootBranches()); addOption(importOptions, ImportOptions.CLEAN_BEFORE_IMPORT, options.isCleanBeforeImport()); Callable<URI> op = getBranchOps().importBranch(locator.getLocation(), branches, importOptions); URI importURI = executeCallable(op); Response response; if (importURI != null) { UriInfo uriInfo = getUriInfo(); URI location = getExchangeResourceURI(uriInfo, importURI); response = Response.created(location).build(); } else { response = Response.ok().build(); } <START> <END> activityLog.createEntry(BRANCH_OPERATION_TYPEID, ActivityLog.INITIAL_STATUS, String.format("Branch Operation Import Branches {branchUUID(s): %s accountId: %s serverId: %s clientId: %s}", branches.toString(), accountId, serverId, clientId)); return response; }</code><technical_language>try/catch</technical_language>

Target:
public Response importBranches(BranchImportOptions options) { List<IOseeBranch> branches; if (!options.getBranchUuids().isEmpty()) { branches = getExportImportBranches(options.getBranchUuids()); } else { branches = Collections.emptyList(); } String path = options.getExchangeFile(); String exchangePath = asExchangeLocator(path); IResourceLocator locator = resourceManager.getResourceLocator(exchangePath); PropertyStore importOptions = new PropertyStore(); addOption(importOptions, ImportOptions.MIN_TXS, options.getMinTx()); addOption(importOptions, ImportOptions.MAX_TXS, options.getMaxTx()); addOption(importOptions, ImportOptions.USE_IDS_FROM_IMPORT_FILE, options.isUseIdsFromImportFile()); addOption(importOptions, ImportOptions.EXCLUDE_BASELINE_TXS, options.isExcludeBaselineTxs()); addOption(importOptions, ImportOptions.ALL_AS_ROOT_BRANCHES, options.isAllAsRootBranches()); addOption(importOptions, ImportOptions.CLEAN_BEFORE_IMPORT, options.isCleanBeforeImport()); Callable<URI> op = getBranchOps().importBranch(locator.getLocation(), branches, importOptions); URI importURI = executeCallable(op); Response response; if (importURI != null) { UriInfo uriInfo = getUriInfo(); URI location = getExchangeResourceURI(uriInfo, importURI); response = Response.created(location).build(); } else { response = Response.ok().build(); } try { activityLog.createEntry(BRANCH_OPERATION_TYPEID, ActivityLog.INITIAL_STATUS, String.format( "Branch Operation Import Branches {branchUUID(s): %s accountId: %s serverId: %s clientId: %s}", branches.toString(), RestUtil.getAccountId(httpHeaders), RestUtil.getServerId(httpHeaders), RestUtil.getClientId(httpHeaders))); } catch (OseeCoreException ex) { OseeLog.log(ActivityLog.class, OseeLevel.SEVERE_POPUP, ex); } return response; }