auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public OperationResult doOperationCallback() throws OperationException { final List<String> controlPluginNameList = paymentStateControlContext.getPaymentControlPluginNames(); final String controlPluginNames = Joiner.on(", ").join(controlPluginNameList); return dispatchWithAccountLockAndTimeout(controlPluginNames, new DispatcherCallback<PluginDispatcherReturnType<OperationResult>, OperationException>() { @Override public PluginDispatcherReturnType<OperationResult> doOperation() throws OperationException { final PaymentTransactionModelDao transaction = paymentStateContext.getPaymentTransactionModelDao(); final PaymentControlContext updatedPaymentControlContext = new DefaultPaymentControlContext(paymentStateContext.getAccount(), paymentStateContext.getPaymentMethodId(), paymentStateControlContext.getAttemptId(), transaction.getPaymentId(), paymentStateContext.getPaymentExternalKey(), transaction.getId(), paymentStateContext.getPaymentTransactionExternalKey(), PaymentApiType.PAYMENT_TRANSACTION, paymentStateContext.getTransactionType(), null, transaction.getAmount(), transaction.getCurrency(), transaction.getProcessedAmount(), transaction.getProcessedCurrency(), paymentStateControlContext.isApiPayment(), paymentStateContext.getCallContext()); executePluginOnSuccessCalls(paymentStateControlContext.getPaymentControlPluginNames(), updatedPaymentControlContext); return PluginDispatcher.createPluginDispatcherReturnType(OperationResult.SUCCESS); } }); }

Target:
public OperationResult doOperationCallback() throws OperationException { final List<String> controlPluginNameList = paymentStateControlContext.getPaymentControlPluginNames(); final String controlPluginNames = JOINER.join(controlPluginNameList); return dispatchWithAccountLockAndTimeout(controlPluginNames, new DispatcherCallback<PluginDispatcherReturnType<OperationResult>, OperationException>() { @Override public PluginDispatcherReturnType<OperationResult> doOperation() throws OperationException { final PaymentTransactionModelDao transaction = paymentStateContext.getPaymentTransactionModelDao(); final PaymentControlContext updatedPaymentControlContext = new DefaultPaymentControlContext(paymentStateContext.getAccount(), paymentStateContext.getPaymentMethodId(), paymentStateControlContext.getAttemptId(), transaction.getPaymentId(), paymentStateContext.getPaymentExternalKey(), transaction.getId(), paymentStateContext.getPaymentTransactionExternalKey(), PaymentApiType.PAYMENT_TRANSACTION, paymentStateContext.getTransactionType(), null, transaction.getAmount(), transaction.getCurrency(), transaction.getProcessedAmount(), transaction.getProcessedCurrency(), paymentStateControlContext.isApiPayment(), paymentStateContext.getCallContext()); executePluginOnSuccessCalls(paymentStateControlContext.getPaymentControlPluginNames(), updatedPaymentControlContext); return PluginDispatcher.createPluginDispatcherReturnType(OperationResult.SUCCESS); } }); }
Source:
public void completeExceptionally(Predicate<SubscriptionQueryMessage<?, ?, ?>> filter, Throwable cause) { registeringSubscriptionQueryReadSafe(filter, () -> updateHandlers.keySet() .stream() .filter(filter) .forEach(query -> { UpdateHandler<?, ?> updateHandler = updateHandlers.get(query); updateHandlers.remove(query); updateHandler.onCompletedExceptionally(cause); })); }

Target:
public void completeExceptionally(Predicate<SubscriptionQueryMessage<?, ?, ?>> filter, Throwable cause) { updateHandlers.keySet() .stream() .filter(filter) .forEach(query -> Optional.ofNullable(updateHandlers.get(query)) .ifPresent(updateHandler -> emitError(query, cause, updateHandler))); }
Source:
public boolean assign(final Map<UUID, ClientState> clientStates, final Set<TaskId> allTasks, final Set<TaskId> statefulTasks, final AssignmentConfigs configs) { this.configs = configs; this.clientStates = clientStates; this.allTasks = allTasks; this.statefulTasks = new TreeSet<>(statefulTasks); statelessTasks = new TreeSet<>(allTasks); statelessTasks.removeAll(statefulTasks); sortedClients = new TreeSet<>(); clientsToNumberOfThreads = new HashMap<>(); clientStates.forEach((client, state) -> { sortedClients.add(client); clientsToNumberOfThreads.put(client, state.capacity()); }); statefulTasksToRankedCandidates = buildClientRankingsByTask(statefulTasks, clientStates, configs.acceptableRecoveryLag); tasksToCaughtUpClients = tasksToCaughtUpClients(statefulTasksToRankedCandidates); if (shouldUsePreviousAssignment()) { assignPreviousTasksToClientStates(); return false; } final Map<TaskId, Integer> tasksToRemainingStandbys = statefulTasks.stream().collect(Collectors.toMap(task -> task, t -> configs.numStandbyReplicas)); final boolean followupRebalanceNeeded = assignStatefulActiveTasks(tasksToRemainingStandbys); assignStandbyReplicaTasks(tasksToRemainingStandbys); assignStatelessActiveTasks(); log.info("Decided on assignment: " + clientStates + " with " + (followupRebalanceNeeded ? "" : "no") + " followup rebalance."); return followupRebalanceNeeded; }

Target:
public boolean assign(final Map<UUID, ClientState> clientStates, final Set<TaskId> allTasks, final Set<TaskId> statefulTasks, final AssignmentConfigs configs) { this.configs = configs; this.clientStates = clientStates; this.allTasks = allTasks; this.statefulTasks = new TreeSet<>(statefulTasks); statelessTasks = new TreeSet<>(allTasks); statelessTasks.removeAll(statefulTasks); sortedClients = new TreeSet<>(); clientsToNumberOfThreads = new HashMap<>(); clientStates.forEach((client, state) -> { sortedClients.add(client); clientsToNumberOfThreads.put(client, state.capacity()); }); statefulTasksToRankedCandidates = buildClientRankingsByTask(statefulTasks, clientStates, configs.acceptableRecoveryLag); tasksToCaughtUpClients = tasksToCaughtUpClients(statefulTasksToRankedCandidates); if (shouldUsePreviousAssignment()) { assignPreviousTasksToClientStates(); return false; } final Map<TaskId, Integer> tasksToRemainingStandbys = statefulTasks.stream().collect(Collectors.toMap(task -> task, t -> configs.numStandbyReplicas)); final boolean probingRebalanceNeeded = assignStatefulActiveTasks(tasksToRemainingStandbys); assignStandbyReplicaTasks(tasksToRemainingStandbys); assignStatelessActiveTasks(); log.info("Decided on assignment: " + clientStates + " with " + (probingRebalanceNeeded ? "" : "no") + " followup probing rebalance."); return probingRebalanceNeeded; }
Source:
public void testBuilderWithDefaultValues() { StudentAttributes sd = StudentAttributes .builder("courseId", "Joe White", "e@e.com") .build(); ______TS("success : defaultTimeStamp for createdAt date"); assertEquals(Const.TIME_REPRESENTS_DEFAULT_TIMESTAMP, sd.getCreatedAt()); ______TS("success : defaultTimeStamp for updatedAt date"); assertEquals(Const.TIME_REPRESENTS_DEFAULT_TIMESTAMP, sd.getUpdatedAt()); ______TS("success : default value for googleId"); assertEquals("", sd.googleId); ______TS("success : default value for section"); assertEquals(Const.DEFAULT_SECTION, sd.section); ______TS("success : default value for updateStatus"); assertEquals(StudentUpdateStatus.UNKNOWN, sd.updateStatus); ______TS("success : default value for lastName"); assertEquals("White", sd.lastName); }

