auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private FileSystem getHadoopFileSystem(String sourceFileUrl, String hadoopConfigPath) throws Exception { final Configuration config = getConfiguration(sourceFileUrl, hadoopConfigPath); final Path path = new Path(sourceFileUrl); FileSystem fs = null; for (int attempt = 1; attempt <= maxAttempts; attempt++) { try { if(HdfsFetcher.keytabPath.length() > 0 && currentHadoopUser == null) { synchronized (HdfsFetcher.class) { if (currentHadoopUser == null) { if(!new File(HdfsFetcher.keytabPath).exists()) { logger.error("Invalid keytab file path. Please provide a valid keytab path"); throw new VoldemortException("Error in getting Hadoop filesystem. Invalid keytab file path."); } UserGroupInformation.setConfiguration(config); UserGroupInformation.loginUserFromKeytab(HdfsFetcher.kerberosPrincipal, HdfsFetcher.keytabPath); currentHadoopUser = UserGroupInformation.getCurrentUser(); logger.info("I have logged in as " + currentHadoopUser.getUserName()); } } } fs = path.getFileSystem(config); break; } catch(Exception e) { if(attempt < maxAttempts) { sleepForRetryDelayMs(attempt); } else { throw e; } } } return fs; }

Target:
private FileSystem getHadoopFileSystem(String sourceFileUrl, String hadoopConfigPath) throws Exception { final Configuration config = getConfiguration(sourceFileUrl, hadoopConfigPath); final Path path = new Path(sourceFileUrl); FileSystem fs = null; for (int attempt = 1; attempt <= maxAttempts; attempt++) { try { if (HdfsFetcher.keytabPath.length() > 0) { synchronized (HdfsFetcher.class) { if (currentHadoopUser == null) { if (!new File(HdfsFetcher.keytabPath).exists()) { logger.error("Invalid keytab file path. Please provide a valid keytab path"); throw new VoldemortException("Error in getting Hadoop filesystem. Invalid keytab file path."); } UserGroupInformation.setConfiguration(config); UserGroupInformation.loginUserFromKeytab(HdfsFetcher.kerberosPrincipal, HdfsFetcher.keytabPath); currentHadoopUser = UserGroupInformation.getCurrentUser(); logger.info("I have logged in as " + currentHadoopUser.getUserName()); } else { currentHadoopUser.reloginFromKeytab(); } } } fs = path.getFileSystem(config); fs.exists(path); break; } catch(VoldemortException e) { throw e; } catch(Exception e) { if (ExceptionUtils.recursiveClassEquals(e, AuthenticationException.class)) { logger.info("Got an AuthenticationException from HDFS. " + "Will retry to login from scratch, on next attempt.", e); synchronized (HdfsFetcher.class) { currentHadoopUser = null; } } if(attempt < maxAttempts) { sleepForRetryDelayMs(attempt); } else { throw e; } } } return fs; }
Source:
public static Predicate<Expression> isInferenceCandidate() { return expression -> { expression = normalizeInPredicateToEquality(expression); if (expression instanceof ComparisonExpression && DeterminismEvaluator.isDeterministic(expression) && !NullabilityAnalyzer.mayReturnNullOnNonNullInput(expression) && !isDynamicFilter(expression)) { ComparisonExpression comparison = (ComparisonExpression) expression; if (comparison.getType() == ComparisonExpressionType.EQUAL) { return !comparison.getLeft().equals(comparison.getRight()); } } return false; }; }

Target:
public static Predicate<Expression> isInferenceCandidate() { return expression -> { expression = normalizeInPredicateToEquality(expression); if (expression instanceof ComparisonExpression && isDeterministic(expression) && !mayReturnNullOnNonNullInput(expression) && !isDynamicFilter(expression)) { ComparisonExpression comparison = (ComparisonExpression) expression; if (comparison.getType() == ComparisonExpressionType.EQUAL) { return !comparison.getLeft().equals(comparison.getRight()); } } return false; }; }
Source:
private static Optional<Credential> getImpersonatedCredential( Configuration config, Credential credential) throws IOException { String serviceAccountToImpersonate = IMPERSONATION_SERVICE_ACCOUNT_SUFFIX .withPrefixes(CONFIG_KEY_PREFIXES) .get(config, config::get); if (isNullOrEmpty(serviceAccountToImpersonate)) { Map<String, String> serviceAccountMapping = IMPERSONATION_IDENTIFIER_PREFIX .withPrefixes(CONFIG_KEY_PREFIXES) .getPropsWithPrefix(config); for (Map.Entry<String, String> entry : serviceAccountMapping.entrySet()) { if (matchedUserOrGroup(entry.getKey())) { serviceAccountToImpersonate = entry.getValue(); break; } } } if (isNullOrEmpty(serviceAccountToImpersonate)) { return Optional.empty(); } GoogleCloudStorageOptions options = GoogleHadoopFileSystemConfiguration.getGcsFsOptionsBuilder(config) .build() .getCloudStorageOptions(); HttpTransport httpTransport = HttpTransportFactory.createHttpTransport( options.getTransportType(), options.getProxyAddress(), options.getProxyUsername(), options.getProxyPassword()); GoogleCredential impersonatedCredential = new GoogleCredentialWithIamAccessToken( httpTransport, new CredentialHttpRetryInitializer(credential), serviceAccountToImpersonate, CredentialFactory.GCS_SCOPES); return Optional.of(impersonatedCredential.createScoped(CredentialFactory.GCS_SCOPES)); }

