auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void validate() { boolean isZkAddressSet = zkAddress != null && !zkAddress.isEmpty(); if (realmMode == RealmAwareZkClient.RealmMode.SINGLE_REALM && !isZkAddressSet) { throw new HelixException( "ConfigAccessor: RealmMode cannot be single-realm without a valid ZkAddress set!"); } if (realmMode == null) { realmMode = isZkAddressSet ? RealmAwareZkClient.RealmMode.SINGLE_REALM : RealmAwareZkClient.RealmMode.MULTI_REALM; } boolean isZkClientConfigSet = realmAwareZkClientConfig != null; realmAwareZkClientConfig = isZkClientConfigSet ? realmAwareZkClientConfig.createHelixZkClientConfig() : new HelixZkClient.ZkClientConfig().setZkSerializer(new ZNRecordSerializer()); if (realmAwareZkConnectionConfig == null) { realmAwareZkConnectionConfig = new RealmAwareZkClient.RealmAwareZkConnectionConfig.Builder().build(); } }

Target:
private void validate() { boolean isZkAddressSet = zkAddress != null && !zkAddress.isEmpty(); if (realmMode == RealmAwareZkClient.RealmMode.SINGLE_REALM && !isZkAddressSet) { throw new HelixException( "RealmMode cannot be single-realm without a valid ZkAddress set!"); } if (realmMode == RealmAwareZkClient.RealmMode.MULTI_REALM && isZkAddressSet) { throw new HelixException( "ZkAddress cannot be set on multi-realm mode!"); } if (realmMode == null) { realmMode = isZkAddressSet ? RealmAwareZkClient.RealmMode.SINGLE_REALM : RealmAwareZkClient.RealmMode.MULTI_REALM; } if (realmAwareZkClientConfig == null) { realmAwareZkClientConfig = new RealmAwareZkClient.RealmAwareZkClientConfig(); } if (realmAwareZkConnectionConfig == null) { realmAwareZkConnectionConfig = new RealmAwareZkClient.RealmAwareZkConnectionConfig.Builder().build(); } }
Source:
private void createContext() { if ( vc != null ) { if (g == null) { jContext = new VariantJEXLContext(vc); } else { jContext = new GenotypeJEXLContext(vc, g); } } else { jContext = new MapContext(new HashMap<String, Object>()); } }

Target:
private void createContext() { if ( vc == null ) { jContext = new MapContext(Collections.emptyMap()); } else if (g == null) { jContext = new VariantJEXLContext(vc); } else { jContext = new GenotypeJEXLContext(vc, g); } }
Source:
public static void updateFromLdapUser(User target, UserDetails ldapUserDetails) { final List<String> roles = new ArrayList<>(); for (final GrantedAuthority ga : ldapUserDetails.getAuthorities()) { roles.add(removePrefix(ga.toString(), LimsSecurityUtils.rolePrefix)); } target.setRoles(roles.toArray(new String[0])); target.setActive(ldapUserDetails.isAccountNonExpired()); target.setAdmin(roles.contains(MisoAuthority.ROLE_ADMIN.name())); target.setInternal(roles.contains(MisoAuthority.ROLE_INTERNAL.name())); target.setPassword(ldapUserDetails.getPassword()); if(ldapUserDetails instanceof InetOrgPerson) { InetOrgPerson person = (InetOrgPerson) ldapUserDetails; target.setFullName(person.getDisplayName()); target.setEmail(person.getMail()); } }

Target:
public static void updateFromLdapUser(User target, UserDetails ldapUserDetails) { final List<String> roles = new ArrayList<>(); for (final GrantedAuthority ga : ldapUserDetails.getAuthorities()) { roles.add(removePrefix(ga.toString(), LimsSecurityUtils.rolePrefix)); } target.setRoles(roles.toArray(new String[0])); target.setActive(ldapUserDetails.isAccountNonExpired()); target.setAdmin(roles.contains(MisoAuthority.ROLE_ADMIN.name())); target.setInternal(roles.contains(MisoAuthority.ROLE_INTERNAL.name())); target.setPassword(ldapUserDetails.getPassword()); if(ldapUserDetails instanceof InetOrgPerson) { InetOrgPerson person = (InetOrgPerson) ldapUserDetails; target.setFullName(person.getDisplayName()); target.setEmail(person.getMail()); } else { target.setFullName(ldapUserDetails.getUsername()); } }
Source:
private void onPermissionsGranted() { if (BuildConfig.FEATURE_APK_GENERATOR_ENABLED) { setContentView(R.layout.activity_main_menu_splashscreen); prepareStandaloneProject(); return; } getSupportFragmentManager().beginTransaction() .replace(R.id.fragment_container, new MainMenuFragment(), MainMenuFragment.TAG) .commit(); showContentView(FRAGMENT); if (SettingsFragment.isCastSharedPreferenceEnabled(this)) { CastManager.getInstance().initializeCast(this); } new ImportProjectsFromExternalStorage(this).showImportProjectsDialog(); }

Target:
private void onPermissionsGranted() { if (BuildConfig.FEATURE_APK_GENERATOR_ENABLED) { setContentView(R.layout.activity_main_menu_splashscreen); prepareStandaloneProject(); return; } getSupportFragmentManager().beginTransaction() .replace(R.id.fragment_container, new MainMenuFragment(), MainMenuFragment.TAG) .commit(); showContentView(FRAGMENT); if (SettingsFragment.isCastSharedPreferenceEnabled(this)) { CastManager.getInstance().initializeCast(this); } if (EXTERNAL_STORAGE_ROOT_DIRECTORY.exists()) { new ImportProjectsFromExternalStorage(this).showImportProjectsDialog(); } }
Source:
MessagingTemplate getMessagingTemplate() { return this.messagingTemplate; }

Target:
protected MessagingTemplate getMessagingTemplate() { return this.messagingTemplate; }
Source:
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { try { Credentials credentials = SSOUtils.getUserCredentialsFromHeader(request); if (credentials == null) { response.sendError(HttpServletResponse.SC_UNAUTHORIZED); } else { AuthenticationUtils.handleCredentials( request.getSession(true), credentials.getUsername(), credentials.getPassword(), credentials.getProfile()); try (OutputStream os = response.getOutputStream()) { os.write(SSOUtils.issueTicket(request.getSession(true), request).getBytes("UTF-8")); } } } catch (Exception e) { log.debug("Unable to authenticate", e); response.sendError(HttpServletResponse.SC_UNAUTHORIZED); } }

