auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected void initActionContext(ActionContext actionContext) { actionContext.setParameters(HttpParameters.create(request.getParameterMap()).build()); initSession(actionContext); <START> ActionContext.bound(actionContext); <END> }</code><technical_language>candidate for bind() if method is created</technical_language>

Target:
protected void initActionContext(ActionContext actionContext) { actionContext.setParameters(HttpParameters.create(request.getParameterMap()).build()); initSession(actionContext); ActionContext.bind(actionContext); }
Source:
<code>public void userCannotSignUpWithExistingUsernameDesktopSzl() { RegisterPage form = performSignUpExpectingFailureOnDesktopAs(createUserWithExistingUsername()); <START> assertEquals(form.getError(), "Nazwa użytkownika jest już wykorzystywana"); <END> }</code><technical_language>cool turn strings const values it, is done i.e. PASSWORD_MATCHING_USERNAME_MSG. a game changer of course. :)</technical_language>

Target:
public void userCannotSignUpWithExistingUsernameDesktopSzl() { RegisterPage form = performSignUpExpectingFailureOnDesktopAs(createUserWithExistingUsername()); assertEquals(form.getError(), USERNAME_TAKEN_MSG_SZL); }
Source:
<code>public void testConvertToExtended() throws Exception { <START> Method method = Code93Writer.class.getDeclaredMethod("convertToExtended", String.class); <END> method.setAccessible(true); String src = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%"; String dst = (String) method.invoke(null, src); assertEquals(src, dst); }</code><technical_language>Oh, package-private for testing reflection</technical_language>

Target:
public void testConvertToExtended() throws Exception { String src = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%"; String dst = Code93Writer.convertToExtended(src); assertEquals(src, dst); }
Source:
<code>public static DomainTrust[] getDomainTrusts(String serverName) { IntByReference domainCount = new IntByReference(); PointerByReference domainsPointerRef = new PointerByReference(); int rc = Netapi32.INSTANCE.DsEnumerateDomainTrusts(serverName, DsGetDC.DS_DOMAIN_VALID_FLAGS, domainsPointerRef, domainCount); if(W32Errors.NO_ERROR != rc) { throw new Win32Exception(rc); } try { PDS_DOMAIN_TRUSTS domains = new PDS_DOMAIN_TRUSTS(domainsPointerRef.getValue()); int domainCountValue = domainCount.getValue(); ArrayList<DomainTrust> trusts = new ArrayList<DomainTrust>(domainCountValue); <START> for(DS_DOMAIN_TRUSTS trust : domains.getTrusts(domainCountValue)) { <END> DomainTrust t = new DomainTrust(); if (trust.DnsDomainName != null) { t.DnsDomainName = trust.DnsDomainName.toString(); } if (trust.NetbiosDomainName != null) { t.NetbiosDomainName = trust.NetbiosDomainName.toString(); } t.DomainSid = trust.DomainSid; if (trust.DomainSid != null) { t.DomainSidString = Advapi32Util.convertSidToStringSid(trust.DomainSid); } t.DomainGuid = trust.DomainGuid; if (trust.DomainGuid != null) { t.DomainGuidString = Ole32Util.getStringFromGUID(trust.DomainGuid); } t.flags = trust.Flags; trusts.add(t); } return trusts.toArray(new DomainTrust[0]); } finally { rc = Netapi32.INSTANCE.NetApiBufferFree(domainsPointerRef.getValue()); if(W32Errors.NO_ERROR != rc) { throw new Win32Exception(rc); } } }</code><technical_language>Get rid of PDS_DOMAIN_TRUSTS DS_DOMAIN_TRUSTS. Do Structure.toArray() call explicitly instead of domains.getTrusts(count), is a misleading</technical_language>

Target:
public static DomainTrust[] getDomainTrusts(String serverName) { IntByReference domainCount = new IntByReference(); PointerByReference domainsPointerRef = new PointerByReference(); int rc = Netapi32.INSTANCE.DsEnumerateDomainTrusts(serverName, DsGetDC.DS_DOMAIN_VALID_FLAGS, domainsPointerRef, domainCount); if(W32Errors.NO_ERROR != rc) { throw new Win32Exception(rc); } try { DS_DOMAIN_TRUSTS domains = new DS_DOMAIN_TRUSTS(domainsPointerRef.getValue()); int domainCountValue = domainCount.getValue(); ArrayList<DomainTrust> trusts = new ArrayList<DomainTrust>(domainCountValue); for(DS_DOMAIN_TRUSTS trust : (DS_DOMAIN_TRUSTS[]) domains.toArray(new DS_DOMAIN_TRUSTS[domainCountValue])) { DomainTrust t = new DomainTrust(); if (trust.DnsDomainName != null) { t.DnsDomainName = trust.DnsDomainName.toString(); } if (trust.NetbiosDomainName != null) { t.NetbiosDomainName = trust.NetbiosDomainName.toString(); } t.DomainSid = trust.DomainSid; if (trust.DomainSid != null) { t.DomainSidString = Advapi32Util.convertSidToStringSid(trust.DomainSid); } t.DomainGuid = trust.DomainGuid; if (trust.DomainGuid != null) { t.DomainGuidString = Ole32Util.getStringFromGUID(trust.DomainGuid); } t.flags = trust.Flags; trusts.add(t); } return trusts.toArray(new DomainTrust[0]); } finally { rc = Netapi32.INSTANCE.NetApiBufferFree(domainsPointerRef.getValue()); if(W32Errors.NO_ERROR != rc) { throw new Win32Exception(rc); } } }
Source:
<code>public void saveRelationship(TaskExecution taskExecution, JobExecution jobExecution) { <START> jdbcTemplate.update(getQuery(INSERT_STATEMENT), taskExecution.getExecutionId(), jobExecution.getId()); <END> }</code><technical_language>want assertNotNull for taskExecution jobExecution</technical_language>

Target:
public void saveRelationship(TaskExecution taskExecution, JobExecution jobExecution) { Assert.notNull(taskExecution, "A taskExecution is required"); Assert.notNull(jobExecution, "A jobExecution is required"); jdbcTemplate.update(getQuery(INSERT_STATEMENT), taskExecution.getExecutionId(), jobExecution.getId()); }
Source:
<code>private void setUpRegions() { server1.invoke(() -> { Cache cache = ClusterStartupRule.getCache(); assertThat(cache).isNotNull(); RegionFactory<String, String> dataRegionFactory = cache.createRegionFactory(RegionShortcut.PARTITION); Region<String, String> region = dataRegionFactory.create(REGION_ONE_NAME); <START> for (int i = 0; i < 10; i++) { region.put("key" + (i + 200), "value" + (i + 200)); } region = dataRegionFactory.create(REGION_TWO_NAME); for (int i = 0; i < 100; i++) { region.put("key" + (i + 200), "value" + (i + 200)); } <END> }); server2.invoke(() -> { Cache cache = ClusterStartupRule.getCache(); assertThat(cache).isNotNull(); RegionFactory<String, String> dataRegionFactory = cache.createRegionFactory(RegionShortcut.PARTITION); Region<String, String> region = dataRegionFactory.create(REGION_ONE_NAME); for (int i = 0; i < 100; i++) { region.put("key" + (i + 400), "value" + (i + 400)); } region = dataRegionFactory.create(REGION_THREE_NAME); for (int i = 0; i < 10; i++) { region.put("key" + (i + 200), "value" + (i + 200)); } }); }</code><technical_language>ints added keys values cleared a bit? reason add 200 here, if number of entries is extracted a constant, in invocation server2 prevent overwriting existing data</technical_language>

Target:
private void setUpRegions() { server1.invoke(() -> { Cache cache = ClusterStartupRule.getCache(); assertThat(cache).isNotNull(); RegionFactory<String, String> dataRegionFactory = cache.createRegionFactory(RegionShortcut.PARTITION); Region<String, String> region1 = dataRegionFactory.create(REGION_ONE_NAME); Region<String, String> region2 = dataRegionFactory.create(REGION_TWO_NAME); for (int i = 0; i < ENTRIES_PER_REGION; i++) { region1.put("key" + i, "Value" + i); region2.put("key" + i, "Value" + i); } }); server2.invoke(() -> { Cache cache = ClusterStartupRule.getCache(); assertThat(cache).isNotNull(); RegionFactory<String, String> dataRegionFactory = cache.createRegionFactory(RegionShortcut.PARTITION); dataRegionFactory.create(REGION_ONE_NAME); Region<String, String> region3 = dataRegionFactory.create(REGION_THREE_NAME); for (int i = 0; i < ENTRIES_PER_REGION; i++) { region3.put("key" + i, "Value" + i); } }); }
Source:
<code>public void testVariantIds() { Set<String> emptySet = new HashSet<>(); checkIds(factory, "1\t1000\trs123\tC\tT\t.\t.\t.", emptySet); checkIds(factory, "1\t1000\trs123;rs456\tC\tT\t.\t.\t.", emptySet); checkIds(factory, "1\t1000\t.\tC\tT\t.\t.\t.", emptySet); VariantVcfFactory accessionedVariantFactory = instantiateAbstractVcfFactory(); accessionedVariantFactory.setIncludeIds(true); checkIds(accessionedVariantFactory, "1\t1000\trs123\tC\tT\t.\t.\t.", Collections.singleton("rs123")); checkIds(accessionedVariantFactory, "1\t1000\trs123;.\tC\tT\t.\t.\t.", Collections.singleton("rs123")); <START> checkIds(accessionedVariantFactory, "1\t1000\trs123;rs456\tC\tT\t.\t.\t.", <END> Stream.of("rs123", "rs456").collect(Collectors.toSet())); }</code><technical_language>Another check ensure RS IDs separated comma read as-is? While this is ideal, explicit is current behavior..</technical_language>

Target:
public void testVariantIds() { Set<String> emptySet = Collections.emptySet(); checkIds(factory, "1\t1000\trs123\tC\tT\t.\t.\t.", emptySet); checkIds(factory, "1\t1000\trs123;rs456\tC\tT\t.\t.\t.", emptySet); checkIds(factory, "1\t1000\t.\tC\tT\t.\t.\t.", emptySet); VariantVcfFactory accessionedVariantFactory = instantiateAbstractVcfFactory(); accessionedVariantFactory.setIncludeIds(true); checkIds(accessionedVariantFactory, "1\t1000\trs123\tC\tT\t.\t.\t.", Collections.singleton("rs123")); checkIds(factory, "1\t1000\t.\tC\tT\t.\t.\t.", emptySet); checkIds(accessionedVariantFactory, "1\t1000\trs123;.\tC\tT\t.\t.\t.", Collections.singleton("rs123")); checkIds(accessionedVariantFactory, "1\t1000\trs123;rs456\tC\tT\t.\t.\t.", Stream.of("rs123", "rs456").collect(Collectors.toSet())); checkIds(accessionedVariantFactory, "1\t1000\trs123,rs456\tC\tT\t.\t.\t.", Collections.singleton("rs123,rs456")); }
Source:
<code>public DockerImageName apply(DockerImageName original) { final String configuredPrefix = configuration.getEnvVarOrProperty(PREFIX_PROPERTY_KEY, ""); <START> if (!!configuredPrefix.isEmpty()) { <END> log.debug("No prefix is configured"); return original; } boolean isAHubImage = original.getRegistry().isEmpty() || original.getRegistry().equals("docker.io") || original.getRegistry().equals("registry.hub.docker.com"); if (!isAHubImage) { log.debug("Image is not a Docker Hub image - not applying registry/repository change", original); return original; } log.debug( "Applying changes to image name {}: applying prefix '{}'", original, configuredPrefix ); DockerImageName prefixAsImage = DockerImageName.parse(configuredPrefix); return original .withRegistry(prefixAsImage.getRegistry()) .withRepository(prefixAsImage.getRepository() + original.getRepository()); }</code><technical_language>double negotiation? suggestion if (configuredPrefix.isEmpty()) {</technical_language>

Target:
public DockerImageName apply(DockerImageName original) { final String configuredPrefix = configuration.getEnvVarOrProperty(PREFIX_PROPERTY_KEY, ""); if (configuredPrefix.isEmpty()) { log.debug("No prefix is configured"); return original; } boolean isAHubImage = original.getRegistry().isEmpty(); if (!isAHubImage) { log.debug("Image is not a Docker Hub image - not applying registry/repository change", original); return original; } log.debug( "Applying changes to image name {}: applying prefix '{}'", original, configuredPrefix ); DockerImageName prefixAsImage = DockerImageName.parse(configuredPrefix); return original .withRegistry(prefixAsImage.getRegistry()) .withRepository(prefixAsImage.getRepository() + original.getRepository()); }
Source:
<code><START> public static Collection<String> replaceWith(String propertyName, List<?> items, String separator, int maxNumberOfPrintedItems) { <END> Validate.isTrue(maxNumberOfPrintedItems >= 0); int size = Math.min(maxNumberOfPrintedItems, items.size()); List<String> printedItems = new ArrayList<String>(size); for (int i = 0; i < size; i++) { printedItems.add(String.format("\t%s", String.valueOf(items.get(i)))); } if (items.size() > maxNumberOfPrintedItems) { printedItems.add("\t..."); } ArrayList<String> replacements = new ArrayList<String>(); replacements.add(MessageFormat.format("${0} {1}", propertyName, StringUtils.join(printedItems, separator))); replacements.add(MessageFormat.format("${0}_COUNTER {1}", propertyName, items.size())); return replacements; }</code><technical_language>manner verify Validate.notNull(separator); prevent output like: "the items xnullbxcnull..."</technical_language>

Target:
public static Collection<String> replaceWith(String propertyName, List<?> items, String separator, int maxNumberOfPrintedItems) { Validate.isTrue(maxNumberOfPrintedItems >= 1); Validate.isTrue(StringUtils.isNotEmpty(separator)); int size = Math.min(maxNumberOfPrintedItems, items.size()); List<String> printedItems = new ArrayList<String>(size); for (int i = 0; i < size; i++) { printedItems.add(String.format("\t%s", String.valueOf(items.get(i)))); } if (items.size() > maxNumberOfPrintedItems) { printedItems.add("\t..."); } ArrayList<String> replacements = new ArrayList<String>(); replacements.add(MessageFormat.format("${0} {1}", propertyName, StringUtils.join(printedItems, separator))); replacements.add(MessageFormat.format("${0}_COUNTER {1}", propertyName, items.size())); return replacements; }
Source:
<code><START> public ResponseEntity deleteDictionary(@PathVariable("tenant") final String tenant, <END> @PathVariable("name") final String name) { final TenantContext context = _contextFactory.getContext(tenant); final Dictionary dictionary = getReferenceDataCatalog(tenant).getDictionary(name); if (dictionary instanceof TextFileDictionary) { try { Files.delete(getResourceFile(context, name).toPath()); } catch (final IOException e) { logger.warn("Synonym catalog file could not be deleted.", e); } } _referenceDataDao.removeDictionary(context, name); return ResponseEntity.noContent().build(); }</code><technical_language>ResponseEntity is a raw type. References generic type ResponseEntity<T> parameterized</technical_language>

Target:
public ResponseEntity<Void> deleteDictionary(@PathVariable("tenant") final String tenant, @PathVariable("name") final String name) { final TenantContext context = _contextFactory.getContext(tenant); final Dictionary dictionary = getReferenceDataCatalog(tenant).getDictionary(name); if (dictionary instanceof TextFileDictionary) { try { Files.delete(getResourceFile(context, name).toPath()); } catch (final IOException e) { logger.warn("Synonym catalog file could not be deleted.", e); } } _referenceDataDao.removeDictionary(context, name); return ResponseEntity.noContent().build(); }
Source:
<code>public RangerCloudIdentitySyncStatus setAzureCloudIdentityMapping(String envCrn, Map<String, String> azureUserMapping) { <START> Optional<SdxCluster> sdxCluster = getSdxCluster(envCrn); if (sdxCluster.isEmpty()) { return newSyncStatus(RangerCloudIdentitySyncState.NOT_APPLICABLE, "No datalakes associated with the environment."); } if (!isDatalakeRunning(sdxCluster.get())) { return newSyncStatus(RangerCloudIdentitySyncState.NOT_APPLICABLE, "Datalake is not running for the environment."); } <END> return setAzureCloudIdentityMapping(envCrn, sdxCluster.get(), azureUserMapping); }</code><technical_language>this is a duplicate of getRangerCloudIdentitySyncStatus. refactor this a common part reduce code duplication</technical_language>

Target:
public RangerCloudIdentitySyncStatus setAzureCloudIdentityMapping(String envCrn, Map<String, String> azureUserMapping) { Optional<SdxCluster> sdxCluster = getSdxCluster(envCrn); return checkIfUnapplicable(sdxCluster).orElseGet(() -> setAzureCloudIdentityMapping(envCrn, sdxCluster.get(), azureUserMapping)); }
Source:
<code>public ToolInstallation installVersion(String version) { autoInstall.check(); <START> sleep(1000); <END> control("properties/hudson-tools-InstallSourceProperty/installers/id").select(version); return this; }</code><technical_language>Is this intended for master, "temporary" code</technical_language>

Target:
public ToolInstallation installVersion(String version) { autoInstall.check(); control("properties/hudson-tools-InstallSourceProperty/installers/id").select(version); return this; }
Source:
<code>private FileObject addFileToWork(WorkObject work, Resource childResc) throws DepositException { PID childPid = PIDs.get(childResc.getURI()); String stagingPath = getPropertyValue(childResc, CdrDeposit.stagingLocation); if (stagingPath == null) { throw new DepositException("No staging location provided for child (" + childResc.getURI() + ") of Work object (" + work.getPid().getQualifiedId() + ")"); } String mimetype = getPropertyValue(childResc, CdrDeposit.mimetype); String sha1 = getPropertyValue(childResc, CdrDeposit.sha1sum); String label = getPropertyValue(childResc, CdrDeposit.label); File file = null; try { URI stagingUri = new URI(stagingPath); file = new File(stagingUri); } catch (URISyntaxException e) { <START> failJob(e, "Unable to staging URI: {0}", stagingPath); <END> } String filename = label != null? label : file.getName(); try (InputStream fileStream = new FileInputStream(file)) { FileObject fileObj = work.addDataFile(childPid, fileStream, filename, mimetype, sha1); metricsClient.incrDepositFileThroughput(getDepositUUID(), file.length()); log.info("Ingested file in for deposit {}", new Object[] {filename, childPid, getDepositPID()}); return fileObj; } catch (FileNotFoundException e) { throw new DepositException("Data file missing for child (" + childPid.getQualifiedId() + ") of work (" + work.getPid().getQualifiedId() + "): " + stagingPath, e); } catch (IOException e) { throw new DepositException("Unable to close inputstream for binary " + childPid.getQualifiedId(), e); } }</code><technical_language>"Unable resolve staging URI"</technical_language>

Target:
private FileObject addFileToWork(WorkObject work, Resource childResc) throws DepositException { PID childPid = PIDs.get(childResc.getURI()); String stagingPath = getPropertyValue(childResc, CdrDeposit.stagingLocation); if (stagingPath == null) { throw new DepositException("No staging location provided for child (" + childResc.getURI() + ") of Work object (" + work.getPid().getQualifiedId() + ")"); } String mimetype = getPropertyValue(childResc, CdrDeposit.mimetype); String sha1 = getPropertyValue(childResc, CdrDeposit.sha1sum); String label = getPropertyValue(childResc, CdrDeposit.label); File file = null; try { URI stagingUri = new URI(stagingPath); file = new File(stagingUri); } catch (URISyntaxException e) { failJob(e, "Unable to resolve staging URI: {0}", stagingPath); } String filename = label != null? label : file.getName(); try (InputStream fileStream = new FileInputStream(file)) { FileObject fileObj = work.addDataFile(childPid, fileStream, filename, mimetype, sha1); metricsClient.incrDepositFileThroughput(getDepositUUID(), file.length()); log.info("Ingested file in for deposit {}", new Object[] {filename, childPid, getDepositPID()}); return fileObj; } catch (FileNotFoundException e) { throw new DepositException("Data file missing for child (" + childPid.getQualifiedId() + ") of work (" + work.getPid().getQualifiedId() + "): " + stagingPath, e); } catch (IOException e) { throw new DepositException("Unable to close inputstream for binary " + childPid.getQualifiedId(), e); } }
Source:
<code>public Optional<ResourceGroupId> match(SelectionContext context) { if (userRegex.isPresent() && !userRegex.get().matcher(context.getUser()).matches()) { return Optional.empty(); } if (sourceRegex.isPresent()) { String source = context.getSource().orElse(""); if (!sourceRegex.get().matcher(source).matches()) { return Optional.empty(); } } <START> if (!clientTags.isEmpty()) { <END> if (!context.getTags().containsAll(clientTags)) { return Optional.empty(); } } if (queryType.isPresent()) { String contextQueryType = context.getQueryType().orElse(""); if (!queryType.get().equalsIgnoreCase(contextQueryType)) { return Optional.empty(); } } return Optional.of(group.expandTemplate(context)); }</code><technical_language>if (!clientTags.isEmpty() && !context.getTags().containsAll(clientTags)) { return Optional.empty(); }</technical_language>

Target:
public Optional<ResourceGroupId> match(SelectionContext context) { if (userRegex.isPresent() && !userRegex.get().matcher(context.getUser()).matches()) { return Optional.empty(); } if (sourceRegex.isPresent()) { String source = context.getSource().orElse(""); if (!sourceRegex.get().matcher(source).matches()) { return Optional.empty(); } } if (!clientTags.isEmpty() && !context.getTags().containsAll(clientTags)) { return Optional.empty(); } if (queryType.isPresent()) { String contextQueryType = context.getQueryType().orElse(""); if (!queryType.get().equalsIgnoreCase(contextQueryType)) { return Optional.empty(); } } return Optional.of(group.expandTemplate(context)); }
Source:
<code>public void retrieveSubjectToken_noRole_expectThrows() { MockExternalAccountCredentialsTransportFactory transportFactory = new MockExternalAccountCredentialsTransportFactory(); IOException response = new IOException(); transportFactory.transport.addResponseErrorSequence(response); transportFactory.transport.addResponseSequence(true, false); final AwsCredentials awsCredential = (AwsCredentials) AwsCredentials.newBuilder(AWS_CREDENTIAL) .setHttpTransportFactory(transportFactory) .setCredentialSource(buildAwsCredentialSource(transportFactory)) .build(); IOException e = assertThrows( IOException.class, new ThrowingRunnable() { @Override public void run() throws Throwable { awsCredential.retrieveSubjectToken(); } }); <START> assertThat(e.getMessage()).isEqualTo("Failed to retrieve AWS IAM role."); <END> }</code><technical_language>assertEquals</technical_language>

Target:
public void retrieveSubjectToken_noRole_expectThrows() { MockExternalAccountCredentialsTransportFactory transportFactory = new MockExternalAccountCredentialsTransportFactory(); IOException response = new IOException(); transportFactory.transport.addResponseErrorSequence(response); transportFactory.transport.addResponseSequence(true, false); final AwsCredentials awsCredential = (AwsCredentials) AwsCredentials.newBuilder(AWS_CREDENTIAL) .setHttpTransportFactory(transportFactory) .setCredentialSource(buildAwsCredentialSource(transportFactory)) .build(); IOException e = assertThrows( IOException.class, new ThrowingRunnable() { @Override public void run() throws Throwable { awsCredential.retrieveSubjectToken(); } }); assertEquals("Failed to retrieve AWS IAM role.", e.getMessage()); }
Source:
<code>public void resetUserPassword(String username) { User user = userRepository.findUser(username); if (user == null) { throw new NoResultException(); } PasswordEncoder passwordEncoder = new BCryptPasswordEncoder(); String newPassword = RandomStringUtils.randomAlphanumeric(16); user.setPassword(passwordEncoder.encode(newPassword)); user.setPasswordReset(true); userRepository.updateUser(user, true); try { MimeMailMessage message= bsisEmailSender.createMailMessage(user.getEmailId(), passwordResetSubject, String.format(passwordResetMessage, newPassword)); bsisEmailSender.sendEmail(message); } catch (MessagingException e) { throw new MailParseException(e); <START> } <END> }</code><technical_language>@timler reason for this is is Exception managed other is a RuntimeException pointed out. Thanks for picking this</technical_language>

Target:
public void resetUserPassword(String username) throws Exception { User user = userRepository.findUser(username); if (user == null) { throw new NoResultException(); } String newPassword = generateRandomPassword(); updateUserWithNewPassword(user, newPassword); sendNewPasswordEmailToUser(user, newPassword); }
Source:
<code>public void toggleAutoStart() { autoStartStrategy.ifPresent(autoStart -> { boolean enableAutoStart = autoStartCheckbox.isSelected(); Task<Void> toggleTask = new ToggleAutoStartTask(autoStart, enableAutoStart); toggleTask.setOnFailed(event -> { autoStartCheckbox.setSelected(!enableAutoStart); LOG.error("Failed to toggle autostart.", event.getSource().getException()); errorComponent.cause(event.getSource().getException()).window(window).returnToScene(preferencesScene.get()).build().showErrorScene(); <START> }); <END> executor.execute(toggleTask); }); }</code><technical_language>alternative get this scene window: window.getScene() benefit in reducing code (variable definitions object injections)</technical_language>

Target:
public void toggleAutoStart() { autoStartStrategy.ifPresent(autoStart -> { boolean enableAutoStart = autoStartCheckbox.isSelected(); Task<Void> toggleTask = new ToggleAutoStartTask(autoStart, enableAutoStart); toggleTask.setOnFailed(event -> { autoStartCheckbox.setSelected(!enableAutoStart); LOG.error("Failed to toggle autostart.", event.getSource().getException()); }); executor.execute(toggleTask); }); }
Source:
<code>public Repository getSnapshotTo(byte[] root) { RepositoryRoot repo = new RepositoryRoot(stateDS, root); <START> repo.config = this.config; <END> return repo; }</code><technical_language>pls, move this argument constructor</technical_language>

Target:
public Repository getSnapshotTo(byte[] root) { return new RepositoryRoot(stateDS, root, config); }
Source:
<code>public String[] promptKeyboardInteractive(String destination, String name, String instruction, String[] prompt, boolean[] echo) { if (logging) { System.out.println("promptKeyboardInteractive:" + destination + ":" + name + ":" + instruction); for (String p : prompt) { System.out.println(" " + p); } } <START> <END> if (firstTry && !fAttributes.getAttribute(prompt[0], EMPTY_STRING, echo[0]).equals(EMPTY_STRING)) { firstTry = false; String[] result = new String[prompt.length]; for (int i=0; i<prompt.length; i++) { result[i] = fAttributes.getAttribute(prompt[i], EMPTY_STRING, echo[i]); } return result; } else if (fAuthenticator != null) { String[] result = fAuthenticator.prompt(destination, name, instruction, prompt, echo); if (result != null) { for (int i=0; i<prompt.length; i++) { fAttributes.setAttribute(prompt[i], result[i], echo[i]); } } return result; } return null; }</code><technical_language>I explicitly check for "User name:" "Password:" prompts USERNAME_ATTR PASSWORD_ATTR attributes (other prompts ok is). this means user is unable change username password editing connection</technical_language>

Target:
public String[] promptKeyboardInteractive(String destination, String name, String instruction, String[] prompt, boolean[] echo) { if (logging) { System.out.println("promptKeyboardInteractive:" + destination + ":" + name + ":" + instruction); for (String p : prompt) { System.out.println(" " + p); } } if (prompt.length==0) { return new String[0]; } else if (firstTry) { firstTry = false; if (prompt.length==1 && prompt[0].trim().equalsIgnoreCase("password:")) { if (!getPassword().equals(EMPTY_STRING)) { return new String[]{getPassword()}; } } else if (!fAttributes.getAttribute(prompt[0], EMPTY_STRING, echo[0]).equals(EMPTY_STRING)) { String[] result = new String[prompt.length]; for (int i=0; i<prompt.length; i++) { result[i] = fAttributes.getAttribute(prompt[i], EMPTY_STRING, echo[i]); } return result; } } if (fAuthenticator != null) { String[] result = fAuthenticator.prompt(destination, name, instruction, prompt, echo); if (result != null) { if (prompt.length==1 && prompt[0].trim().equalsIgnoreCase("password:")) { fAttributes.setSecureAttribute(JSchConnectionAttributes.PASSWORD_ATTR, result[0]); } else { for (int i=0; i<prompt.length; i++) { fAttributes.setAttribute(prompt[i], result[i], echo[i]); } } } return result; } return null; }
Source:
<code>public void delete(int cfIndex, byte[] keyBytes) throws RocksDBException { try { <START> String tableName = tablesNames.get(cfIndex); <END> Class keyType = getKeyType(tableName); Object key = codecRegistry.asObject(keyBytes, keyType); OMDBUpdateEvent.OMUpdateEventBuilder builder = new OMDBUpdateEvent.OMUpdateEventBuilder<>(); builder.setTable(tableName); builder.setKey(key); builder.setAction(OMDBUpdateEvent.OMDBUpdateAction.DELETE); OMDBUpdateEvent deleteEvent = builder.build(); LOG.info("Generated OM delete Event for table : " + deleteEvent.getTable() + ", Key = " + deleteEvent.getKey()); omdbUpdateEvents.add(deleteEvent); } catch (IOException ioEx) { LOG.error("Exception when reading key : " + ioEx); } }</code><technical_language>a repetitive code, a Builder pattern for EventInfo nice</technical_language>

Target:
public void delete(int cfIndex, byte[] keyBytes) throws RocksDBException { try { processEvent(cfIndex, keyBytes, null, OMDBUpdateEvent.OMDBUpdateAction.DELETE); } catch (IOException ioEx) { LOG.error("Exception when reading key : " + ioEx); } }
Source:
<code>public List<Field> getFields() { try { if (notStrictFieldLayoutRowSyntaxValidator == null) { notStrictFieldLayoutRowSyntaxValidator = new NotStrictFieldLayoutRowSyntaxValidator(this.contentType, this.fields); notStrictFieldLayoutRowSyntaxValidator.validate(); } return notStrictFieldLayoutRowSyntaxValidator.getFields(); } catch (FieldLayoutValidationException e) { <START> throw new DotRuntimeException(e); <END> } }</code><technical_language>log Identifier name of Content Type in error</technical_language>

Target:
public List<Field> getFields() { try { if (notStrictFieldLayoutRowSyntaxValidator == null) { notStrictFieldLayoutRowSyntaxValidator = new NotStrictFieldLayoutRowSyntaxValidator(this.contentType, this.fields); notStrictFieldLayoutRowSyntaxValidator.validate(); } return notStrictFieldLayoutRowSyntaxValidator.getFields(); } catch (FieldLayoutValidationException e) { Logger.error(FieldLayout.class, e.getMessage()); throw new DotRuntimeException(e); } }
Source:
<code>protected void prepareHeaderWidgets(PatchScript script, PatchSetDetail detail) { initPatchSetListForTableHeader(); psListOfHeaderA.display(detail, script, patchKey, idSideA, idSideB); psListOfHeaderB.display(detail, script, patchKey, idSideA, idSideB); <START> iconA = new Anchor(); <END> iconA.setTitle(PatchUtil.C.addFileComment()); DOM.insertBefore(iconA.getElement(), new Image(Gerrit.RESOURCES.addFileComment()).getElement(), DOM.getFirstChild(iconA.getElement())); iconA.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { createFileCommentEditorOnSideA(); } }); iconB = new Anchor(); iconB.setTitle(PatchUtil.C.addFileComment()); DOM.insertBefore(iconB.getElement(), new Image(Gerrit.RESOURCES.addFileComment()).getElement(), DOM.getFirstChild(iconB.getElement())); iconB.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { createFileCommentEditorOnSideB(); } }); }</code><technical_language>Image widget ClickHandler? I reason for Anchor here. I set a title string Image mouse rollover show explanation</technical_language>