Target:
public void testBuilderWithDefaultValues() { StudentAttributes sd = StudentAttributes .builder("courseId", "Joe White", "e@e.com") .build(); assertEquals(Const.TIME_REPRESENTS_DEFAULT_TIMESTAMP, sd.getCreatedAt()); assertEquals(Const.TIME_REPRESENTS_DEFAULT_TIMESTAMP, sd.getUpdatedAt()); assertEquals("", sd.googleId); assertEquals(Const.DEFAULT_SECTION, sd.section); assertEquals(StudentUpdateStatus.UNKNOWN, sd.updateStatus); assertEquals("White", sd.lastName); }
Source:
private void onSuccess(String result) { if (mListener != null) { mListener.onSuccess(result); } else { Log.v(TAG, "Cancelled callback and outstanding requests"); } }

Target:
private void onSuccess(String result) { synchronized(mListenerLock) { if (mListener != null) { mListener.onSuccess(result); } else { Log.v(TAG, "Cancelled callback and outstanding requests"); } } }
Source:
private boolean callActionServiceMethod(ActionEvent action, Integer actionIndex, Map<String, Object> parameters, TaskContext taskContext) throws TaskHandlerException { ServiceReference reference = bundleContext.getServiceReference( action.getServiceInterface() ); boolean serviceAvailable = reference != null; if (serviceAvailable) { Object service = bundleContext.getService(reference); String serviceMethod = action.getServiceMethod(); MethodHandler methodHandler = new MethodHandler(action, parameters); try { Method method = service.getClass().getMethod(serviceMethod, methodHandler.getClasses()); try { Object object = method.invoke(service, methodHandler.getObjects()); addPostActionParametersToTaskContext(action, actionIndex, taskContext, object); } catch (IllegalAccessException | InvocationTargetException e) { throw new TaskHandlerException( ACTION, "task.error.serviceMethodInvokeError", e, serviceMethod, action.getServiceInterface() ); } } catch (NoSuchMethodException e) { throw new TaskHandlerException( ACTION, "task.error.notFoundMethodForService", e, serviceMethod, action.getServiceInterface() ); } } return serviceAvailable; }

Target:
private boolean callActionServiceMethod(ActionEvent action, Integer actionIndex, Map<String, Object> parameters, TaskContext taskContext) throws TaskHandlerException { ServiceReference reference = bundleContext.getServiceReference( action.getServiceInterface() ); boolean serviceAvailable = reference != null; if (serviceAvailable) { Object service = bundleContext.getService(reference); String serviceMethod = action.getServiceMethod(); MethodHandler methodHandler = new MethodHandler(action, parameters); try { Method method = service.getClass().getMethod(serviceMethod, methodHandler.getClasses()); try { Object object = method.invoke(service, methodHandler.getObjects()); if (object != null) { addPostActionParametersToTaskContext(action, actionIndex, taskContext, object); } } catch (IllegalAccessException | InvocationTargetException e) { throw new TaskHandlerException( ACTION, "task.error.serviceMethodInvokeError", e, serviceMethod, action.getServiceInterface() ); } } catch (NoSuchMethodException e) { throw new TaskHandlerException( ACTION, "task.error.notFoundMethodForService", e, serviceMethod, action.getServiceInterface() ); } } return serviceAvailable; }
Source:
public UsersWorkspaceDto startById(@PathParam("id") String workspaceId, @QueryParam("environment") String envName, @QueryParam("accountId") String accountId) throws ServerException, BadRequestException, NotFoundException, ForbiddenException { ensureUserIsWorkspaceOwner(workspaceId); final Map<String, String> params = ImmutableMap.of("accountId", accountId, "workspaceId", workspaceId); permissionManager.checkPermission(START_WORKSPACE, getCurrentUserId(), params); return injectLinks(DtoConverter.asDto(workspaceManager.startWorkspaceById(workspaceId, envName, accountId))); }

Target:
public UsersWorkspaceDto startById(@PathParam("id") String workspaceId, @QueryParam("environment") String envName, @QueryParam("accountId") String accountId) throws ServerException, BadRequestException, NotFoundException, ForbiddenException { ensureUserIsWorkspaceOwner(workspaceId); permissionManager.checkPermission(START_WORKSPACE, getCurrentUserId(), ImmutableMap.of("accountId", accountId, "workspaceId", workspaceId)); return injectLinks(DtoConverter.asDto(workspaceManager.startWorkspaceById(workspaceId, envName, accountId))); }
Source:
public @NotNull Span popSpan() throws EmptyStackException { if (!hasSpan()) { throw new EmptyStackException(); } else { try (Scope scope = scopeManager.active()) { return scope.span(); } } }

