auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void renderOptimizeRangeRequests() { line("private RangeRequest optimizeColumnSelection(RangeRequest range) {"); { line("if (range.getColumnNames().isEmpty()) {"); { line("return range.getBuilder().retainColumns(allColumns).build();"); } line("}"); line("return range;"); } line("}"); line(); line("private Iterable<RangeRequest> optimizeColumnSelections(Iterable<RangeRequest> ranges) {"); { line("return Iterables.transform(ranges, this::optimizeColumnSelection);"); } line("}"); }

Target:
private void renderOptimizeRangeRequests() { line("private RangeRequest optimizeRangeRequest(RangeRequest range) {"); { line("if (range.getColumnNames().isEmpty()) {"); { line("return range.getBuilder().retainColumns(allColumns).build();"); } line("}"); line("return range;"); } line("}"); line(); line("private Iterable<RangeRequest> optimizeRangeRequests(Iterable<RangeRequest> ranges) {"); { line("return Iterables.transform(ranges, this::optimizeRangeRequest);"); } line("}"); }
Source:
public BlockUseHandler getItemHandler() { return e -> { e.cancel(); Player p = e.getPlayer(); if (p.hasPermission("slimefun.inventory.bypass") || (SlimefunPlugin.getProtectionManager().hasPermission( p, e.getClickedBlock().get().getLocation(), ProtectableAction.ACCESS_INVENTORIES)) && Slimefun.hasUnlocked(p, item, false) ) { SlimefunPlugin.getGPSNetwork().openTransmitterControlPanel(p); } else { SlimefunPlugin.getLocalization().sendMessage(p, "inventory.no-access", true); } }; }

Target:
public BlockUseHandler getItemHandler() { return e -> { e.cancel(); Player p = e.getPlayer(); if (p.hasPermission("slimefun.gps.bypass") || (SlimefunPlugin.getProtectionManager().hasPermission( p, e.getClickedBlock().get().getLocation(), ProtectableAction.ACCESS_INVENTORIES)) ) { SlimefunPlugin.getGPSNetwork().openTransmitterControlPanel(p); } else { SlimefunPlugin.getLocalization().sendMessage(p, "inventory.no-access", true); } }; }
Source:
public void onDateSet(DatePicker view, int year, int month, int day) { GregorianCalendar calendar = new GregorianCalendar(year, month, day); try { showSpinner(R.string.box_sharesdk_fetching_collaborators, R.string.boxsdk_Please_wait); mController.executeRequest(BoxItem.class, mController.getCreatedSharedLinkRequest(mShareItem).setUnsharedAt(calendar.getTime())).addOnCompletedListener(mBoxItemListener); } catch (Exception e){ dismissSpinner(); mController.showToast(getActivity(), "invalid time selected"); } }

Target:
public void onDateSet(DatePicker view, int year, int month, int day) { GregorianCalendar calendar = new GregorianCalendar(year, month, day); try { showSpinner(R.string.box_sharesdk_updating_link_access, R.string.boxsdk_Please_wait); mController.executeRequest(BoxItem.class, mController.getCreatedSharedLinkRequest(mShareItem).setUnsharedAt(calendar.getTime())).addOnCompletedListener(mBoxItemListener); } catch (Exception e){ dismissSpinner(); mController.showToast(getActivity(), "invalid time selected"); } }
Source:
private void handleBinaryWebSocketMessage(BinaryCarbonMessage binaryCarbonMessage, PatternPathRouter.RoutableDestination<Object> routableEndpoint, Session session) { Object webSocketEndpoint = routableEndpoint.getDestination(); Map<String, String> paramValues = routableEndpoint.getGroupNameValues(); Method method = new EndpointDispatcher().getOnBinaryMessageMethod(webSocketEndpoint); try { List<Object> parameterList = new LinkedList<>(); Arrays.stream(method.getParameters()).forEach( parameter -> { if (parameter.getType() == ByteBuffer.class) { parameterList.add(binaryCarbonMessage.readBytes()); } else if (parameter.getType() == byte[].class) { ByteBuffer buffer = binaryCarbonMessage.readBytes(); byte[] bytes = new byte[buffer.capacity()]; for (int i = 0; i < buffer.capacity(); i++) { bytes[i] = buffer.get(); } parameterList.add(bytes); } else if (parameter.getType() == boolean.class) { parameterList.add(binaryCarbonMessage.isFinalFragment()); } else if (parameter.getType() == Session.class) { parameterList.add(session); } else if (parameter.getType() == String.class) { PathParam pathParam = parameter.getAnnotation(PathParam.class); if (pathParam != null) { parameterList.add(paramValues.get(pathParam.value())); } else { parameterList.add(null); throw new IllegalArgumentException("String parameters without" + " @PathParam annotation"); } } else { parameterList.add(null); } } ); executeMethod(method, webSocketEndpoint, parameterList, session); } catch (Throwable throwable) { handleError(binaryCarbonMessage, throwable, routableEndpoint, session); } }

Target:
private void handleBinaryWebSocketMessage(BinaryCarbonMessage binaryCarbonMessage, PatternPathRouter.RoutableDestination<Object> routableEndpoint, Session session) { Object webSocketEndpoint = routableEndpoint.getDestination(); Map<String, String> paramValues = routableEndpoint.getGroupNameValues(); Optional<Method> methodOptional = new EndpointDispatcher().getOnBinaryMessageMethod(webSocketEndpoint); try { methodOptional.ifPresent( method -> { List<Object> parameterList = new LinkedList<>(); Arrays.stream(method.getParameters()).forEach( parameter -> { if (parameter.getType() == ByteBuffer.class) { parameterList.add(binaryCarbonMessage.readBytes()); } else if (parameter.getType() == byte[].class) { ByteBuffer buffer = binaryCarbonMessage.readBytes(); byte[] bytes = new byte[buffer.capacity()]; for (int i = 0; i < buffer.capacity(); i++) { bytes[i] = buffer.get(); } parameterList.add(bytes); } else if (parameter.getType() == boolean.class) { parameterList.add(binaryCarbonMessage.isFinalFragment()); } else if (parameter.getType() == Session.class) { parameterList.add(session); } else if (parameter.getType() == String.class) { PathParam pathParam = parameter.getAnnotation(PathParam.class); if (pathParam != null) { parameterList.add(paramValues.get(pathParam.value())); } else { throw new IllegalArgumentException("String parameters without" + " @PathParam annotation"); } } else { parameterList.add(null); } } ); executeMethod(method, webSocketEndpoint, parameterList, session); } ); } catch (Throwable throwable) { handleError(throwable, routableEndpoint, session); } }
Source:
private void setNonOperational(VDS server) { Map<String, String> customValues = new HashMap<String, String>(); customValues.put(GlusterConstants.COMMAND, "gluster peer probe"); SetNonOperationalVdsParameters nonOpParams = new SetNonOperationalVdsParameters(server.getId(), NonOperationalReason.GLUSTER_COMMAND_FAILED, customValues); nonOpParams.setSaveToDb(true); Backend.getInstance().runInternalAction(VdcActionType.SetNonOperationalVds, nonOpParams, ExecutionHandler.createInternalJobContext()); }