Target:
private static Optional<Credential> getImpersonatedCredential( Configuration config, Credential credential) throws IOException { GoogleCloudStorageOptions options = GoogleHadoopFileSystemConfiguration.getGcsFsOptionsBuilder(config) .build() .getCloudStorageOptions(); String serviceAccountToImpersonate = IMPERSONATION_SERVICE_ACCOUNT_SUFFIX .withPrefixes(CONFIG_KEY_PREFIXES) .get(config, config::get); if (isNullOrEmpty(serviceAccountToImpersonate)) { Optional<String> serviceAccountToImpersonateFromUser = getMatchedServiceAccountToImpersonateFromGroup( options.getUserImpersonationServiceAccounts(), ImmutableList.of(UserGroupInformation.getCurrentUser().getShortUserName())); Optional<String> serviceAccountToImpersonateFromGroup = getMatchedServiceAccountToImpersonateFromGroup( options.getGroupImpersonationServiceAccounts(), ImmutableList.copyOf(UserGroupInformation.getCurrentUser().getGroupNames())); serviceAccountToImpersonate = serviceAccountToImpersonateFromUser.orElse( serviceAccountToImpersonateFromGroup.orElse(null)); } if (isNullOrEmpty(serviceAccountToImpersonate)) { return Optional.empty(); } HttpTransport httpTransport = HttpTransportFactory.createHttpTransport( options.getTransportType(), options.getProxyAddress(), options.getProxyUsername(), options.getProxyPassword()); GoogleCredential impersonatedCredential = new GoogleCredentialWithIamAccessToken( httpTransport, new CredentialHttpRetryInitializer(credential), serviceAccountToImpersonate, CredentialFactory.GCS_SCOPES); return Optional.of(impersonatedCredential.createScoped(CredentialFactory.GCS_SCOPES)); }
Source:
public ProcessResult process(AbstractFile file) { if (!utils.isSupported(file, this)) { return ProcessResult.OK; } if (file.getSize() > TextClassifierUtils.MAX_FILE_SIZE) { logger.log(Level.INFO, "Encountered file " + file.getParentPath() + file.getName() + " with object id of " + file.getId() + " which exceeds max file size of " + TextClassifierUtils.MAX_FILE_SIZE + " bytes, with a size of " + file.getSize()); return IngestModule.ProcessResult.OK; } boolean isNotable; try { isNotable = classify(file); } catch (TextExtractorFactory.NoTextExtractorFound ex) { logger.log(Level.SEVERE, "NoTextExtractorFound in categorizing : " + ex.getMessage()); return ProcessResult.ERROR; } catch (InitReaderException ex) { logger.log(Level.SEVERE, "InitReaderException in categorizing : " + ex.getMessage()); return ProcessResult.ERROR; } catch (IOException ex) { logger.log(Level.SEVERE, "IOException in categorizing : " + ex.getMessage()); return ProcessResult.ERROR; } if (isNotable) { try { BlackboardArtifact artifact = file.newArtifact(BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_FILE_HIT); artifact.addAttribute(new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_SET_NAME, Bundle.TextClassifierModuleFactory_moduleName_text(), "Possible notable text")); try { blackboard.indexArtifact(artifact); } catch (Blackboard.BlackboardException ex) { logger.log(Level.SEVERE, "Unable to index blackboard artifact " + artifact.getArtifactID(), ex); } } catch (TskCoreException ex) { logger.log(Level.SEVERE, "TskCoreException in categorizing : " + ex.getMessage()); } } return ProcessResult.OK; }

Target:
public ProcessResult process(AbstractFile file) { if (!utils.isSupported(file)) { return ProcessResult.OK; } if (file.getSize() > TextClassifierUtils.MAX_FILE_SIZE) { logger.log(Level.INFO, "Encountered file " + file.getParentPath() + file.getName() + " with object id of " + file.getId() + " which exceeds max file size of " + TextClassifierUtils.MAX_FILE_SIZE + " bytes, with a size of " + file.getSize()); return IngestModule.ProcessResult.OK; } boolean isNotable; try { isNotable = classify(file); } catch (IOException | InitReaderException | NoTextExtractorFound ex) { logger.log(Level.SEVERE, "Exception while categorizing : " + ex.getMessage(), ex); return ProcessResult.ERROR; } if (isNotable) { try { BlackboardArtifact artifact = file.newArtifact(BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_FILE_HIT); artifact.addAttribute(new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_SET_NAME, Bundle.TextClassifierModuleFactory_moduleName_text(), "Possible notable text")); try { blackboard.postArtifact(artifact, Bundle.TextClassifierModuleFactory_moduleName_text()); } catch (Blackboard.BlackboardException ex) { logger.log(Level.SEVERE, "Unable to post blackboard artifact " + artifact.getArtifactID(), ex); } } catch (TskCoreException ex) { logger.log(Level.SEVERE, "TskCoreException in categorizing : " + ex.getMessage(), ex); } } return ProcessResult.OK; }
Source:
public void buildAndDeployTest() { ClassLoader currentCL = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(classLoader); PMMLRequestData request = new PMMLRequestData("123", "SimpleScorecard"); request.addRequestParam("param1", 10.0); request.addRequestParam("param2", 15.0); ApplyPmmlModelCommand command = (ApplyPmmlModelCommand) ((CommandFactoryServiceImpl) commandsFactory).newApplyPmmlModel(request); command.setPackageName("org.kie.scorecard"); ServiceResponse<ExecutionResults> results = ruleClient.executeCommandsWithResults(CONTAINER_ID, command); assertNotNull(results); PMML4Result resultHolder = (PMML4Result) results.getResult().getValue("results"); assertNotNull(resultHolder); assertEquals("OK", resultHolder.getResultCode()); System.out.println(resultHolder.toString()); logger.info(resultHolder.toString()); }

Target:
public void buildAndDeployTest() { Thread.currentThread().setContextClassLoader(classLoader); PMMLRequestData request = new PMMLRequestData("123", "SimpleScorecard"); request.addRequestParam("param1", 10.0); request.addRequestParam("param2", 15.0); ApplyPmmlModelCommand command = (ApplyPmmlModelCommand) ((CommandFactoryServiceImpl) commandsFactory).newApplyPmmlModel(request); command.setPackageName("org.kie.scorecard"); ServiceResponse<ExecutionResults> results = ruleClient.executeCommandsWithResults(CONTAINER_ID, command); assertNotNull(results); PMML4Result resultHolder = (PMML4Result) results.getResult().getValue("results"); assertNotNull(resultHolder); assertEquals("OK", resultHolder.getResultCode()); System.out.println(resultHolder.toString()); logger.info(resultHolder.toString()); }
Source:
public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { TargetLandPermanent target = new TargetLandPermanent(0, amount, new FilterLandPermanent(), true); if (target.canChoose(source.getSourceId(), source.getControllerId(), game)) { FilterPermanent filter = new FilterLandPermanent(); filter.add(new TappedPredicate()); Player player = game.getPlayer(game.getActivePlayerId()); int tappedLands = game.getBattlefield().getAllActivePermanents(filter, game.getActivePlayerId(), game).size(); if (player != null && tappedLands <= amount) { if (player.chooseUse(outcome, "Include your tapped lands to untap?", source, game)) { for (Permanent land : game.getBattlefield().getAllActivePermanents(filter, player.getId(), game)) { target.addTarget(land.getId(), source, game); } } } if (target.choose(Outcome.Untap, source.getControllerId(), source.getSourceId(), game)) { for (Object targetId : target.getTargets()) { Permanent p = game.getPermanent((UUID) targetId); if (p != null) { p.untap(game); } } } } return true; } return false; }