Target:
public @NotNull Span popSpan() throws EmptyStackException { try (Scope scope = scopeManager.active()) { if (scope == null) { throw new EmptyStackException(); } return scope.span(); } }
Source:
public EapResult process(EapMessage message) { if (message.eapCode == EAP_CODE_SUCCESS) { transitionTo(new FinalState()); return new EapSuccess(MSK, EMSK); } else if (message.eapCode == EAP_CODE_FAILURE) { transitionTo(new FinalState()); return new EapFailure(); } else if (message.eapData.eapType == EAP_NOTIFICATION) { return handleEapNotification(mTAG, message); } if (message.eapData.eapType != getEapMethod()) { return new EapError(new EapInvalidRequestException( "Expected EAP Type " + getEapMethod() + ", received " + message.eapData.eapType)); } DecodeResult<EapAkaTypeData> decodeResult = mEapAkaTypeDataDecoder.decode(message.eapData.eapTypeData); if (!decodeResult.isSuccessfulDecode()) { return buildClientErrorResponse( message.eapIdentifier, EAP_TYPE_AKA, decodeResult.atClientErrorCode); } EapAkaTypeData eapAkaTypeData = decodeResult.eapTypeData; switch (eapAkaTypeData.eapSubtype) { case EAP_AKA_CHALLENGE: break; case EAP_AKA_NOTIFICATION: throw new UnsupportedOperationException( "EAP-AKA notifications not supported yet"); default: return buildClientErrorResponse( message.eapIdentifier, EAP_TYPE_AKA, AtClientErrorCode.UNABLE_TO_PROCESS); } if (!isValidChallengeAttributes(eapAkaTypeData)) { return buildClientErrorResponse( message.eapIdentifier, EAP_TYPE_AKA, AtClientErrorCode.UNABLE_TO_PROCESS); } return null; }

Target:
public EapResult process(EapMessage message) { if (message.eapCode == EAP_CODE_SUCCESS) { if (!mCanReceiveSuccess) { LOG.e(mTAG, "Received unexpected EAP-Success"); return new EapError( new EapInvalidRequestException( "Received an EAP-Success in the ChallengeState")); } transitionTo(new FinalState()); return new EapSuccess(mMSK, mEMSK); } else if (message.eapCode == EAP_CODE_FAILURE) { transitionTo(new FinalState()); return new EapFailure(); } else if (message.eapData.eapType == EAP_NOTIFICATION) { return handleEapNotification(mTAG, message); } if (message.eapData.eapType != getEapMethod()) { return new EapError(new EapInvalidRequestException( "Expected EAP Type " + getEapMethod() + ", received " + message.eapData.eapType)); } DecodeResult<EapAkaTypeData> decodeResult = mEapAkaTypeDataDecoder.decode(message.eapData.eapTypeData); if (!decodeResult.isSuccessfulDecode()) { return buildClientErrorResponse( message.eapIdentifier, EAP_TYPE_AKA, decodeResult.atClientErrorCode); } EapAkaTypeData eapAkaTypeData = decodeResult.eapTypeData; switch (eapAkaTypeData.eapSubtype) { case EAP_AKA_CHALLENGE: break; case EAP_AKA_NOTIFICATION: throw new UnsupportedOperationException( "EAP-AKA notifications not supported yet"); default: return buildClientErrorResponse( message.eapIdentifier, EAP_TYPE_AKA, AtClientErrorCode.UNABLE_TO_PROCESS); } if (!isValidChallengeAttributes(eapAkaTypeData)) { return buildClientErrorResponse( message.eapIdentifier, EAP_TYPE_AKA, AtClientErrorCode.UNABLE_TO_PROCESS); } return null; }
Source:
public static void setupJoysticks() { DriveCode.leftJoystickChannel = Igneous.joystick1.getYAxisSource(); DriveCode.rightJoystickChannel = Igneous.joystick1.getAxisSource(6); DriveCode.octocanumShifting = BooleanMixing.createDispatch(Igneous.joystick1.getButtonChannel(1), Igneous.globalPeriodic); Elevator.raisingInput = BooleanMixing.createDispatch(Igneous.joystick1.getButtonChannel(2), Igneous.globalPeriodic); Elevator.loweringInput = BooleanMixing.createDispatch(Igneous.joystick1.getButtonChannel(3), Igneous.globalPeriodic); }

Target:
public static void setupJoysticks() { DriveCode.leftJoystickChannel = Igneous.joystick1.getYAxisSource(); DriveCode.rightJoystickChannel = Igneous.joystick1.getAxisSource(6); DriveCode.octocanumShifting = BooleanMixing.createDispatch(Igneous.joystick1.getButtonChannel(1), Igneous.globalPeriodic); Elevator.raisingInput = Igneous.joystick1.getButtonSource(2); Elevator.loweringInput = Igneous.joystick1.getButtonSource(3); Rollers.runRollersButton = Igneous.joystick2.getButtonSource(3); Rollers.toggleRollersButton =Igneous.joystick2.getButtonSource(4); }
Source:
public void close() throws IOException { if (!closed && inputStream != null) { try { ByteStreams.exhaust(this); inputStream.close(); } finally { this.closed = true; } } }

Target:
public void close() throws IOException { if (!closed && in != null) { try { ByteStreams.exhaust(this); super.in.close(); } finally { this.closed = true; } } }
Source:
private void bind() { $(shoppingBagWidget).hide(); shoppingBagOpen = false; $(backTop).click(new Function() { @Override public void f() { $("html, body").each(new Function() { @Override public void f(Element element) { new ScrollTopAnimation(element).run(ANIMATION_DURATION); } }); } }); $(cartButton).click(new Function() { @Override public void f() { if (shoppingBagOpen) { $(shoppingBagWidget).show(); $(cartIcon).attr("class", "iconClose"); shoppingBagOpen = false; } else { $(shoppingBagWidget).hide(); $(cartIcon).attr("class", "iconCart"); shoppingBagOpen = true; } } }); setI18nAnchors(); }

Target:
private void bind() { $(shoppingBagWidget).hide(); shoppingBagOpen = false; $(backTop).click(new Function() { @Override public void f() { $("html, body").each(new Function() { @Override public void f(Element element) { new ScrollTopAnimation(element).run(ANIMATION_DURATION); } }); } }); $(cartButton).click(new Function() { @Override public void f() { if (shoppingBagOpen) { $(shoppingBagWidget).show(); $(cartIcon).attr("class", fontRes.icons().iconClose()); shoppingBagOpen = false; } else { $(shoppingBagWidget).hide(); $(cartIcon).attr("class", fontRes.icons().iconCart()); shoppingBagOpen = true; } } }); setI18nAnchors(); }
Source:
public static org.kie.dmn.model.api.InputClause dmnFromWB(final InputClause wb) { org.kie.dmn.model.api.InputClause result = new org.kie.dmn.model.v1_2.TInputClause(); result.setId(wb.getId().getValue()); result.setDescription(DescriptionPropertyConverter.dmnFromWB(wb.getDescription())); org.kie.dmn.model.api.LiteralExpression expression = LiteralExpressionPropertyConverter.dmnFromWB(wb.getInputExpression()); UnaryTests inputValues = UnaryTestsPropertyConverter.dmnFromWB(wb.getInputValues()); if (expression != null) { expression.setParent(result); } result.setInputExpression(expression); if (inputValues != null && !inputValues.getText().isEmpty()) { inputValues.setParent(result); result.setInputValues(inputValues); } return result; }