Target:
protected void prepareHeaderWidgets(PatchScript script, PatchSetDetail detail) { initPatchSetListForTableHeader(); psListOfHeaderA.display(detail, script, patchKey, idSideA, idSideB); psListOfHeaderB.display(detail, script, patchKey, idSideA, idSideB); iconA = new Image(Gerrit.RESOURCES.addFileComment()); iconA.setTitle(PatchUtil.C.addFileComment()); iconA.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { createFileCommentEditorOnSideA(); } }); iconB = new Image(Gerrit.RESOURCES.addFileComment()); iconB.setTitle(PatchUtil.C.addFileComment()); iconB.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { createFileCommentEditorOnSideB(); } }); }
Source:
<code>public Schedule createSchedule(ReferenceData refData) { LocalDate unadjStart = calculatedUnadjustedStartDate(refData); LocalDate unadjEnd = calculatedUnadjustedEndDate(refData); LocalDate regularStart = calculatedFirstRegularStartDate(unadjStart, refData); LocalDate regularEnd = calculatedLastRegularEndDate(unadjEnd, refData); RollConvention rollConv = calculatedRollConvention(regularStart, regularEnd); List<LocalDate> unadj = generateUnadjustedDates(unadjStart, regularStart, regularEnd, unadjEnd, rollConv); List<LocalDate> adj = applyBusinessDayAdjustment(unadj, refData); List<SchedulePeriod> periods = new ArrayList<>(); try { <START> if (combinePeriodsIfNecessary) { <END> adj = new ArrayList<>(adj); unadj = new ArrayList<>(unadj); for (int i = 0; i < adj.size() - 1; i++) { if (adj.get(i).equals(adj.get(i + 1))) { adj.remove(i); unadj.remove(i); } } } for (int i = 0; i < unadj.size() - 1; i++) { periods.add(SchedulePeriod.of(adj.get(i), adj.get(i + 1), unadj.get(i), unadj.get(i + 1))); } } catch (IllegalArgumentException ex) { createUnadjustedDates(); createAdjustedDates(refData); ScheduleException se = new ScheduleException(this, "Schedule calculation resulted in invalid period"); se.initCause(ex); throw se; } return Schedule.builder() .periods(periods) .frequency(frequency) .rollConvention(rollConv) .build(); }</code><technical_language>code turned out, analysis wrong, sorry. I is right add combinePeriodsIfNecessary extra property in PeriodicSchedule handled extra parameter createSchedule() (with a compatibility overload). This side effect PeriodicSchedule stay a normal bean, removing another incompatibility</technical_language>