Target:
public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { TargetLandPermanent target = new TargetLandPermanent(0, amount, new FilterLandPermanent(), true); if (target.canChoose(source.getSourceId(), source.getControllerId(), game)) { FilterPermanent filter = new FilterLandPermanent(); filter.add(new TappedPredicate()); int tappedLands = game.getBattlefield().getAllActivePermanents(filter, controller.getId(), game).size(); if (tappedLands <= amount) { if (controller.chooseUse(outcome, "Include your tapped lands to untap?", source, game)) { for (Permanent land : game.getBattlefield().getAllActivePermanents(filter, controller.getId(), game)) { target.addTarget(land.getId(), source, game); } } } if (target.choose(Outcome.Untap, source.getControllerId(), source.getSourceId(), game)) { for (Object targetId : target.getTargets()) { Permanent p = game.getPermanent((UUID) targetId); if (p != null) { p.untap(game); } } } } return true; } return false; }
Source:
public void assertHasDeclaredMethods(AssertionInfo info, Class<?> actual, String... methods) { assertNotNull(info, actual); doAssertHasMethods(info, actual, actual.getDeclaredMethods(), methods); }

Target:
public void assertHasDeclaredMethods(AssertionInfo info, Class<?> actual, String... methods) { assertNotNull(info, actual); doAssertHasMethods(info, actual, actual.getDeclaredMethods(), true, methods); }
Source:
public boolean testForEvent(ITmfEvent event) throws AttributeNotFoundException { ITmfStateSystem ss = fContainer.getStateSystem(); if (fStateValueList.length > 0) { return testForEvent(event, NonNullUtils.checkNotNull(ss)); } else if (!fConditions.isEmpty()) { switch (fOperator) { case AND: for (TmfXmlCondition childCondition : fConditions) { if (!childCondition.testForEvent(event)) { return false; } } return true; case NONE: break; case NOT: return !fConditions.get(0).testForEvent(event); case OR: for (TmfXmlCondition childCondition : fConditions) { if (childCondition.testForEvent(event)) { return true; } } return false; default: break; } } return true; }

Target:
public boolean testForEvent(ITmfEvent event) throws AttributeNotFoundException { ITmfStateSystem ss = fContainer.getStateSystem(); if (!fStateValues.isEmpty()) { return testForEvent(event, NonNullUtils.checkNotNull(ss)); } else if (!fConditions.isEmpty()) { switch (fOperator) { case AND: for (TmfXmlCondition childCondition : fConditions) { if (!childCondition.testForEvent(event)) { return false; } } return true; case NONE: break; case NOT: return !fConditions.get(0).testForEvent(event); case OR: for (TmfXmlCondition childCondition : fConditions) { if (childCondition.testForEvent(event)) { return true; } } return false; default: break; } } return true; }
Source:
public void execute(DelegateExecution execution) throws Exception { Pool pool = (Pool) execution.getVariable(CoreProcessVariables.POOL); checkNotNull(pool, "Please add the pool description as a process " + "variable with the name '%s'.", CoreProcessVariables.POOL); Machine machine = (Machine) execution.getVariable("machine"); LOG.info(">> Connecting to machine to install packages", machine); SSHClient client = Ssh.newClient(machine, pool.getAdminAccess(), 5 * 60000 ); try { String puppetScript = Mustache.toString(InstallPackages.class, "/com/axemblr/provisionr/core/puppet/packages.pp.mustache", ImmutableMap.of("packages", packagesAsListOfMaps(pool.getSoftware()))); Ssh.createFile(client, puppetScript, 0600, "/tmp/packages.pp"); Session session = client.startSession(); try { session.allocateDefaultPTY(); Session.Command command = session.exec("sudo puppet apply /tmp/packages.pp"); Ssh.logCommandOutput(LOG, machine.getExternalId(), command); command.join(); if (command.getExitStatus() != 0) { throw new RuntimeException(String.format("Failed to execute " + "'sudo puppet apply /tmp/packages.pp'. Exit code: %d. Exit message: %s", command.getExitStatus(), command.getExitErrorMessage())); } else { LOG.info("<< Command completed successfully with exit code 0"); } } finally { session.close(); } } finally { client.close(); } }

Target:
public void execute(DelegateExecution execution) throws Exception { Pool pool = (Pool) execution.getVariable(CoreProcessVariables.POOL); checkNotNull(pool, "Please add the pool description as a process " + "variable with the name '%s'.", CoreProcessVariables.POOL); Machine machine = (Machine) execution.getVariable("machine"); LOG.info(">> Connecting to machine to install packages", machine); SSHClient client = Ssh.newClient(machine, pool.getAdminAccess()); try { String puppetScript = Mustache.toString(InstallPackages.class, "/com/axemblr/provisionr/core/puppet/packages.pp.mustache", ImmutableMap.of("packages", packagesAsListOfMaps(pool.getSoftware()))); Ssh.createFile(client, puppetScript, 0600, "/tmp/packages.pp"); Session session = client.startSession(); try { session.allocateDefaultPTY(); Session.Command command = session.exec("sudo puppet apply /tmp/packages.pp"); Ssh.logCommandOutput(LOG, machine.getExternalId(), command); command.join(); if (command.getExitStatus() != 0) { throw new RuntimeException(String.format("Failed to execute " + "'sudo puppet apply /tmp/packages.pp'. Exit code: %d. Exit message: %s", command.getExitStatus(), command.getExitErrorMessage())); } else { LOG.info("<< Command completed successfully with exit code 0"); } } finally { session.close(); } } finally { client.close(); } }
Source:
public void testUpgradeTaskShouldPass() throws DotDataException { final Task05205UpdateIndexNameLength task = new Task05205UpdateIndexNameLength(); task.executeUpgrade(); final Map<String, String> result = getColumnPropertiesAfterUpgrade(); assertEquals("100", result.get("field_length")); assertEquals(DbConnectionFactory.getDBType().equals("Oracle") ? "N" : "NO", result.get("nullable_value")); }

