auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public CheEnvironmentEngine(SnapshotDao snapshotDao, MachineInstanceProviders machineInstanceProviders, @Named("che.workspace.logs") String machineLogsDir, @Named("che.workspace.default_memory_mb") int defaultMachineMemorySizeMB, EventService eventService, EnvironmentParser environmentParser, DefaultServicesStartStrategy startStrategy, MachineInstanceProvider machineProvider, InfrastructureProvisioner infrastructureProvisioner, @Named("che.api") String apiEndpoint, RecipeDownloader recipeDownloader, ContainerNameGenerator containerNameGenerator, AgentRegistry agentRegistry, WorkspaceSharedPool sharedPool) { this.snapshotDao = snapshotDao; this.eventService = eventService; this.environmentParser = environmentParser; this.startStrategy = startStrategy; this.machineProvider = machineProvider; this.infrastructureProvisioner = infrastructureProvisioner; this.recipeDownloader = recipeDownloader; this.agentRegistry = agentRegistry; this.environments = new ConcurrentHashMap<>(); this.machineInstanceProviders = machineInstanceProviders; this.machineLogsDir = new File(machineLogsDir); this.defaultMachineMemorySizeBytes = Size.parseSize(defaultMachineMemorySizeMB + "MB"); this.stripedLocks = new StripedLocks(16); this.recipeApiPattern = Pattern.compile("(^https?" + apiEndpoint.substring(apiEndpoint.indexOf(":")) + "/recipe/.*$)|(^/recipe/.*$)"); this.containerNameGenerator = containerNameGenerator; eventService.subscribe(event -> { if ((event.getType() == OOM) || (event.getType() == DIE)) { sharedPool.execute(() -> cleanupMachine(event.getWorkspaceId(), event.getMachineId(), event.getType())); } }, InstanceStateEvent.class); }

Target:
public CheEnvironmentEngine(SnapshotDao snapshotDao, MachineInstanceProviders machineInstanceProviders, @Named("che.workspace.logs") String machineLogsDir, @Named("che.workspace.default_memory_mb") int defaultMachineMemorySizeMB, EventService eventService, EnvironmentParser environmentParser, DefaultServicesStartStrategy startStrategy, MachineInstanceProvider machineProvider, InfrastructureProvisioner infrastructureProvisioner, @Named("che.api") String apiEndpoint, RecipeDownloader recipeDownloader, ContainerNameGenerator containerNameGenerator, AgentRegistry agentRegistry, WorkspaceSharedPool sharedPool) { this.snapshotDao = snapshotDao; this.eventService = eventService; this.environmentParser = environmentParser; this.startStrategy = startStrategy; this.machineProvider = machineProvider; this.infrastructureProvisioner = infrastructureProvisioner; this.recipeDownloader = recipeDownloader; this.agentRegistry = agentRegistry; this.sharedPool = sharedPool; this.environments = new ConcurrentHashMap<>(); this.machineInstanceProviders = machineInstanceProviders; this.machineLogsDir = new File(machineLogsDir); this.defaultMachineMemorySizeBytes = Size.parseSize(defaultMachineMemorySizeMB + "MB"); this.stripedLocks = new StripedLocks(16); this.recipeApiPattern = Pattern.compile("(^https?" + apiEndpoint.substring(apiEndpoint.indexOf(":")) + "/recipe/.*$)|(^/recipe/.*$)"); this.containerNameGenerator = containerNameGenerator; }
Source:
private int executeWithParameters(Map<String, Object> params, Query query) { applyMetaQueryParameters(params, query); query.getParameters() .stream() .filter(e -> params.containsKey(e.getName())) .forEach(p -> query.setParameter(p.getName(), params.get(p.getName()))); return query.executeUpdate(); }

Target:
private int executeWithParameters(Map<String, Object> params, Query query) { applyMetaQueryParameters(params, query); return query.executeUpdate(); }
Source:
private void validateGatewayAccount(ValidatableResponse response) { String type = "test"; String serviceName = "a cool service"; response .body("containsKey('gateway_account')", is(true)) .body("gateway_account.gateway_account_id", is(Long.valueOf(accountId))) .body("gateway_account.containsKey('credentials')", is(false)) .body("gateway_account.service_name", is(serviceName)) .body("gateway_account.payment_provider", is(paymentProvider)) .body("gateway_account.type", is(type)) .body("gateway_account.analytics_id", is(analyticsId)) .body("gateway_account.corporate_credit_card_surcharge_amount", isNumber(corporateCreditCardSurchargeAmount)) .body("gateway_account.corporate_debit_card_surcharge_amount", isNumber(corporateDebitCardSurchargeAmount)) .body("gateway_account.card_types", is(notNullValue())) .body("gateway_account.card_types[0].id", is(notNullValue())) .body("gateway_account.card_types[0].label", is("Mastercard")) .body("gateway_account.card_types[0].type", is("CREDIT")) .body("gateway_account.card_types[0].brand", is("master-card")) .body("gateway_account.card_types[1].id", is(notNullValue())) .body("gateway_account.card_types[1].label", is("Visa")) .body("gateway_account.card_types[1].type", is("CREDIT")) .body("gateway_account.card_types[1].brand", is("visa")); }

Target:
private void validateGatewayAccount(ValidatableResponse response) { response .body("containsKey('gateway_account')", is(true)) .body("gateway_account.gateway_account_id", is(Long.valueOf(accountId))) .body("gateway_account.containsKey('credentials')", is(false)) .body("gateway_account.service_name", is("a cool service")) .body("gateway_account.payment_provider", is(paymentProvider)) .body("gateway_account.type", is("test")) .body("gateway_account.analytics_id", is(analyticsId)) .body("gateway_account.corporate_credit_card_surcharge_amount", isNumber(corporateCreditCardSurchargeAmount)) .body("gateway_account.corporate_debit_card_surcharge_amount", isNumber(corporateDebitCardSurchargeAmount)) .body("gateway_account.card_types", is(notNullValue())) .body("gateway_account.card_types", contains( allOf( hasKey("id"), hasEntry("label", "Mastercard"), hasEntry("type", "CREDIT"), hasEntry("brand", "master-card") ), allOf( hasKey("id"), hasEntry("label","Visa"), hasEntry("type", "CREDIT"), hasEntry("brand", "visa") ) )); }
Source:
protected void addRow(EClass clazz, EObject eObject, EStructuralFeature structuralFeature) { Optional<EObject> eObjectToAdd; if (!getViewModelContext().hasService(TableControlService.class)) { final ReferenceService referenceService = getViewModelContext().getService(ReferenceService.class); eObjectToAdd = referenceService.addNewModelElements(eObject, EReference.class.cast(structuralFeature), false); } else { final TableControlService tableService = getViewModelContext() .getService(TableControlService.class); eObjectToAdd = tableService.createNewElement(clazz, eObject, structuralFeature); } if (!eObjectToAdd.isPresent()) { return; } final EObject instance = eObjectToAdd.get(); final EditingDomain editingDomain = getEditingDomain(eObject); if (editingDomain == null) { return; } editingDomain.getCommandStack().execute( AddCommand.create(editingDomain, eObject, structuralFeature, instance)); tableViewer.setSelection(new StructuredSelection(eObjectToAdd.get()), true); }