Target:
private void setNonOperational(VDS server) { SetNonOperationalVdsParameters nonOpParams = new SetNonOperationalVdsParameters(server.getId(), NonOperationalReason.GLUSTER_COMMAND_FAILED, Collections.singletonMap(GlusterConstants.COMMAND, "gluster peer probe")); nonOpParams.setSaveToDb(true); Backend.getInstance().runInternalAction(VdcActionType.SetNonOperationalVds, nonOpParams, ExecutionHandler.createInternalJobContext()); }
Source:
public static void move(State state, ObjectInstance containerInstance, ObjectInstance spaceInstance) { String oldSpace = ContainerFactory.getSpaceName(containerInstance); ObjectInstance oldSpaceObject = state.getObject(oldSpace); ContainerFactory.changeContainerSpace(containerInstance, spaceInstance.getName()); SpaceFactory.addContainer(spaceInstance, containerInstance); SpaceFactory.removeContainer(oldSpaceObject, containerInstance); if (SpaceFactory.getOnOff(spaceInstance) && !ContainerFactory.isEmptyContainer(containerInstance)) { if (SpaceFactory.isHeating(spaceInstance) && ContainerFactory.isHeatingContainer(containerInstance)) { for (String name : ContainerFactory.getContentNames(containerInstance)) { if (!IngredientFactory.isMeltedAtRoomTemperature(state.getObject(name))) { IngredientFactory.meltIngredient(state.getObject(name)); } } } else if (SpaceFactory.isBaking(spaceInstance) && ContainerFactory.isBakingContainer(containerInstance)) { for (String name : ContainerFactory.getContentNames(containerInstance)) { IngredientFactory.bakeIngredient(state.getObject(name)); } } } }

Target:
private static void move(State state, ObjectInstance containerInstance, ObjectInstance spaceInstance) { String oldSpace = ContainerFactory.getSpaceName(containerInstance); ObjectInstance oldSpaceObject = state.getObject(oldSpace); ContainerFactory.changeContainerSpace(containerInstance, spaceInstance.getName()); SpaceFactory.addContainer(spaceInstance, containerInstance); SpaceFactory.removeContainer(oldSpaceObject, containerInstance); if (SpaceFactory.getOnOff(spaceInstance) && !ContainerFactory.isEmptyContainer(containerInstance)) { if (SpaceFactory.isHeating(spaceInstance) && ContainerFactory.isHeatingContainer(containerInstance)) { for (String name : ContainerFactory.getContentNames(containerInstance)) { if (!IngredientFactory.isMeltedAtRoomTemperature(state.getObject(name))) { IngredientFactory.meltIngredient(state.getObject(name)); } } } else if (SpaceFactory.isBaking(spaceInstance) && ContainerFactory.isBakingContainer(containerInstance)) { for (String name : ContainerFactory.getContentNames(containerInstance)) { IngredientFactory.bakeIngredient(state.getObject(name)); } } } }
Source:
private static <T> void printIndented(Iterable<T> strings) { for (T extension : strings) { System.out.println(" " + extension); } }

Target:
private static <T> void printIndented(Iterable<T> strings) { for (T item : strings) { System.out.println(" " + item); } }
Source:
private void populateRepositoryRefresh() { this.refreshLayout = new GridPane(); this.refreshLayout.setHgap(20); this.refreshLayout.setVgap(10); this.refreshRepositoriesLabel = new Label( translate("Fetch updates for the repositories to retrieve the newest script versions")); this.refreshRepositoriesLabel.setWrapText(true); this.refreshRepositoriesButton = new Button("Refresh Repositories"); this.refreshRepositoriesButton.setOnAction(event -> { this.vBox.setDisable(true); this.getChildren().add(this.overlay); repositoryManager.triggerRepositoryChange(); }); this.refreshLayout.add(refreshRepositoriesLabel, 0, 0); this.refreshLayout.add(refreshRepositoriesButton, 1, 0); GridPane.setHgrow(refreshRepositoriesLabel, Priority.ALWAYS); }

Target:
private void populateRepositoryRefresh() { this.refreshLayout = new GridPane(); this.refreshLayout.setHgap(20); this.refreshLayout.setVgap(10); this.refreshRepositoriesLabel = new Label( translate("Fetch updates for the repositories to retrieve the newest script versions")); this.refreshRepositoriesLabel.setWrapText(true); this.refreshRepositoriesButton = new Button("Refresh Repositories"); this.refreshRepositoriesButton.setOnAction(event -> { this.vBox.setDisable(true); this.overlay.toFront(); repositoryManager.triggerRepositoryChange(); }); this.refreshLayout.add(refreshRepositoriesLabel, 0, 0); this.refreshLayout.add(refreshRepositoriesButton, 1, 0); GridPane.setHgrow(refreshRepositoriesLabel, Priority.ALWAYS); }
Source:
public List<Map<String, Object>> search(String tenant, Map<String, List<String>> query) throws Exception { final Timer.Context eventSearchTimerContext = eventSearchTimer.time(); String result = elasticsearchRestHelper.fetchEvents(tenant, query); eventSearchTimerContext.stop(); return getEventResults(result); }

Target:
public List<Map<String, Object>> search(String tenant, Map<String, List<String>> query) { ArrayList<Map<String, Object>> searchResults = new ArrayList<>(); Timer.Context eventSearchTimerContext = eventSearchTimer.time(); try { String result = elasticsearchRestHelper.fetchEvents(tenant, query); searchResults.addAll(getEventResults(result)); } catch(IOException e){ String format = "Query for given event in elasticsearch failed. Exception message: %s"; log.error(String.format(format, e.getMessage())); throw new RuntimeException(String.format(format, e.getMessage()), e); } finally{ eventSearchTimerContext.stop(); } return searchResults; }
Source:
public AbstractPlanNode toPlanNode() { RexProgram program = getProgram(); if (program.getCondition() != null) { throw new IllegalStateException( "VoltDBCalc(with Condition).toPlanNode is not implemented."); } AbstractPlanNode child = inputRelNodeToPlanNode(this, 0); NodeSchema schema = RexConverter.convertToVoltDBNodeSchema(program); ProjectionPlanNode ppn = new ProjectionPlanNode(schema); ppn.addAndLinkChild(child); return ppn; }