Target:
public static org.kie.dmn.model.api.InputClause dmnFromWB(final InputClause wb) { org.kie.dmn.model.api.InputClause result = new org.kie.dmn.model.v1_2.TInputClause(); result.setId(wb.getId().getValue()); result.setDescription(DescriptionPropertyConverter.dmnFromWB(wb.getDescription())); org.kie.dmn.model.api.LiteralExpression expression = LiteralExpressionPropertyConverter.dmnFromWB(wb.getInputExpression()); UnaryTests inputValues = UnaryTestsPropertyConverter.dmnFromWB(wb.getInputValues()); if (expression != null) { expression.setParent(result); } result.setInputExpression(expression); if (inputValues != null && StringUtils.nonEmpty(inputValues.getText())) { inputValues.setParent(result); result.setInputValues(inputValues); } return result; }
Source:
public void onDisplay(NavigateEvent navigateEvent) { super.onDisplay(navigateEvent); if (!tabPane.getTabs().isEmpty()) { Tab tab = tabPane.getSelectionModel().getSelectedItem(); Optional.ofNullable(nameToChatTabController.get(tab.getId())).ifPresent(AbstractChatTabController::onDisplay); } }

Target:
public void onDisplay(NavigateEvent navigateEvent) { super.onDisplay(navigateEvent); Platform.runLater(() -> { if (!tabPane.getTabs().isEmpty()) { Tab tab = tabPane.getSelectionModel().getSelectedItem(); if (tab != null) { nameToChatTabController.get(tab.getId()).onDisplay(); } } }); }
Source:
public static String buildCommandLine(String workspace) throws NullPointerException { String property = System.getProperty(PROP_VM); Assert.isNotNull(property, "'" + PROP_VM + "' system property is not set!"); StringBuilder result = new StringBuilder(512); result.append(property); result.append('\n'); String vmargs = System.getProperty(PROP_VMARGS); if (vmargs != null) { result.append(vmargs); } property = System.getProperty(PROP_COMMANDS); if (property == null) { result.append(CMD_DATA); result.append('\n'); result.append(workspace); result.append('\n'); } else { int cmd_data_pos = property.lastIndexOf(CMD_DATA); if (cmd_data_pos != -1) { cmd_data_pos += CMD_DATA.length() + 1; result.append(property.substring(0, cmd_data_pos)); result.append(workspace); int nextArg = property.indexOf("\n-", cmd_data_pos - 1); if (nextArg != -1) { result.append(property.substring(nextArg)); } } else { result.append(CMD_DATA); result.append('\n'); result.append(workspace); result.append('\n'); result.append(property); } } if (vmargs != null) { if (result.charAt(result.length() - 1) != '\n') { result.append('\n'); } result.append(CMD_VMARGS); result.append('\n'); result.append(vmargs); } return result.toString(); }

Target:
private static String buildCommandLine(String workspace) { String property = System.getProperty(PROP_VM); if (property == null) { if (!Platform.inDevelopmentMode()) { WorkbenchPlugin.log(NLS.bind(WorkbenchMessages.Workbench_missingPropertyMessage, PROP_VM)); } return null; } StringBuilder result = new StringBuilder(512); result.append(property); result.append('\n'); String vmargs = System.getProperty(PROP_VMARGS); if (vmargs != null) { result.append(vmargs); } property = System.getProperty(PROP_COMMANDS); if (property == null) { result.append(CMD_DATA); result.append('\n'); result.append(workspace); result.append('\n'); } else { int cmd_data_pos = property.lastIndexOf(CMD_DATA); if (cmd_data_pos != -1) { cmd_data_pos += CMD_DATA.length() + 1; result.append(property.substring(0, cmd_data_pos)); result.append(workspace); int nextArg = property.indexOf("\n-", cmd_data_pos - 1); if (nextArg != -1) { result.append(property.substring(nextArg)); } } else { result.append(CMD_DATA); result.append('\n'); result.append(workspace); result.append('\n'); result.append(property); } } if (vmargs != null) { if (result.charAt(result.length() - 1) != '\n') { result.append('\n'); } result.append(CMD_VMARGS); result.append('\n'); result.append(vmargs); } return result.toString(); }
Source:
public ImmutablePair<String, ImmutableSet<String>> parse(String experimentAccession) { try (TsvStreamer aeTitleIdfStreamer = idfReaderFactory.create(experimentAccession); TsvStreamer titleIdfStreamer = idfReaderFactory.create(experimentAccession); TsvStreamer pubmedIdfStreamer = idfReaderFactory.create(experimentAccession)) { String title = ""; title = aeTitleIdfStreamer.get() .filter(line -> line.length > 1) .filter(line -> AE_EXPERIMENT_DISPLAY_NAME.equalsIgnoreCase(line[0].trim())) .map(line-> line[1]) .findFirst() .orElse(""); if(title.isEmpty()) { title = titleIdfStreamer.get() .filter(line -> line.length > 1) .filter(line -> INVESTIGATION_TITLE_ID.equalsIgnoreCase(line[0].trim())) .map(line -> line[1]) .findFirst() .orElse(""); } ImmutableSet<String> pubmedIds = ImmutableSet.copyOf( pubmedIdfStreamer.get() .filter(line -> line.length > 1) .filter(line -> PUBMED_ID.equalsIgnoreCase(line[0].trim())) .flatMap(line -> Arrays.stream(line).skip(1)) .iterator()); return ImmutablePair.of(title, pubmedIds); } }

Target:
public ImmutablePair<String, ImmutableSet<String>> parse(String experimentAccession) { try ( TsvStreamer titleIdfStreamer = idfReaderFactory.create(experimentAccession); TsvStreamer pubmedIdfStreamer = idfReaderFactory.create(experimentAccession)) { Map<String, String> titles = titleIdfStreamer.get() .filter(line -> line.length > 1) .filter(line -> AE_EXPERIMENT_DISPLAY_NAME.equalsIgnoreCase(line[0].trim()) || INVESTIGATION_TITLE_ID.equalsIgnoreCase(line[0].trim())) .collect(Collectors.toMap(line -> line[0].toUpperCase().trim(), line-> line[1])); String title = titles.getOrDefault(AE_EXPERIMENT_DISPLAY_NAME.toUpperCase(), titles.getOrDefault(INVESTIGATION_TITLE_ID.toUpperCase(), "")); ImmutableSet<String> pubmedIds = ImmutableSet.copyOf( pubmedIdfStreamer.get() .filter(line -> line.length > 1) .filter(line -> PUBMED_ID.equalsIgnoreCase(line[0].trim())) .flatMap(line -> Arrays.stream(line).skip(1)) .iterator()); return ImmutablePair.of(title, pubmedIds); } }
Source:
public List<ModuleMetadata> findAllByContainerId(String containerId) { Assert.hasLength(containerId, "containerId is required"); List<ModuleMetadata> results = new ArrayList<ModuleMetadata>(); try { List<String> deployedModules = getDeployedModules(containerId); for (String moduleId : deployedModules) { results.add(findOne(containerId, moduleId)); } return (List<ModuleMetadata>) updateDeploymentStatus(results); } catch (Exception e) { throw ZooKeeperUtils.wrapThrowable(e); } }