Target:
protected void addRow(EClass clazz, EObject eObject, EStructuralFeature structuralFeature) { Optional<EObject> eObjectToAdd = null; if (getViewModelContext().hasService(TableControlService.class)) { final TableControlService tableService = getViewModelContext() .getService(TableControlService.class); eObjectToAdd = tableService.createNewElement(clazz, eObject, structuralFeature); } if (eObjectToAdd == null) { final ReferenceService referenceService = getViewModelContext().getService(ReferenceService.class); eObjectToAdd = referenceService.addNewModelElements(eObject, EReference.class.cast(structuralFeature), false); } if (!eObjectToAdd.isPresent()) { return; } final EObject instance = eObjectToAdd.get(); final EditingDomain editingDomain = getEditingDomain(eObject); if (editingDomain == null) { return; } editingDomain.getCommandStack().execute( AddCommand.create(editingDomain, eObject, structuralFeature, instance)); tableViewer.setSelection(new StructuredSelection(eObjectToAdd.get()), true); }
Source:
protected void doExecute() { if (childViewsAdapters == null && childViewsAdaptersForCenterLayout == null) { executeLayoutOnDiagramOpening(); } else { executeLayoutDueToExternalChanges(); } }

Target:
protected void doExecute() { Display.getDefault().syncExec(new Runnable() { @Override public void run() { if (childViewsAdapters == null && childViewsAdaptersForCenterLayout == null) { executeLayoutOnDiagramOpening(); } else { executeLayoutDueToExternalChanges(); } } }); }
Source:
protected void internalReceiveCommand(String itemName, Command command) { for (ModbusBindingProvider provider : providers) { if (provider.providesBindingFor(itemName)) { ModbusBindingConfig config = provider.getConfig(itemName); ModbusSlave slave = modbusSlaves.get(config.slaveName); if(config.getItemClass() == RollershutterItem.class) { if(command instanceof StopMoveType) { slave.executeCommand(command, config.readIndex, config.writeIndex+1); return; } if(command instanceof UpDownType) { slave.executeCommand(command, config.readIndex+1, config.writeIndex); return; } } slave.executeCommand(command, config.readIndex, config.writeIndex); } } }

Target:
protected void internalReceiveCommand(String itemName, Command command) { for (ModbusBindingProvider provider : providers) { if (provider.providesBindingFor(itemName)) { ModbusBindingConfig config = provider.getConfig(itemName); ModbusSlave slave = modbusSlaves.get(config.slaveName); if (config.getItemClass() == RollershutterItem.class) { if (command instanceof StopMoveType) { slave.executeCommand(command, config, config.readIndex, config.writeIndex + 1); return; } if (command instanceof UpDownType) { slave.executeCommand(command, config, config.readIndex + 1, config.writeIndex); return; } } slave.executeCommand(command, config, config.readIndex, config.writeIndex); } } }
Source:
public MethodOutcome updatePatientByIdentifier(@ResourceParam Patient patient, @IdParam IdDt theId, @ConditionalUrlParam String theConditional) { MethodOutcome outcome = new MethodOutcome(); if (theConditional != null) { List<Patient> patientList = null; String args[] = theConditional.split("?"); String parameterPart = args[1]; String paraArgs[] = parameterPart.split("="); String parameterName = paraArgs[0]; if ("name".equals(parameterName)) { StringParam param = new StringParam(); param.setValue(paraArgs[1]); patientList = patientResource.searchByName(param); } else if ("identifier".equals(parameterName)) { TokenParam params = new TokenParam(); params.setValue(paraArgs[1]); patientList = patientResource.searchByIdentifier(params); } else if ("givenName".equals(parameterName)) { StringParam param = new StringParam(); param.setValue(paraArgs[1]); patientList = patientResource.searchByGivenName(param); } if (patientList != null) { if (patientList.size() == 0) { outcome = updatePatient(patient, null); } else if (patientList.size() == 1) { outcome = updatePatient(patient, patientList.get(0).getId()); } else { throw new PreconditionFailedException("There are more than one patient for the given condition"); } } } else { outcome = updatePatient(patient, theId); } return outcome; }

Target:
public MethodOutcome updatePatientByIdentifier(@ResourceParam Patient patient, @IdParam IdDt theId, @ConditionalUrlParam String theConditional) { MethodOutcome outcome = new MethodOutcome(); OperationOutcome operationoutcome = null; if (theConditional != null) { String paramValue = null; List<Patient> patientList = null; String parameterName = null; try { String args[] = theConditional.split("?"); String parameterPart = args[1]; String paraArgs[] = parameterPart.split("="); parameterName = paraArgs[0]; paramValue = paraArgs[1]; } catch (Exception e) { operationoutcome = new OperationOutcome(); operationoutcome.addIssue().setDetails("Please check Condition URL format"); outcome.setOperationOutcome(operationoutcome); return outcome; } if (FHIRConstants.PARAMETER_NAME.equals(parameterName)) { StringParam param = new StringParam(); param.setValue(paramValue); patientList = patientResource.searchByName(param); } else if (FHIRConstants.PARAMETER_IDENTIFIER.equals(parameterName)) { TokenParam params = new TokenParam(); params.setValue(paramValue); patientList = patientResource.searchByIdentifier(params); } else if (FHIRConstants.PARAMETER_GIVENNAME.equals(parameterName)) { StringParam param = new StringParam(); param.setValue(paramValue); patientList = patientResource.searchByGivenName(param); } if (patientList != null) { if (patientList.size() == 0) { outcome = updatePatient(patient, null); } else if (patientList.size() == 1) { outcome = updatePatient(patient, patientList.get(0).getId()); } else { throw new PreconditionFailedException("There are more than one patient for the given condition"); } } } else { outcome = updatePatient(patient, theId); } return outcome; }
Source:
protected void createButtonsForButtonBar(Composite parent) { createButton(parent, IDialogConstants.CANCEL_ID, "&Cancel", true); createButton(parent, IDialogConstants.OK_ID, "&Ok", true); }