Target:
public Schedule createSchedule(ReferenceData refData) { return createSchedule(refData, false); }
Source:
<code><START> public void visit( TypeCastExpressionNode n ) <END> { n.expression().accept( this ); if ( n.type() == NativeType.INT ) { currExpression = new CastIntExpression( currExpression ); } else if ( n.type() == NativeType.DOUBLE ) { currExpression = new CastDoubleExpression( currExpression ); } else if ( n.type() == NativeType.STRING ) { currExpression = new CastStringExpression( currExpression ); } else if ( n.type() == NativeType.BOOL ) { currExpression = new CastBoolExpression( currExpression ); } else if ( n.type() == NativeType.LONG ) { currExpression = new CastLongExpression( currExpression ); } }</code><technical_language>commit is reverting changes this method for some reason. correct version is switch</technical_language>

Target:
public void visit( TypeCastExpressionNode n ) { n.expression().accept( this ); switch( n.type() ) { case INT: currExpression = new CastIntExpression( currExpression ); break; case DOUBLE: currExpression = new CastDoubleExpression( currExpression ); break; case STRING: currExpression = new CastStringExpression( currExpression ); break; case BOOL: currExpression = new CastBoolExpression( currExpression ); break; case LONG: currExpression = new CastLongExpression( currExpression ); break; } }
Source:
<code>public void start() { if (!running) { ChannelBindingServiceProperties channelBindingServiceProperties = null; try { ChannelBindingService channelBindingService = this.applicationContext .getBean(ChannelBindingService.class); channelBindingServiceProperties = channelBindingService.getChannelBindingServiceProperties(); Map<String, Bindable> bindables = this.applicationContext.getBeansOfType(Bindable.class); for (Bindable bindable : bindables.values()) { bindable.bindInputs(channelBindingService); } } catch (BeansException e) { throw new IllegalStateException( "Cannot perform binding, no proper implementation found", e); } <START> if (channelBindingServiceProperties != null && channelBindingServiceProperties.isAutoStartup()) { <END> this.running = true; } } }</code><technical_language>setting of flag conditional autostartup</technical_language>