Target:
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { try { Credentials credentials = SSOUtils.getUserCredentialsFromHeader(request); if (credentials == null) { response.sendError(HttpServletResponse.SC_UNAUTHORIZED); } else { AuthenticationUtils.handleCredentials( request.getSession(true), credentials.getUsername(), credentials.getPassword(), credentials.getProfile()); try (OutputStream os = response.getOutputStream()) { os.write(SSOUtils.issueTicket(request.getSession(true), request).getBytes("UTF-8")); } } } catch (Exception e) { log.error("Unable to authenticate {}", e.getMessage()); response.sendError(HttpServletResponse.SC_UNAUTHORIZED); } }
Source:
private void runFixVcfHeader(final int checkFirstNRecords, final File replacementHeader, final boolean enforceSampleSamples) { final FixVcfHeader program = new FixVcfHeader(); final File outputVcf = new File(OUTPUT_DATA_PATH, "output.vcf"); outputVcf.deleteOnExit(); final File outputVcfIndex = new File(OUTPUT_DATA_PATH, "output.vcf.idx"); outputVcfIndex.deleteOnExit(); program.INPUT = INPUT_VCF; program.OUTPUT = outputVcf; if (replacementHeader == null) { program.CHECK_FIRST_N_RECORDS = checkFirstNRecords; } else { program.HEADER = replacementHeader; program.ENFORCE_SAME_SAMPLES = enforceSampleSamples; } Assert.assertEquals(program.instanceMain(new String[0]), 0); IOUtil.assertFilesEqual(OUTPUT_VCF, outputVcf); }

Target:
private void runFixVcfHeader(final int checkFirstNRecords, final File replacementHeader, final boolean enforceSampleSamples) throws IOException { final FixVcfHeader program = new FixVcfHeader(); final File outputVcf = VcfTestUtils.createTemporaryIndexedVcfFile("output.", ".vcf"); program.INPUT = INPUT_VCF; program.OUTPUT = outputVcf; if (replacementHeader == null) { program.CHECK_FIRST_N_RECORDS = checkFirstNRecords; } else { program.HEADER = replacementHeader; program.ENFORCE_SAME_SAMPLES = enforceSampleSamples; } Assert.assertEquals(program.instanceMain(new String[0]), 0); IOUtil.assertFilesEqual(OUTPUT_VCF, outputVcf); }
Source:
public void onStart(ISuite suite) { isCleanUpCompleted.set(false); runningTests.clear(); Runtime.getRuntime().addShutdownHook(new Thread(this::shutdown)); Injector injector = createInjector(getParentModules()); injector.injectMembers(this); suite.setParentInjector(injector); }

Target:
public void onStart(ISuite suite) { isCleanUpCompleted.set(false); runningTests.clear(); Injector injector = createInjector(getParentModules()); injector.injectMembers(this); suite.setParentInjector(injector); }
Source:
public boolean stop() { backgroundSyncExecutor.shutdown(); outOfBandManagementDao.expireOutOfBandManagementOwnershipByServer(getId()); return true; }

Target:
public boolean stop() { backgroundSyncBlockingExecutor.shutdown(); outOfBandManagementDao.expireOutOfBandManagementOwnershipByServer(getId()); return true; }
Source:
public DirectoryAsyncClient buildAsyncClient() { Objects.requireNonNull(endpoint); if (pipeline != null) { return new DirectoryAsyncClient(endpoint, pipeline, shareName, directoryName, shareSnapshot); } if (sasTokenCredential == null && sharedKeyCredential == null) { throw new IllegalArgumentException("Credentials are required for authorization"); } final List<HttpPipelinePolicy> policies = new ArrayList<>(); policies.add(new UserAgentPolicy(FileConfiguration.NAME, FileConfiguration.VERSION, configuration)); policies.add(new RequestIdPolicy()); policies.add(new AddDatePolicy()); if (sharedKeyCredential != null) { policies.add(new SharedKeyCredentialPolicy(sharedKeyCredential)); } else { policies.add(new SASTokenCredentialPolicy(sasTokenCredential)); } HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.addAll(this.policies); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(logLevel)); HttpPipeline pipeline = HttpPipeline.builder() .policies(policies.toArray(new HttpPipelinePolicy[0])) .httpClient(httpClient) .build(); return new DirectoryAsyncClient(endpoint, pipeline, shareName, directoryName, shareSnapshot); }

Target:
public DirectoryAsyncClient buildAsyncClient() { Objects.requireNonNull(shareName); Objects.requireNonNull(directoryPath); if (pipeline != null) { return new DirectoryAsyncClient(endpoint, pipeline, shareName, directoryPath, snapshot); } if (sasTokenCredential == null && sharedKeyCredential == null) { throw new IllegalArgumentException("Credentials are required for authorization"); } final List<HttpPipelinePolicy> policies = new ArrayList<>(); policies.add(new UserAgentPolicy(FileConfiguration.NAME, FileConfiguration.VERSION, configuration)); policies.add(new RequestIdPolicy()); policies.add(new AddDatePolicy()); if (sharedKeyCredential != null) { policies.add(new SharedKeyCredentialPolicy(sharedKeyCredential)); } else { policies.add(new SASTokenCredentialPolicy(sasTokenCredential)); } HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.addAll(this.policies); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(logLevel)); HttpPipeline pipeline = HttpPipeline.builder() .policies(policies.toArray(new HttpPipelinePolicy[0])) .httpClient(httpClient) .build(); return new DirectoryAsyncClient(endpoint, pipeline, shareName, directoryPath, snapshot); }
Source:
public boolean canExecute() { boolean canExecute = false; Object model = edgeEditPart.getModel(); if (model instanceof Edge && sourceEditPart != null && targetEditPart != null) { Edge edge = (Edge) model; EdgeQuery edgeQuery = new EdgeQuery(edge); canExecute = !edgeQuery.isEdgeWithTreeRoutingStyle(); if (canExecute) { isSourceABorderNode = sourceEditPart instanceof AbstractDiagramBorderNodeEditPart; isTargetABorderNode = targetEditPart instanceof AbstractDiagramBorderNodeEditPart; int axis = getSourceAndTargetSameAxis(); canExecute = axis != PositionConstants.NONE; if (canExecute) { if ((axis == PositionConstants.HORIZONTAL && (straightenType == StraightenToAction.TO_TOP || straightenType == StraightenToAction.TO_BOTTOM)) || (axis == PositionConstants.VERTICAL && (straightenType == StraightenToAction.TO_LEFT || straightenType == StraightenToAction.TO_RIGHT))) { moveSource = isSourceWillBeMoved(); } else { canExecute = false; } } } if (canExecute) { canExecute = !isMovedNodeABorderNodeWithSeveralConnections(); } if (canExecute) { canExecute = !isCentered(); } if (canExecute) { canExecute = isNewLocationInParentBounds(); } if (canExecute) { canExecute = !isOverlapped(); } } return canExecute; }