Target:
public AbstractPlanNode toPlanNode() { RexProgram program = getProgram(); if (program.getCondition() != null) { throw new CalcitePlanningException( "VoltDBCalc(with Condition).toPlanNode is not implemented."); } AbstractPlanNode child = inputRelNodeToPlanNode(this, 0); NodeSchema schema = RexConverter.convertToVoltDBNodeSchema(program); ProjectionPlanNode ppn = new ProjectionPlanNode(schema); ppn.addAndLinkChild(child); return ppn; }
Source:
public SClass read(final SObject rcvr) { Object cachedValue = read.read(rcvr); assert cachedValue != null; if (cachedValue != Nil.nilObject) { return (SClass) cachedValue; } if (!rcvr.isObjectSlotAllocated(slotDef)) { CompilerDirectives.transferToInterpreterAndInvalidate(); ObjectTransitionSafepoint.INSTANCE.ensureSlotAllocatedToAvoidDeadlock(rcvr, slotDef); } synchronized (rcvr) { try { guard.entryMatches(rcvr); cachedValue = read.read(rcvr); } catch (InvalidAssumptionException e) { CompilerDirectives.transferToInterpreterAndInvalidate(); cachedValue = rcvr.readSlot(slotDef); } if (cachedValue == Nil.nilObject) { return instantiateAndWriteUnsynced(rcvr); } else { assert cachedValue instanceof SClass; return (SClass) cachedValue; } } }

Target:
public SClass read(final SObject rcvr) { Object cachedValue = read.read(rcvr); assert cachedValue != null; if (cachedValue != Nil.nilObject) { return (SClass) cachedValue; } if (!objectSlotIsAllocated) { CompilerDirectives.transferToInterpreterAndInvalidate(); ObjectTransitionSafepoint.INSTANCE.ensureSlotAllocatedToAvoidDeadlock(rcvr, slotDef); } synchronized (rcvr) { try { guard.entryMatches(rcvr); cachedValue = read.read(rcvr); } catch (InvalidAssumptionException e) { CompilerDirectives.transferToInterpreterAndInvalidate(); cachedValue = rcvr.readSlot(slotDef); } if (cachedValue == Nil.nilObject) { return instantiateAndWriteUnsynced(rcvr); } else { assert cachedValue instanceof SClass; return (SClass) cachedValue; } } }
Source:
public void respond(IRequestCycle requestCycle) { WebApplication application = WebApplication.get(); Integer pageId = pageKey.getPageId(); Session.get().getPageManager().touchPage(new Page() { @Override public PageParameters getPageParameters() { return super.getPageParameters(); } @Override public int getPageId() { return 0; } }); Page page = (Page) Session.get().getPageManager().getPage(pageId); if (page != null) { page.dirty(); AjaxRequestTarget target = application.newAjaxRequestTarget(page); executeHandlers(target, page); } else { LOGGER.warn("Could not find a page with id '{}' for session with id '{}' in the page stores. It will be unregistered", pageId, pageKey.getSessionId()); EventBus.get(application).unregister(pageKey); } }

Target:
public void respond(IRequestCycle requestCycle) { WebApplication application = WebApplication.get(); Integer pageId = pageKey.getPageId(); Page page = (Page) Session.get().getPageManager().getPage(pageId); if (page != null) { page.dirty(); AjaxRequestTarget target = application.newAjaxRequestTarget(page); executeHandlers(target, page); } else { LOGGER.warn("Could not find a page with id '{}' for session with id '{}' in the page stores. It will be unregistered", pageId, pageKey.getSessionId()); EventBus.get(application).unregister(pageKey); } }
Source:
public PendingTaskBasedWorkerProvisioningStrategy( PendingTaskBasedWorkerProvisioningConfig config, Supplier<WorkerBehaviorConfig> workerConfigRef, ProvisioningSchedulerConfig provisioningSchedulerConfig ) { this( config, workerConfigRef, provisioningSchedulerConfig, new Supplier<ScheduledExecutorService>() { @Override public ScheduledExecutorService get() { return ScheduledExecutors.fixed(1, "PendingTaskBasedResourceManagement-manager--%d"); } } ); }

Target:
public PendingTaskBasedWorkerProvisioningStrategy( PendingTaskBasedWorkerProvisioningConfig config, Supplier<WorkerBehaviorConfig> workerConfigRef, ProvisioningSchedulerConfig provisioningSchedulerConfig ) { this( config, workerConfigRef, provisioningSchedulerConfig, new Supplier<ScheduledExecutorService>() { @Override public ScheduledExecutorService get() { return ScheduledExecutors.fixed(1, "PendingTaskBasedWorkerProvisioning-manager--%d"); } } ); }
Source:
String getName() { if (uri != null) { return uri.getPath(); } else if (resourcePackage != null) { return new StringBuilder(resourcePackage).append(':').append(resourceId).toString(); } return Integer.toHexString(resourceId); }

Target:
String getName() { if (uri != null) { return uri.getPath(); } else if (resourcePackage != null) { return resourcePackage + ':' + resourceId; } return Integer.toHexString(resourceId); }
Source:
public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); butPlay.setOnClickListener(v -> { if (controller != null && controller.getMedia().getMediaType() == MediaType.VIDEO) { controller.playPause(); if(controller.getStatus() != PlayerStatus.PLAYING) { getContext().startActivity(PlaybackService.getPlayerActivityIntent(getContext(),controller.getMedia())); } }else if (controller != null) { controller.playPause(); } }); loadMediaInfo(); }