Target:
public void testUpgradeTaskShouldPass() throws DotDataException, SQLException { setStateBeforeUpgrade(); Map<String, String> result = getColumnProperties(); assertEquals("30", result.get("field_length")); assertEquals(DbConnectionFactory.getDBType().equals("Oracle") ? "N" : "NO", result.get("nullable_value")); final Task05205UpdateIndexNameLength task = new Task05205UpdateIndexNameLength(); task.executeUpgrade(); result = getColumnProperties(); assertEquals("100", result.get("field_length")); assertEquals(DbConnectionFactory.getDBType().equals("Oracle") ? "N" : "NO", result.get("nullable_value")); }
Source:
public Boolean isValid() { return valid && ( conf.size() == ConfigurationKey.values().length ); }

Target:
public Boolean isValid() { return valid && ( conf.keySet().containsAll(EnumSet.allOf(ConfigurationKey.class))); }
Source:
void awaitOpCompletionOrTimeOut(FutureResult futureResult) throws InterruptedException { int timer = 0; List<RequestInfo> allRequests = new ArrayList<>(); while (timer < AWAIT_TIMEOUT_MS / 2 && !futureResult.completed()) { pollOpManager(allRequests); Thread.sleep(50); timer += 50; allRequests.clear(); } }

Target:
private void awaitOpCompletionOrTimeOut(FutureResult futureResult) throws InterruptedException { int timer = 0; List<RequestInfo> allRequests = new ArrayList<>(); while (timer < AWAIT_TIMEOUT_MS / 2 && !futureResult.completed()) { pollOpManager(allRequests); Thread.sleep(50); timer += 50; allRequests.clear(); } }
Source:
private void updateStoragePoolFormatType() { final storage_pool storagePool = getStoragePool(); final Guid spId = storagePool.getId(); final Version spVersion = storagePool.getcompatibility_version(); final Version oldSpVersion = _oldStoragePool.getcompatibility_version(); if (Version.OpEquality(spVersion, oldSpVersion)) { return; } StorageFormatType targetFormat = StorageFormatType.V1; if (spVersion.compareTo(Version.v3_0) == 0) { targetFormat = StorageFormatType.V2; } else if (spVersion.compareTo(Version.v3_1) == 0) { targetFormat = StorageFormatType.V3; } StorageType spType = storagePool.getstorage_pool_type(); if (targetFormat == StorageFormatType.V2 && spType != StorageType.ISCSI && spType != StorageType.FCP) { return; } storagePool.setStoragePoolFormatType(targetFormat); getStoragePoolDAO().update(storagePool); updateMemberDomainsFormat(targetFormat); if (storagePool.getstatus() != StoragePoolStatus.Up) { return; } UpgradeStoragePoolVDSCommandParameters parameters = new UpgradeStoragePoolVDSCommandParameters(spId, targetFormat); if (getStoragePool().getstatus() == StoragePoolStatus.Up) { runVdsCommand(VDSCommandType.UpgradeStoragePool, parameters); } }

Target:
private void updateStoragePoolFormatType() { final storage_pool storagePool = getStoragePool(); final Guid spId = storagePool.getId(); final Version spVersion = storagePool.getcompatibility_version(); final Version oldSpVersion = _oldStoragePool.getcompatibility_version(); if (Version.OpEquality(spVersion, oldSpVersion)) { return; } StorageFormatType targetFormat = StorageFormatType.V1; if (spVersion.compareTo(Version.v3_0) == 0) { targetFormat = StorageFormatType.V2; } else if (spVersion.compareTo(Version.v3_1) == 0) { targetFormat = StorageFormatType.V3; } StorageType spType = storagePool.getstorage_pool_type(); if (targetFormat == StorageFormatType.V2 && spType != StorageType.ISCSI && spType != StorageType.FCP) { return; } storagePool.setStoragePoolFormatType(targetFormat); getStoragePoolDAO().updatePartial(storagePool); updateMemberDomainsFormat(targetFormat); if (storagePool.getstatus() != StoragePoolStatus.Up) { return; } if (getStoragePool().getstatus() == StoragePoolStatus.Up) { runVdsCommand(VDSCommandType.UpgradeStoragePool, new UpgradeStoragePoolVDSCommandParameters(spId, targetFormat)); } }
Source:
public void setEnableSmallFileFeatures(final boolean on) { enableSmallFileFeatures = on; if (enableSmallFileFeatures) { syntaxHighlighting.setValue(getValue().isSyntaxHighlighting()); } else { syntaxHighlighting.setValue(false); } Element element = context.getElement().getFirstChildElement(); while (element.getPropertyInt("value") != AccountDiffPreference.WHOLE_FILE_CONTEXT) { element = element.getNextSiblingElement(); } if (element.getPropertyInt("value") == AccountDiffPreference.WHOLE_FILE_CONTEXT) { if (enableSmallFileFeatures) { element.removeAttribute("disabled"); } else { element.setAttribute("disabled", "disabled"); if (AccountDiffPreference.CONTEXT_CHOICES[context.getSelectedIndex()] == AccountDiffPreference.WHOLE_FILE_CONTEXT) { for (int i = 0; i < AccountDiffPreference.CONTEXT_CHOICES.length; i++) { if (AccountDiffPreference.CONTEXT_CHOICES[i] == PatchScreen.LARGE_FILE_CONTEXT) { context.setSelectedIndex(i); break; } } } } } toggleEnabledStatus(save.isEnabled()); }

Target:
public void setEnableSmallFileFeatures(final boolean on) { enableSmallFileFeatures = on; if (enableSmallFileFeatures) { syntaxHighlighting.setValue(getValue().isSyntaxHighlighting()); } else { syntaxHighlighting.setValue(false); } NodeList<OptionElement> options = context.getElement().<SelectElement>cast().getOptions(); for (int i = 0; i < options.getLength(); i++) { OptionElement currOption = options.getItem(i); if (Short.valueOf(currOption.getValue()) == AccountDiffPreference.WHOLE_FILE_CONTEXT) { if (enableSmallFileFeatures) { currOption.setDisabled(false); } else { currOption.setDisabled(true); if (AccountDiffPreference.CONTEXT_CHOICES[context.getSelectedIndex()] == AccountDiffPreference.WHOLE_FILE_CONTEXT) { for (int j = 0; i < AccountDiffPreference.CONTEXT_CHOICES.length; j++) { if (AccountDiffPreference.CONTEXT_CHOICES[j] == PatchScreen.LARGE_FILE_CONTEXT) { context.setSelectedIndex(j); break; } } } } } } toggleEnabledStatus(save.isEnabled()); }
Source:
public static void main(String[] args) { String connectionString = System.getenv("AZURE_SERVICEBUS_CONNECTION_STRING"); ServiceBusReceiverAsyncClient receiverAsyncClient = new ServiceBusClientBuilder() .connectionString(connectionString) .buildReceiverClientBuilder() .queueName("<<queue-name>>") .buildAsyncClient(); Disposable subscription = receiverAsyncClient.receive() .subscribe(message -> { System.out.println("Received Message Id:" + message.getMessageId()); System.out.println("Received Message:" + new String(message.getBody())); }, error -> System.err.println("Error occurred while receiving message: " + error), () -> System.out.println("Receiving complete.")); try { Thread.sleep(Duration.ofSeconds(20).toMillis()); } catch (InterruptedException ignored) { } subscription.dispose(); receiverAsyncClient.close(); }