Target:
public List<ModuleMetadata> findAllByContainerId(String containerId) { Assert.hasText(containerId, "containerId is required"); List<ModuleMetadata> results = new ArrayList<ModuleMetadata>(); try { List<String> deployedModules = getDeployedModules(containerId); for (String moduleId : deployedModules) { results.add(findOne(containerId, moduleId)); } return (List<ModuleMetadata>) updateDeploymentStatus(results); } catch (Exception e) { throw ZooKeeperUtils.wrapThrowable(e); } }
Source:
public String getFandomUrl(EnvType envType) { String hostname = FANDOM_HOSTNAME; if (!envType.equals(PROD)) { hostname = env + "." + hostname; } return "http://" + hostname + "/"; }

Target:
public String getFandomUrl(EnvType envType) { String hostname = FANDOM_HOSTNAME; if (!envType.equals(PROD)) { hostname = env + "." + hostname; } return HTTP_PREFIX + hostname + "/"; }
Source:
public static long getPageSizeMs(Scan scan) { long pageSizeMs = Long.MAX_VALUE; byte[] pageSizeMsBytes = scan.getAttribute(BaseScannerRegionObserver.SERVER_PAGE_SIZE_MS); if (pageSizeMsBytes != null) { pageSizeMs = Bytes.toLong(pageSizeMsBytes); } return pageSizeMs; }

Target:
private static long getPageSizeMs(Scan scan) { long pageSizeMs = Long.MAX_VALUE; byte[] pageSizeMsBytes = scan.getAttribute(BaseScannerRegionObserver.SERVER_PAGE_SIZE_MS); if (pageSizeMsBytes != null) { pageSizeMs = Bytes.toLong(pageSizeMsBytes); } return pageSizeMs; }
Source:
private static boolean isChildAndParent(String childContextId, String parentContextId) { IContextService contextService = PlatformUI.getWorkbench().getService(IContextService.class); try { for (String c = contextService.getContext(childContextId).getParentId(); c != null; c = contextService .getContext(c).getParentId()) { if (c.equals(parentContextId)) { return true; } } } catch (NotDefinedException e) { } return false; }

Target:
private boolean isChildAndParent(String childContextId, String parentContextId) { for (String c = getParentContextId(childContextId); c != null; c = getParentContextId(c)) { if (c.equals(parentContextId)) { return true; } } return false; }
Source:
protected static void getExpiredJobs(HelixDataAccessor dataAccessor, HelixPropertyStore<ZNRecord> propertyStore, WorkflowConfig workflowConfig, WorkflowContext workflowContext, Set<String> expiredJobs, Set<String> jobsWithoutConfig) { if (workflowContext != null) { Map<String, TaskState> jobStates = workflowContext.getJobStates(); for (String job : workflowConfig.getJobDag().getAllNodes()) { JobConfig jobConfig = TaskUtil.getJobConfig(dataAccessor, job); JobContext jobContext = TaskUtil.getJobContext(propertyStore, job); if (jobConfig != null) { long expiry = jobConfig.getExpiry(); if (jobContext != null && jobStates.get(job) == TaskState.COMPLETED) { if (jobContext.getFinishTime() != WorkflowContext.UNFINISHED && System.currentTimeMillis() >= jobContext.getFinishTime() + expiry) { expiredJobs.add(job); } } } else { LOG.error(String.format( "Job %s exists in JobDAG but JobConfig is missing! Job might have been deleted manually from the JobQueue: %s, or left in the DAG due to a failed clean-up attempt from last purge.", job, workflowConfig.getWorkflowId())); jobsWithoutConfig.add(job); } } } }

Target:
protected static void getExpiredJobs(HelixDataAccessor dataAccessor, HelixPropertyStore<ZNRecord> propertyStore, WorkflowConfig workflowConfig, WorkflowContext workflowContext, Set<String> expiredJobs, Set<String> jobsWithoutConfig) { if (workflowContext != null) { Map<String, TaskState> jobStates = workflowContext.getJobStates(); for (String job : workflowConfig.getJobDag().getAllNodes()) { JobConfig jobConfig = TaskUtil.getJobConfig(dataAccessor, job); JobContext jobContext = TaskUtil.getJobContext(propertyStore, job); if (jobConfig == null) { LOG.error(String.format( "Job %s exists in JobDAG but JobConfig is missing! Job might have been deleted manually from the JobQueue: %s, or left in the DAG due to a failed clean-up attempt from last purge.", job, workflowConfig.getWorkflowId())); jobsWithoutConfig.add(job); } else { long expiry = jobConfig.getExpiry(); if (jobContext != null && jobStates.get(job) == TaskState.COMPLETED) { if (jobContext.getFinishTime() != WorkflowContext.UNFINISHED && System.currentTimeMillis() >= jobContext.getFinishTime() + expiry) { expiredJobs.add(job); } } } } } }
Source:
public void runTask() throws Exception { final Spreadsheet sheet = new Spreadsheet("Invoices"); process(sheet, new File(DIR)); final ByteArrayOutputStream stream = new ByteArrayOutputStream(); sheet.exportToXLSSheet(stream); output("invoices.xls", stream.toByteArray()); final String subject = "Recibos passados a entidades terceiras"; final String body = "Listagem atualizada com os 'recibos' passados no Fénix entidades terceiras: " + new DateTime().toString("yyyy-MM-dd HH:mm"); TaskUtils.sendErrorReport("invoices_" + new DateTime().toString("yyyy_MM_dd_HH_mm") + ".xls", stream.toByteArray(), subject, body); }