Target:
public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); butPlay.setOnClickListener(v -> { if (controller != null) { if (controller.getMedia().getMediaType() == MediaType.VIDEO && controller.getStatus() != PlayerStatus.PLAYING) { controller.playPause(); getContext().startActivity(PlaybackService .getPlayerActivityIntent(getContext(), controller.getMedia())); } else { controller.playPause(); } } }); loadMediaInfo(); }
Source:
private void showDownloadSizeExceedDialog(final ArrayList<DownloadEntry> de, final int noOfDownloads, final FragmentActivity activity, final DownloadManagerCallback callback) { Map<String, String> dialogMap = new HashMap<String, String>(); dialogMap.put("title", activity.getString(R.string.download_exceed_title)); dialogMap.put("message_1", activity.getString(R.string.download_exceed_message)); downloadFragment = DownloadSizeExceedDialog.newInstance(dialogMap, new IDialogCallback() { @Override public void onPositiveClicked() { if (!de.isEmpty()) { startDownload(de, activity, callback); final DownloadEntry downloadEntry = de.get(0); analyticsRegistry.trackSubSectionBulkVideoDownload(downloadEntry.getSectionName(), downloadEntry.getChapterName(), downloadEntry.getEnrollmentId(), noOfDownloads); EventBus.getDefault().post(new DownloadStartedEvent()); } } @Override public void onNegativeClicked() { downloadFragment.dismiss(); EventBus.getDefault().post(new DownloadInterruptedEvent()); } }); downloadFragment.setStyle(DialogFragment.STYLE_NO_TITLE, 0); downloadFragment.show(activity.getSupportFragmentManager(), "dialog"); downloadFragment.setCancelable(false); }

Target:
private void showDownloadSizeExceedDialog(final ArrayList<DownloadEntry> de, final int noOfDownloads, final FragmentActivity activity, final DownloadManagerCallback callback) { Map<String, String> dialogMap = new HashMap<String, String>(); dialogMap.put("title", activity.getString(R.string.download_exceed_title)); dialogMap.put("message_1", activity.getString(R.string.download_exceed_message)); downloadFragment = DownloadSizeExceedDialog.newInstance(dialogMap, new IDialogCallback() { @Override public void onPositiveClicked() { if (!de.isEmpty()) { startDownload(de, activity, callback); final DownloadEntry downloadEntry = de.get(0); analyticsRegistry.trackSubSectionBulkVideoDownload(downloadEntry.getSectionName(), downloadEntry.getChapterName(), downloadEntry.getEnrollmentId(), noOfDownloads); EventBus.getDefault().post(new BulkVideosDownloadStartedEvent()); } } @Override public void onNegativeClicked() { downloadFragment.dismiss(); EventBus.getDefault().post(new BulkVideosDownloadCancelledEvent()); } }); downloadFragment.setStyle(DialogFragment.STYLE_NO_TITLE, 0); downloadFragment.show(activity.getSupportFragmentManager(), "dialog"); downloadFragment.setCancelable(false); }
Source:
public String getShortName() { return "developmentinformation" ; }

Target:
public String getShortName() { return "devInf" ; }
Source:
protected boolean isEnoughSpaceToMergeSnapshots() { for (final Guid storageDomainId : getStorageToDiskMap().keySet()) { List<DiskImage> diskImages = getStorageToDiskMap().get(storageDomainId); long sizeRequested = 0; for (DiskImage diskImage : diskImages) { sizeRequested += diskImage.getActualSize(); } storage_domains storageDomain = getStorageDomainDAO().getForStoragePool(storageDomainId, getStoragePoolId()); if (!validate(new StorageDomainValidator(storageDomain).isDomainHasSpaceForRequest(sizeRequested, false))) { return false; } } return true; }

Target:
protected boolean isEnoughSpaceToMergeSnapshots() { for (final Entry<Guid, List<DiskImage>> storageToDiskEntry : getStorageToDiskMap().entrySet()) { Guid storageDomainId = storageToDiskEntry.getKey(); List<DiskImage> diskImages = storageToDiskEntry.getValue(); long sizeRequested = 0l; for (DiskImage diskImage : diskImages) { sizeRequested += diskImage.getActualSize(); } storage_domains storageDomain = getStorageDomainDAO().getForStoragePool(storageDomainId, getStoragePoolId()); if (!validate(new StorageDomainValidator(storageDomain).isDomainHasSpaceForRequest(sizeRequested, false))) { return false; } } return true; }
Source:
private void writeAggregatedBroadcasts( Item item, FieldWriter writer, OutputContext ctxt ) throws IOException { List<Id> downweighChannelIds = Arrays.stream( ctxt.getRequest() .getParameter(Attributes.DOWNWEIGH.externalName()) .split(",")) .map(Id::valueOf) .collect(MoreCollectors.toImmutableList()); writer.writeList( aggregatedBroadcastWriter, broadcastAggregator.aggregateBroadcasts( item.getBroadcasts(), ctxt.getPlatform(), downweighChannelIds ), ctxt ); }

Target:
private void writeAggregatedBroadcasts( Item item, FieldWriter writer, OutputContext ctxt ) throws IOException { String[] downweighIds = ctxt.getRequest() .getParameterValues(Attributes.DOWNWEIGH.externalName()); List<Id> downweighChannelIds; if (downweighIds == null || downweighIds.length == 0) { downweighChannelIds = ImmutableList.of(); } else { downweighChannelIds = Arrays.stream(downweighIds) .map(codec::decode) .map(Id::valueOf) .collect(MoreCollectors.toImmutableList()); } writer.writeList( broadcastWriter, broadcastAggregator.aggregateBroadcasts( item.getBroadcasts(), ctxt.getPlatform(), downweighChannelIds ), ctxt ); }
Source:
public void testEvictCostOnReplace() { PlanNode y = node(); PlanNode x = node(y); Memo memo = new Memo(idAllocator, x); int xGroup = memo.getRootGroup(); int yGroup = getChildGroup(memo, memo.getRootGroup()); PlanNodeCostEstimate yCost = PlanNodeCostEstimate.cpuCost(42); PlanNodeCostEstimate xCost = yCost.add(PlanNodeCostEstimate.networkCost(37)); memo.storeCumulativeCost(yGroup, yCost); memo.storeCumulativeCost(xGroup, xCost); assertEquals(Optional.of(yCost), memo.getCumulativeCost(yGroup)); assertEquals(Optional.of(xCost), memo.getCumulativeCost(xGroup)); memo.replace(yGroup, node(), "rule"); assertEquals(Optional.empty(), memo.getCumulativeCost(yGroup)); assertEquals(Optional.empty(), memo.getCumulativeCost(xGroup)); }