Target:
public static void main(String[] args) { String connectionString = "Endpoint={fully-qualified-namespace};SharedAccessKeyName={policy-name};" + "SharedAccessKey={key}"; ServiceBusReceiverAsyncClient receiverAsyncClient = new ServiceBusClientBuilder() .connectionString(connectionString) .receiver() .queueName("<<queue-name>>") .buildAsyncClient(); Disposable subscription = receiverAsyncClient.receive() .subscribe(message -> { System.out.println("Received Message Id:" + message.getMessageId()); System.out.println("Received Message:" + new String(message.getBody())); }, error -> System.err.println("Error occurred while receiving message: " + error), () -> System.out.println("Receiving complete.")); try { Thread.sleep(Duration.ofSeconds(20).toMillis()); } catch (InterruptedException ignored) { } subscription.dispose(); receiverAsyncClient.close(); }
Source:
private InputStream downloadFile(final String fileId) { final HttpResponse<InputStream> response = Unirest.delete(getDriveUrl() + "/api/drive/file/" + fileId + "/download") .header("Authorization", "Bearer " + getAccessToken()) .asObject(raw -> raw.getContent()); final HttpResponse<InputStream> realResponse = response.getStatus() == 307 ? Unirest.get(response.getHeaders().getFirst("Location")).asObject(raw -> raw.getContent()) : response; return realResponse.getBody(); }

Target:
private InputStream downloadFile(final String fileId) { final HttpResponse<InputStream> response = Unirest.get(getDriveUrl() + "/api/drive/file/" + fileId + "/download") .header("Authorization", "Bearer " + getAccessToken()) .asObject(raw -> raw.getContent()); final HttpResponse<InputStream> realResponse = response.getStatus() == 307 ? Unirest.get(response.getHeaders().getFirst("Location")).asObject(raw -> raw.getContent()) : response; return realResponse.getBody(); }
Source:
public String getSubnetHostname() { if (_privateHostname == null) { Optional<NodeMetadata> node = getOptionalNode(); if (node.isPresent()) { _privateHostname = jcloudsParent.getPrivateHostname(node.get(), Optional.of(getSshHostAndPort()), config().getBag()); } else { for (String p : getPrivateAddresses()) { if (Networking.isLocalOnly(p)) continue; _privateHostname = p; } if (groovyTruth(getPublicAddresses())) { _privateHostname = getPublicAddresses().iterator().next(); } else if (groovyTruth(getHostname())) { _privateHostname = getHostname(); } else { return null; } } } return _privateHostname; }

Target:
public String getSubnetHostname() { if (_privateHostname == null) { for (String p : getPrivateAddresses()) { if (Networking.isLocalOnly(p)) continue; _privateHostname = p; } if (groovyTruth(getPublicAddresses())) { _privateHostname = getPublicAddresses().iterator().next(); } else if (groovyTruth(getHostname())) { _privateHostname = getHostname(); } else { return null; } } return _privateHostname; }
Source:
protected static void dropStacks(Multiset<ItemStack> drops, World world, BlockPos posToDrop) { for (Multiset.Entry<ItemStack> entry : drops.entrySet()) { int count = entry.getCount(); ItemStack stack = entry.getElement(); int maxStackSize = stack.getItem().getItemStackLimit(stack); while (count >= maxStackSize) { ItemStack s = stack.copy(); s.setCount(maxStackSize); world.spawnEntity(new EntityItem(world, posToDrop.getX(), posToDrop.getY(), posToDrop.getZ(), s)); count -= maxStackSize; } if (count > 0) { ItemStack s = stack.copy(); s.setCount(count); world.spawnEntity(new EntityItem(world, posToDrop.getX(), posToDrop.getY(), posToDrop.getZ(), s)); } } }

Target:
protected static void dropStacks(Multiset<ItemStack> drops, World world, BlockPos posToDrop) { for (Multiset.Entry<ItemStack> entry : drops.entrySet()) { int count = entry.getCount(); ItemStack stack = entry.getElement(); int maxStackSize = stack.getItem().getItemStackLimit(stack); while (count >= maxStackSize) { ItemStack s = ItemHandlerHelper.copyStackWithSize(stack, maxStackSize); world.spawnEntity(new EntityItem(world, posToDrop.getX(), posToDrop.getY(), posToDrop.getZ(), s)); count -= maxStackSize; } if (count > 0) { ItemStack s = ItemHandlerHelper.copyStackWithSize(stack, count); world.spawnEntity(new EntityItem(world, posToDrop.getX(), posToDrop.getY(), posToDrop.getZ(), s)); } } }
Source:
public void testSequenceFlowSupplier() throws Exception { final CaseManagementSetChildNodeGraphCommand command = new CaseManagementSetChildNodeGraphCommand(parent, candidate, index, originalParent, originalIndex); final Supplier<ViewConnector<SequenceFlow>> supplier = command.sequenceFlowSupplier(); final ViewConnector<SequenceFlow> viewConnector = supplier.get(); assertNotNull(viewConnector); assertNotNull(viewConnector.getSourceConnection()); assertNotNull(viewConnector.getTargetConnection()); assertNotNull(viewConnector.getBounds()); assertNotNull(viewConnector.getDefinition()); }