Target:
protected void createButtonsForButtonBar(Composite parent) { createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, true); createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); }
Source:
public boolean contains(OGCGeometry another) { if (isEmpty() || another.isEmpty()) return false; if (this == another) return true; OGCConcreteGeometryCollection flattened1 = flatten(); if (flattened1.isEmpty()) return true; OGCConcreteGeometryCollection otherCol = new OGCConcreteGeometryCollection(another, esriSR); OGCConcreteGeometryCollection flattened2 = otherCol.flatten(); if (flattened2.isEmpty()) return true; for (int i = 0, n2 = flattened2.numGeometries(); i < n2; ++i) { OGCGeometry g2 = flattened2.geometryN(i); boolean good = false; for (int j = 0, n1 = flattened1.numGeometries(); j < n1; ++j) { OGCGeometry g1 = flattened1.geometryN(i); if (g1.contains(g2)) { good = true; break; } } if (!good) return false; } return true; }

Target:
public boolean contains(OGCGeometry another) { if (isEmpty() || another.isEmpty()) return false; if (this == another) return true; return another.difference(this).isEmpty(); }
Source:
protected void configure() { log.debug("configure: entered."); requireBinding(ConfigProvider.class); bind(WebApplicationExceptionMapper.class).asEagerSingleton(); bindVtepDataClientFactory(); bind(ApplicationResource.class); install(new FactoryModuleBuilder().build(ResourceFactory.class)); bind(RestApiService.class).asEagerSingleton(); bind(VxlanGatewayHA.class).asEagerSingleton(); log.debug("configure: exiting."); }

Target:
protected void configure() { log.debug("configure: entered."); requireBinding(ConfigProvider.class); bind(WebApplicationExceptionMapper.class).asEagerSingleton(); bindVtepDataClientFactory(); bind(ApplicationResource.class); install(new FactoryModuleBuilder().build(ResourceFactory.class)); bind(RestApiService.class).asEagerSingleton(); bind(VxlanGatewayService.class).asEagerSingleton(); log.debug("configure: exiting."); }
Source:
public List<org.kie.server.controller.api.model.runtime.Container> getContainers(ServerInstanceKey serverInstanceKey) { List<org.kie.server.controller.api.model.runtime.Container> containers = new ArrayList<org.kie.server.controller.api.model.runtime.Container>(); if (serverInstanceKey == null || serverInstanceKey.getUrl() == null) { return containers; } try { KieServicesClient client = getClient(serverInstanceKey.getUrl()); ServiceResponse<KieContainerResourceList> response = client.listContainers(); if (response.getType().equals(ServiceResponse.ResponseType.SUCCESS)) { KieContainerResourceList resourceList = response.getResult(); for (KieContainerResource containerResource : resourceList.getContainers()) { Container container = new Container(); container.setContainerSpecId(containerResource.getContainerId()); container.setContainerName(containerResource.getContainerId()); container.setServerInstanceId(serverInstanceKey.getServerInstanceId()); container.setUrl(serverInstanceKey.getUrl() + "/containers/" + containerResource.getContainerId()); container.setResolvedReleasedId(containerResource.getResolvedReleaseId() == null ? containerResource.getReleaseId():containerResource.getResolvedReleaseId()); container.setServerTemplateId(serverInstanceKey.getServerTemplateId()); container.setStatus(containerResource.getStatus()); container.setMessages(containerResource.getMessages()); containers.add(container); } } } catch (Exception e) { logger.warn("Unable to get list of containers from remote server at url due to {}", serverInstanceKey.getUrl(), e.getMessage()); } return containers; }

Target:
public List<Container> getContainers(ServerInstanceKey serverInstanceKey) { List<Container> containers = new ArrayList<org.kie.server.controller.api.model.runtime.Container>(); if (serverInstanceKey == null || serverInstanceKey.getUrl() == null) { return containers; } try { KieServicesClient client = getClient(serverInstanceKey.getUrl()); ServiceResponse<KieContainerResourceList> response = client.listContainers(); if (response.getType().equals(ServiceResponse.ResponseType.SUCCESS)) { KieContainerResourceList resourceList = response.getResult(); for (KieContainerResource containerResource : resourceList.getContainers()) { Container container = new Container(); container.setContainerSpecId(containerResource.getContainerId()); container.setContainerName(containerResource.getContainerId()); container.setServerInstanceId(serverInstanceKey.getServerInstanceId()); container.setUrl(serverInstanceKey.getUrl() + CONTAINERS_URI_PART + containerResource.getContainerId()); container.setResolvedReleasedId(containerResource.getResolvedReleaseId() == null ? containerResource.getReleaseId():containerResource.getResolvedReleaseId()); container.setServerTemplateId(serverInstanceKey.getServerTemplateId()); container.setStatus(containerResource.getStatus()); container.setMessages(containerResource.getMessages()); containers.add(container); } } } catch (Exception e) { logger.warn("Unable to get list of containers from remote server at url due to {}", serverInstanceKey.getUrl(), e.getMessage()); } return containers; }
Source:
private static Collection<String> findValidFileNames(final ModelNode model) { final Collection<String> names = new ArrayList<>(); for (Property resource : model.asPropertyList()) { final String name = resource.getName(); if (FILE_RESOURCE_NAMES.contains(name)) { for (Property handlerResource : resource.getValue().asPropertyList()) { final ModelNode handlerModel = handlerResource.getValue(); if (handlerModel.hasDefined(CommonAttributes.FILE.getName())) { final ModelNode fileModel = handlerModel.get(CommonAttributes.FILE.getName()); if (fileModel.has(PathResourceDefinition.RELATIVE_TO.getName()) && ServerEnvironment.SERVER_LOG_DIR.equals(fileModel.get(PathResourceDefinition.RELATIVE_TO.getName()).asString()) && fileModel.hasDefined(PathResourceDefinition.PATH.getName())) { names.add(fileModel.get(PathResourceDefinition.PATH.getName()).asString()); } } } } } return names; }