Target:
public void testEvictCostOnReplace() { PlanNode y = node(); PlanNode x = node(y); Memo memo = new Memo(idAllocator, x); int xGroup = memo.getRootGroup(); int yGroup = getChildGroup(memo, memo.getRootGroup()); PlanNodeCostEstimate yCost = PlanNodeCostEstimate.cpuCost(42); PlanNodeCostEstimate xCost = yCost.add(PlanNodeCostEstimate.networkCost(37)); memo.storeCumulativeCost(yGroup, yCost); memo.storeCumulativeCost(xGroup, xCost); assertEquals(memo.getCumulativeCost(yGroup), Optional.of(yCost)); assertEquals(memo.getCumulativeCost(xGroup), Optional.of(xCost)); memo.replace(yGroup, node(), "rule"); assertEquals(memo.getCumulativeCost(yGroup), Optional.empty()); assertEquals(memo.getCumulativeCost(xGroup), Optional.empty()); }
Source:
private void detectExecDisabled() { try { getUId(); } catch(JSchException | IOException e) { execDisabled = true; } }

Target:
private void detectExecDisabled() { try { getUId(); } catch(JSchException | IOException e) { execDisabled = true; LOG.debug("Cannot get UID, assuming no exec channel is present", e); } }
Source:
private void createDiskBasedOnLun() { LUNs lun = ((LunDisk) getParameters().getDiskInfo()).getLun(); StorageDomainCommandBase.proceedLUNInDb(lun, lun.getLunType()); getBaseDiskDao().save(getParameters().getDiskInfo()); getDiskLunMapDao().save(new DiskLunMap(getParameters().getDiskInfo().getId(), lun.getLUN_id())); if (getVm() != null) { VmDeviceUtils.addManagedDevice(new VmDeviceId(getParameters().getDiskInfo().getId(), getVmId()), VmDeviceType.DISK, VmDeviceType.DISK, null, true, false, ""); } VmHandler.unlockVm(getVm().getDynamicData(), getCompensationContext()); setSucceeded(true); }

Target:
private void createDiskBasedOnLun() { LUNs lun = ((LunDisk) getParameters().getDiskInfo()).getLun(); StorageDomainCommandBase.proceedLUNInDb(lun, lun.getLunType()); getBaseDiskDao().save(getParameters().getDiskInfo()); getDiskLunMapDao().save(new DiskLunMap(getParameters().getDiskInfo().getId(), lun.getLUN_id())); if (getVm() != null) { VmDeviceUtils.addManagedDevice(new VmDeviceId(getParameters().getDiskInfo().getId(), getVmId()), VmDeviceType.DISK, VmDeviceType.DISK, null, true, false); } VmHandler.unlockVm(getVm().getDynamicData(), getCompensationContext()); setSucceeded(true); }
Source:
private List<Object> resetOutputFolders(IJavaProject project, IProgressMonitor monitor) throws JavaModelException { if (monitor == null) monitor= new NullProgressMonitor(); try { IPackageFragmentRoot[] roots= project.getPackageFragmentRoots(); monitor.beginTask(NewWizardMessages.ClasspathModifier_Monitor_ResetOutputFolder, roots.length + 10); List<CPListElementAttribute> entries= new ArrayList<>(); for (IPackageFragmentRoot r : roots) { monitor.worked(1); IPackageFragmentRoot root= r; if (root.isArchive() || root.isExternal()) continue; IClasspathEntry entry= root.getRawClasspathEntry(); CPListElement element= CPListElement.createFromExisting(entry, project); CPListElementAttribute outputFolder= new CPListElementAttribute(element, CPListElement.OUTPUT, element.getAttribute(CPListElement.OUTPUT), true); entries.add(outputFolder); } return reset(entries, project, new SubProgressMonitor(monitor, 10)); } finally { monitor.done(); } }

Target:
private List<Object> resetOutputFolders(IJavaProject project, IProgressMonitor monitor) throws JavaModelException { if (monitor == null) monitor= new NullProgressMonitor(); try { IPackageFragmentRoot[] roots= project.getPackageFragmentRoots(); monitor.beginTask(NewWizardMessages.ClasspathModifier_Monitor_ResetOutputFolder, roots.length + 10); List<CPListElementAttribute> entries= new ArrayList<>(); for (IPackageFragmentRoot root : roots) { monitor.worked(1); if (root.isArchive() || root.isExternal()) continue; IClasspathEntry entry= root.getRawClasspathEntry(); CPListElement element= CPListElement.createFromExisting(entry, project); CPListElementAttribute outputFolder= new CPListElementAttribute(element, CPListElement.OUTPUT, element.getAttribute(CPListElement.OUTPUT), true); entries.add(outputFolder); } return reset(entries, project, new SubProgressMonitor(monitor, 10)); } finally { monitor.done(); } }
Source:
public <T> T executeSQL(String databaseName, String query, ExecuteResultHandler<T> handler) throws SQLiteException { Util.throwIfNull(query); Util.throwIfNull(handler); SQLiteDatabase database = openDatabase(databaseName); try { String trimmedSql = query.trim(); String prefixSql = ""; if (trimmedSql.length() >= 3) { prefixSql = trimmedSql.substring(0, 3).toUpperCase(); } if (prefixSql.equals("UPD") || prefixSql.equals("DEL")) { return executeUpdateDelete(database, query, handler); } else if (prefixSql.equals("INS")) { return executeInsert(database, query, handler); } else { return executeRawQuery(database, trimmedSql, handler); } } finally { database.close(); } }

Target:
public <T> T executeSQL(String databaseName, String query, ExecuteResultHandler<T> handler) throws SQLiteException { Util.throwIfNull(query); Util.throwIfNull(handler); SQLiteDatabase database = openDatabase(databaseName); try { String firstWord = getFirstWord(query); if (firstWord.equalsIgnoreCase("UPDATE") || firstWord.equalsIgnoreCase("DELETE")) { return executeUpdateDelete(database, query, handler); } else if (firstWord.equalsIgnoreCase("INSERT")) { return executeInsert(database, query, handler); } else if (firstWord.equalsIgnoreCase("SELECT")) { return executeSelect(database, query, handler); } else { return executeRawQuery(database, query, handler); } } finally { database.close(); } }
Source:
public String readResource(URI endpoint) throws IOException { Map<String, String> headers = new HashMap<String, String>(); headers.put("User-Agent", USER_AGENT); headers.put("Accept", "*/*"); headers.put("Connection", "keep-alive"); return readResource(endpoint, CredentialsEndpointRetryPolicy.NO_RETRY, new HashMap<String, String>()); }