Target:
public void testSequenceFlowSupplier() { final CaseManagementSetChildNodeGraphCommand command = new CaseManagementSetChildNodeGraphCommand(parent, candidate, index, originalParent, originalIndex); final Supplier<ViewConnector<SequenceFlow>> supplier = command.sequenceFlowSupplier(); final ViewConnector<SequenceFlow> viewConnector = supplier.get(); assertNotNull(viewConnector); assertNotNull(viewConnector.getSourceConnection()); assertNotNull(viewConnector.getTargetConnection()); assertNotNull(viewConnector.getBounds()); assertNotNull(viewConnector.getDefinition()); }
Source:
public static boolean sanityCheckArenaBlockSize(long writeBufferSize, long arenaBlockSizeConfigured, long writeBufferManagerCapacity) throws IllegalStateException { long defaultArenaBlockSize = RocksDBMemoryControllerUtils.calculateRocksDBDefaultArenaBlockSize(writeBufferSize); long arenaBlockSize = arenaBlockSizeConfigured <= 0 ? defaultArenaBlockSize : arenaBlockSizeConfigured; long mutableLimit = RocksDBMemoryControllerUtils.calculateRocksDBMutableLimit(writeBufferManagerCapacity); if (RocksDBMemoryControllerUtils.validateArenaBlockSize(arenaBlockSize, mutableLimit)) { return true; } else { LOG.warn("RocksDBStateBackend performance will be poor because of the current Flink memory configuration! " + "RocksDB will flush memtable constantly, causing high IO and CPU. " + "Typically the easiest fix is to increase task manager managed memory size. " + "If running locally, see the parameter taskmanager.memory.managed.size. " + "Details: arenaBlockSize < mutableLimit (writeBufferSize arenaBlockSizeConfigured defaultArenaBlockSize writeBufferManagerCapacity {})", arenaBlockSize, mutableLimit, writeBufferSize, arenaBlockSizeConfigured, defaultArenaBlockSize, writeBufferManagerCapacity); return false; } }

Target:
static boolean sanityCheckArenaBlockSize( long writeBufferSize, long arenaBlockSizeConfigured, long writeBufferManagerCapacity) throws IllegalStateException { long defaultArenaBlockSize = RocksDBMemoryControllerUtils.calculateRocksDBDefaultArenaBlockSize(writeBufferSize); long arenaBlockSize = arenaBlockSizeConfigured <= 0 ? defaultArenaBlockSize : arenaBlockSizeConfigured; long mutableLimit = RocksDBMemoryControllerUtils.calculateRocksDBMutableLimit(writeBufferManagerCapacity); if (RocksDBMemoryControllerUtils.validateArenaBlockSize(arenaBlockSize, mutableLimit)) { return true; } else { LOG.warn("RocksDBStateBackend performance will be poor because of the current Flink memory configuration! " + "RocksDB will flush memtable constantly, causing high IO and CPU. " + "Typically the easiest fix is to increase task manager managed memory size. " + "If running locally, see the parameter taskmanager.memory.managed.size. " + "Details: arenaBlockSize < mutableLimit (writeBufferSize = {}, arenaBlockSizeConfigured = {}," + " defaultArenaBlockSize = {}, writeBufferManagerCapacity = {})", arenaBlockSize, mutableLimit, writeBufferSize, arenaBlockSizeConfigured, defaultArenaBlockSize, writeBufferManagerCapacity); return false; } }
Source:
public void testHighLevelApi() throws Exception { Random random = new Random(); int count = 10; List<PageView> pageviews = new ArrayList<>(count); for (int i = 0; i < count; i++) { String pagekey = PAGEKEYS[random.nextInt(PAGEKEYS.length - 1)]; int memberId = i; pageviews.add(new PageView(pagekey, memberId)); } CollectionStreamSystem system = CollectionStreamSystem.create("test"); CollectionStream<PageView> input = CollectionStream.of("PageView", pageviews).from(system); CollectionStream output = CollectionStream.empty("Output", 10).from(system); TestRunner .of(app) .addInputStream(input) .addOutputStream(output) .addOverrideConfig("job.default.system", "test") .run(); Assert.assertEquals(StreamUtils.getStreamState(output).get(random.nextInt(count)).size(), 1); }

Target:
public void testHighLevelApi() throws Exception { Random random = new Random(); int count = 10; List<PageView> pageviews = new ArrayList<>(count); for (int i = 0; i < count; i++) { String pagekey = PAGEKEYS[random.nextInt(PAGEKEYS.length - 1)]; int memberId = i; pageviews.add(new PageView(pagekey, memberId)); } CollectionStream<PageView> input = CollectionStream.of("test", "PageView", pageviews); CollectionStream output = CollectionStream.empty("test", "Output", 10); TestRunner .of(app) .addInputStream(input) .addOutputStream(output) .addOverrideConfig("job.default.system", "test") .run(); Assert.assertEquals(TestRunner.consumeStream(output, 10000).get(random.nextInt(count)).size(), 1); }
Source:
private Observable<String> dropTable(String table) { return session.execute(String.format(DROP_TABLE_CQL, table)) .map(resultSet -> table) .onErrorResumeNext(t -> { logger.infof(t, "Failed to drop %s", table); return Observable.just(""); }); }

Target:
private Observable<String> dropTable(String table) { return session.execute(String.format(DROP_TABLE_CQL, table)) .map(resultSet -> table) .onErrorResumeNext(t -> { logger.infof(t, "Failed to drop %s", table); return Observable.empty(); }); }
Source:
public void bind() { try { afterBind(); } catch (Exception e) { e.printStackTrace(); } }

Target:
public void bind() { try { afterBind(); } catch (Exception e) { throw new IllegalStateException(e); } }
Source:
public Stream<ProgramState> statesAfterInvocation(List<SymbolicValue> invocationArguments, List<Type> invocationTypes, ProgramState programState, Supplier<SymbolicValue> svSupplier) { int nbArguments = invocationArguments.size(); if (nbArguments != parametersConstraints().length) { return Stream.empty(); } int lastParameterIndex = nbArguments - 1; if (behavior.isMethodVarArgs() && parameterConstraint(lastParameterIndex) != null && !invocationTypes.get(lastParameterIndex).isArray()) { return Stream.empty(); } for (int index = 0; index < nbArguments; index++) { Constraint yieldConstraint = parameterConstraint(index); Constraint stateConstraint = programState.getConstraint(invocationArguments.get(index)); if (yieldConstraint != null && !yieldConstraint.equals(stateConstraint)) { return Stream.empty(); } } return super.statesAfterInvocation(invocationArguments, invocationTypes, programState, svSupplier); }