Target:
public void start() { if (!running) { try { ChannelBindingService channelBindingService = this.applicationContext .getBean(ChannelBindingService.class); Map<String, Bindable> bindables = this.applicationContext.getBeansOfType(Bindable.class); for (Bindable bindable : bindables.values()) { bindable.bindInputs(channelBindingService); } } catch (BeansException e) { throw new IllegalStateException( "Cannot perform binding, no proper implementation found", e); } this.running = true; } }
Source:
<code>public void pageFindByCandidateEntityShouldNotFindApplicationForCandidateWithoutApplications() { CandidateEntity candidateB = this.candidateRepository.findOne(CANDIDATE_B_ID); Page<ApplicationEntity> <START> pageResult = <END> this.repository.findByCandidateEntity(candidateB, DEFAULT_PAGE_REQUEST); List<ApplicationEntity> result = pageResult.getContent(); assertThat(result, notNullValue()); assertThat(result, empty()); }</code><technical_language>local variables final</technical_language>

Target:
public void pageFindByCandidateEntityShouldNotFindApplicationForCandidateWithoutApplications() { CandidateEntity candidateB = this.candidateRepository.findOne(CANDIDATE_B_ID); final Page<ApplicationEntity> pageResult = this.repository.findByCandidateEntity(candidateB, DEFAULT_PAGE_REQUEST); final List<ApplicationEntity> result = pageResult.getContent(); assertThat(result, notNullValue()); assertThat(result, empty()); }
Source:
<code>private synchronized Status updateAndGetStatus() { if (this.status == Status.OPEN && Instant.now().isAfter(this.closeCircuitInstant)) { LOGGER.info("Timeout expired for OPEN circuit"); this.halfOpenCircuit(); } <START> return this.status == Status.HALF_OPEN ? Status.CLOSED : this.status; <END> }</code><technical_language>This method return status HALF_OPEN? is return status here, add status HALF_OPEN check in isClosed method</technical_language>