Target:
public void runTask() throws Exception { final Spreadsheet sheet = new Spreadsheet("Invoices"); process(sheet, new File(DIR)); final ByteArrayOutputStream stream = new ByteArrayOutputStream(); sheet.exportToXLSSheet(stream); output("invoices.xls", stream.toByteArray()); final String subject = "Recibos passados a entidades terceiras"; final String body = "Listagem atualizada com os 'recibos' passados no Fénix entidades terceiras: " + new DateTime().toString("yyyy-MM-dd HH:mm"); TaskUtils.sendReport("invoices_" + new DateTime().toString("yyyy_MM_dd_HH_mm") + ".xls", stream.toByteArray(), subject, body); }
Source:
public void render(Context context, ImageResource value, SafeHtmlBuilder sb) { if (value != null) { sb.append(template.imageContainerWithStyleClass( styleClass == null ? style : "", styleClass == null ? "" : styleClass, SafeHtmlUtils.fromTrustedString(AbstractImagePrototype.create(value).getHTML()))); } }

Target:
public void render(Context context, ImageResource value, SafeHtmlBuilder sb) { if (value != null) { sb.append(template.imageContainerWithStyleClass( style, styleClass, SafeHtmlUtils.fromTrustedString(AbstractImagePrototype.create(value).getHTML()))); } }
Source:
public void persistInfraVariables() { logger.info("persist start"); if (!nodeSource.getName().equals(NodeSource.DEFAULT_LOCAL_NODES_NODE_SOURCE_NAME)) { readLock.lock(); logger.info("lock acquired start"); try { if (dbManager == null) { setRmDbManager(RMDBManager.getInstance()); } logger.info("get node source start"); logger.info("get node source end"); if (nodeSourceData != null) { nodeSourceData.setInfrastructureVariables(persistedInfraVariables); dbManager.updateNodeSource(nodeSourceData); logger.info("update node source end"); } } catch (RuntimeException e) { logger.error("Exception while persisting runtime variables: " + e.getMessage()); throw e; } finally { readLock.unlock(); logger.info("lock released"); } } logger.info("persist end"); }

Target:
public void persistInfraVariables() { if (!nodeSource.getName().equals(NodeSource.DEFAULT_LOCAL_NODES_NODE_SOURCE_NAME)) { readLock.lock(); try { if (dbManager == null) { setRmDbManager(RMDBManager.getInstance()); } if (nodeSourceData != null) { nodeSourceData.setInfrastructureVariables(persistedInfraVariables); dbManager.updateNodeSource(nodeSourceData); } } catch (RuntimeException e) { logger.error("Exception while persisting runtime variables: " + e.getMessage()); throw e; } finally { readLock.unlock(); } } }
Source:
public void processes(WebContext ctx) { ElasticQuery<Process> query = elastic.select(Process.class).orderDesc(Process.STARTED); UserInfo user = UserContext.getCurrentUser(); if (!user.hasPermission(PERMISSION_MANAGE_ALL_PROCESSES)) { query.eq(Process.TENANT_ID, user.getTenantId()); } if (!user.hasPermission(PERMISSION_MANAGE_PROCESSES)) { query.eq(Process.USER_ID, user.getUserId()); } query.where(Elastic.FILTERS.oneInField(Process.REQUIRED_PERMISSION, new ArrayList<>(user.getPermissions())) .orEmpty() .build()); ElasticPageHelper<Process> ph = ElasticPageHelper.withQuery(query); ph.withContext(ctx); ph.addTermAggregation(Process.STATE, ProcessState.class); ph.addParameterFacet("reference", "reference-label", Process.REFERENCES, NLS.get("ProcessController.reference"), null); ph.addTermAggregation(Process.PROCESS_TYPE, value -> NLS.getIfExists(value, null).orElse(null)); ph.addTimeAggregation(Process.STARTED, DateRange.lastFiveMinutes(), DateRange.lastFiveteenMinutes(), DateRange.lastTwoHours(), DateRange.today(), DateRange.yesterday(), DateRange.thisWeek(), DateRange.lastWeek()); ph.withSearchFields(QueryField.contains(ProcessLog.SEARCH_FIELD)); ctx.respondWith().template("templates/biz/process/processes.html.pasta", ph.asPage()); }

Target:
public void processes(WebContext ctx) { ElasticQuery<Process> query = elastic.select(Process.class).orderDesc(Process.STARTED); UserInfo user = UserContext.getCurrentUser(); if (!user.hasPermission(PERMISSION_MANAGE_ALL_PROCESSES)) { query.eq(Process.TENANT_ID, user.getTenantId()); } if (!user.hasPermission(PERMISSION_MANAGE_PROCESSES)) { query.eq(Process.USER_ID, user.getUserId()); } query.where(Elastic.FILTERS.oneInField(Process.REQUIRED_PERMISSION, new ArrayList<>(user.getPermissions())) .orEmpty() .build()); ElasticPageHelper<Process> pageHelper = ElasticPageHelper.withQuery(query); pageHelper.withContext(ctx); pageHelper.addTermAggregation(Process.STATE, ProcessState.class); pageHelper.addParameterFacet("reference", "reference-label", Process.REFERENCES, NLS.get("ProcessController.reference"), null); pageHelper.addTermAggregation(Process.PROCESS_TYPE, value -> NLS.getIfExists(value, null).orElse(null)); pageHelper.addTimeAggregation(Process.STARTED, DateRange.lastFiveMinutes(), DateRange.lastFiveteenMinutes(), DateRange.lastTwoHours(), DateRange.today(), DateRange.yesterday(), DateRange.thisWeek(), DateRange.lastWeek()); pageHelper.withSearchFields(QueryField.contains(ProcessLog.SEARCH_FIELD)); ctx.respondWith().template("templates/biz/process/processes.html.pasta", pageHelper.asPage()); }
Source:
public Map<String, Response> getResponses() { return responses; }

Target:
public Map<String, Response> getResponses() { if (this.responsesObject == null && responses != null) { this.responsesObject = new Responses(); for (String key : responses.keySet()) { this.responsesObject.put(key, responses.get(key)); } } return responses; }
Source:
public void onDelete() { try { fileUtilities.remove(this.localFolder.getAbsolutePath()); LOGGER.info("Deleted " + this); } catch (IOException e) { LOGGER.error("Couldn't delete " + this, e); } }

Target:
public void onDelete() { try { FileUtils.deleteDirectory(this.localFolder); LOGGER.info("Deleted " + this); } catch (IOException e) { LOGGER.error("Couldn't delete " + this, e); } }
Source:
public String getId() { return this.difficultyResourceKey.replace("options.difficulty.", ""); }