Target:
public Stream<ProgramState> statesAfterInvocation(List<SymbolicValue> invocationArguments, List<Type> invocationTypes, ProgramState programState, Supplier<SymbolicValue> svSupplier) { if (parameterConstraintsMatchExactly(invocationArguments, invocationTypes, programState)) { return super.statesAfterInvocation(invocationArguments, invocationTypes, programState, svSupplier); } return Stream.empty(); }
Source:
public V process(Map.Entry<K, V> entry) { action.accept(entry.getKey(), entry.getValue()); return entry.getValue(); }

Target:
public V process(Map.Entry<K, V> entry) { action.accept(entry.getKey(), entry.getValue()); return null; }
Source:
public boolean isHeader() { return true; }

Target:
public boolean isHeader() { return header; }
Source:
public void silentInvalidateAll(final BiFunction<K, ValueHolder<V>, Void> biFunction) throws StoreAccessException { silentInvalidateAllObserver.begin(); StoreAccessException exception = null; long errorCount = 0; Iterator<Cache.Entry<K, ValueHolder<V>>> iterator = iterator(); while (iterator.hasNext()) { try { final Cache.Entry<K, ValueHolder<V>> entry = iterator.next(); silentInvalidate(entry.getKey(), new Function<ValueHolder<V>, Void>() { @Override public Void apply(ValueHolder<V> mappedValue) { biFunction.apply(entry.getKey(), mappedValue); return null; } }); } catch (StoreAccessException e) { errorCount++; if (exception == null) { exception = e; } } } if (exception != null) { silentInvalidateAllObserver.end(HigherCachingTierOperationOutcomes.SilentInvalidateAllOutcome.FAILURE); throw new StoreAccessException("silentInvalidateAll failed - error count: " + errorCount, exception); } silentInvalidateAllObserver.end(HigherCachingTierOperationOutcomes.SilentInvalidateAllOutcome.SUCCESS); }

Target:
public void silentInvalidateAll(final BiFunction<K, ValueHolder<V>, Void> biFunction) throws StoreAccessException { silentInvalidateAllObserver.begin(); StoreAccessException exception = null; long errorCount = 0; for (final K k : map.keySet()) { try { silentInvalidate(k, new Function<ValueHolder<V>, Void>() { @Override public Void apply(ValueHolder<V> mappedValue) { biFunction.apply(k, mappedValue); return null; } }); } catch (StoreAccessException e) { errorCount++; if (exception == null) { exception = e; } } } if (exception != null) { silentInvalidateAllObserver.end(HigherCachingTierOperationOutcomes.SilentInvalidateAllOutcome.FAILURE); throw new StoreAccessException("silentInvalidateAll failed - error count: " + errorCount, exception); } silentInvalidateAllObserver.end(HigherCachingTierOperationOutcomes.SilentInvalidateAllOutcome.SUCCESS); }
Source:
public void typesTextInReadOnly() throws Exception { final SWTBotText text = bot.textInGroup("Text", 1); assertTrue(text.isReadOnly()); try { text.typeText(""); fail("Expecting an exception"); } catch (Exception e) { assertEquals("TextBox is read-only", e.getMessage()); } }

Target:
public void typesTextInReadOnly() throws Exception { bot.checkBox("SWT.READ_ONLY").select(); final SWTBotText text = bot.textInGroup("Text"); assertTrue(text.isReadOnly()); try { text.typeText(""); fail("Expecting an exception"); } catch (Exception e) { assertEquals("TextBox is read-only", e.getMessage()); } }
Source:
private void refreshBeansList() throws IOException { this.beans = new HashSet<ObjectInstance>(); try { LinkedList<String> beanScopes = getBeansScopes(); for (String scope : beanScopes) { ObjectName name = new ObjectName(scope); this.beans.addAll(connection.queryMBeans(name)); } } catch (Exception e) { e.printStackTrace(); this.beans = connection.queryMBeans(null); } this.lastRefreshTime = System.currentTimeMillis(); }

Target:
private void refreshBeansList() throws IOException { this.beans = new HashSet<ObjectInstance>(); try { LinkedList<String> beanScopes = getBeansScopes(); for (String scope : beanScopes) { ObjectName name = new ObjectName(scope); this.beans.addAll(connection.queryMBeans(name)); } } catch (Exception e) { e.printStackTrace(); LOGGER.error("Unable to compute a common bean scope, querying all beans as a fallback"); this.beans = connection.queryMBeans(null); } this.lastRefreshTime = System.currentTimeMillis(); }
Source:
public PartialInterestRateBean(Interval overlap, BigDecimal rate) { this.overlap = overlap; this.rate = rate; this.numberOfDays = Days.daysBetween(overlap.getStart(), overlap.getEnd()).getDays(); this.result = calculateResult(); }

Target:
public PartialInterestRateBean(Interval overlap, BigDecimal rate) { this.overlap = overlap; this.rate = rate; this.numberOfDays = Days.daysBetween(overlap.getStart().toLocalDate(), overlap.getEnd().toLocalDate()).getDays(); this.result = calculateResult(); }
Source:
public void testRouteWithSnmpV3UsersMultipleTimes() throws Exception { camelContext = new DefaultCamelContext(); camelContext.addRoutes(new RouteBuilder() { @Override public void configure() throws Exception { jaxbUnmarshaller=new JaxbUtilsUnmarshalProcessor(TrapdConfiguration.class); trapReciever=new TrapReceiverImpl(getTrapConfiguration()); from("http://localhost:10500/trapd-configuration-withSnmpV3Users.html").bean(jaxbUnmarshaller).bean(TrapdConfigBean.class, "onUpdate").bean(trapReciever, "setTrapdConfig").to("mock:result"); } }); camelContext.start(); for (int i = 0; i < 10; i++) { mockEndPoint = camelContext.getEndpoint("mock:result", MockEndpoint.class); mockEndPoint.expectedMessageCount(1); producerTemplate = camelContext.createProducerTemplate(); producerTemplate.start(); mockEndPoint.assertIsSatisfied(); } producerTemplate.stop(); camelContext.stop(); }