Target:
private Status updateAndGetStatus() { this.lock.lock(); try { if (this.status == Status.OPEN && Instant.now().isAfter(this.closeCircuitInstant)) { LOGGER.info("Timeout expired for OPEN circuit"); this.halfOpenCircuit(); } return this.status; } finally { this.lock.unlock(); } }
Source:
<code>public RestxSpecTestsRunner(Class<?> testClass) throws InitializationError, IllegalAccessException, InvocationTargetException, InstantiationException, NoSuchFieldException, IOException { super(testClass); <START> FindSpecsIn findSpecsIn = getTestClass().getJavaClass().getAnnotation(FindSpecsIn.class); if (findSpecsIn != null) { Factory factory = Factory.newInstance(); WebServerSupplier supplier = factory.queryByClass(WebServerSupplier.class).findOne().get().getComponent(); RestxSpecRule rule = new RestxSpecRule(findSpecsIn.withRouterPath(), supplier, factory); tests = new RestxSpecTests(rule, RestxSpecTests.findSpecsIn(findSpecsIn.value())); <END> } else { Object o = getTestClass().getOnlyConstructor().newInstance(); if (!(o instanceof RestxSpecTests)) { throw new IllegalArgumentException( format("Test class %s must either be annotated with FindSpecsIn" + " or extend RestxSpecTests " + "to be run with RestxSpecTestsRunner.", getTestClass().getJavaClass().getName())); } tests = (RestxSpecTests) o; } }</code><technical_language>elaborate a new Factory is required java 11</technical_language>