Target:
private static Collection<String> findValidFileNames(final ModelNode model) { final Collection<String> names = new ArrayList<>(); for (Property resource : model.asPropertyList()) { final String name = resource.getName(); if (FILE_RESOURCE_NAMES.contains(name)) { for (Property handlerResource : resource.getValue().asPropertyList()) { final ModelNode handlerModel = handlerResource.getValue(); if (handlerModel.hasDefined(CommonAttributes.FILE.getName())) { final ModelNode fileModel = handlerModel.get(CommonAttributes.FILE.getName()); if (fileModel.hasDefined(PathResourceDefinition.RELATIVE_TO.getName()) && ServerEnvironment.SERVER_LOG_DIR.equals(fileModel.get(PathResourceDefinition.RELATIVE_TO.getName()).asString()) && fileModel.hasDefined(PathResourceDefinition.PATH.getName())) { names.add(fileModel.get(PathResourceDefinition.PATH.getName()).asString()); } } } } } return names; }
Source:
public ComponentTreeWsRequest setBaseComponentKey(@Nullable String baseComponentKey) { return setComponent(baseComponentKey); }

Target:
public ComponentTreeWsRequest setBaseComponentKey(@Nullable String baseComponentKey) { this.baseComponentKey = baseComponentKey; return this; }
Source:
public static List<BrooklinMetricInfo> getMetricInfos(String connectorName) { List<BrooklinMetricInfo> metrics = new ArrayList<>(); metrics.addAll(AbstractKafkaBasedConnectorTask.getMetricInfos( generateMetricsPrefix(connectorName, CLASS_NAME) + MetricsAware.KEY_REGEX)); metrics.add(new BrooklinCounterInfo( generateMetricsPrefix(connectorName, CLASS_NAME) + TOPIC_MANAGER_METRICS_PREFIX + ".*")); return metrics; }

Target:
public static List<BrooklinMetricInfo> getMetricInfos(String connectorName) { List<BrooklinMetricInfo> metrics = new ArrayList<>(); metrics.addAll(AbstractKafkaBasedConnectorTask.getMetricInfos( generateMetricsPrefix(connectorName, CLASS_NAME) + MetricsAware.KEY_REGEX)); metrics.add(new BrooklinCounterInfo( generateMetricsPrefix(connectorName, CLASS_NAME) + TOPIC_MANAGER_METRICS_PREFIX + MetricsAware.KEY_REGEX + ".*")); return metrics; }
Source:
void addSoftware(String software, int nbTokens) { persistedJobsLicenses.put(software, new LinkedBlockingQueue<String>(nbTokens)); persistedTasksLicenses.put(software, new LinkedBlockingQueue<String>(nbTokens)); remainingTokens.put(software, nbTokens); }

Target:
void addSoftware(String software, int nbTokens) { persistedJobsLicenses.put(software, new LinkedBlockingQueue<>(nbTokens)); persistedTasksLicenses.put(software, new LinkedBlockingQueue<>(nbTokens)); remainingTokens.put(software, nbTokens); }
Source:
private void setLoadingLayout() { binding.progressBar.setVisibility(View.VISIBLE); binding.feedDisplay.setVisibility(View.GONE); }

Target:
private void setLoadingLayout() { viewBinding.progressBar.setVisibility(View.VISIBLE); viewBinding.feedDisplayContainer.setVisibility(View.GONE); }
Source:
private void setGatewayServices(final GatewayServices gws) { try { Field gwsField = GatewayServer.class.getDeclaredField("services"); gwsField.setAccessible(true); gwsField.set(null, gws); } catch (Exception e) { e.printStackTrace(); } }

Target:
private void setGatewayServices(final GatewayServices gws) throws Exception { Field gwsField = GatewayServer.class.getDeclaredField("services"); gwsField.setAccessible(true); gwsField.set(null, gws); }
Source:
public void testCopy() throws Exception { put("/rest/resource/mydir/mynewres?operation=copy", "/mydir/myres"); Resource newRes = getDataDirectory().get("/mydir/mynewres"); Assert.assertTrue(Resources.exists(myRes)); Assert.assertTrue(Resources.exists(newRes)); try (InputStream is = newRes.in()) { Assert.assertEquals("This is my test.", IOUtils.toString(is)); } newRes.delete(); }

Target:
public void testCopy() throws Exception { put("/rest/resource/mydir/mynewres?operation=cOpY", "/mydir/myres"); Resource newRes = getDataDirectory().get("/mydir/mynewres"); Assert.assertTrue(Resources.exists(myRes)); Assert.assertTrue(Resources.exists(newRes)); try (InputStream is = newRes.in()) { Assert.assertEquals(STR_MY_TEST, IOUtils.toString(is)); } newRes.delete(); }
Source:
public AzureBatchSource(AzureBatchConfig config) { super(new FileBatchConfig(config.referenceName, config.fileRegex, config.timeTable, config.inputFormatClass, config.fileSystemProperties, config.maxSplitSize, config.ignoreNonExistingFolders, config.recursive, config.path, config.pathField, config.filenameOnly, config.schema)); this.config = config; }

Target:
public AzureBatchSource(AzureBatchConfig config) { super(config); this.config = config; }
Source:
private void compareConsoleToOutput(String console, String output, String alternateOutput) { if (RunningPlatform.isWindows() && alternateOutput != null) { assertTrue("Console text does not contains expected text", console.contains(alternateOutput)); } else if (console.equals(output)) { log.info("Console text corresponds to expected output"); } else if (console.trim().equals(output.trim())) { log.info("Console text corresponds to expected output after trimming"); } else { fail("Console text does not corresponds to the expected output"); } }

Target:
private void compareConsoleToOutput(String console, String output, String alternateOutput) { if (RunningPlatform.isWindows() && alternateOutput != null && alternateOutput.length() > 0) { log.info("Testing alternative output for windows platform: " + alternateOutput); assertTrue("Console text does not contains expected text", console.contains(alternateOutput)); } else if (console.equals(output)) { log.info("Console text corresponds to expected output"); } else if (console.trim().equals(output.trim())) { log.info("Console text corresponds to expected output after trimming"); } else { fail("Console text does not corresponds to the expected output"); } }
Source:
protected void startDefaultMaster(String... args) throws Exception { List<String> argsList = setupDefaultMaster(args); if (argsList == null) { return; } startMaster(argsList.toArray(new String[argsList.size()])); waitForMasterToConnectToZK(); }