Target:
public boolean canExecute() { boolean canExecute = false; Object model = edgeEditPart.getModel(); if (model instanceof Edge && sourceEditPart != null && targetEditPart != null) { Edge edge = (Edge) model; EdgeQuery edgeQuery = new EdgeQuery(edge); canExecute = !edgeQuery.isEdgeWithTreeRoutingStyle(); if (canExecute) { canExecute = !(sourceEditPart instanceof ConnectionEditPart || targetEditPart instanceof ConnectionEditPart); } if (canExecute) { isSourceABorderNode = sourceEditPart instanceof AbstractDiagramBorderNodeEditPart; isTargetABorderNode = targetEditPart instanceof AbstractDiagramBorderNodeEditPart; int axis = getSourceAndTargetSameAxis(); canExecute = axis != PositionConstants.NONE; if (canExecute) { if ((axis == PositionConstants.HORIZONTAL && (straightenType == StraightenToAction.TO_TOP || straightenType == StraightenToAction.TO_BOTTOM)) || (axis == PositionConstants.VERTICAL && (straightenType == StraightenToAction.TO_LEFT || straightenType == StraightenToAction.TO_RIGHT))) { moveSource = isSourceWillBeMoved(); } else { canExecute = false; } } } if (canExecute) { canExecute = !isMovedNodeABorderNodeWithSeveralConnections(); } if (canExecute) { canExecute = !isCentered(); } if (canExecute) { canExecute = isNewLocationInParentBounds(); } if (canExecute) { canExecute = !isOverlapped(); } } return canExecute; }
Source:
public void executionWithLocalizedDescription() throws Exception { final CurrencyUnit currencyUnit = USD; final TaxRateDraft taxRate = TaxRateDraft.of("x20", 0.20, true, COUNTRY_CODE); withZone(client(), zone -> { withTaxCategory(client(), TaxCategoryDraft.of("taxcat", asList(taxRate)), taxCategory -> { final ZoneRateDraft zoneRate = ZoneRateDraftBuilder.of(zone.toResourceIdentifier(), asList(ShippingRate.of(MoneyImpl.of(30, currencyUnit)))).build(); final ShippingMethodDraft draft = ShippingMethodDraft.of("standard shipping", LocalizedString.of(ENGLISH, "description"), taxCategory, asList(zoneRate)); final ShippingMethod shippingMethod = client().executeBlocking(ShippingMethodCreateCommand.of(draft)); client().executeBlocking(ShippingMethodDeleteCommand.of(shippingMethod)); }); }, COUNTRY_CODE); }

Target:
public void executionWithLocalizedDescription() throws Exception { final CurrencyUnit currencyUnit = USD; final TaxRateDraft taxRate = TaxRateDraft.of("x20", 0.20, true, COUNTRY_CODE); withZone(client(), zone -> { withTaxCategory(client(), TaxCategoryDraft.of("taxcat", asList(taxRate)), taxCategory -> { LocalizedString localizedDescription = LocalizedString.of(ENGLISH, "description"); final ZoneRateDraft zoneRate = ZoneRateDraftBuilder.of(zone.toResourceIdentifier(), asList(ShippingRate.of(MoneyImpl.of(30, currencyUnit)))).build(); final ShippingMethodDraft draft = ShippingMethodDraft.of("standard shipping", localizedDescription, taxCategory, asList(zoneRate)); final ShippingMethod shippingMethod = client().executeBlocking(ShippingMethodCreateCommand.of(draft)); assertThat(shippingMethod.getLocalizedDescription()).isEqualTo(localizedDescription); client().executeBlocking(ShippingMethodDeleteCommand.of(shippingMethod)); }); }, COUNTRY_CODE); }
Source:
public ResponseEntity<String> countPhenotypes(@PathVariable final String crop, @PathVariable final Integer studyId, @PathVariable final Integer datasetId, @RequestParam(value = "variableIds", required = true) final Integer[] variableIds) { if (!this.studyDatasetService.datasetExists(studyId, datasetId)) { return new ResponseEntity<>("", HttpStatus.NOT_FOUND); } final long count = this.studyDatasetService.countPhenotypesForDataset(datasetId, Arrays.asList(variableIds)); final HttpHeaders respHeaders = new HttpHeaders(); respHeaders.add("X-Total-Count", String.valueOf(count)); return new ResponseEntity<>("", respHeaders, HttpStatus.OK); }

Target:
public ResponseEntity<String> countPhenotypes(@PathVariable final String crop, @PathVariable final Integer studyId, @PathVariable final Integer datasetId, @RequestParam(value = "variableIds", required = true) final Integer[] variableIds) { final long count = this.studyDatasetService.countPhenotypes(studyId, datasetId, Arrays.asList(variableIds)); final HttpHeaders respHeaders = new HttpHeaders(); respHeaders.add("X-Total-Count", String.valueOf(count)); return new ResponseEntity<>("", respHeaders, HttpStatus.OK); }
Source:
private void applyInput(SolGame game) { boolean d = controlDown.isOn(); boolean u = controlUp.isOn(); boolean l = controlLeft.isOn(); boolean r = controlRight.isOn(); Vector2 v = SolMath.getVec(); if (l != r) { v.x = SolMath.toInt(r); } if (d != u) { v.y = SolMath.toInt(d); } v.scl(MOVE_SPD * game.getTimeStep()); SolMath.rotate(v, myAngle); myPos.add(v); SolMath.free(v); }

Target:
private void applyInput(SolGame game) { MainScreen screen = game.getScreens().mainScreen; boolean d = screen.isCameraDown(); boolean u = screen.isCameraUp(); boolean l = screen.isCameraLeft(); boolean r = screen.isCameraRight(); Vector2 v = SolMath.getVec(); if (l != r) { v.x = SolMath.toInt(r); } if (d != u) { v.y = SolMath.toInt(d); } v.scl(MOVE_SPD * game.getTimeStep()); SolMath.rotate(v, myAngle); myPos.add(v); SolMath.free(v); }
Source:
public void testNormalFlow() throws Exception { InputStream inputStream = getBlobInputStream(blobSize); CloudBlobMetadata cloudBlobMetadata = new CloudBlobMetadata(blobId, 0, blobSize); assertTrue("Expected upload to return true", azureDest.uploadBlob(blobId, blobSize, cloudBlobMetadata, inputStream)); assertTrue("Expected update to return true", azureDest.updateBlobExpiration(blobId, Utils.Infinite_Time)); assertTrue("Expected deletion to return true", azureDest.deleteBlob(blobId, System.currentTimeMillis())); }