Target:
public RestxSpecTestsRunner(Class<?> testClass) throws InitializationError, IllegalAccessException, InvocationTargetException, InstantiationException, NoSuchFieldException, IOException { super(testClass); FindSpecsIn findSpecsIn = getTestClass().getJavaClass().getAnnotation(FindSpecsIn.class); if (findSpecsIn != null) { tests = new RestxSpecTests(new RestxSpecRule(findSpecsIn.withRouterPath()), RestxSpecTests.findSpecsIn(findSpecsIn.value())); } else { Object o = getTestClass().getOnlyConstructor().newInstance(); if (!(o instanceof RestxSpecTests)) { throw new IllegalArgumentException( format("Test class %s must either be annotated with FindSpecsIn" + " or extend RestxSpecTests " + "to be run with RestxSpecTestsRunner.", getTestClass().getJavaClass().getName())); } tests = (RestxSpecTests) o; } }
Source:
<code>public static CertificateService getCertificateService() { if (certiticateService == null) { <START> ServiceReference<?> guiVerifyReference <END> = IrcActivator.getBundleContext().getServiceReference( CertificateService.class.getName()); if (guiVerifyReference != null) { certiticateService = (CertificateService) IrcActivator.getBundleContext().getService( guiVerifyReference); } } return certiticateService; }</code><technical_language>Consider ServiceUtils.getService</technical_language>