Target:
protected void startDefaultMaster(String... args) throws Exception { final List<String> argsList = setupDefaultMaster(args); if (argsList == null) { return; } startMaster(argsList.toArray(new String[argsList.size()])); waitForMasterToConnectToZK(); }
Source:
public void testExpirationTime_whenMaxIdleTime_isSmallerThan_TTL() { IMap<Integer, Integer> map = createMapWithMaxIdleSeconds(10); map.put(1, 1, 100, TimeUnit.SECONDS); EntryView<Integer, Integer> entryView = map.getEntryView(1); long lastAccessTime = entryView.getLastAccessTime(); long delayToExpiration = lastAccessTime + TimeUnit.SECONDS.toMillis(10); long expectedExpirationTime = delayToExpiration + entryView.getCreationTime(); System.out.println(lastAccessTime + " " + delayToExpiration); assertEquals(expectedExpirationTime, entryView.getExpirationTime()); }

Target:
public void testExpirationTime_whenMaxIdleTime_isSmallerThan_TTL() { IMap<Integer, Integer> map = createMapWithMaxIdleSeconds(10); map.put(1, 1, 100, TimeUnit.SECONDS); EntryView<Integer, Integer> entryView = map.getEntryView(1); long lastAccessTime = entryView.getLastAccessTime(); long delayToExpiration = lastAccessTime + TimeUnit.SECONDS.toMillis(10); long expectedExpirationTime = delayToExpiration + entryView.getCreationTime(); assertEquals(expectedExpirationTime, entryView.getExpirationTime()); }
Source:
protected void configureEnvironment(final ClusterEnvironment.Builder builder) { Jackson2ObjectMapperBuilder jacksonBuilder = new Jackson2ObjectMapperBuilder(); jacksonBuilder.serializationInclusion(JsonInclude.Include.NON_NULL); jacksonBuilder.modules(new CouchbaseJacksonModule(), new JsonValueModule()); ObjectMapper objectMapper = new ObjectMapper(); objectMapper.registerModule(new CouchbaseJacksonModule()); objectMapper.registerModule(new JsonValueModule()); builder.jsonSerializer(JacksonJsonSerializer.create(objectMapper)); }

Target:
protected void configureEnvironment(final ClusterEnvironment.Builder builder) { ObjectMapper objectMapper = new ObjectMapper(); objectMapper.registerModule(new CouchbaseJacksonModule()); objectMapper.registerModule(new JsonValueModule()); builder.jsonSerializer(JacksonJsonSerializer.create(objectMapper)); }
Source:
public ValueHolder parseUrl(String stringUrl) { ValueHolder valueHolder = null; Matcher regexpMatcher = URL_REGEX.matcher( stringUrl ); if ( regexpMatcher.matches() ) { String protocol = regexpMatcher.group( 1 ); String host = regexpMatcher.group( 2 ); int port = -1; String portMatch = regexpMatcher.group( 3 ); if ( portMatch != null ) { port = Integer.parseInt( portMatch ); } valueHolder = new ValueHolder( protocol, host, port ); } return valueHolder; }

Target:
private ValueHolder parseUrl(String stringUrl) { ValueHolder valueHolder = null; Matcher regexpMatcher = URL_REGEX.matcher( stringUrl ); if ( regexpMatcher.matches() ) { String protocol = regexpMatcher.group( 1 ); String host = regexpMatcher.group( 2 ); int port = -1; String portMatch = regexpMatcher.group( 3 ); if ( portMatch != null ) { port = Integer.parseInt( portMatch ); } valueHolder = new ValueHolder( protocol, host, port ); } return valueHolder; }
Source:
public Integer int32(String name) { Int32Field field = fieldSearcher.nextField(name, Int32Field.class, null, structReadBuffer); if (field == null) { return null; } return (Integer) field.decode(structReadBuffer); }

Target:
public Integer int32(String name) { return fieldDecoder.decodeValue(name, Int32Field.class); }
Source:
private TaskData doInBackgroundCountModels(TaskData... params){ Timber.d("doInBackgroundLoadModels"); Collection col = CollectionHelper.getInstance().getCol(mContext); ArrayList<JSONObject> models = (ArrayList<JSONObject>) col.getModels().all(); ArrayList<Integer> cardCount = new ArrayList<Integer>(); Collections.sort(models, new Comparator<JSONObject>() { @Override public int compare(JSONObject a, JSONObject b) { try { return a.getString("name").compareTo(b.getString("name")); } catch (JSONException e) { throw new RuntimeException(e); } } }); for (JSONObject n : models) { try { long modID = n.getLong("id"); cardCount.add(col.getModels().nids(col.getModels().get(modID)).size()); } catch (JSONException e) { Timber.e("doInBackgroundLoadModels :: JSONException"); return new TaskData(false); } } Object[] data = new Object[2]; data[0] = models; data[1] = cardCount; return (new TaskData(0, data, true)); }

Target:
private TaskData doInBackgroundCountModels(TaskData... params){ Timber.d("doInBackgroundLoadModels"); Collection col = CollectionHelper.getInstance().getCol(mContext); ArrayList<JSONObject> models = (ArrayList<JSONObject>) col.getModels().all(); ArrayList<Integer> cardCount = new ArrayList<Integer>(); Collections.sort(models, new Comparator<JSONObject>() { @Override public int compare(JSONObject a, JSONObject b) { try { return a.getString("name").compareTo(b.getString("name")); } catch (JSONException e) { throw new RuntimeException(e); } } }); try{ for (JSONObject n : models) { long modID = n.getLong("id"); cardCount.add(col.getModels().nids(col.getModels().get(modID)).size()); } } catch (JSONException e) { Timber.e("doInBackgroundLoadModels :: JSONException"); return new TaskData(false); } Object[] data = new Object[2]; data[0] = models; data[1] = cardCount; return (new TaskData(0, data, true)); }
Source:
public void applyInventory(InventoryEvent event) { String par = event.getMessage(); Player p = event.getPlayer(); Inventory i = p.getInventory(); if (par.equalsIgnoreCase(name)) { clearInv(p); ItemStack HEALTH_POTION = new ItemStack(Material.POTION, 1, (short) 16373); ItemStack STEAK = new ItemStack(Material.COOKED_BEEF, 1); ItemStack BOW = new ItemStack(Material.BOW, 1); ItemStack ARROWS = new ItemStack(Material.ARROW, 64); ItemStack STONEY_POOS = new ItemStack(Material.STONE, 64); ItemStack IRON_HELMET = new ItemStack(Material.IRON_HELMET, 1); ItemStack IRON_CHESTPLATE = new ItemStack(Material.IRON_CHESTPLATE, 1); ItemStack IRON_PANTS = new ItemStack(Material.IRON_LEGGINGS, 1); ItemStack IRON_BOOTS = new ItemStack(Material.IRON_BOOTS, 1); ItemStack IRON_SWORD = new ItemStack(Material.IRON_SWORD, 1); p.getInventory().setBoots(IRON_BOOTS); p.getInventory().setLeggings(IRON_PANTS); p.getInventory().setChestplate(IRON_CHESTPLATE); p.getInventory().setHelmet(IRON_HELMET); i.setItem(0, IRON_SWORD); i.setItem(1, BOW); i.setItem(2, STEAK); i.setItem(3, HEALTH_POTION); i.setItem(4, ARROWS); i.setItem(5, STONEY_POOS); i.setItem(6, STONEY_POOS); } }