Target:
public void testNormalFlow() throws Exception { PartitionId partitionId = new MockPartitionId(); BlobId blobId = new BlobId(BLOB_ID_V6, BlobIdType.NATIVE, dataCenterId, accountId, containerId, partitionId, false, BlobDataType.DATACHUNK); InputStream inputStream = getBlobInputStream(blobSize); CloudBlobMetadata cloudBlobMetadata = new CloudBlobMetadata(blobId, System.currentTimeMillis(), Utils.Infinite_Time, blobSize); assertTrue("Expected upload to return true", azureDest.uploadBlob(blobId, blobSize, cloudBlobMetadata, inputStream)); assertFalse("Expected duplicate upload to return false", azureDest.uploadBlob(blobId, blobSize, cloudBlobMetadata, inputStream)); long expirationTime = Utils.Infinite_Time; assertTrue("Expected update to return true", azureDest.updateBlobExpiration(blobId, expirationTime)); CloudBlobMetadata metadata = azureDest.getBlobMetadata(Collections.singletonList(blobId)).get(blobId.getID()); assertEquals(expirationTime, metadata.getExpirationTime()); long deletionTime = System.currentTimeMillis() + 1000; assertTrue("Expected deletion to return true", azureDest.deleteBlob(blobId, deletionTime)); metadata = azureDest.getBlobMetadata(Collections.singletonList(blobId)).get(blobId.getID()); assertEquals(deletionTime, metadata.getDeletionTime()); }
Source:
protected List<Protos.CommandInfo.URI> getUris() { List<Protos.CommandInfo.URI> uris = new ArrayList<>(); if (myriadExecutorConfiguration.getJvmUri().isPresent()) { final String jvmRemoteUri = myriadExecutorConfiguration.getJvmUri().get(); LOGGER.info("Getting JRE distribution from:" + jvmRemoteUri); uris.add(Protos.CommandInfo.URI.newBuilder().setValue(jvmRemoteUri).build()); } if (myriadExecutorConfiguration.getConfigUri().isPresent()) { String configURI = myriadExecutorConfiguration.getConfigUri().get(); LOGGER.info("Getting Hadoop distribution from: {}", configURI); uris.add(Protos.CommandInfo.URI.newBuilder().setValue(configURI).build()); } if (myriadExecutorConfiguration.getNodeManagerUri().isPresent()) { if (!(myriadConfiguration.getFrameworkUser().isPresent() && myriadConfiguration.getFrameworkSuperUser().isPresent())) { LOGGER.warn("Trying to use remote distribution, but frameworkUser and/or frameworkSuperUser not set!" + "Some features may not work"); } String nodeManagerUri = myriadExecutorConfiguration.getNodeManagerUri().get(); LOGGER.info("Getting Hadoop distribution from: {}", nodeManagerUri); uris.add(Protos.CommandInfo.URI.newBuilder().setValue(nodeManagerUri).setExtract(false).build()); } return uris; }

Target:
protected List<Protos.CommandInfo.URI> getUris() { List<Protos.CommandInfo.URI> uris = new ArrayList<>(); if (myriadExecutorConfiguration.getJvmUri().isPresent()) { final String jvmRemoteUri = myriadExecutorConfiguration.getJvmUri().get(); LOGGER.info("Getting JRE distribution from:" + jvmRemoteUri); uris.add(Protos.CommandInfo.URI.newBuilder().setValue(jvmRemoteUri).build()); } if (myriadExecutorConfiguration.getConfigUri().isPresent()) { String configURI = myriadExecutorConfiguration.getConfigUri().get(); LOGGER.info("Getting Hadoop configuration from: {}", configURI); uris.add(Protos.CommandInfo.URI.newBuilder().setValue(configURI).build()); } else if (myriadExecutorConfiguration.getNodeManagerUri().isPresent()) { String configURI = getConfigurationUrl(); LOGGER.info("Getting Hadoop configuration from: {}", configURI); uris.add(Protos.CommandInfo.URI.newBuilder().setValue(configURI).build()); } if (myriadExecutorConfiguration.getNodeManagerUri().isPresent()) { if (!(myriadConfiguration.getFrameworkUser().isPresent() && myriadConfiguration.getFrameworkSuperUser().isPresent())) { LOGGER.warn("Trying to use remote distribution, but frameworkUser and/or frameworkSuperUser not set!" + "Some features may not work"); } String nodeManagerUri = myriadExecutorConfiguration.getNodeManagerUri().get(); LOGGER.info("Getting Hadoop distribution from: {}", nodeManagerUri); uris.add(Protos.CommandInfo.URI.newBuilder().setValue(nodeManagerUri).setExtract(false).build()); } return uris; }
Source:
public List<Order> getAllByProduct(Product product){ List<Order> orders = new ArrayList<>(); for ( OrderProduct orderProduct :orderProductRepository.findAllByProduct(product)){ orders.addAll(orderRepository.findAllByOrderProducts(orderProduct)); } return orders; }

Target:
public List<Order> getAllByProduct(Product product) { return orderProductRepository.findAllByProduct(product).stream() .map(orderRepository::findAllByOrderProducts) .flatMap(List::stream) .collect(Collectors.toList()); }
Source:
public boolean equals(Object obj) { if (obj instanceof GridProfileId) { final GridProfileId other = (GridProfileId) obj; if (this.gp.getPort() == other.gp.getPort()) { final String thisHost = this.gp.getHost(); final String otherHost = other.gp.getHost(); if (thisHost != null) { if (thisHost.equals(otherHost)) { return this.getMemberId().equals(other.getMemberId()); } } else { return (otherHost == null); } } } return false; }

Target:
public boolean equals(Object obj) { if (obj instanceof GridProfileId) { final GridProfileId other = (GridProfileId) obj; if (this.gp.getPort() == other.gp.getPort()) { final String thisHost = this.gp.getHost(); final String otherHost = other.gp.getHost(); if (thisHost != null) { if (thisHost.equals(otherHost)) { if (this.getMemberId() != null) { return this.getMemberId().getUniqueId().equals(other.getMemberId().getUniqueId()); } else { return other.getMemberId() == null; } } } else { return (otherHost == null); } } } return false; }
Source:
public void run() { try { LogLevelAdjuster.register(); final Injector injector = Initialization.makeInjectorWithModules( getBaseInjector(), getModules() ); final Lifecycle lifecycle = injector.getInstance(Lifecycle.class); final HadoopDruidIndexerJob job = injector.getInstance(HadoopDruidIndexerJob.class); try { lifecycle.start(); } catch (Throwable t) { log.error(t, "Error when starting up. Failing."); System.exit(1); } job.run(); try { lifecycle.stop(); } catch (Throwable t) { log.error(t, "Error when stopping. Failing."); System.exit(1); } } catch (Exception e) { throw com.google.common.base.Throwables.propagate(e); } }