Target:
public void testRouteWithSnmpV3UsersMultipleTimes() throws Exception { DefaultCamelContext camelContext = new DefaultCamelContext(); Set<Object> uniqueExchangesRouted = new HashSet<Object>(); camelContext.addRoutes(new RouteBuilder() { @Override public void configure() throws Exception { JaxbUtilsUnmarshalProcessor jaxbUnmarshaller = new JaxbUtilsUnmarshalProcessor( TrapdConfiguration.class); TrapReceiverImpl trapReciever = new TrapReceiverImpl( getTrapConfiguration()); from("timer:mytimer?period=100") .to("http://localhost:10500/trapd-configuration-withSnmpV3Users.html") .bean(jaxbUnmarshaller) .bean(TrapdConfigBean.class, "onUpdate") .bean(trapReciever, "setTrapdConfig").to("mock:result"); } }); camelContext.start(); MockEndpoint mockEndPoint = camelContext.getEndpoint("mock:result", MockEndpoint.class); if (mockEndPoint.getExchanges().toArray().length == 10) { uniqueExchangesRouted.add(mockEndPoint.getExchanges().toArray()); assertEquals(1, uniqueExchangesRouted); } ProducerTemplate producerTemplate = camelContext .createProducerTemplate(); producerTemplate.start(); mockEndPoint.assertIsSatisfied(); producerTemplate.stop(); camelContext.stop(); }
Source:
protected void activate() { DiscoveryServiceCallback dsc = createDiscoveryServiceCallback(); this.discoveryServiceCallback = dsc; active.set(true); for (ExtendedDiscoveryService extendedDiscoveryService : extendedDiscoveryServices) { extendedDiscoveryService.setDiscoveryServiceCallback(dsc); } }

Target:
protected void activate() { DiscoveryServiceCallbackImpl dsc = createDiscoveryServiceCallback(); this.discoveryServiceCallback = dsc; for (ExtendedDiscoveryService extendedDiscoveryService : extendedDiscoveryServices) { SafeCaller sc = safeCaller; if (sc != null) { sc.create(extendedDiscoveryService, ExtendedDiscoveryService.class).build() .setDiscoveryServiceCallback(dsc); } } }
Source:
public void getOrderSubTypes_shouldGetAllSubOrderTypesWithRetiredOrderTypes() { OrderService orderService = Context.getOrderService(); List<OrderType> orderTypeList = orderService.getOrderSubtypes(orderService.getOrderType(2), true); assertEquals(6, orderTypeList.size()); }

Target:
public void getOrderSubTypes_shouldGetAllSubOrderTypesWithRetiredOrderTypes() { OrderService orderService = Context.getOrderService(); List<OrderType> orderTypeList = orderService.getOrderSubtypes(orderService.getOrderType(2), true); assertEquals(7, orderTypeList.size()); }
Source:
public void locksAreExclusive() { LockTokenV2 token = CLUSTER.lock(requestFor(LOCK_A)); Future<LockTokenV2> futureToken = executor.submit(() -> CLUSTER.lock(requestFor(LOCK_A))); assertNotYetLocked(futureToken); CLUSTER.unlock(token); assertLockedAndUnlock(futureToken); }

Target:
public void locksAreExclusive() { LockTokenV2 token = CLUSTER.lock(requestFor(LOCK_A)); Future<LockTokenV2> futureToken = CLUSTER.lockAsync(requestFor(LOCK_A)); assertNotYetLocked(futureToken); CLUSTER.unlock(token); assertLockedAndUnlock(futureToken); }
Source:
public void removeAllGroupResourceAttributes(PerunSession sess, Resource resource) throws InternalErrorException, WrongAttributeValueException, WrongAttributeAssignmentException, WrongReferenceAttributeValueException { List<Group> groups = this.perunBl.getResourcesManagerBl().getAssignedGroups(sess, resource); List<Attribute> attrs = new ArrayList<>(); for(Group group: groups){ attrs.addAll(this.getAttributes(sess, resource, group)); for(Attribute attr : attrs) { attr.setValue(null); try { this.checkAttributesValue(sess, resource, group, attrs); } catch(WrongAttributeAssignmentException ex) { throw new ConsistencyErrorException(ex); } } attrs.clear(); } this.attributesManagerImpl.removeAllGroupResourceAttributes(sess, resource); log.info("All attributes (theirs values) were removed from resource. Resource={}.", resource); }

Target:
public void removeAllGroupResourceAttributes(PerunSession sess, Resource resource) throws InternalErrorException, WrongAttributeValueException, WrongAttributeAssignmentException, WrongReferenceAttributeValueException { List<Group> groups = this.perunBl.getResourcesManagerBl().getAssignedGroups(sess, resource); List<Attribute> attrs = new ArrayList<>(); for(Group group: groups){ attrs =this.getAttributes(sess, resource, group); for(Attribute attr : attrs) { attr.setValue(null); try { this.checkAttributesValue(sess, resource, group, attrs); } catch(WrongAttributeAssignmentException ex) { throw new ConsistencyErrorException(ex); } } } this.attributesManagerImpl.removeAllGroupResourceAttributes(sess, resource); log.info("All non-virtual group-resource attributes removed for all groups and {}", resource); }
Source:
public void setUp() throws Exception { super.setUp(); if (SystemUtils.IS_OS_LINUX) { try { eventLoopGroup = new EpollEventLoopGroup(); } catch (Throwable t) { LOG.warn("Could not use Netty Epoll event loop {}", t.getMessage()); eventLoopGroup = new NioEventLoopGroup(); } } else { eventLoopGroup = new NioEventLoopGroup(); } executor = OrderedSafeExecutor.newBuilder() .name("BKClientOrderedSafeExecutor") .numThreads(2) .build(); }

Target:
public void setUp() throws Exception { super.setUp(); eventLoopGroup = new NioEventLoopGroup(); executor = OrderedSafeExecutor.newBuilder() .name("BKClientOrderedSafeExecutor") .numThreads(2) .build(); }
Source:
private void setupStatsEnabledNamePatterns(IntegrationManagementConfigurer configurer) { List<String> patterns = new ArrayList<String>(); String[] statsEnabled = this.attributes.getStringArray("statsEnabled"); for (String managedComponent : statsEnabled) { String pattern = this.environment.resolvePlaceholders(managedComponent); patterns.addAll(Arrays.asList(StringUtils.commaDelimitedListToStringArray(pattern))); } configurer.setEnabledStatsPatterns(patterns.toArray(new String[patterns.size()])); }

Target:
private void setupStatsEnabledNamePatterns(IntegrationManagementConfigurer configurer) { List<String> patterns = new ArrayList<>(); String[] statsEnabled = this.attributes.getStringArray("statsEnabled"); for (String managedComponent : statsEnabled) { String pattern = this.environment.resolvePlaceholders(managedComponent); patterns.addAll(Arrays.asList(StringUtils.commaDelimitedListToStringArray(pattern))); } configurer.setEnabledStatsPatterns(patterns.toArray(new String[0])); }