Target:
public static CertificateService getCertificateService() { if (certificateService == null) { certificateService = ServiceUtils.getService(bundleContext, CertificateService.class); } return certificateService; }
Source:
<code>protected Repository getRepository(boolean warn) { RepositoryMapping mapping = null; for (IResource resource : getSelectedResources()) { <START> RepositoryMapping repositoryMapping = RepositoryMapping.getMapping(resource.getProject()); <END> if (mapping == null) mapping = repositoryMapping; if (repositoryMapping == null) return null; if (mapping.getRepository() != repositoryMapping.getRepository()) { if (warn) MessageDialog.openError(getShell(), "Multiple Repositories Selection", "Cannot perform reset on multiple repositories simultaneously.\n\nPlease select items from only one repository."); return null; } } if (mapping == null) { if (warn) MessageDialog.openError(getShell(), "Cannot Find Repository", "Could not find a repository associated with this project"); return null; } final Repository repository = mapping.getRepository(); return repository; }</code><technical_language>do need change this</technical_language>

Target:
protected Repository getRepository(boolean warn) { RepositoryMapping mapping = null; for (IProject project : getSelectedProjects()) { RepositoryMapping repositoryMapping = RepositoryMapping.getMapping(project); if (mapping == null) mapping = repositoryMapping; if (repositoryMapping == null) return null; if (mapping.getRepository() != repositoryMapping.getRepository()) { if (warn) MessageDialog.openError(getShell(), "Multiple Repositories Selection", "Cannot perform reset on multiple repositories simultaneously.\n\nPlease select items from only one repository."); return null; } } if (mapping == null) { if (warn) MessageDialog.openError(getShell(), "Cannot Find Repository", "Could not find a repository associated with this project"); return null; } final Repository repository = mapping.getRepository(); return repository; }
Source:
<code>public synchronized void removeFromDirQueue(String dir) { Object[] tempArray = dirQueue.toArray(); DirToCheck dirToCheck = null; for (int b = 0; b < tempArray.length; b++) { dirToCheck = (DirToCheck) tempArray[b]; String processWork = dirToCheck.getName(); if (processWork.equals(dir)) { if (dirQueue.remove(dirToCheck)) { totalDirsFound--; } else { <START> LOG.error("Removed " + processWork + " from dir queue"); <END> } } } }</code><technical_language>"Failed remove...". suggest warn</technical_language>