Target:
public void run() { try { Injector injector = makeInjector(); final HadoopDruidIndexerJob job = injector.getInstance(HadoopDruidIndexerJob.class); Lifecycle lifecycle = initLifecycle(injector); job.run(); try { lifecycle.stop(); } catch (Throwable t) { log.error(t, "Error when stopping. Failing."); System.exit(1); } } catch (Exception e) { throw Throwables.propagate(e); } }
Source:
private List<ReportSender> getSenderInstances(@NonNull CoreConfiguration config) { List<Class<? extends ReportSenderFactory>> factoryClasses = config.reportSenderFactoryClasses(); if (ACRA.DEV_LOGGING) ACRA.log.d(LOG_TAG, "config#reportSenderFactoryClasses : " + factoryClasses); final List<ReportSenderFactory> factories; if (factoryClasses.isEmpty()) { if (ACRA.DEV_LOGGING) ACRA.log.d(LOG_TAG, "No reportSenderFactoryClasses - loading using PluginLoader to find ReportSenders"); final PluginLoader loader = config.pluginLoader(); factories = loader.loadEnabled(config, ReportSenderFactory.class); } else { if (ACRA.DEV_LOGGING) ACRA.log.d(LOG_TAG, "Creating reportSenderFactories for reportSenderFactory config"); factories = new InstanceCreator().create(factoryClasses); } if (ACRA.DEV_LOGGING) ACRA.log.d(LOG_TAG, "reportSenderFactories : " + factories); final List<ReportSender> reportSenders = new ArrayList<>(); for (ReportSenderFactory factory : factories) { final ReportSender sender = factory.create(this.getApplication(), config); if (ACRA.DEV_LOGGING) ACRA.log.d(LOG_TAG, "Adding reportSender : " + sender); reportSenders.add(sender); } if (reportSenders.isEmpty()) { if (ACRA.DEV_LOGGING) ACRA.log.d(LOG_TAG, "No ReportSenders configured - adding NullSender"); reportSenders.add(new NullSender()); } return reportSenders; }

Target:
private List<ReportSender> getSenderInstances(@NonNull CoreConfiguration config) { List<Class<? extends ReportSenderFactory>> factoryClasses = config.reportSenderFactoryClasses(); if (ACRA.DEV_LOGGING) ACRA.log.d(LOG_TAG, "config#reportSenderFactoryClasses : " + factoryClasses); final List<ReportSenderFactory> factories; if (factoryClasses.isEmpty()) { if (ACRA.DEV_LOGGING) ACRA.log.d(LOG_TAG, "Using PluginLoader to find ReportSender factories"); final PluginLoader loader = config.pluginLoader(); factories = loader.loadEnabled(config, ReportSenderFactory.class); } else { if (ACRA.DEV_LOGGING) ACRA.log.d(LOG_TAG, "Creating reportSenderFactories for reportSenderFactory config"); factories = new InstanceCreator().create(factoryClasses); } if (ACRA.DEV_LOGGING) ACRA.log.d(LOG_TAG, "reportSenderFactories : " + factories); final List<ReportSender> reportSenders = new ArrayList<>(); for (ReportSenderFactory factory : factories) { final ReportSender sender = factory.create(this.getApplication(), config); if (ACRA.DEV_LOGGING) ACRA.log.d(LOG_TAG, "Adding reportSender : " + sender); reportSenders.add(sender); } if (reportSenders.isEmpty()) { if (ACRA.DEV_LOGGING) ACRA.log.d(LOG_TAG, "No ReportSenders configured - adding NullSender"); reportSenders.add(new NullSender()); } return reportSenders; }
Source:
public String getValue() { return name().toLowerCase(); }

Target:
public String getValue() { return value; }
Source:
public void initShouldRaiseMessagingExceptionWhenInvalidClassName() throws MessagingException { FakeMatcherConfig mci = FakeMatcherConfig.builder() .matcherName("HasException") .condition("java.lang.InvalidClassName") .build(); boolean exceptionRaised = false; try { matcher.init(mci); } catch (MessagingException e) { exceptionRaised = true; } assertThat(exceptionRaised).isTrue(); }

Target:
public void initShouldRaiseMessagingExceptionWhenInvalidClassName() throws MessagingException { FakeMatcherConfig matcherConfig = FakeMatcherConfig.builder() .matcherName("HasException") .condition("java.lang.InvalidClassName") .build(); assertThatThrownBy(() -> testee.init(matcherConfig)).isInstanceOf(MessagingException.class); }
Source:
public static String getString(String key) { String value = System.getProperty(key); if (value != null) { if (LOGGER.isLoggable(Level.CONFIG)) { LOGGER.log(Level.CONFIG, "Property (system): {0} => {1}", new Object[] {key, value}); } return value; } value = tryGetValueFromContext(key); if (value != null) { LOGGER.log(Level.CONFIG, "Property (context): {0} => {1}", new Object[]{key, value}); return value; } if (LOGGER.isLoggable(Level.CONFIG)) { LOGGER.log(Level.CONFIG, "Property (not found): {0} => {1}", new Object[] {key, value}); } return null; }

Target:
public static String getString(String key) { String value = System.getProperty(key); if (value != null) { if (LOGGER.isLoggable(Level.CONFIG)) { LOGGER.log(Level.CONFIG, "Property (system): {0} => {1}", new Object[] {key, value}); } return value; } value = tryGetValueFromContext(key); if (value != null) { if (LOGGER.isLoggable(Level.CONFIG)) { LOGGER.log(Level.CONFIG, "Property (context): {0} => {1}", new Object[]{key, value}); } return value; } if (LOGGER.isLoggable(Level.CONFIG)) { LOGGER.log(Level.CONFIG, "Property (not found): {0} => {1}", new Object[] {key, value}); } return null; }
Source:
public void testCacheLockingConcurrency() throws Exception { System.setProperty(DataSpaceNodeConfigurationAgent.NODE_DATASPACE_CACHE_CLEANING_PERIOD, "100"); DataSpaceNodeConfigurationAgent nodeConfigurationAgent = (DataSpaceNodeConfigurationAgent) PAActiveObject .newActive(DataSpaceNodeConfigurationAgent.class.getName(), null); boolean result = nodeConfigurationAgent.configureNode(); PAActiveObject.terminateActiveObject(nodeConfigurationAgent, false); Future future = executor.submit(new Runnable() { @Override public void run() { lockAndWait(40000); } }); Thread.sleep(5000); Future[] futures = new Future[NB_TASKS - 1]; for (int i = 0; i < NB_TASKS - 1; i++) { futures[i] = executor.submit(new Runnable() { @Override public void run() { lockAndWait(1000); } }); } future.get(); for (int i = 0; i < NB_TASKS - 1; i++) { Assert.assertTrue(futures[i].isDone()); } }