Target:
public String getId() { return this.id; }
Source:
public List<SearchSuggestion> getSuggestions(String namespace, String input) { return graphSearchService.getSuggestions(namespace, input); }

Target:
public Response getSuggestions(String namespace, String input) { List<SearchSuggestion> result = graphSearchService.getSuggestions(namespace, input); if(result.size() < 1) { return Response.noContent().build(); } return Response.ok(result).type(MediaType.APPLICATION_JSON_TYPE).build(); }
Source:
public Class getLambdaInterface() { checkState(!isValueTypeArgument(), "lambdaInterface only applies to function type argument"); return lambdaInterface.get(); }

Target:
public Class getLambdaInterface() { checkState(getArgumentType() == FUNCTION_TYPE, "lambdaInterface only applies to function type argument"); return lambdaInterface.get(); }
Source:
private CompletableFuture<Void> handleDataReadCommand(InvocationContext ctx, DataCommand command) { return ctx.onReturn((rCtx, rCommand, rv, throwable) -> { DataCommand dataCommand = (DataCommand) rCommand; if (throwable != null) { if (throwable instanceof RpcException && performPartitionCheck(rCtx, dataCommand)) { throw log.degradedModeKeyUnavailable(dataCommand.getKey()); } else { if (throwable instanceof TimeoutException && performPartitionCheck(rCtx, dataCommand)) { List<Address> owners = distributionManager.locate(dataCommand.getKey()); if (!InfinispanCollections.containsAny(transport.getMembers(), owners)) { throw log.degradedModeKeyUnavailable(dataCommand.getKey()); } } throw throwable; } } postOperationPartitionCheck(rCtx, dataCommand, dataCommand.getKey()); return null; }); }

Target:
private CompletableFuture<Void> handleDataReadCommand(InvocationContext ctx, DataCommand command) { return ctx.onReturn((rCtx, rCommand, rv, throwable) -> { DataCommand dataCommand = (DataCommand) rCommand; if (throwable != null) { if (throwable instanceof RpcException && performPartitionCheck(rCtx, dataCommand)) { throw log.degradedModeKeyUnavailable(dataCommand.getKey()); } else { throw throwable; } } postOperationPartitionCheck(rCtx, dataCommand, dataCommand.getKey()); return null; }); }
Source:
public Seat getCurrentUserSeat(Authentication auth) { User user = (User) auth.getPrincipal(); return seatService.getSeatByUsername(user.getUsername()); }

Target:
public List<Seat> getCurrentUserSeat(Authentication auth) { User user = (User) auth.getPrincipal(); return seatService.getSeatsByUsername(user.getUsername()); }
Source:
public PagedModel<TaskDefinitionResource> list(Pageable pageable, @RequestParam(required = false) String search, @RequestParam(required = false) boolean manifest, @RequestParam(required = false) String dslText, PagedResourcesAssembler<TaskExecutionAwareTaskDefinition> assembler) { final Page<TaskDefinition> taskDefinitions; if (search != null) { if (dslText != null) { taskDefinitions = repository.findByTaskNameContainsAndDslTextContains(search, dslText, pageable); } else { taskDefinitions = repository.findByTaskNameContains(search, pageable); } } else { if (dslText != null) { taskDefinitions = repository.findByDslTextContains(dslText, pageable); } else { taskDefinitions = repository.findAll(pageable); } } final java.util.HashMap<String, TaskDefinition> taskDefinitionMap = new java.util.HashMap<>(); for (TaskDefinition taskDefinition : taskDefinitions) { taskDefinitionMap.put(taskDefinition.getName(), taskDefinition); } final List<TaskExecution> taskExecutions; if (!taskDefinitionMap.isEmpty()) { taskExecutions = this.explorer.getLatestTaskExecutionsByTaskNames( taskDefinitionMap.keySet().toArray(new String[taskDefinitionMap.size()])); } else { taskExecutions = null; } final Page<TaskExecutionAwareTaskDefinition> taskExecutionAwareTaskDefinitions = taskDefinitions .map(new TaskDefinitionConverter(taskExecutions)); PagedModel<TaskDefinitionResource> taskDefinitionResources = assembler.toModel(taskExecutionAwareTaskDefinitions, new Assembler(manifest)); updateComposedTaskElement(taskDefinitionResources.getContent()); return taskDefinitionResources; }

Target:
public PagedModel<TaskDefinitionResource> list(Pageable pageable, @RequestParam(required = false) String search, @RequestParam(required = false) boolean manifest, @RequestParam(required = false) String dslText, PagedResourcesAssembler<TaskExecutionAwareTaskDefinition> assembler) { final Page<TaskDefinition> taskDefinitions; if (search != null) { if (dslText != null) { throw new TaskQueryParamException(new String[] {"search", "dslText"}); } else { taskDefinitions = repository.findByTaskNameContains(search, pageable); } } else { if (dslText != null) { taskDefinitions = repository.findByDslTextContains(dslText, pageable); } else { taskDefinitions = repository.findAll(pageable); } } final java.util.HashMap<String, TaskDefinition> taskDefinitionMap = new java.util.HashMap<>(); for (TaskDefinition taskDefinition : taskDefinitions) { taskDefinitionMap.put(taskDefinition.getName(), taskDefinition); } final List<TaskExecution> taskExecutions; if (!taskDefinitionMap.isEmpty()) { taskExecutions = this.explorer.getLatestTaskExecutionsByTaskNames( taskDefinitionMap.keySet().toArray(new String[taskDefinitionMap.size()])); } else { taskExecutions = null; } final Page<TaskExecutionAwareTaskDefinition> taskExecutionAwareTaskDefinitions = taskDefinitions .map(new TaskDefinitionConverter(taskExecutions)); PagedModel<TaskDefinitionResource> taskDefinitionResources = assembler.toModel(taskExecutionAwareTaskDefinitions, new Assembler(manifest)); updateComposedTaskElement(taskDefinitionResources.getContent()); return taskDefinitionResources; }
Source:
public FixedDoubleHistogram(int bucketCount, double min, double max) { this.bucketCount = bucketCount; this.min = min; this.max = max; FixedHistogramUtils.verifyParams(bucketCount, min, max); this.weights = new double[bucketCount]; }