Target:
public void applyInventory(InventoryEvent event) { String par = event.getMessage(); Player p = event.getPlayer(); Inventory i = p.getInventory(); if (par.equalsIgnoreCase(name)) { clearInv(p); ItemStack HEALTH_POTION = new ItemStack(Material.POTION, 1, (short) 16373); ItemStack STEAK = new ItemStack(Material.COOKED_BEEF, 1); ItemStack BOW = new ItemStack(Material.BOW, 1); ItemStack ARROWS = new ItemStack(Material.ARROW, 64); ItemStack STONE = new ItemStack(Material.STONE, 64); ItemStack IRON_HELMET = new ItemStack(Material.IRON_HELMET, 1); ItemStack IRON_CHESTPLATE = new ItemStack(Material.IRON_CHESTPLATE, 1); ItemStack IRON_PANTS = new ItemStack(Material.IRON_LEGGINGS, 1); ItemStack IRON_BOOTS = new ItemStack(Material.IRON_BOOTS, 1); ItemStack IRON_SWORD = new ItemStack(Material.IRON_SWORD, 1); p.getInventory().setBoots(IRON_BOOTS); p.getInventory().setLeggings(IRON_PANTS); p.getInventory().setChestplate(IRON_CHESTPLATE); p.getInventory().setHelmet(IRON_HELMET); i.setItem(0, IRON_SWORD); i.setItem(1, BOW); i.setItem(2, STEAK); i.setItem(3, HEALTH_POTION); i.setItem(4, ARROWS); i.setItem(5, STONE); i.setItem(6, STONE); } }
Source:
public static String resolveFast(User u) { Mailer.UserProperty emailProperty = u.getProperty(Mailer.UserProperty.class); if (emailProperty != null && emailProperty.hasExplicitlyConfiguredAddress()) { String explicitAddress = emailProperty.getExplicitlyConfiguredAddress(); if (explicitAddress != null) return explicitAddress; } String extractedAddress = extractAddressFromId(u.getFullName()); if (extractedAddress != null) return extractedAddress; if(u.getFullName().contains("@")) return u.getFullName(); String ds = Mailer.descriptor().getDefaultSuffix(); if(ds!=null) { Matcher m = WINDOWS_DOMAIN_REGEXP.matcher(u.getFullName()); if (m.matches() && u.getFullName().replace('\\','_').equals(u.getId())) return m.group(1)+ds; return u.getId()+ds; } return null; }

Target:
public static String resolveFast(User u) { String userPropertyAddress = extractAddressFromUserProperty(u); if (userPropertyAddress != null) { return userPropertyAddress; } String extractedAddress = extractAddressFromId(u.getFullName()); if (extractedAddress != null) return extractedAddress; if(u.getFullName().contains("@")) return u.getFullName(); String ds = Mailer.descriptor().getDefaultSuffix(); if(ds!=null) { Matcher m = WINDOWS_DOMAIN_REGEXP.matcher(u.getFullName()); if (m.matches() && u.getFullName().replace('\\','_').equals(u.getId())) return m.group(1)+ds; return u.getId()+ds; } return null; }
Source:
public void testGeneIdsOrGeneNamesNonExisting() { List<FeatureCoordinates> featureCoordinates = findByIdsOrNamesHelper(Arrays.asList(GENE_ID_NON_EXISTING), Arrays.asList(GENE_NAME_NON_EXISITNG)); assertTrue(featureCoordinates.size() == 0); featureCoordinates = findByIdsOrNamesHelper(Arrays.asList(GENE_ID_NON_EXISTING), null); assertTrue(featureCoordinates.size() == 0); featureCoordinates = findByIdsOrNamesHelper(null, Arrays.asList(GENE_NAME_NON_EXISITNG)); assertTrue(featureCoordinates.size() == 0); }

Target:
public void testGeneIdsOrGeneNamesNonExisting() { List<FeatureCoordinates> featureCoordinates = findByIdsOrNamesHelper(Arrays.asList(GENE_ID_NON_EXISTING), Arrays.asList(GENE_NAME_NON_EXISITNG)); assertEquals(0, featureCoordinates.size()); featureCoordinates = findByIdsOrNamesHelper(Arrays.asList(GENE_ID_NON_EXISTING), null); assertEquals(0, featureCoordinates.size()); featureCoordinates = findByIdsOrNamesHelper(null, Arrays.asList(GENE_NAME_NON_EXISITNG)); assertEquals(0, featureCoordinates.size()); }
Source:
public PatternScatterGraphView() { super(ID); this.addPartPropertyListener(new IPropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent event) { if (event.getProperty().equals(TmfXmlStrings.XML_LATENCY_OUTPUT_DATA)) { Object newValue = event.getNewValue(); if (newValue instanceof String) { String data = (String) newValue; fViewInfo.setViewData(data); setPartName(fViewInfo.getLabel()); loadLatencyView(); } } } }); }