Target:
public void testCacheLockingConcurrency() throws Exception { System.setProperty(DataSpaceNodeConfigurationAgent.NODE_DATASPACE_CACHE_CLEANING_PERIOD, "100"); DataSpaceNodeConfigurationAgent nodeConfigurationAgent = (DataSpaceNodeConfigurationAgent) PAActiveObject .newActive(DataSpaceNodeConfigurationAgent.class.getName(), null); boolean result = nodeConfigurationAgent.configureNode(); PAActiveObject.terminateActiveObject(nodeConfigurationAgent, false); Future future = executor.submit(new Runnable() { @Override public void run() { lockAndWait(20000); } }); Thread.sleep(2000); Future[] futures = new Future[NB_TASKS - 1]; for (int i = 0; i < NB_TASKS - 1; i++) { futures[i] = executor.submit(new Runnable() { @Override public void run() { lockAndWait(500); } }); } future.get(); for (int i = 0; i < NB_TASKS - 1; i++) { Assert.assertTrue(futures[i].isDone()); } }
Source:
public void testAnnotation() { String[] variant = { "12:g.43130875C>G", "12:g.43130996C>G" }; VariantAnnotation ann0 = this.fetchVariantAnnotationGET(variant[0]); assertEquals(43130875, ann0.getStart().intValue()); VariantAnnotation[] anns = this.fetchVariantAnnotationPOST(Arrays.asList(variant)); assertEquals(anns[0].getStart().intValue(), ann0.getStart().intValue()); }

Target:
public void testAnnotation() { String[] variants = { "12:g.43130875C>G", "12:g.43130996C>G", "INVALID" }; String variantAllele = ((HashMap)((ArrayList) this.fetchVariantAnnotationGET(variants[0]).get("intergenic_consequences")).get(0)).get("variantAllele").toString(); assertEquals("G", variantAllele); assertEquals(variants.length - 1, this.fetchVariantAnnotationPOST(variants).size()); String variantAllele0 = ((HashMap)((ArrayList) this.fetchVariantAnnotationPOST(variants).get(0).get("intergenic_consequences")).get(0)).get("variantAllele").toString(); assertEquals(variantAllele, variantAllele0); }
Source:
public String render(ModelAndView modelAndView) { Template template = velocityEngine.getTemplate(provider.layout(), "utf-8"); Object model = modelAndView.getModel(); if (model == null) { model = Collections.emptyMap(); } if (model instanceof Map) { VelocityContext context = initialContextProvider.getVelocityContext((Map) model, controller, modelAndView.getViewName()); StringWriter writer = new StringWriter(); template.merge(context, writer); Object meta = context.get("meta"); context.put("meta", new Gson().toJson(meta)); return writer.toString(); } else { throw new IllegalArgumentException("modelAndView must be of type java.util.Map"); } }

Target:
public String render(ModelAndView modelAndView) { Template template = velocityEngine.getTemplate(provider.layout(), "utf-8"); Object model = modelAndView.getModel(); if (model == null) { model = Collections.emptyMap(); } if (model instanceof Map) { VelocityContext context = initialContextProvider.getVelocityContext((Map) model, controller, modelAndView.getViewName()); StringWriter writer = new StringWriter(); template.merge(context, writer); Object meta = context.get("meta"); context.put("meta", GSON.toJson(meta)); return writer.toString(); } else { throw new IllegalArgumentException("modelAndView must be of type java.util.Map"); } }
Source:
public List<Job<?, ?>> filterJobs(Collection<? extends Item> items) { List<Job<?, ?>> jobs = new ArrayList<Job<?, ?>>(); if (items == null) { return jobs; } for (ItemGroup<?> folder : filter(items, abstractFolderClass)) { List<Job> groupJobs = filter(folder.getItems(), Job.class); for (Job job : groupJobs) { String relativename = job.getRelativeNameFrom(folder); boolean shouldInclude = includePattern == null || includePattern.matcher(relativename).find(); boolean shouldExclude = excludePattern != null && excludePattern.matcher(relativename).find(); if (shouldInclude && !shouldExclude) { jobs.add(job); } } } for (Job job : filter(items, Job.class)) { jobs.add(job); } return jobs; }

Target:
public List<Job<?, ?>> filterJobs(Collection<? extends Item> items) { List<Job<?, ?>> jobs = new ArrayList<Job<?, ?>>(); if (items == null) { return jobs; } if (abstractFolderClass != null) { for (ItemGroup<?> folder : filter(items, abstractFolderClass)) { Collection<?> folderItems = folder.getItems(); if (folderItems == null) { continue; } List<Job> groupJobs = filter(folderItems, Job.class); for (Job job : groupJobs) { String relativename = job.getRelativeNameFrom(folder); boolean shouldInclude = includePattern == null || includePattern.matcher(relativename).find(); boolean shouldExclude = excludePattern != null && excludePattern.matcher(relativename).find(); if (shouldInclude && !shouldExclude) { jobs.add(job); } } } } for (Job job : filter(items, Job.class)) { jobs.add(job); } return jobs; }
Source:
public ScheduleInfoResource getSchedule( @PathVariable("name") String scheduleName) { return taskAssembler.toResource(schedulerService.getSchedule(scheduleName)); }

Target:
public ScheduleInfoResource getSchedule( @PathVariable("name") String scheduleName) { return taskAssembler.toResource(this.schedulerService.getSchedule(scheduleName)); }
Source:
public InitialAuthConfig(ConfigurationProperties configurationProperties) { Map<String, String> authProperties = configurationProperties.getProperties(CONFIGURATION_PREFIX_PATTERN); Set<String> registryPrefixes = authProperties.entrySet() .stream() .map(property -> getRegistryPrefix(property.getKey())) .collect(Collectors.toSet()); Map<String, AuthConfig> configMap = new HashMap<>(); for (String regPrefix: registryPrefixes) { String url = getPropertyValue(authProperties, regPrefix + URL); String userName = getPropertyValue(authProperties, regPrefix + USER_NAME); String password = getPropertyValue(authProperties, regPrefix + PASSWORD); configMap.put(url, newDto(AuthConfig.class).withUsername(userName).withPassword(password)); } authConfigs = newDto(AuthConfigs.class).withConfigs(configMap); }