Target:
public String readResource(URI endpoint) throws IOException { Map<String, String> headers = new HashMap<String, String>(); headers.put("User-Agent", USER_AGENT); headers.put("Accept", "*/*"); headers.put("Connection", "keep-alive"); return readResource(endpoint, CredentialsEndpointRetryPolicy.NO_RETRY, headers); }
Source:
protected Menu getMenu(final MMenu mmenu, ToolItem toolItem) { Object obj = mmenu.getWidget(); if (obj instanceof Menu) { return (Menu) obj; } if (mmenu instanceof MRenderedMenu) { obj = ((MRenderedMenu) mmenu).getContributionManager(); if (obj instanceof IContextFunction) { final IEclipseContext lclContext = getContext(mmenu); obj = ((IContextFunction) obj).compute(lclContext, null); ((MRenderedMenu) mmenu).setContributionManager(obj); } if (obj instanceof IMenuCreator) { final IMenuCreator creator = (IMenuCreator) obj; final Menu menu = creator.getMenu(toolItem.getParent() .getShell()); if (menu != null) { toolItem.addDisposeListener(new DisposeListener() { public void widgetDisposed(DisposeEvent e) { if (menu != null && !menu.isDisposed()) { creator.dispose(); ((MRenderedMenu) mmenu).setWidget(null); } } }); mmenu.setWidget(menu); menu.setData(AbstractPartRenderer.OWNING_ME, menu); return menu; } } } else { final IEclipseContext lclContext = getContext(mmenu); IPresentationEngine engine = lclContext .get(IPresentationEngine.class); obj = engine.createGui(mmenu, toolItem.getParent(), lclContext); if (obj instanceof Menu) { return (Menu) obj; } System.err.println("Rendering returned " + obj); } return null; }

Target:
protected Menu getMenu(final MMenu mmenu, ToolItem toolItem) { Object obj = mmenu.getWidget(); if (obj instanceof Menu) { return (Menu) obj; } if (mmenu instanceof MRenderedMenu) { obj = ((MRenderedMenu) mmenu).getContributionManager(); if (obj instanceof IContextFunction) { final IEclipseContext lclContext = getContext(mmenu); obj = ((IContextFunction) obj).compute(lclContext, null); ((MRenderedMenu) mmenu).setContributionManager(obj); } if (obj instanceof IMenuCreator) { final IMenuCreator creator = (IMenuCreator) obj; final Menu menu = creator.getMenu(toolItem.getParent() .getShell()); if (menu != null) { toolItem.addDisposeListener(new DisposeListener() { public void widgetDisposed(DisposeEvent e) { if (menu != null && !menu.isDisposed()) { creator.dispose(); ((MRenderedMenu) mmenu).setWidget(null); } } }); mmenu.setWidget(menu); menu.setData(AbstractPartRenderer.OWNING_ME, menu); return menu; } } } else { final IEclipseContext lclContext = getContext(mmenu); IPresentationEngine engine = lclContext .get(IPresentationEngine.class); obj = engine.createGui(mmenu, toolItem.getParent(), lclContext); if (obj instanceof Menu) { return (Menu) obj; } logger.debug("Rendering returned " + obj); } return null; }
Source:
public static int rapidParseInt(final String input) { final int len = input.length(); int val = 0; int i = 0; boolean isNegative = false; if (0 < len && '-' == input.charAt(0)) { i = 1; isNegative = true; } for (; i < len; ++i) { final char ch = input.charAt(i); if (Character.isDigit(ch)) { val = (val * 10) + (ch - 48); } else { break; } } if (isNegative) val = -val; return val; }

Target:
public static int rapidParseInt(final String input) throws NumberFormatException { final int len = input.length(); int val = 0; int i = 0; boolean isNegative = false; if (0 < len && '-' == input.charAt(0)) { i = 1; isNegative = true; } boolean hasDigits = false; for (; i < len; ++i) { final char ch = input.charAt(i); if (Character.isDigit(ch)) { val = (val * 10) + (ch - 48); hasDigits = true; } else { break; } } if (!hasDigits) throw new NumberFormatException("String '" + input + "' did not start with a parsable number."); if (isNegative) val = -val; return val; }
Source:
public void testGetScreenshot() { HWND desktopWindow = User32.INSTANCE.GetDesktopWindow(); assertNotNull(desktopWindow); BufferedImage image = GDI32Util.getScreenshot(desktopWindow); List<Integer> distinctPixels = new ArrayList<Integer>(); for (int x = 0; x < image.getWidth(); x++) { for (int y = 0; y < image.getHeight(); y++) { int pixel = image.getRGB(x, y); if (!distinctPixels.contains(pixel)) { distinctPixels.add(pixel); } if (distinctPixels.size() > 20) { break; } } } assertTrue(distinctPixels.size() > 20); }

Target:
public void testGetScreenshot() { HWND desktopWindow = User32.INSTANCE.GetDesktopWindow(); assertNotNull("Failed to obtain desktop window handle", desktopWindow); BufferedImage image = GDI32Util.getScreenshot(desktopWindow); List<Integer> distinctPixels = new ArrayList<Integer>(); for (int x = 0; x < image.getWidth(); x++) { for (int y = 0; y < image.getHeight(); y++) { int pixel = image.getRGB(x, y); if (!distinctPixels.contains(pixel)) { distinctPixels.add(pixel); } if (distinctPixels.size() > 20) { break; } } } assertTrue("Number of distinct pixels was not above 20.", distinctPixels.size() > 20); }
Source:
public Set<Group> groupsFor(AuthenticatedUser au) { Set<Group> groups = new HashSet<>(); groups.addAll(groupsFor(au, null)); String identifier = au.getIdentifier(); String identifierWithoutAtSign = null; if (identifier != null) { try { identifierWithoutAtSign = identifier.substring(1); } catch (IndexOutOfBoundsException ex) { logger.info("Couldn't trim first character (@ sign) from identifier: " + identifier); } } if (identifierWithoutAtSign != null) { roleAssigneeSvc.getUserGroups(identifierWithoutAtSign).stream().forEach((groupAlias) -> { ExplicitGroup explicitGroup = explicitGroupProvider.get(groupAlias); if (explicitGroup != null) { groups.add(explicitGroup); } else { logger.info("Couldn't find group based on alias " + groupAlias); } }); } return groups; }