Target:
public FixedDoubleHistogram(int bucketCount, double min, double max) { this.bucketCount = bucketCount; this.min = min; this.max = max; verifyParameters(bucketCount, min, max); this.weights = new double[bucketCount]; }
Source:
public static void fhirResourceGetHistory(String resourceName, String versionId) throws IOException, URISyntaxException { CloudHealthcare client = createClient(); HttpClient httpClient = HttpClients.createDefault(); String uri = String.format( "%sv1beta1/%s/_history/%s", client.getRootUrl(), resourceName, versionId); URIBuilder uriBuilder = new URIBuilder(uri) .setParameter("access_token", getAccessToken()); HttpUriRequest request = RequestBuilder .get() .setUri(uriBuilder.build()) .addHeader("Content-Type", "application/fhir+json") .addHeader("Accept-Charset", "utf-8") .addHeader("Accept", "application/fhir+json; charset=utf-8") .build(); HttpResponse response = httpClient.execute(request); HttpEntity responseEntity = response.getEntity(); if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) { System.err.print(String.format( "Exception retrieving FHIR history: %s\n", response.getStatusLine().toString())); responseEntity.writeTo(System.err); throw new RuntimeException(); } System.out.println("FHIR resource history list retrieved: "); responseEntity.writeTo(System.out); }

Target:
public static void fhirResourceGetHistory(String resourceName, String versionId) throws IOException, URISyntaxException { CloudHealthcare client = createClient(); HttpClient httpClient = HttpClients.createDefault(); String uri = String.format( "%sv1/%s/_history/%s", client.getRootUrl(), resourceName, versionId); URIBuilder uriBuilder = new URIBuilder(uri) .setParameter("access_token", getAccessToken()); HttpUriRequest request = RequestBuilder .get() .setUri(uriBuilder.build()) .addHeader("Content-Type", "application/fhir+json") .addHeader("Accept-Charset", "utf-8") .addHeader("Accept", "application/fhir+json; charset=utf-8") .build(); HttpResponse response = httpClient.execute(request); HttpEntity responseEntity = response.getEntity(); if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) { System.err.print(String.format( "Exception retrieving FHIR history: %s\n", response.getStatusLine().toString())); responseEntity.writeTo(System.err); throw new RuntimeException(); } System.out.println("FHIR resource history list retrieved: "); responseEntity.writeTo(System.out); }
Source:
public ModelBuilderTest() { dictionary = new EntityDictionary(Collections.EMPTY_MAP); dictionary.bindEntity(getType(Book.class)); dictionary.bindEntity(getType(Author.class)); dictionary.bindEntity(getType(Publisher.class)); }

Target:
public ModelBuilderTest() { dictionary = new EntityDictionary(Collections.EMPTY_MAP); dictionary.bindEntity(Book.class); dictionary.bindEntity(Author.class); dictionary.bindEntity(Publisher.class); }
Source:
private void setupConfForSparkR(SparkConf conf) { String sparkRBasePath = new InterpreterProperty("SPARK_HOME", null, null, null).getValue(); File sparkRPath; if (null == sparkRBasePath) { sparkRBasePath = new InterpreterProperty("ZEPPELIN_HOME", "zeppelin.home", "../", null).getValue(); sparkRPath = new File(sparkRBasePath, "interpreter" + File.separator + "spark" + File.separator + "R"); } else { sparkRPath = new File(sparkRBasePath, "R" + File.separator + "lib"); } sparkRPath = new File(sparkRPath, "sparkr.zip"); if (sparkRPath.exists() && sparkRPath.isFile()) { String archives = null; if (conf.contains("spark.yarn.dist.archives")) { archives = conf.get("spark.yarn.dist.archives"); } if (archives != null) { archives = archives + "," + "file:/" + sparkRPath + "#sparkr"; } else { archives = "file:/" + sparkRPath + "#sparkr"; } conf.set("spark.yarn.dist.archives", archives); } else { logger.warn("sparkr.zip is not found, sparkr may not work."); } }

Target:
private void setupConfForSparkR(SparkConf conf) { String sparkRBasePath = new InterpreterProperty("SPARK_HOME", null, null, null).getValue(); File sparkRPath; if (null == sparkRBasePath) { sparkRBasePath = new InterpreterProperty("ZEPPELIN_HOME", "zeppelin.home", "../", null).getValue(); sparkRPath = new File(sparkRBasePath, "interpreter" + File.separator + "spark" + File.separator + "R"); } else { sparkRPath = new File(sparkRBasePath, "R" + File.separator + "lib"); } sparkRPath = new File(sparkRPath, "sparkr.zip"); if (sparkRPath.exists() && sparkRPath.isFile()) { String archives = null; if (conf.contains("spark.yarn.dist.archives")) { archives = conf.get("spark.yarn.dist.archives"); } if (archives != null) { archives = archives + "," + sparkRPath + "#sparkr"; } else { archives = sparkRPath + "#sparkr"; } conf.set("spark.yarn.dist.archives", archives); } else { logger.warn("sparkr.zip is not found, sparkr may not work."); } }
Source:
public void setStepProperties(Map<String, Properties> properties) { Assert.notNull(properties, "Step properties cannot be null"); for(Map.Entry<String, Properties> propertiesEntry : properties.entrySet()) { String stepName = propertiesEntry.getKey(); if (!propertiesEntry.getValue().isEmpty()) { if (this.stepProperties.containsKey(stepName)) { Properties existingStepProperties = this.stepProperties.get(stepName); existingStepProperties.putAll(propertiesEntry.getValue()); this.stepProperties.put(stepName, existingStepProperties); } else { this.stepProperties.put(stepName, propertiesEntry.getValue()); } } } }

Target:
public void setStepProperties(Map<String, Properties> properties) { Assert.notNull(properties, "Step properties cannot be null"); for(Map.Entry<String, Properties> propertiesEntry : properties.entrySet()) { String stepName = propertiesEntry.getKey(); Properties stepProperties = propertiesEntry.getValue(); if (!stepProperties.isEmpty()) { if (this.stepProperties.containsKey(stepName)) { Properties existingStepProperties = this.stepProperties.get(stepName); Enumeration<?> stepPropertyNames = stepProperties.propertyNames(); while(stepPropertyNames.hasMoreElements()) { String propertyEntryName = (String) stepPropertyNames.nextElement(); existingStepProperties.put(propertyEntryName, stepProperties.getProperty(propertyEntryName)); } this.stepProperties.put(stepName, existingStepProperties); } else { this.stepProperties.put(stepName, propertiesEntry.getValue()); } } } }
Source:
public Response remove() { get(); RemoveDiskParameters parameters = new RemoveDiskParameters(); parameters.setDiskId(guid); parameters.setStorageDomainId(asGuid(storageDomainId)); return performAction(VdcActionType.RemoveDisk, parameters); }

Target:
public Response remove() { get(); return performAction(VdcActionType.RemoveDisk, new RemoveDiskParameters(guid, asGuid(storageDomainId))); }