Target:
public InitialAuthConfig(ConfigurationProperties configurationProperties) { Map<String, String> authProperties = configurationProperties.getProperties(CONFIGURATION_PREFIX_PATTERN); Set<String> registryPrefixes = authProperties.entrySet() .stream() .map(property -> getRegistryPrefix(property.getKey())) .collect(Collectors.toSet()); Map<String, AuthConfig> configMap = newHashMapWithExpectedSize(registryPrefixes.size()); for (String regPrefix : registryPrefixes) { String url = getPropertyValue(authProperties, regPrefix + URL); String userName = getPropertyValue(authProperties, regPrefix + USER_NAME); String password = getPropertyValue(authProperties, regPrefix + PASSWORD); configMap.put(url, newDto(AuthConfig.class).withUsername(userName).withPassword(password)); } authConfigs = newDto(AuthConfigs.class).withConfigs(configMap); }
Source:
public void testStopCq() throws Exception { gfsh.executeAndAssertThat("create region --name=region --type=PARTITION") .statusIsSuccess(); qs.newCq("Select * from /region r where r.ID = 1", cqa).execute(); server1.invoke(() -> populateRegion(0, 100)); locator.invoke(() -> { Cache cache = getCache(); ManagementService service = ManagementService.getManagementService(cache); DistributedSystemMXBean dsmbean = service.getDistributedSystemMXBean(); await().untilAsserted(() -> assertThat(dsmbean.getActiveCQCount()).isEqualTo(2)); }); qs.stopCqs(); locator.invoke(() -> { Cache cache = getCache(); ManagementService service = ManagementService.getManagementService(cache); DistributedSystemMXBean dsmbean = service.getDistributedSystemMXBean(); await().untilAsserted(() -> assertThat(dsmbean.getActiveCQCount()).isEqualTo(0)); }); checkActiveCqCount(server1, 0); checkActiveCqCount(server2, 0); }

Target:
public void testStopCq() throws Exception { gfsh.executeAndAssertThat("create region --name=region --type=PARTITION") .statusIsSuccess(); queryService.newCq("Select * from /region r where r.ID = 1", cqAttributes).execute(); server1.invoke(() -> populateRegion(0, 100)); locator.invoke(() -> { Cache cache = getCache(); ManagementService service = ManagementService.getManagementService(cache); DistributedSystemMXBean dsmbean = service.getDistributedSystemMXBean(); await().atMost(30, TimeUnit.SECONDS) .untilAsserted(() -> assertThat(dsmbean.getActiveCQCount()).isEqualTo(2)); }); queryService.stopCqs(); locator.invoke(() -> { Cache cache = getCache(); ManagementService service = ManagementService.getManagementService(cache); DistributedSystemMXBean dsmbean = service.getDistributedSystemMXBean(); await().atMost(30, TimeUnit.SECONDS) .untilAsserted(() -> assertThat(dsmbean.getActiveCQCount()).isEqualTo(0)); }); checkActiveCqCount(server1, 0); checkActiveCqCount(server2, 0); }
Source:
public void testGetEventSuccess() throws Exception { Client client = getLiveClient(); Request<Event> request = new Event.GetRequestBuilder(EVENT_ID).build(); Event event = client.sendRequest(request, Event.class); System.out.printf("Event retrieved: %s", event.getId()); assertNotNull(event); assertEquals(EVENT_ID, event.getId()); assertTrue(event.getData() instanceof Charge); }

Target:
public void testGetEventSuccess() throws Exception { Request<Event> request = new Event.GetRequestBuilder(EVENT_ID).build(); Event event = client.sendRequest(request, Event.class); System.out.printf("Event retrieved: %s", event.getId()); assertNotNull(event); assertEquals(EVENT_ID, event.getId()); assertTrue(event.getData() instanceof Charge); }
Source:
public List<UUID> getTaggedTables() { TableRegistry tableRegistry = runtime.getTableRegistry(); List<UUID> tables = tableRegistry .listTables() .stream() .filter(tableName -> tableRegistry .getRegistryTable() .get(tableName) .getMetadata() .getTableOptions() .getRequiresBackupSupport()) .map(tableName -> CorfuRuntime .getStreamID(TableRegistry.getFullyQualifiedTableName(tableName))) .collect(Collectors.toList()); log.info("{} tables need to be backed up: {}", tables.size(), tables); return tables; }

Target:
private List<UUID> getTaggedTables() { TableRegistry tableRegistry = runtime.getTableRegistry(); List<UUID> tables = tableRegistry .listTables() .stream() .filter(tableName -> tableRegistry .getRegistryTable() .get(tableName) .getMetadata() .getTableOptions() .getRequiresBackupSupport()) .map(tableName -> CorfuRuntime .getStreamID(TableRegistry.getFullyQualifiedTableName(tableName))) .collect(Collectors.toList()); log.info("{} tables need to be backed up: {}", tables.size(), tables); return tables; }
Source:
void bindItem(int position) { pos = position; PageTitle item = languageEntries.get(position); String languageCode = item.getWikiSite().languageCode(); String localizedLanguageName = app.language().getAppLanguageLocalizedName(languageCode); localizedLanguageNameTextView.setText(localizedLanguageName == null ? languageCode : StringUtils.capitalize(localizedLanguageName)); articleTitleTextView.setText(item.getDisplayText()); if (langLinksProgress.getVisibility() != View.VISIBLE && !languageCode.equals(app.language().getSystemLanguageCode())) { String canonicalName = getCanonicalName(languageCode); if (canonicalName != null) { nonLocalizedLanguageNameTextView.setText(TextUtils.isEmpty(canonicalName) ? app.language().getAppLanguageCanonicalName(languageCode) : canonicalName); } } itemView.setOnClickListener(this); }

Target:
void bindItem(int position) { pos = position; PageTitle item = languageEntries.get(position); String languageCode = item.getWikiSite().languageCode(); String localizedLanguageName = app.language().getAppLanguageLocalizedName(languageCode); localizedLanguageNameTextView.setText(localizedLanguageName == null ? languageCode : StringUtils.capitalize(localizedLanguageName)); articleTitleTextView.setText(item.getDisplayText()); if (langLinksProgress.getVisibility() != View.VISIBLE) { String canonicalName = getCanonicalName(languageCode); if (TextUtils.isEmpty(canonicalName) || languageCode.equals(app.language().getSystemLanguageCode())) { nonLocalizedLanguageNameTextView.setVisibility(View.GONE); } else { nonLocalizedLanguageNameTextView.setText(canonicalName); nonLocalizedLanguageNameTextView.setVisibility(View.VISIBLE); } } itemView.setOnClickListener(this); }
Source:
public static void clearLogOffline(final String geocode) { if (StringUtils.isBlank(geocode)) { return; } init(); final String[] geocodeWhereArgs = {geocode}; database.delete(dbTableLogsOffline, "geocode = ?", geocodeWhereArgs); database.execSQL(String.format("UPDATE %s SET visiteddate = 0 where geocode = ?", dbTableCaches), geocodeWhereArgs); }