Target:
public Set<Group> groupsFor(AuthenticatedUser au) { Set<Group> groups = new HashSet<>(); groups.addAll(groupsFor(au, null)); String identifier = au.getIdentifier(); String identifierWithoutAtSign = null; if (identifier != null) { try { identifierWithoutAtSign = identifier.substring(1); } catch (IndexOutOfBoundsException ex) { logger.info("Couldn't trim first character (@ sign) from identifier: " + identifier); } } if (identifierWithoutAtSign != null) { roleAssigneeSvc.getUserExplicitGroups(identifierWithoutAtSign).stream().forEach((groupAlias) -> { ExplicitGroup explicitGroup = explicitGroupProvider.get(groupAlias); if (explicitGroup != null) { groups.add(explicitGroup); } else { logger.info("Couldn't find group based on alias " + groupAlias); } }); } return groups; }
Source:
public Object deserialize(JsonParser parser, DeserializationContext context) throws IOException { if (claimTypeMap != null && parser.currentName() != null && claimTypeMap.containsKey(parser.currentName())) { Class type = claimTypeMap.get(parser.currentName()); return parser.readValueAsTree().traverse(parser.getCodec()).readValueAs(type); } return super.deserialize(parser, context); }

Target:
public Object deserialize(JsonParser parser, DeserializationContext context) throws IOException { String name = parser.currentName(); if (claimTypeMap != null && name != null && claimTypeMap.containsKey(name)) { Class type = claimTypeMap.get(name); return parser.readValueAsTree().traverse(parser.getCodec()).readValueAs(type); } return super.deserialize(parser, context); }
Source:
public void invoke(ClientEvent event) { try { method.invoke(listener, event); } catch (InvocationTargetException e) { log.errorInvokingListener(method, listener, e.getTargetException()); throw log.exceptionInvokingListener( e.getClass().getName(), method, listener, e.getTargetException()); } catch (Exception e) { throw log.exceptionInvokingListener( e.getClass().getName(), method, listener, e); } }

Target:
public void invoke(ClientEvent event) { try { method.invoke(listener, event); } catch (InvocationTargetException e) { throw log.exceptionInvokingListener( e.getClass().getName(), method, listener, e.getTargetException()); } catch (Exception e) { throw log.exceptionInvokingListener( e.getClass().getName(), method, listener, e); } }
Source:
public MultiStreamableMessageSource(Builder builder) { this.eventStreams = builder.messageSources(); this.trackedEventComparator = builder.trackedEventComparator; }

Target:
protected MultiStreamableMessageSource(Builder builder) { this.eventStreams = builder.messageSources(); this.trackedEventComparator = builder.trackedEventComparator; }
Source:
public static Rectangle2D getVisualBounds(Stage stage) { return JavaFxUtil.getScreenForRectangle( new Rectangle2D(stage.getX(), stage.getY(), stage.getWidth(), stage.getHeight())).getVisualBounds(); }

Target:
public static Rectangle2D getVisualBounds(Stage stage) { double x1 = stage.getX() + (stage.getWidth() / 2); double y1 = stage.getY() + (stage.getHeight() / 2); Rectangle2D windowCenter = new Rectangle2D(x1, y1, 1, 1); ObservableList<Screen> screensForRectangle = Screen.getScreensForRectangle(windowCenter); return screensForRectangle.get(0).getVisualBounds(); }
Source:
public void prepareSandboxTaskTest() throws IOException, NoLanguagePluginFoundException, ArchiveException { TaskExecutor executor = new TaskExecutorImpl(); Path exercisePath = TestUtils.getPath(getClass(), "arith_funcs"); Path submissionPath = TestUtils.getPath(getClass(), "arith_funcs_solution"); Path outputDirectory = Files.createTempDirectory("output-directory"); Path outputPath = new File("/tmp/output.tar").toPath(); Path tmcRunPath = new File("/home/local/onniaarn/Visulahti.R").toPath(); Path tmcLangsPath = new File("/home/local/onniaarn/Projects/tmc-langs/tmc-langs-cli/target/tmc-langs-cli-0.7.7-SNAPSHOT.jar").toPath(); executor.prepareSandboxTask(exercisePath, submissionPath, outputPath, tmcRunPath, tmcLangsPath); Path testDirectory = Files.createTempDirectory("test-directory"); Process untarringProcess = new ProcessBuilder("tar", "-C", testDirectory.toString(), "-xf", outputPath.toString()).start(); assertTrue(Files.exists(outputPath)); assertTrue(Files.exists(testDirectory.resolve("tmc-langs.jar"))); assertTrue(Files.exists(testDirectory.resolve("tmc-run.sh"))); FileUtils.forceDelete(outputDirectory.toFile()); FileUtils.forceDelete(tmcRunPath.toFile()); FileUtils.forceDelete(tmcLangsPath.toFile()); FileUtils.forceDelete(testDirectory.toFile()); }

Target:
public void prepareSandboxTaskTest() throws IOException, NoLanguagePluginFoundException, ArchiveException { TaskExecutor executor = new TaskExecutorImpl(); Path exercisePath = TestUtils.getPath(getClass(), "arith_funcs"); Path submissionPath = TestUtils.getPath(getClass(), "arith_funcs_solution"); Path outputDirectory = Files.createTempDirectory("output-directory"); Path outputPath = outputDirectory.resolve("output.tar"); Path tmcRunPath = Files.createTempFile("fake-tmc-run", ".sh"); Path tmcLangsPath = Files.createTempFile("fake-tmc-langs", ".jar"); executor.prepareSandboxTask(exercisePath, submissionPath, outputPath, tmcRunPath, tmcLangsPath); Path testDirectory = Files.createTempDirectory("test-directory"); Process untarringProcess = new ProcessBuilder("tar", "-C", testDirectory.toString(), "-xf", outputPath.toString()).start(); assertTrue(Files.exists(outputPath)); assertTrue(Files.exists(testDirectory.resolve("tmc-langs.jar"))); assertTrue(Files.exists(testDirectory.resolve("tmc-run.sh"))); FileUtils.forceDelete(outputDirectory.toFile()); FileUtils.forceDelete(tmcRunPath.toFile()); FileUtils.forceDelete(tmcLangsPath.toFile()); FileUtils.forceDelete(testDirectory.toFile()); }
Source:
public Optional<JobStatus> getJobStatus(@NotBlank(message = "Job id is missing and is required") final String id) { return this.jobRepository.findByUniqueId(id, JobStatusProjection.class).map(JobStatusProjection::getStatus); }