Target:
public PatternScatterGraphView() { super(ID); this.addPartPropertyListener(event -> { if (event.getProperty().equals(TmfXmlStrings.XML_LATENCY_OUTPUT_DATA)) { Object newValue = event.getNewValue(); if (newValue instanceof String) { String data = (String) newValue; fViewInfo.setViewData(data); setPartName(fViewInfo.getLabel()); loadLatencyView(); } } }); }
Source:
public JSONObject populateRunOptions(HttpSession session, JSONObject json) { Long sequencerReferenceId = json.getLong("sequencerReference"); String cId = json.getString("run_cId"); try { SequencerReference sr = requestManager.getSequencerReferenceById(sequencerReferenceId); PlatformType pt = sr.getPlatform().getPlatformType(); Map<String, Object> responseMap = new HashMap<>(); User user = securityManager.getUserByLoginName(SecurityContextHolder.getContext().getAuthentication().getName()); Run run = new RunImpl(user); run.setSequencerReference(sr); session.setAttribute("run_" + cId, run); responseMap.put("partitions", getPlatformRunOptions(run)); return JSONUtils.JSONObjectResponse(responseMap); } catch (IOException e) { log.error("failed to get run options", e); return JSONUtils.SimpleJSONError("Failed to get Run options"); } }

Target:
public JSONObject populateRunOptions(HttpSession session, JSONObject json) { Long sequencerReferenceId = json.getLong("sequencerReference"); String cId = json.getString("run_cId"); try { SequencerReference sr = requestManager.getSequencerReferenceById(sequencerReferenceId); PlatformType pt = sr.getPlatform().getPlatformType(); Map<String, Object> responseMap = new HashMap<>(); User user = securityManager.getUserByLoginName(SecurityContextHolder.getContext().getAuthentication().getName()); Run run = new RunImpl(user); run.setPlatformType(pt); run.setSequencerReference(sr); session.setAttribute("run_" + cId, run); responseMap.put("partitions", getPlatformRunOptions(run)); return JSONUtils.JSONObjectResponse(responseMap); } catch (IOException e) { log.error("failed to get run options", e); return JSONUtils.SimpleJSONError("Failed to get Run options"); } }
Source:
public Boolean add(Room room) throws Exception { if (getById(room.getId()).isPresent()) { return false; } try (var connection = getConnection(); var statement = connection.prepareStatement("INSERT INTO ROOMS VALUES (?,?,?,?)")) { statement.setInt(1, room.getId()); statement.setString(2, room.getRoomType()); statement.setInt(3, room.getPrice()); statement.setBoolean(4, room.isBooked()); statement.execute(); return true; } catch (Exception ex) { throw new SqlException(ex.getMessage(), ex); } }

Target:
public Boolean add(Room room) throws Exception { if (getById(room.getId()).isPresent()) { return false; } try (var connection = getConnection(); var statement = connection.prepareStatement("INSERT INTO ROOMS VALUES (?,?,?,?)")) { statement.setInt(1, room.getId()); statement.setString(2, room.getRoomType()); statement.setInt(3, room.getPrice()); statement.setBoolean(4, room.isBooked()); statement.execute(); return true; } catch (Exception e) { throw new Exception(e.getMessage(), e); } }
Source:
public String asString() { final Map<String, Object> map = jsonBuilder.map(); map.put("rels", relList); AtomicInteger skipNormalize = null; if (getDetailLevel() != SqlExplainLevel.DIGEST_ATTRIBUTES) { skipNormalize = RexNode.DESCRIBE_WITHOUT_NORMALIZE.get(); skipNormalize.incrementAndGet(); } try { return jsonBuilder.toJsonString(map); } finally { if (skipNormalize != null) { skipNormalize.decrementAndGet(); } } }

Target:
public String asString() { final Map<String, Object> map = jsonBuilder.map(); map.put("rels", relList); try (RexNode.Closeable ignored = withRexNormalize()) { return jsonBuilder.toJsonString(map); } }
Source:
private CompiledQuery sqlBackup(SqlExecutionContext executionContext) throws SqlException { final CharSequence tok = SqlUtil.fetchNext(lexer); if (null != tok) { if (Chars.equalsLowerCaseAscii(tok, "table")) { return sqlTableBackup(executionContext); } } throw SqlException.position(lexer.getPosition()).put(" expected 'table'"); }

Target:
private CompiledQuery sqlBackup(SqlExecutionContext executionContext) throws SqlException { if (null == configuration.getBackupRoot()) { throw CairoException.instance(0).put("Backup is disabled, no backup root directory is configured in the server configuration ['cairo.sql.backup.root' property]"); } final CharSequence tok = SqlUtil.fetchNext(lexer); if (null != tok) { if (Chars.equalsLowerCaseAscii(tok, "table")) { return sqlTableBackup(executionContext); } if (Chars.equalsLowerCaseAscii(tok, "database")) { return sqlDatabaseBackup(executionContext); } } throw SqlException.position(lexer.lastTokenPosition()).put(" expected 'table' or 'database'"); }
Source:
public void testCannotDecodeIncompleteSequence() { List<Long> bytes = Arrays.asList(0xffL); assertEquals(null, variableLengthQuantity.decode(bytes)); }

Target:
public void testCannotDecodeIncompleteSequence() { List<Long> bytes = Arrays.asList(0xffL); expectedException.expect(IllegalArgumentException.class); expectedException.expectMessage("Invalid variable-length quantity encoding"); variableLengthQuantity.decode(bytes); }
Source:
public void openSite_shouldShowAuditLog() { tester.debugComponentTrees(); tester.assertVisible("auditsContainer:audits"); tester.assertVisible("auditsContainer:audits:0:audit"); tester.assertVisible("auditsContainer:audits:1:audit"); int i = 0; for (Event event : domain.getAllAudits()) { tester.assertLabel("auditsContainer:audits:" + i + ":audit", event.getName()); i++; } }

Target:
public void openSite_shouldShowAuditLog() { tester.assertVisible("auditsContainer:audits"); tester.assertVisible("auditsContainer:audits:0:audit"); tester.assertVisible("auditsContainer:audits:1:audit"); int i = 0; for (Event event : domain.getAllAudits()) { tester.assertLabel("auditsContainer:audits:" + i + ":audit", event.getName()); i++; } }
Source:
public static synchronized void logWarning(String message,Throwable ex) { if (IntroPlugin.getDefault().isDebugging() && LOG_WARN) { getDefault().getLog().warn(message, ex); } }