Target:
public static void clearLogOffline(final String geocode) { if (StringUtils.isBlank(geocode)) { return; } init(); final String[] geocodeWhereArgs = {geocode}; database.delete(dbTableLogsOffline, "geocode = ?", geocodeWhereArgs); database.execSQL(String.format("UPDATE %s SET visiteddate = 0 WHERE geocode = ?", dbTableCaches), geocodeWhereArgs); }
Source:
public ByteBuf readChunk( ByteBufAllocator allocator ) throws IOException { boolean endOfInput = isEndOfInput(); if ( endOfInput ) { return null; } ByteBuf buffer = allocator.buffer( chunkSize ); try { buffer.writeBoolean( endOfInput ); if ( progress() == 0 ) { buffer.writeByte( contentType ); buffer.writeInt( byteBufAwareMarshal.length() ); } if ( !byteBufAwareMarshal.encode( buffer ) ) { lastByteWasWritten = true; } if ( isEndOfInput() != endOfInput ) { buffer.setBoolean( 0, isEndOfInput() ); } progress += buffer.readableBytes(); return buffer; } catch ( IOException e ) { buffer.release(); throw e; } }

Target:
public ByteBuf readChunk( ByteBufAllocator allocator ) throws IOException { if ( isEndOfInput() ) { return null; } boolean lastChunk = true; ByteBuf buffer = allocator.buffer( chunkSize ); try { buffer.writeBoolean( lastChunk ); if ( progress() == 0 ) { buffer.writeByte( contentType ); buffer.writeInt( byteBufAwareMarshal.length() ); } if ( !byteBufAwareMarshal.encode( buffer ) ) { this.endOfInput = true; } if ( isEndOfInput() != lastChunk ) { buffer.setBoolean( 0, isEndOfInput() ); } progress += buffer.readableBytes(); return buffer; } catch ( Throwable e ) { buffer.release(); throw e; } }
Source:
private final AlignmentContext getDerivedAlignmentContext( final Set<ReferenceContext> sliceReferenceContexts, final int singleRefAlignmentStart, final int singleRefAlignmentEnd) { ReferenceContext referenceContext; switch (sliceReferenceContexts.size()) { case 0: referenceContext = ReferenceContext.UNMAPPED_UNPLACED_CONTEXT; break; case 1: referenceContext = sliceReferenceContexts.iterator().next(); break; default: referenceContext = ReferenceContext.MULTIPLE_REFERENCE_CONTEXT; } if (referenceContext.isMappedSingleRef()) { AlignmentContext.validateAlignmentContext( true, referenceContext, singleRefAlignmentStart, singleRefAlignmentEnd - singleRefAlignmentStart + 1); return new AlignmentContext( referenceContext, singleRefAlignmentStart, singleRefAlignmentEnd - singleRefAlignmentStart + 1); } else if (referenceContext.isUnmappedUnplaced()) { return AlignmentContext.UNMAPPED_UNPLACED_CONTEXT; } else { return AlignmentContext.MULTIPLE_REFERENCE_CONTEXT; } }

Target:
private static final AlignmentContext getDerivedAlignmentContext( final Set<ReferenceContext> sliceReferenceContexts, final int singleRefAlignmentStart, final int singleRefAlignmentEnd) { ReferenceContext referenceContext; switch (sliceReferenceContexts.size()) { case 0: referenceContext = ReferenceContext.UNMAPPED_UNPLACED_CONTEXT; break; case 1: referenceContext = sliceReferenceContexts.iterator().next(); break; default: referenceContext = ReferenceContext.MULTIPLE_REFERENCE_CONTEXT; } if (referenceContext.isMappedSingleRef()) { AlignmentContext.validateAlignmentContext( true, referenceContext, singleRefAlignmentStart, singleRefAlignmentEnd - singleRefAlignmentStart + 1); return new AlignmentContext( referenceContext, singleRefAlignmentStart, singleRefAlignmentEnd - singleRefAlignmentStart + 1); } else if (referenceContext.isUnmappedUnplaced()) { return AlignmentContext.UNMAPPED_UNPLACED_CONTEXT; } else { return AlignmentContext.MULTIPLE_REFERENCE_CONTEXT; } }
Source:
public List<SlimAssertion> call(final Map<String, String> scenarioArguments, SlimTable parentTable, int row) throws TestExecutionException { Table newTable = getTable().asTemplate(new Table.CellContentSubstitution() { @Override public String substitute(String content) throws SyntaxError { for (Map.Entry<String, String> scenarioArgument : scenarioArguments.entrySet()) { String arg = scenarioArgument.getKey(); if (getInputs().contains(arg)) { String argument = scenarioArguments.get(arg); content = StringUtils.replace(content, "@" + arg, replaceSymbols(argument)); content = StringUtils.replace(content, "@{" + arg + "}", replaceSymbols(argument)); } else { throw new SyntaxError(String.format("The argument %s is not an input to the scenario.", arg)); } } return content; } }); ScenarioTestContext testContext = new ScenarioTestContext(parentTable.getTestContext()); ScriptTable t = createChild(testContext, parentTable, newTable); parentTable.addChildTable(t, row); List<SlimAssertion> assertions = t.getAssertions(); assertions.add(makeAssertion(Instruction.NOOP_INSTRUCTION, new ScenarioExpectation(t, row))); return assertions; }

Target:
public List<SlimAssertion> call(final Map<String, String> scenarioArguments, SlimTable parentTable, int row) throws TestExecutionException { Table newTable = getTable().asTemplate(content -> { for (Map.Entry<String, String> scenarioArgument : scenarioArguments.entrySet()) { String arg = scenarioArgument.getKey(); if (getInputs().contains(arg)) { String argument = scenarioArguments.get(arg); content = StringUtils.replace(content, "@" + arg, argument); content = StringUtils.replace(content, "@{" + arg + "}", argument); } else { throw new SyntaxError(String.format("The argument %s is not an input to the scenario.", arg)); } } return content; }); ScenarioTestContext testContext = new ScenarioTestContext(parentTable.getTestContext()); ScriptTable t = createChild(testContext, parentTable, newTable); parentTable.addChildTable(t, row); List<SlimAssertion> assertions = t.getAssertions(); assertions.add(makeAssertion(Instruction.NOOP_INSTRUCTION, new ScenarioExpectation(t, row))); return assertions; }
Source:
public List<Concept> getPossibleValues() { try { return Context.getConceptService().getConceptsByName(""); } catch (Exception e) { logger.error("Error", e); } return Collections.emptyList(); }

Target:
public List<Concept> getPossibleValues() { try { return Context.getConceptService().getConceptsByName(""); } catch (Exception e) { log.error("Error", e); } return Collections.emptyList(); }