Target:
public synchronized void removeFromDirQueue(String dir) { Object[] tempArray = dirQueue.toArray(); DirToCheck dirToCheck = null; for (int b = 0; b < tempArray.length; b++) { dirToCheck = (DirToCheck) tempArray[b]; String processWork = dirToCheck.getName(); if (processWork.equals(dir)) { if (dirQueue.remove(dirToCheck)) { totalDirsFound--; } else { LOG.warn("Failed to remove " + processWork + " from dir queue"); } } } }
Source:
<code>public void testPairedIntervalFilter(final String intervalFilename, final int expectNumber) throws Exception { final File inputSam = File.createTempFile("testSam", ".sam", TEST_DIR); inputSam.deleteOnExit(); <START> final File sortedSamIdx = new File(TEST_DIR, inputSam.getName() + ".bai"); <END> sortedSamIdx.deleteOnExit(); final SAMFileWriter writer = new SAMFileWriterFactory() .setCreateIndex(true).makeBAMWriter(builder.getHeader(), false, inputSam); for (final SAMRecord record : builder) { writer.addAlignment(record); } writer.close(); final File intervalFile = new File(intervalFilename); FilterSamReads filterTest = setupProgram(intervalFile, inputSam, FilterSamReads.Filter.includePairedIntervals); Assert.assertEquals(filterTest.doWork(),0); long count = getReadCount(filterTest); Assert.assertEquals(count, expectNumber); }</code><technical_language>A sam file a .bai index though</technical_language>

Target:
public void testPairedIntervalFilter(final String intervalFilename, final int expectNumber) throws Exception { final File inputSam = File.createTempFile("testSam", ".sam", TEST_DIR); inputSam.deleteOnExit(); final File sortedSamIdx = new File(TEST_DIR, inputSam.getName() + ".idx"); sortedSamIdx.deleteOnExit(); final SAMFileWriter writer = new SAMFileWriterFactory() .setCreateIndex(true).makeSAMWriter(builder.getHeader(), false, inputSam); for (final SAMRecord record : builder) { writer.addAlignment(record); } writer.close(); final File intervalFile = new File(intervalFilename); FilterSamReads filterTest = setupProgram(intervalFile, inputSam, FilterSamReads.Filter.includePairedIntervals); Assert.assertEquals(filterTest.doWork(),0); long count = getReadCount(filterTest); Assert.assertEquals(count, expectNumber); }
Source:
<code>public String getSwiftContainerName(){ String swiftContainerName; try { DataFileIO dataFileIO = getFile().getDataFileIO(); try { SwiftAccessIO swiftIO = (SwiftAccessIO)dataFileIO; swiftIO.open(); swiftContainerName = swiftIO.getSwiftContainerName(); logger.info("Swift container name: " + swiftContainerName); return swiftContainerName; } catch (Exception e) { e.printStackTrace(); } } catch (Exception e) { <START> e.printStackTrace(); <END> } return ""; }</code><technical_language>here. get rid of printing stack trace, ugly</technical_language>

Target:
public String getSwiftContainerName(){ SwiftAccessIO swiftObject = getSwiftObject(); try { swiftObject.open(); return swiftObject.getSwiftContainerName(); } catch (IOException e){ logger.info("FilePage: Failed to open swift object"); } return ""; }
Source:
<code>public static Cube syncCubeLoad(ICubicWorld world, CubeIO loader, ServerCubeCache cache, int cubeX, int cubeY, int cubeZ) { Column column = cache.loadChunk(cubeX, cubeZ); QueuedCube key = new QueuedCube(cubeX, cubeY, cubeZ, world); AsyncCubeIOProvider task = cubeTasks.remove(key); if (task != null) { runTask(task); } else { task = new AsyncCubeIOProvider(key, loader); task.setColumn(column); task.run(); task.runSynchronousPart(); } <START> task.runCallbacks(); <END> return task.get(); }</code><technical_language>This run callbacks - remove runCallbacks() part in cube provider</technical_language>

Target:
public static Cube syncCubeLoad(ICubicWorld world, CubeIO loader, ServerCubeCache cache, int cubeX, int cubeY, int cubeZ) { Column column = cache.loadChunk(cubeX, cubeZ); QueuedCube key = new QueuedCube(cubeX, cubeY, cubeZ, world); AsyncCubeIOProvider task = cubeTasks.remove(key); if (task != null) { runTask(task); } else { task = new AsyncCubeIOProvider(key, loader); task.setColumn(column); task.run(); } task.runSynchronousPart(); return task.get(); }
Source:
<code>protected boolean canDoAction() { if (!super.canDoAction()) { return false; } if (getParameters().getClusterId() == null) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_CLUSTER_IS_NOT_VALID); return false; } <START> if (getParameters() == null || getParameters().getConfigParams() == null <END> || getParameters().getConfigParams().size() == 0) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_SNAPSHOT_CONFIG_PARAMS_IS_EMPTY); return false; } for (GlusterVolumeSnapshotConfig param : getParameters().getConfigParams()) { if (param.getParamValue() == null || param.getParamValue().equals("")) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_SNAPSHOT_CONFIG_PARAM_VALUE_IS_EMPTY); return false; } } return true; }</code><technical_language>getParameters() == null is redundant check getParameters().getClusterId()</technical_language>

Target:
protected boolean canDoAction() { if (!super.canDoAction()) { return false; } if (getParameters().getClusterId() == null) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_CLUSTER_IS_NOT_VALID); return false; } if (getParameters().getConfigParams() == null || getParameters().getConfigParams().size() == 0) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_SNAPSHOT_CONFIG_PARAMS_IS_EMPTY); return false; } for (GlusterVolumeSnapshotConfig param : getParameters().getConfigParams()) { if (param.getParamValue() == null || param.getParamValue().equals("")) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_SNAPSHOT_CONFIG_PARAM_VALUE_IS_EMPTY); return false; } } return true; }
Source:
<code>static RoomAppDatabase obtainInstance(Context context) { <START> RoomAppDatabase database = singleInstance; <END> if (database == null) { synchronized (LOCK) { database = singleInstance; if (database == null) { singleInstance = newInstance(context); database = singleInstance; } } } return database; }</code><technical_language>Yup</technical_language>

Target:
static RoomAppDatabase obtainInstance(Context context) { if (singleInstance == null) { synchronized (RoomAppDatabase.class) { if (singleInstance == null) { singleInstance = newInstance(context); } } } return singleInstance; }