Target:
public JobStatus getJobStatus( @NotBlank(message = "Job id is missing and is required") final String id ) throws GenieNotFoundException { return this.jobRepository .findByUniqueId(id, JobStatusProjection.class) .orElseThrow(() -> new GenieNotFoundException("No job with id " + id + " exists. Unable to get status.")) .getStatus(); }
Source:
public void cwlCorrect() throws IOException{ File cwlFile = new File(ResourceHelpers.resourceFilePath("1st-workflow.cwl")); File cwlJSON = new File(ResourceHelpers.resourceFilePath("1st-workflow-job.json")); ArrayList<String> args = new ArrayList<String>() {{ add("--local-entry"); add("--json"); add(cwlJSON.getAbsolutePath()); }}; WorkflowsApi api = mock(WorkflowsApi.class); UsersApi usersApi = mock(UsersApi.class); Client client = new Client(); client.setConfigFile(ResourceHelpers.resourceFilePath("config")); WorkflowClient workflowClient = new WorkflowClient(api, usersApi, client); workflowClient.checkEntryFile(cwlFile.getAbsolutePath(), args, null); Assert.assertTrue("output should include a successful cromwell run",systemOutRule.getLog().contains("Provisioning your output files to their final destinations") ); }

Target:
public void cwlCorrect() throws IOException{ File cwlFile = new File(ResourceHelpers.resourceFilePath("1st-workflow.cwl")); File cwlJSON = new File(ResourceHelpers.resourceFilePath("1st-workflow-job.json")); ArrayList<String> args = new ArrayList<String>() {{ add("--local-entry"); add("--json"); add(cwlJSON.getAbsolutePath()); }}; WorkflowsApi api = mock(WorkflowsApi.class); UsersApi usersApi = mock(UsersApi.class); Client client = new Client(); client.setConfigFile(ResourceHelpers.resourceFilePath("config")); WorkflowClient workflowClient = new WorkflowClient(api, usersApi, client); workflowClient.checkEntryFile(cwlFile.getAbsolutePath(), args, null); Assert.assertTrue("output should include a successful cromwell run",systemOutRule.getLog().contains("Cromwell exit code: 0") ); }
Source:
private void logContext(RelationshipOp operation, Environment environment) { List<?> children = (environment.field.getSelectionSet() != null) ? (List) environment.field.getSelectionSet().getChildren() : new ArrayList<>(); List<String> fieldName = new ArrayList<String>(); if (children.size() > 0) { children.stream().forEach(i -> { if (i.getClass().equals(Field.class)) { fieldName.add(((Field) i).getName()); } else if (i.getClass().equals(FragmentSpread.class)) { fieldName.add(((FragmentSpread) i).getName()); } else { log.debug("A new type of Selection, other than Field and FragmentSpread was encountered, {}", i.getClass()); } }); } String requestedFields = environment.field.getName() + fieldName.toString(); GraphQLType parent = environment.parentType; if (log.isDebugEnabled()) { log.debug("{} fields with parent {}<{}>", operation, requestedFields, EntityDictionary.getSimpleName(new ClassType(parent.getClass())), parent.getName()); } }

Target:
private void logContext(RelationshipOp operation, Environment environment) { List<?> children = (environment.field.getSelectionSet() != null) ? (List) environment.field.getSelectionSet().getChildren() : new ArrayList<>(); List<String> fieldName = new ArrayList<String>(); if (children.size() > 0) { children.stream().forEach(i -> { if (i.getClass().equals(Field.class)) { fieldName.add(((Field) i).getName()); } else if (i.getClass().equals(FragmentSpread.class)) { fieldName.add(((FragmentSpread) i).getName()); } else { log.debug("A new type of Selection, other than Field and FragmentSpread was encountered, {}", i.getClass()); } }); } String requestedFields = environment.field.getName() + fieldName.toString(); GraphQLType parent = environment.parentType; if (log.isDebugEnabled()) { log.debug("{} fields with parent {}<{}>", operation, requestedFields, EntityDictionary.getSimpleName(EntityDictionary.getType(parent)), parent.getName()); } }
Source:
public void changesUpdateAttribute() throws Exception { final Bout bout = new MkBase().randomBout(); final Attachments attachments = bout.attachments(); final Long last = bout.updated().getTime(); final String name = "att-name"; attachments.create(name); final Attachment attachment = attachments.get(name); attachment.write( IOUtils.toInputStream("<root/>", CharEncoding.UTF_8), "text/xml", Long.toString(System.currentTimeMillis()) ); final Long pause = 100L; Thread.sleep(pause); MatcherAssert.assertThat( bout.updated().getTime(), Matchers.greaterThan(last) ); }

Target:
public void changesUpdateAttribute() throws Exception { final Bout bout = new MkBase().randomBout(); final Attachments attachments = bout.attachments(); final Long last = bout.updated().getTime(); final String name = "att-name"; attachments.create(name); final Attachment attachment = attachments.get(name); attachment.write( IOUtils.toInputStream("<root/>", StandardCharsets.UTF_8), "text/xml", Long.toString(System.currentTimeMillis()) ); Thread.sleep(Tv.HUNDRED); MatcherAssert.assertThat( bout.updated().getTime(), Matchers.greaterThan(last) ); }
Source:
public OperationResult execute() throws OperationException { logger.log(Level.INFO, "Determine file system actions ..."); FileSystemActionReconciliator actionReconciliator = new FileSystemActionReconciliator(config, result.getChangeSet()); List<FileSystemAction> actions; if (cleanupOccurred) { actions = actionReconciliator.determineFileSystemActions(winnersDatabase, true, preDeleteFileHistoriesWithLastVersion); } else { actions = actionReconciliator.determineFileSystemActions(winnersDatabase); } Set<MultiChunkId> unknownMultiChunks = determineRequiredMultiChunks(actions, winnersDatabase); try { downloader.downloadAndDecryptMultiChunks(unknownMultiChunks); } catch (StorageException | IOException e) { throw new OperationException(e); } result.getDownloadedMultiChunks().addAll(unknownMultiChunks); try { applyFileSystemActions(actions); } catch (IOException e) { throw new OperationException(e); } return null; }

Target:
public OperationResult execute() throws OperationException { logger.log(Level.INFO, "Determine file system actions ..."); FileSystemActionReconciliator actionReconciliator = new FileSystemActionReconciliator(config, result.getChangeSet()); List<FileSystemAction> actions; if (cleanupOccurred) { actions = actionReconciliator.determineFileSystemActions(winnersDatabase, true, preDeleteFileHistoriesWithLastVersion); } else { actions = actionReconciliator.determineFileSystemActions(winnersDatabase); } Set<MultiChunkId> unknownMultiChunks = determineRequiredMultiChunks(actions, winnersDatabase); try { downloader.downloadAndDecryptMultiChunks(unknownMultiChunks); result.getDownloadedMultiChunks().addAll(unknownMultiChunks); applyFileSystemActions(actions); } catch (StorageException | IOException e) { throw new OperationException(e); } return null; }