Target:
public static synchronized void logWarning(String message,Throwable ex) { if (LOG_WARN && IntroPlugin.getDefault().isDebugging()) { getDefault().getLog().warn(message, ex); } }
Source:
public String init() { String urlName = getWorkspaceUrlName(); if (StringUtils.isBlank(urlName)) { return NavigationRules.NOT_FOUND; } WorkspaceEntity workspaceEntity = workspaceController.findWorkspaceEntityByUrlName(urlName); if (workspaceEntity == null) { return NavigationRules.NOT_FOUND; } if (!sessionController.hasWorkspacePermission(MuikkuPermissions.MANAGE_WORKSPACE, workspaceEntity)) { return NavigationRules.ACCESS_DENIED; } workspaceChatSettings = true; workspaceEntityId = workspaceEntity.getId(); workspaceBackingBean.setWorkspaceUrlName(urlName); WorkspaceEntityFile customFrontImage = workspaceEntityFileController.findWorkspaceEntityFile(workspaceEntity, "workspace-frontpage-image-cropped"); hasCustomFrontPageImage = customFrontImage != null; customFrontPageImageUrl = hasCustomFrontPageImage ? String.format("/rest/workspace/workspaces/%d/workspacefile/workspace-frontpage-image-cropped", workspaceEntity.getId()) : null; return null; }

Target:
public String init() { String urlName = getWorkspaceUrlName(); if (StringUtils.isBlank(urlName)) { return NavigationRules.NOT_FOUND; } WorkspaceEntity workspaceEntity = workspaceController.findWorkspaceEntityByUrlName(urlName); if (workspaceEntity == null) { return NavigationRules.NOT_FOUND; } if (!sessionController.hasWorkspacePermission(MuikkuPermissions.MANAGE_WORKSPACE, workspaceEntity)) { return NavigationRules.ACCESS_DENIED; } SchoolDataIdentifier userIdentifier = sessionController.getLoggedUser(); UserChatSettings userChatSettings = chatController.findUserChatSettings(userIdentifier); if (userChatSettings != null && userChatSettings.getVisibility().equals(UserChatVisibility.VISIBLE_TO_ALL)) { workspaceChatSettings = true; } workspaceEntityId = workspaceEntity.getId(); workspaceBackingBean.setWorkspaceUrlName(urlName); WorkspaceEntityFile customFrontImage = workspaceEntityFileController.findWorkspaceEntityFile(workspaceEntity, "workspace-frontpage-image-cropped"); hasCustomFrontPageImage = customFrontImage != null; customFrontPageImageUrl = hasCustomFrontPageImage ? String.format("/rest/workspace/workspaces/%d/workspacefile/workspace-frontpage-image-cropped", workspaceEntity.getId()) : null; return null; }
Source:
private long getExpiryTime(NHttpClientConnection connection) { long expiryTime = System.currentTimeMillis(); String keepAliveTimeout = (String) connection.getContext(). getAttribute(PassThroughConstants.CONNECTION_KEEP_ALIVE_TIME_OUT); if (keepAliveTimeout != null) { try { expiryTime = expiryTime + (Integer.parseInt(keepAliveTimeout) * 1000) - this.connectionGraceTime; } catch (NumberFormatException e) { log.error("Error parsing value " + keepAliveTimeout + " as connection keep-alive timeout.", e); expiryTime = expiryTime + this.connectionIdleTime; } } else { expiryTime = expiryTime + this.connectionIdleTime; } return expiryTime; }

Target:
private long getExpiryTime(NHttpClientConnection connection) { long expiryTime = System.currentTimeMillis(); Object keepAlive = connection.getContext(). getAttribute(PassThroughConstants.CONNECTION_KEEP_ALIVE_TIME_OUT); if (keepAlive != null) { int keepAliveTimeout = (int) keepAlive; expiryTime = expiryTime + keepAliveTimeout - this.connectionGraceTime; } else { expiryTime = expiryTime + this.connectionIdleTime; } if (log.isDebugEnabled()) { log.debug("Expiry time set for connection: " + expiryTime + " milliseconds"); } return expiryTime; }
Source:
protected void executeCommand() { getParameters().setEntityInfo(new EntityInfo(VdcObjectType.Disk, getParameters().getImageGroupId())); if (!getParameters().isVmRunningOnSpm()) { imagesHandler.prepareImage(getParameters().getStoragePoolId(), getParameters().getStorageDomainId(), getParameters().getImageGroupId(), getParameters().getImageId(), getParameters().getSpmId()); } ReduceImageVDSCommandParameters parameters = new ReduceImageVDSCommandParameters(getParameters().getStoragePoolId(), getParameters().getStorageDomainId(), getParameters().getImageGroupId(), getParameters().getImageId(), getParameters().isAllowActive()); VDSReturnValue vdsReturnValue = runVdsCommand(VDSCommandType.ReduceImage, parameters); if (vdsReturnValue.getSucceeded()) { Guid taskId = persistAsyncTaskPlaceHolder(getParameters().getParentCommand()); getTaskIdList().add(createTask(taskId, vdsReturnValue.getCreationInfo(), getParameters().getParentCommand(), VdcObjectType.Storage, getParameters().getStorageDomainId())); setSucceeded(true); } }

Target:
protected void executeCommand() { getParameters().setEntityInfo(new EntityInfo(VdcObjectType.Disk, getParameters().getImageGroupId())); boolean prepareImageSucceeded = false; if (!getParameters().isVmRunningOnSpm()) { log.debug("Preparing image on the SPM", getParameters().getImageId()); try { imagesHandler.prepareImage(getParameters().getStoragePoolId(), getParameters().getStorageDomainId(), getParameters().getImageGroupId(), getParameters().getImageId(), getParameters().getSpmId()); prepareImageSucceeded = true; } catch (EngineException e) { log.error("Failed to prepare image on the SPM", getParameters().getImageId()); } } if (!getParameters().isVmRunningOnSpm() && !prepareImageSucceeded) { log.error("Image prepare failed on the SPM, hence reduce will not be performed"); return; } try { ReduceImageVDSCommandParameters parameters = new ReduceImageVDSCommandParameters(getParameters().getStoragePoolId(), getParameters().getStorageDomainId(), getParameters().getImageGroupId(), getParameters().getImageId(), getParameters().isAllowActive()); VDSReturnValue vdsReturnValue = runVdsCommand(VDSCommandType.ReduceImage, parameters); if (vdsReturnValue.getSucceeded()) { Guid taskId = persistAsyncTaskPlaceHolder(getParameters().getParentCommand()); getTaskIdList().add(createTask(taskId, vdsReturnValue.getCreationInfo(), getParameters().getParentCommand(), VdcObjectType.Storage, getParameters().getStorageDomainId())); } } catch (EngineException e) { log.error("Reducing image failed", getParameters().getImageId()); } setSucceeded(true); }