auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public Iterable<RawQuery.Result<String>> query(RawQuery query, KeyInformation.IndexRetriever informations, TransactionHandle tx) throws StorageException { List<RawQuery.Result<String>> result = new ArrayList<RawQuery.Result<String>>(); String core = query.getStore(); String keyIdField = keyFieldIds.get(core); SolrServer solr = this.solrServers.get(core); SolrQuery solrQuery = new SolrQuery(); solrQuery.setQuery("*:*"); solrQuery.addFilterQuery(query.getQuery()); <START> solrQuery.addField("*"); <END> solrQuery.addField("score"); if (query.hasLimit()) { solrQuery.setRows(query.getLimit()); } else { solrQuery.setRows(MAX_RESULT_SET_SIZE); } try { QueryResponse response = null; response = solr.query(solrQuery); log.debug("Executed query in ms", query.getQuery(), response.getElapsedTime()); int totalHits = response.getResults().size(); if (false == query.hasLimit() && totalHits >= MAX_RESULT_SET_SIZE) { log.warn("Query result set truncated to first elements for query: {}", MAX_RESULT_SET_SIZE, query); } result = new ArrayList<RawQuery.Result<String>>(totalHits); for (SolrDocument hit : response.getResults()) { result.add(new RawQuery.Result<String>(hit.getFieldValue(keyIdField).toString(), Double.parseDouble(hit.getFieldValue("score").toString()))); } } catch (HttpSolrServer.RemoteSolrException e) { log.error("Query did not complete because parameters were not recognized : ", e); } catch (SolrServerException e) { log.error("Unable to query Solr index.", e); } return result; }</code><technical_language>retrieve fields score key ID field below? this unnecessary overhead for stores lots and/or multi-valued fields</technical_language>

Target:
public Iterable<RawQuery.Result<String>> query(RawQuery query, KeyInformation.IndexRetriever informations, TransactionHandle tx) throws StorageException { List<RawQuery.Result<String>> result = new ArrayList<RawQuery.Result<String>>(); String core = query.getStore(); String keyIdField = keyFieldIds.get(core); SolrServer solr = this.solrServers.get(core); SolrQuery solrQuery = new SolrQuery(); solrQuery.setQuery("*:*"); solrQuery.addFilterQuery(query.getQuery()); solrQuery.addField(keyIdField); solrQuery.addField("score"); if (query.hasLimit()) { solrQuery.setRows(query.getLimit()); } else { solrQuery.setRows(MAX_RESULT_SET_SIZE); } try { QueryResponse response = null; response = solr.query(solrQuery); log.debug("Executed query in ms", query.getQuery(), response.getElapsedTime()); int totalHits = response.getResults().size(); if (false == query.hasLimit() && totalHits >= MAX_RESULT_SET_SIZE) { log.warn("Query result set truncated to first elements for query: {}", MAX_RESULT_SET_SIZE, query); } result = new ArrayList<RawQuery.Result<String>>(totalHits); for (SolrDocument hit : response.getResults()) { double score = Double.parseDouble(hit.getFieldValue("score").toString()); result.add( new RawQuery.Result<String>(hit.getFieldValue(keyIdField).toString(), score)); } } catch (HttpSolrServer.RemoteSolrException e) { log.error("Query did not complete because parameters were not recognized : ", e); } catch (SolrServerException e) { log.error("Unable to query Solr index.", e); } return result; }
Source:
<code>private Object visitDataReadCommand(InvocationContext ctx, AbstractDataCommand command) { final Object key = command.getKey(); CompletionStage<Void> stage = entryFactory.wrapEntryForReading(ctx, key, command.getSegment(), ignoreOwnership(command) || canRead(command)); <START> if ((CompletionStages.isCompletedSuccessfully(stage))) { <END> return invokeNextThenApply(ctx, command, dataReadReturnHandler); } return asyncValue(stage).thenApply(ctx, command, ((rCtx, rCommand, rv) -> invokeNextThenApply(rCtx, command, dataReadReturnHandler))); }</code><technical_language>nitpick: ( )</technical_language>

Target:
private Object visitDataReadCommand(InvocationContext ctx, AbstractDataCommand command) { final Object key = command.getKey(); CompletionStage<Void> stage = entryFactory.wrapEntryForReading(ctx, key, command.getSegment(), ignoreOwnership(command) || canRead(command)); return makeStage(asyncInvokeNext(ctx, command, stage)).thenApply(ctx, command, dataReadReturnHandler); }
Source:
<code>void onComplete(DeleteOperation op) { Exception e = op.getOperationException(); if (e == null) { notificationSystem.onBlobDeleted(op.getBlobId().getID()); } else { routerMetrics.deleteBlobErrorCount.inc(); routerMetrics.countError(e); } routerMetrics.operationDequeuingRate.mark(); routerMetrics.deleteBlobOperationLatencyMs.update(time.milliseconds() - op.getSubmissionTimeMs()); <START> if (op.setCallbackInvoked()) { <END> operationCompleteCallback.completeOperation(op.getFutureResult(), op.getCallback(), op.getOperationResult(), op.getOperationException()); } }</code><technical_language>this (here in PutManager), do is call op.invokeOperationCompleteCallback() check callback invocation internally? a setCallbackInvoked() a bit odd</technical_language>

Target:
void onComplete(DeleteOperation op) { Exception e = op.getOperationException(); if (e == null) { notificationSystem.onBlobDeleted(op.getBlobId().getID()); } else { routerMetrics.deleteBlobErrorCount.inc(); routerMetrics.countError(e); } routerMetrics.operationDequeuingRate.mark(); routerMetrics.deleteBlobOperationLatencyMs.update(time.milliseconds() - op.getSubmissionTimeMs()); operationCompleteCallback.completeOperation(op.getFutureResult(), op.getCallback(), op.getOperationResult(), op.getOperationException()); }
Source:
<code>public synchronized void setDistinctId(String distinctId) { <START> if (mDistinctId == distinctId) { <END> return; } else { mUnseenSurveys.clear(); mUnseenNotifications.clear(); mVariants = new JSONArray(); mDistinctId = distinctId; } }</code><technical_language>if (mDistinctId != null && mDistinctId.equals(distinctId)) I this preferred</technical_language>

Target:
public synchronized void setDistinctId(String distinctId) { if (mDistinctId == null || !mDistictId.equals(distinctId)){ mUnseenSurveys.clear(); mUnseenNotifications.clear(); } mDistinctId = distinctId; }
Source:
<code>public void issue_1678() { ProjectFactory.newProject("test-empty").version(SupportedVersions.CAMEL_LATEST).type(ProjectType.SPRING) .create(); CamelEditor editor = new CamelEditor("camel-context.xml"); editor.addCamelComponent(new Route(), 100, 100); editor.selectEditPart("Route _route1"); FusePropertiesView propertiesView = new FusePropertiesView(); propertiesView.activate(); propertiesView.selectTab("Details"); propertiesView.setProperty(PropertyType.TEXT, "Auto Startup", "true"); editor.save(); editor.doOperation("Route _route1", "Go Into"); assertFalse("Invoke of 'Go Into' failed", editor.isComponentAvailable("Route _route2")); <START> assertFalse("Project 'test-empty' contains 'Graphic is disposed' error", graphicError()); <END> editor.doOperation("Route _route1", "Show Camel Context"); assertTrue("Invoke of 'Show Camel Context' failed", editor.isComponentAvailable("Route _route2")); assertFalse("Project 'test-empty' contains 'Graphic is disposed' error", graphicError()); }</code><technical_language>I check Error Log for error Fuse Tooling plugins (it cover _Graphic is disposed_ error well)</technical_language>

Target:
public void issue_1678() { ProjectFactory.newProject("test-empty").version(SupportedVersions.CAMEL_LATEST).type(ProjectType.SPRING) .create(); CamelEditor editor = new CamelEditor("camel-context.xml"); editor.addCamelComponent(new Route(), 100, 100); editor.selectEditPart("Route _route1"); FusePropertiesView propertiesView = new FusePropertiesView(); propertiesView.activate(); propertiesView.selectTab("Details"); propertiesView.setProperty(PropertyType.TEXT, "Auto Startup", "true"); editor.save(); editor.doOperation("Route _route1", "Go Into"); assertFalse("Invoke of 'Go Into' failed", editor.isComponentAvailable("Route _route2")); assertTrue(LogGrapper.getPluginErrors("fuse").size() == 0); editor.doOperation("Route _route1", "Show Camel Context"); assertTrue("Invoke of 'Show Camel Context' failed", editor.isComponentAvailable("Route _route2")); assertTrue(LogGrapper.getPluginErrors("fuse").size() == 0); }
Source:
<code>private void runTester(long numberOfItems, ComparisonConstant op, int ts) throws NoConnectionsException, IOException { Pair<Long, Long> pair = new Pair<>(0l, Long.MAX_VALUE); int loop = 0; long existingRows = numberOfItems; while (pair.getSecond() > 0) { pair = nibbleDeletePartitioned(op, ts, existingRows); existingRows -= pair.getFirst(); if (++loop > 100) { fail("Make no progress on delete, something wrong happens in @NibbleDeleteSP"); } } pair = new Pair<>(0l, Long.MAX_VALUE); loop = 0; existingRows = numberOfItems; while (pair.getSecond() > 0) { pair = nibbleDeleteReplicated(op, ts, existingRows); existingRows -= pair.getFirst(); if (++loop > 100) { <START> fail("Make no progress on delete, something wrong happens in @NibbleDeleteSP"); <END> } } }</code><technical_language>NibbleDeleteMP</technical_language>

Target:
private void runTester(long numberOfItems, ComparisonConstant op, int ts) throws NoConnectionsException, IOException { Pair<Long, Long> pair = new Pair<>(0l, Long.MAX_VALUE); int loop = 0; long existingRows = numberOfItems; while (pair.getSecond() > 0) { pair = nibbleDeletePartitioned(op, ts, existingRows); existingRows -= pair.getFirst(); if (++loop > 100) { fail("Make no progress on delete, something wrong happens in @NibbleDeleteSP or @NibbleDeleteMP"); } } pair = new Pair<>(0l, Long.MAX_VALUE); loop = 0; existingRows = numberOfItems; while (pair.getSecond() > 0) { pair = nibbleDeleteReplicated(op, ts, existingRows); existingRows -= pair.getFirst(); if (++loop > 100) { fail("Make no progress on delete, something wrong happens in @NibbleDeleteSP or @NibbleDeleteMP"); } } }
Source:
<code>public void write(JsonWriter out, PublicKey value) throws IOException { checkArgument(value instanceof RSAPublicKey || value instanceof DSAPublicKey, "Only RSA and DSA keys are supported"); if (value instanceof RSAPublicKey) { out.value(SshKeys.encodeAsOpenSSH((RSAPublicKey) value)); } else { out.value(DSAKeys.encodeAsOpenSSH((DSAPublicKey) value)); <START> } <END> }</code><technical_language>save check this, you: if (value instanceof RSAPublicKey) { .. } else if (value instanceof DSAPublicKey) { .. } else { throw new ... }</technical_language>

Target:
public void write(JsonWriter out, PublicKey value) throws IOException { if (value instanceof RSAPublicKey) { out.value(SshKeys.encodeAsOpenSSH((RSAPublicKey) value)); } else if (value instanceof DSAPublicKey) { out.value(DSAKeys.encodeAsOpenSSH((DSAPublicKey) value)); } else { throw new IllegalArgumentException("Only RSA and DSA keys are supported"); } }
Source:
<code>public void shutdown() throws InterruptedException { bossGroup.shutdownGracefully().sync(); workerGroup.shutdownGracefully().sync(); <START> logger.info("HttpServer shutdown "); <END> }</code><technical_language>this "HttpsServer" instead of "HttpServer"</technical_language>

Target:
public void shutdown() throws InterruptedException { bossGroup.shutdownGracefully().sync(); workerGroup.shutdownGracefully().sync(); logger.info("HttpsServer shutdown "); }
Source:
<code>public void testNotFound() throws Exception { given() .when() <START> .get("/skeleton/0000.SKL") <END> .then() .statusCode(HttpStatus.NOT_FOUND.value()); }</code><technical_language>filename match regular expression in @RequestMapping annotation</technical_language>

Target:
public void testNotFound() throws Exception { given() .when() .get("/skeletonFiles/0000.SKL") .then() .statusCode(HttpStatus.NOT_FOUND.value()); }
Source:
<code>public void testSnapshotRemoteWithNodeFiler() throws Exception { int grids = 3; CacheConfiguration<Integer, Integer> ccfg = txCacheConfig(new CacheConfiguration<Integer, Integer>(DEFAULT_CACHE_NAME)) .setNodeFilter(node -> node.consistentId().toString().endsWith("1")); for (int i = 0; i < grids; i++) startGrid(optimize(getConfiguration(getTestIgniteInstanceName(i)).setCacheConfiguration())); IgniteEx ig0 = grid(0); ig0.cluster().baselineAutoAdjustEnabled(false); ig0.cluster().state(ACTIVE); for (int i = 0; i < CACHE_KEYS_RANGE; i++) ig0.getOrCreateCache(ccfg).put(i, i); <START> forceCheckpoint(); <END> Map<Integer, Set<Integer>> parts = new HashMap<>(); parts.put(CU.cacheId(DEFAULT_CACHE_NAME), null); IgniteInternalFuture<?> fut = snp(grid(0)).requestRemoteSnapshot(grid(2).localNode().id(), parts, new BiConsumer<File, GroupPartitionId>() { @Override public void accept(File file, GroupPartitionId gprPartId) { fail("We should not receive anything."); } }); assertThrowsAnyCause(log, fut::get, IgniteCheckedException.class, "The snapshot operation stopped"); }</code><technical_language>Redundant</technical_language>

Target:
public void testSnapshotRemoteWithNodeFiler() throws Exception { int grids = 3; CacheConfiguration<Integer, Integer> ccfg = txCacheConfig(new CacheConfiguration<Integer, Integer>(DEFAULT_CACHE_NAME)) .setNodeFilter(node -> node.consistentId().toString().endsWith("1")); for (int i = 0; i < grids; i++) startGrid(optimize(getConfiguration(getTestIgniteInstanceName(i)).setCacheConfiguration())); IgniteEx ig0 = grid(0); ig0.cluster().baselineAutoAdjustEnabled(false); ig0.cluster().state(ACTIVE); for (int i = 0; i < CACHE_KEYS_RANGE; i++) ig0.getOrCreateCache(ccfg).put(i, i); Map<Integer, Set<Integer>> parts = new HashMap<>(); parts.put(CU.cacheId(DEFAULT_CACHE_NAME), null); IgniteInternalFuture<?> fut = snp(grid(0)).requestRemoteSnapshot(grid(2).localNode().id(), parts, new BiConsumer<File, GroupPartitionId>() { @Override public void accept(File file, GroupPartitionId gprPartId) { fail("We should not receive anything."); } }); assertThrowsAnyCause(log, fut::get, IgniteCheckedException.class, "The snapshot operation stopped"); }
Source:
<code>public ClientBuilder newBuilder(String clientName, JaxRsClientConfig config, Collection<JaxRsFeatureGroup> featureGroups) { <START> final List<Consumer<SslContextFactory>> sSlFactoryContextCustomizers = getSSlFactoryContextCustomizers(config, featureGroups); <END> final List<Consumer<HttpClient>> httpClientCustomizers = getHttpClientCustomizers(clientName, config); return new JettyResteasyClientBuilder(true, httpClientCustomizers, sSlFactoryContextCustomizers) .connectTimeout(config.getConnectTimeout().toMillis(), TimeUnit.MILLISECONDS) .executorService(configureThreadPool(clientName, config)); }</code><technical_language>Nit: suggestion final List<Consumer<SslContextFactory>> sslFactoryContextCustomizers = getSslFactoryContextCustomizers(config, featureGroups);</technical_language>

Target:
public ClientBuilder newBuilder(String clientName, JaxRsClientConfig config, Collection<JaxRsFeatureGroup> featureGroups) { final List<Consumer<SslContextFactory>> sslFactoryContextCustomizers = getSSlFactoryContextCustomizers(config, featureGroups); final List<Consumer<HttpClient>> httpClientCustomizers = getHttpClientCustomizers(clientName, config); return new JettyResteasyClientBuilder(true, httpClientCustomizers, sslFactoryContextCustomizers) .connectTimeout(config.getConnectTimeout().toMillis(), TimeUnit.MILLISECONDS) .executorService(configureThreadPool(clientName, config)); }
Source:
<code>public void startNewSegment() { lastTimeUpdated = 0; lastPoint = null; <START> execWithClose(updateScript, new Object[] { 0, 0, 0, 0, 0, System.currentTimeMillis(), -1.0f}); <END> addTrackPoint(null, true, System.currentTimeMillis()); }</code><technical_language>Create constant for -1.0</technical_language>

Target:
public void startNewSegment() { lastTimeUpdated = 0; lastPoint = null; execWithClose(updateScript, new Object[] { 0, 0, 0, 0, 0, System.currentTimeMillis(), NO_HEADING}); addTrackPoint(null, true, System.currentTimeMillis()); }
Source:
<code>Set<Pool> revokeEntitlementsFromOverflowingPools(List<Pool> pools) { Collection<Pool> overflowing = new ArrayList<>(); <START> for (Pool pool : pools) { <END> if (pool.isOverflowing()) { overflowing.add(pool); } } if (overflowing.isEmpty()) { return null; } List<Entitlement> entitlementsToRevoke = new ArrayList<>(); overflowing = poolCurator.lockAndLoad(overflowing); List<Entitlement> overFlowingEnts = this.poolCurator.retrieveOrderedEntitlementsOf(overflowing); Map<String, List<Entitlement>> entMap = new HashMap<>(); for (Entitlement entitlement : overFlowingEnts) { List<Entitlement> poolEnts = entMap.get(entitlement.getPool().getId()); if (poolEnts == null) { poolEnts = new ArrayList<Entitlement>(); entMap.put(entitlement.getPool().getId(), poolEnts); } poolEnts.add(entitlement); } for (Pool pool : overflowing) { List<Entitlement> entitlements = entMap.get(pool.getId()); long newConsumed = pool.getConsumed(); for (Entitlement ent : entitlements) { if (newConsumed > pool.getQuantity()) { entitlementsToRevoke.add(ent); newConsumed -= ent.getQuantity(); } else { break; } } } return revokeEntitlements(new ArrayList<>(entitlementsToRevoke)); }</code><technical_language>This a good place stream api. Collection<Pool> overflowing = pools.stream().filter(Pool::isOverflowing).collect(Collectors.toList())</technical_language>

Target:
Set<Pool> revokeEntitlementsFromOverflowingPools(List<Pool> pools) { Collection<Pool> overflowing = pools.stream().filter(Pool::isOverflowing).collect(Collectors.toList()); if (overflowing.isEmpty()) { return null; } List<Entitlement> entitlementsToRevoke = new ArrayList<>(); overflowing = poolCurator.lockAndLoad(overflowing); List<Entitlement> overFlowingEnts = this.poolCurator.retrieveOrderedEntitlementsOf(overflowing); Map<String, List<Entitlement>> entMap = new HashMap<>(); for (Entitlement entitlement : overFlowingEnts) { entMap.computeIfAbsent(entitlement.getPool().getId(), k -> new ArrayList<>()).add(entitlement); } for (Pool pool : overflowing) { List<Entitlement> entitlements = entMap.get(pool.getId()); long newConsumed = pool.getConsumed(); for (Entitlement ent : entitlements) { if (newConsumed > pool.getQuantity()) { entitlementsToRevoke.add(ent); newConsumed -= ent.getQuantity(); } else { break; } } } return revokeEntitlements(new ArrayList<>(entitlementsToRevoke)); }
Source:
<code>default boolean connectAll(@Nonnull S subject, @Nullable Collection<O> objects) { if (subject == null) { throw new IllegalArgumentException(); } return objects == null <START> || objects.stream().filter(Objects::nonNull).map(object -> connect(subject, object)).allMatch(b -> b); <END> }</code><technical_language>I combine map allMatch do objects.stream().filter(Objects::nonNull).allMatch(object -> connect(subject, object));</technical_language>

Target:
default boolean connectAll(@Nonnull S subject, @Nullable Collection<O> objects) { if (subject == null) { throw new IllegalArgumentException(); } return objects == null || objects.stream().filter(Objects::nonNull).map(object -> connect(subject, object)) .reduce(Boolean.TRUE, (b1, b2) -> b1 && b2); }
Source:
<code>private IAuthenticationResult getAccessTokenByClientCredentialGrant(AzureCloudConfig azureCloudConfig) throws MalformedURLException, InterruptedException, ExecutionException { ConfidentialClientApplication app = ConfidentialClientApplication.builder(azureCloudConfig.azureStorageClientId, ClientCredentialFactory.createFromSecret(azureCloudConfig.azureStorageSecret)) .authority(azureCloudConfig.azureStorageAuthority) .build(); ClientCredentialParameters clientCredentialParam = ClientCredentialParameters.builder(Collections.singleton(AZURE_STORAGE_ACCESS_SCOPE)).build(); CompletableFuture<IAuthenticationResult> future = app.acquireToken(clientCredentialParam); <START> return future.get(); <END> }</code><technical_language>Minor: combine lines if future for else</technical_language>

Target:
private IAuthenticationResult getAccessTokenByClientCredentialGrant(AzureCloudConfig azureCloudConfig) throws MalformedURLException, InterruptedException, ExecutionException { ConfidentialClientApplication app = ConfidentialClientApplication.builder(azureCloudConfig.azureStorageClientId, ClientCredentialFactory.createFromSecret(azureCloudConfig.azureStorageSecret)) .authority(azureCloudConfig.azureStorageAuthority) .build(); ClientCredentialParameters clientCredentialParam = ClientCredentialParameters.builder(Collections.singleton(azureCloudConfig.azureStorageScope)).build(); return app.acquireToken(clientCredentialParam).get(); }
Source:
<code>private static IProject createExistingProject(final ProjectRecord record, IProgressMonitor monitor) throws CoreException { String projectName = record.getProjectName(); final IWorkspace workspace = ResourcesPlugin.getWorkspace(); final IProject project = workspace.getRoot().getProject(projectName); if (record.getProjectDescription() == null) { record.setProjectDescription(workspace .newProjectDescription(projectName)); IPath locationPath = new Path(record.getProjectSystemFile() .getAbsolutePath()); <START> if (Platform.getLocation().isPrefixOf(locationPath)) { <END> record.getProjectDescription().setLocation(null); } else { record.getProjectDescription().setLocation(locationPath); } } else { record.getProjectDescription().setName(projectName); } try { monitor.beginTask( UIText.WizardProjectsImportPage_CreateProjectsTask, 100); project.create(record.getProjectDescription(), new SubProgressMonitor(monitor, 30)); project.open(IResource.BACKGROUND_REFRESH, new SubProgressMonitor( monitor, 50)); return project; } finally { monitor.done(); } }</code><technical_language>style nit: braces</technical_language>

Target:
private static IProject createExistingProject(final ProjectRecord record, IProgressMonitor monitor) throws CoreException { String projectName = record.getProjectName(); final IWorkspace workspace = ResourcesPlugin.getWorkspace(); final IProject project = workspace.getRoot().getProject(projectName); if (record.getProjectDescription() == null) { record.setProjectDescription(workspace .newProjectDescription(projectName)); IPath locationPath = new Path(record.getProjectSystemFile() .getAbsolutePath()); if (Platform.getLocation().isPrefixOf(locationPath)) record.getProjectDescription().setLocation(null); else record.getProjectDescription().setLocation(locationPath); } else record.getProjectDescription().setName(projectName); try { monitor.beginTask( UIText.WizardProjectsImportPage_CreateProjectsTask, 100); project.create(record.getProjectDescription(), new SubProgressMonitor(monitor, 30)); project.open(IResource.BACKGROUND_REFRESH, new SubProgressMonitor( monitor, 50)); return project; } finally { monitor.done(); } }
Source:
<code>void func(long seed, Random param) { Random localVar1 = new Random(); Random localVar2 = new Random(seed); Object localVar3 = new Object(); staticField = new Random(); field = new Random(); <START> thid.field = new Random(); <END> field = localVar1 = new Random(); field = (localVar1 = new Random()); localVar1 = localVar2 = new Random(); localVar1 = (localVar2 = new Random()); Random localVar4 = field = new Random(); Random localVar5 = localVar4 = new Random(); new Random(); param = new Random(); func(12, new Random()); func(12, localVar1 = new Random()); }</code><technical_language>typo</technical_language>

Target:
void func(long seed, Random param) { Random localVar1 = new Random(); Random localVar2 = new Random(seed); Object localVar3 = new Object(); staticField = new Random(); field = new Random(); this.field = new Random(); field = localVar1 = new Random(); field = (localVar1 = new Random()); localVar1 = localVar2 = new Random(); localVar1 = (localVar2 = new Random()); Random localVar4 = field = new Random(); Random localVar5 = localVar4 = new Random(); new Random(); param = new Random(); func(12, new Random()); func(12, localVar1 = new Random()); }
Source:
<code>private CardDetailsEntity buildCardDetailsEntity(AuthCardDetails authCardDetails) { CardDetailsEntity detailsEntity = new CardDetailsEntity(); detailsEntity.setCardBrand(sanitize(authCardDetails.getCardBrand())); detailsEntity.setCardHolderName(sanitize(authCardDetails.getCardHolder())); detailsEntity.setExpiryDate(authCardDetails.getEndDate()); if (hasFullCardNumber(authCardDetails)) { detailsEntity.setFirstDigitsCardNumber(FirstDigitsCardNumber.of(StringUtils.left(authCardDetails.getCardNo(), 6))); } if (hasLastFourCharactersCardNumber(authCardDetails)) { detailsEntity.setLastDigitsCardNumber(LastDigitsCardNumber.of(StringUtils.right(authCardDetails.getCardNo(), 4))); } <START> if (authCardDetails.getAddress().isPresent()) { AddressEntity addressEntity = new AddressEntity(authCardDetails.getAddress().get()); processRegionForCanadaOrUs(addressEntity); detailsEntity.setBillingAddress(addressEntity); } <END> detailsEntity.setCardType(PayersCardType.toCardType(authCardDetails.getPayersCardType())); return detailsEntity; }</code><technical_language>ifPresent( ) isPresent() here: java if (authCardDetails.getAddress().ifPresent(address -> { AddressEntity addressEntity = new AddressEntity(address); processRegionForCanadaOrUs(addressEntity); detailsEntity.setBillingAddress(addressEntity); });</technical_language>

Target:
private CardDetailsEntity buildCardDetailsEntity(AuthCardDetails authCardDetails) { CardDetailsEntity detailsEntity = new CardDetailsEntity(); detailsEntity.setCardBrand(sanitize(authCardDetails.getCardBrand())); detailsEntity.setCardHolderName(sanitize(authCardDetails.getCardHolder())); detailsEntity.setExpiryDate(authCardDetails.getEndDate()); if (hasFullCardNumber(authCardDetails)) { detailsEntity.setFirstDigitsCardNumber(FirstDigitsCardNumber.of(StringUtils.left(authCardDetails.getCardNo(), 6))); } if (hasLastFourCharactersCardNumber(authCardDetails)) { detailsEntity.setLastDigitsCardNumber(LastDigitsCardNumber.of(StringUtils.right(authCardDetails.getCardNo(), 4))); } authCardDetails.getAddress().ifPresent(address -> { AddressEntity addressEntity = new AddressEntity(authCardDetails.getAddress().get()); processRegionForCanadaOrUs(addressEntity); detailsEntity.setBillingAddress(addressEntity); }); detailsEntity.setCardType(PayersCardType.toCardType(authCardDetails.getPayersCardType())); return detailsEntity; }
Source:
<code><START> public static String stripSlash(String url) { <END> String ret = url; while (ret.endsWith("/")) { ret = ret.substring(0, ret.length() - 1); } return ret; }</code><technical_language>I expose public, do strip querying API</technical_language>

Target:
private String stripSlash(String url) { String ret = url; while (ret.endsWith("/")) { ret = ret.substring(0, ret.length() - 1); } return ret; }
Source:
<code>private List<Exception> violationsToException(Set<ConstraintViolation<Adapter>> violations) { <START> List<Exception> result = new ArrayList<>(); <END> for (ConstraintViolation v : violations) { result.add(new CoreException(String.format("Interlok Validation Error: [%1$s]=[%2$s]", v.getPropertyPath(), v.getMessage()))); } return result; }</code><technical_language>a liner? private List<Exception> violationsToException(Set<ConstraintViolation<Adapter>> violations) { return violations.stream().map(this::violationsCoreException).collect(Collectors.toList()); } private CoreException violationsCoreException(ConstraintViolation<?> violation) { return new CoreException( String.format("Interlok Validation Error: [%1$s]=[%2$s]", violation.getPropertyPath(), violation.getMessage())); }</technical_language>

Target:
private List<Exception> violationsToException(Set<ConstraintViolation<Adapter>> violations) { return violations.stream().map((v) -> new CoreException(String .format("Interlok Validation Error: [%1$s]=[%2$s]", v.getPropertyPath(), v.getMessage()))) .collect(Collectors.toList()); }
Source:
<code>public static BootProtocol map(Ipv6BootProtocol entity) { if (entity == null) { return null; } switch (entity) { <START> case POLY_DHCP_AUTOCONF: <END> case AUTOCONF: return BootProtocol.AUTOCONF; case DHCP: return BootProtocol.DHCP; case NONE: return BootProtocol.NONE; case STATIC_IP: return BootProtocol.STATIC; default: return null; } }</code><technical_language>add POLY_DHCP_AUTOCONF BootProtocol</technical_language>

Target:
public static BootProtocol map(Ipv6BootProtocol entity) { if (entity == null) { return null; } switch (entity) { case AUTOCONF: return BootProtocol.AUTOCONF; case DHCP: return BootProtocol.DHCP; case NONE: return BootProtocol.NONE; case STATIC_IP: return BootProtocol.STATIC; default: return null; } }
Source:
<code>void aggregates() { BbCreateProject createProject1 = createProject(); BbCreateProject createProject2 = createProject(); BbProject expectedProject1 = createdProjectState(createProject1); BbProject expectedProject2 = createdProjectState(createProject2); context.receivesCommands(createProject1, createProject2) .assertThat(exactly(BbProject.class, <START> ImmutableSet.of(expectedProject1, expectedProject2))); <END> }</code><technical_language>this changed in scope of this PR, OK</technical_language>

Target:
void aggregates() { BbCreateProject createProject1 = createProject(); BbCreateProject createProject2 = createProject(); BbProject expectedProject1 = createdProjectState(createProject1); BbProject expectedProject2 = createdProjectState(createProject2); context.receivesCommands(createProject1, createProject2) .assertThat(exactly(BbProject.class, of(expectedProject1, expectedProject2))); }
Source:
<code>public List<Relationship> getRightRelations(Context context, Entity entity) { List<Relationship> fullList = this.getAllRelations(context, entity); List<Relationship> listToReturn = new LinkedList<>(); for (Relationship relationship : fullList) { <START> if (relationship.getRightItem() == entity.getItem()) { <END> listToReturn.add(relationship); } } return listToReturn; }</code><technical_language>equals here</technical_language>

Target:
public List<Relationship> getRightRelations(Context context, Entity entity) { List<Relationship> fullList = entity.getRelationships(); List<Relationship> listToReturn = new LinkedList<>(); for (Relationship relationship : fullList) { if (relationship.getRightItem().getID() == entity.getItem().getID()) { listToReturn.add(relationship); } } return listToReturn; }
Source:
<code>private TimeLockServices createInvalidatingTimeLockServices(String client) { List<String> uris = install.cluster().cluster().uris(); ImmutableLeaderConfig leaderConfig = ImmutableLeaderConfig.builder() .addLeaders(uris.toArray(new String[uris.size()])) .localServer(install.cluster().localServer()) .sslConfiguration(PaxosRemotingUtils.getSslConfigurationOptional(install)) <START> .quorumSize(uris.size() / 2 + 1) <END> .build(); Supplier<ManagedTimestampService> rawTimestampServiceSupplier = timestampCreator.createTimestampService(client, leaderConfig); Supplier<LockService> rawLockServiceSupplier = lockCreator::createThreadPoolingLockService; return timelockCreator.createTimeLockServices(client, rawTimestampServiceSupplier, rawLockServiceSupplier); }</code><technical_language>nit: equivalent PaxosRemotingUtils.getQuorumSize(uris)</technical_language>

Target:
private TimeLockServices createInvalidatingTimeLockServices(String client) { List<String> uris = install.cluster().cluster().uris(); ImmutableLeaderConfig leaderConfig = ImmutableLeaderConfig.builder() .addLeaders(uris.toArray(new String[uris.size()])) .localServer(install.cluster().localServer()) .sslConfiguration(PaxosRemotingUtils.getSslConfigurationOptional(install)) .quorumSize(PaxosRemotingUtils.getQuorumSize(uris)) .build(); Supplier<ManagedTimestampService> rawTimestampServiceSupplier = timestampCreator .createTimestampService(client, leaderConfig); Supplier<LockService> rawLockServiceSupplier = lockCreator::createThreadPoolingLockService; return timelockCreator.createTimeLockServices(client, rawTimestampServiceSupplier, rawLockServiceSupplier); }
Source:
<code>public void stop(ProfilePoint operationName) { long stop = System.nanoTime(); if (operationName == NULL_OP) { return; } if (!operations.containsKey(operationName)) { return; } long total = stop - operations.get(operationName); double time = (total / 1000) / 1000.0; if(time >= logThreshold){ String stringTime = Double.toString(time); if(stringTime.length() < 6 && stringTime.contains(".")){ while(stringTime.length() < 6){ stringTime += "0"; } } stringTime += "ms"; if(time > 1000){ stringTime = Double.toString(((long)time) / 1000.0) + "sec"; } <START> doLog("[" + stringTime + "][Lvl:" + (operationName.getGranularity().getLevel()) + "]:" + getIndent(queuedProfilePoints) + operationName.toString() + operationName.getMessage() + (operationName.wasGCd()?gcString:"")); <END> } queuedProfilePoints--; }</code><technical_language>Needs spacing. this smush operationnameandoperationmessage. Default message null, do this: (message!=null?" "+message:"")</technical_language>

Target:
public void stop(ProfilePoint operationName) { long stop = System.nanoTime(); if (operationName == NULL_OP) { return; } if (!operations.containsKey(operationName)) { return; } long total = stop - operations.get(operationName); double time = (total / 1000) / 1000.0; if(time >= logThreshold){ String stringTime = Double.toString(time); if(stringTime.length() < 6 && stringTime.contains(".")){ while(stringTime.length() < 6){ stringTime += "0"; } } stringTime += "ms"; if(time > 1000){ stringTime = Double.toString(((long)time) / 1000.0) + "sec"; } String operationMessage = operationName.getMessage()!=null?" Message: "+operationName.getMessage():""; doLog("[" + stringTime + "][Lvl:" + (operationName.getGranularity().getLevel()) + "]:" + getIndent(queuedProfilePoints) + operationName.toString() + operationMessage + (operationName.wasGCd()?gcString:"")); } queuedProfilePoints--; }
Source:
<code>public Cluster apply(Cluster original) { requireNonNull(original); Node nodeInStripe = getStripe().getNodes().stream().findAny().get(); Optional<Stripe> stripeOptional = original.getStripe(nodeInStripe.getNodeAddress()); if (!stripeOptional.isPresent()) { <START> throw new IllegalArgumentException("Node name: " + nodeInStripe.getNodeName() + " is not in cluster: " + original); <END> } for (Node node : getStripe().getNodes()) { if (stripeOptional.get().containsNode(node.getNodeAddress())) { throw new IllegalArgumentException("Node with address: " + node.getNodeAddress() + " is not in stripe: " + stripeOptional.get() + " in cluster: " + original); } } Cluster updated = original.clone(); updated.detachStripe(getStripe()); return updated; }</code><technical_language>instead: Stripe ... is in cluster ...</technical_language>

Target:
public Cluster apply(Cluster original) { requireNonNull(original); if (!original.getStripes().contains(getStripe())) { throw new IllegalArgumentException("Stripe : " + getStripe() + " is not in cluster: " + original); } Cluster updated = original.clone(); updated.removeStripe(getStripe()); return updated; }
Source:
<code>private static boolean extendsZopeInterface(@Nullable Symbol symbol) { <START> return SymbolUtils.findAllSuperClasses(symbol).stream().anyMatch( <END> s -> "zope.interface.Interface".equals(s.fullyQualifiedName())); }</code><technical_language>I symbol.isOrExtends("zope.interface.Interface") here. I change isOrExtends implementation this work. I</technical_language>

Target:
private static boolean extendsZopeInterface(@Nullable Symbol symbol) { if (symbol != null && symbol.kind() == Symbol.Kind.CLASS) { return ((ClassSymbol) symbol).isOrExtends("zope.interface.Interface"); } return false; }
Source:
<code>private boolean isConsoleEnabled() { boolean isConsoleEnabled; if (getParameters().isConsoleEnabled() != null) { <START> isConsoleEnabled = <END> getParameters().isConsoleEnabled(); } else { isConsoleEnabled = getVmDeviceUtils().hasConsoleDevice(getVmId()); } return isConsoleEnabled; }</code><technical_language>simply return here, variable is needed</technical_language>

Target:
private boolean isConsoleEnabled() { if (getParameters().isConsoleEnabled() != null) { return getParameters().isConsoleEnabled(); } else { return getVmDeviceUtils().hasConsoleDevice(getVmId()); } }
Source:
<code><START> public String getPath() { <END> if (path == null) { return null; } boolean trailingSeparator = path.endsWith(File.separator); Path absolutePath = Paths.get(path); if (!absolutePath.isAbsolute()) { if (System.getProperty("ddf.home") != null) { absolutePath = Paths.get(System.getProperty("ddf.home"), path); } else { LOGGER.warn( "Path is relative. System property ddf.home is not set, resolving path to: ", path, absolutePath.toAbsolutePath()); } } String absolutePathStr = absolutePath.toAbsolutePath().toString(); return trailingSeparator ? absolutePathStr + File.separator : absolutePathStr; }</code><technical_language>update this method return getPath(System.getProperty("ddf.home")); a extra baggage this older implementation - logging specifically ddf.home is set worthwhile, I suppose - otherwise, duplicate logic</technical_language>

Target:
public String getPath() { if (System.getProperty("ddf.home") == null) { LOGGER.warn("System property ddf.home is not set"); } return getPath(System.getProperty("ddf.home")); }
Source:
<code>public Rectangle getPreferredLocation(Rectangle proposedLocation) { Rectangle newLocation = null; if (port instanceof Port) { RTPortKindEnum kind = RTPortUtils.getKind((Port) port); if (null != kind) { switch (kind) { case EXTERNAL: case RELAY: newLocation = getPreferredBorderedLocation(proposedLocation); break; case SPP: case SAP: <START> if (RTPortUtils.isService((Port) port)) { newLocation = getPreferredBorderedLocation(proposedLocation); } else { newLocation = getPreferredInternalLocation(proposedLocation); } <END> break; case INTERNAL: newLocation = getPreferredInternalLocation(proposedLocation); break; default: newLocation = getPreferredBorderedLocation(proposedLocation); break; } } else { newLocation = getPreferredBorderedLocation(proposedLocation); } } else { newLocation = getPreferredBorderedLocation(proposedLocation); } return newLocation; }</code><technical_language>check Port::isService Peter suggests, do legacy port kinds mean? If supposed support non-service SPPs service SAPs, do need new kinds for in enumeration support fully? is this fix in importing models RSA</technical_language>

Target:
public Rectangle getPreferredLocation(Rectangle proposedLocation) { Rectangle newLocation = null; if (port instanceof Port) { if (RTPortUtils.isService((Port) port)) { newLocation = getPreferredBorderedLocation(proposedLocation); } else { newLocation = getPreferredInternalLocation(proposedLocation); } } else { newLocation = getPreferredBorderedLocation(proposedLocation); } return newLocation; }
Source:
<code>public static Set<String> getSwiftSourceFiles() throws IOException { <START> Set<String> filenames = new TreeSet<String>(); <END> for (String pathname: pathnames) { if (pathname.endsWith(".swift")) { filenames.add(pathname); } if (new File(pathname).isDirectory()) { Files.walk(Paths.get(pathname)) .filter((Path path) -> path.toString().endsWith(".swift")) .forEach((Path path) -> filenames.add(path.toString())); } } return filenames; }</code><technical_language>remove String TreeSet<String></technical_language>

Target:
public static Set<String> getSwiftSourceFiles() throws IOException { Set<String> filenames = new TreeSet<>(); for (String pathName : pathNames) { File file = new File(pathName); if (file.isDirectory()) { Files.walk(Paths.get(pathName)) .filter(path -> path.toFile().isFile()) .filter(path -> path.toString().endsWith(".swift")) .forEach(path -> filenames.add(path.toString())); } else if (file.isFile() && pathName.endsWith(".swift") && file.canRead()) { filenames.add(pathName); } else { throw new IOException("Cannot read " + pathName); } } return filenames; }
Source:
<code>public void before() throws Exception { downloadCache.before(); Path tmpPath = tmp.getRoot().toPath(); LOG.info("The current temporary path: {}", tmpPath); this.sqlClientSessionConf = tmpPath.resolve("sql-client-session.conf"); this.result = tmpPath.resolve("result"); <START> <END> apacheAvroJars.add(downloadCache.getOrDownload("<LINK_2>", tmpPath)); apacheAvroJars.add(downloadCache.getOrDownload("<LINK_0>", tmpPath)); apacheAvroJars.add(downloadCache.getOrDownload("<LINK_1>", tmpPath)); }</code><technical_language>flink-shaded-hadoop exist anymore in this change duh, hadoop is classpath, no? fulfilling contract of Hadoop category; if test is passing category removed</technical_language>

Target:
public void before() throws Exception { DOWNLOAD_CACHE.before(); Path tmpPath = tmp.getRoot().toPath(); LOG.info("The current temporary path: {}", tmpPath); this.sqlClientSessionConf = tmpPath.resolve("sql-client-session.conf"); this.result = tmpPath.resolve("result"); apacheAvroJars.add(DOWNLOAD_CACHE.getOrDownload("<LINK_2>", tmpPath)); apacheAvroJars.add(DOWNLOAD_CACHE.getOrDownload("<LINK_0>", tmpPath)); apacheAvroJars.add(DOWNLOAD_CACHE.getOrDownload("<LINK_1>", tmpPath)); }
Source:
<code>public SubstitutionMatrix(final List<CramCompressionRecord> records) { initializeBaseByCode(); final long[][] frequencies = buildFrequencies(records); for (final SubstitutionBase b : SubstitutionBase.values()) { encodedMatrixBytes[b.ordinal()] = substitutionCodeVector(b.getBase(), frequencies[b.getBase()]); } <START> for (final SubstitutionBase r : SubstitutionBase.values()) { <END> for (final SubstitutionBase b : SubstitutionBase.values()) { if (r != b) { baseByCode[r.getBase()][codeByBase[r.getBase()][b.getBase()]] = b.getBase(); baseByCode[Character.toLowerCase(r.getBase())][codeByBase[r.getBase()][b.getBase()]] = b.getBase(); } } } }</code><technical_language>values() is a costly operation enums due fact modify returned array creates a copy time. Is annoying I consider add a unmodifiable static final List<SubstutionBase> SubstitutionBase enum iterate that. extends AbstractList read-only access</technical_language>

Target:
public SubstitutionMatrix(final List<CramCompressionRecord> records) { final long[][] frequencies = buildFrequencies(records); for (final SubstitutionBase b : BASES) { encodedMatrixBytes[b.ordinal()] = substitutionCodeVector(b.getBase(), frequencies[b.getBase()]); } for (final SubstitutionBase r : BASES) { for (final SubstitutionBase b : BASES) { if (r != b) { baseByCode[r.getBase()][codeByBase[r.getBase()][b.getBase()]] = b.getBase(); baseByCode[Character.toLowerCase(r.getBase())][codeByBase[r.getBase()][b.getBase()]] = b.getBase(); } } } }
Source:
<code>public int getOpacity() { <START> return PixelFormat.UNKNOWN; <END> }</code><technical_language>opacity unknown</technical_language>

Target:
public int getOpacity() { return 0; }
Source:
<code>public static boolean isOffsetFileValid(File storeDir, Set<SystemStreamPartition> storeSSPs, boolean isSideInput) { boolean hasValidOffsetFile = false; if (storeDir.exists()) { Map<SystemStreamPartition, String> offsetContents = readOffsetFile(storeDir, storeSSPs, isSideInput); if (offsetContents == null) { LOG.info("Offset file is not valid for store: {}.", storeDir.toPath() + "; the file does not exist."); } else if (offsetContents.isEmpty()) { LOG.info("Offset file is not valid for store: {}.", storeDir.toPath() + "; the file is empty."); } else if (!offsetContents.keySet().equals(storeSSPs)) { <START> LOG.info("Offset file is not valid for store: {}.", storeDir.toPath() + "; the file does not match store SSPs: " + storeSSPs.toString() + "."); <END> } else { hasValidOffsetFile = true; } } return hasValidOffsetFile; }</code><technical_language>log offsetContents.keySet() in addition storeSSPs</technical_language>

Target:
public static boolean isOffsetFileValid(File storeDir, Set<SystemStreamPartition> storeSSPs, boolean isSideInput) { boolean hasValidOffsetFile = false; if (storeDir.exists()) { Map<SystemStreamPartition, String> offsetContents = readOffsetFile(storeDir, storeSSPs, isSideInput); if (offsetContents == null) { LOG.info("Offset file does not exist. Store directory: {}", storeDir.toPath()); } else if (offsetContents.isEmpty()) { LOG.info("Offset file is empty. Store directory: {}", storeDir.toPath()); } else if (!offsetContents.keySet().equals(storeSSPs)) { LOG.info("Offset file is invalid since change-log SSPs don't match. " + "Store directory: {}. SSPs from offset-file: SSPs expected: ", storeDir.toPath(), offsetContents.keySet(), storeSSPs); } else { hasValidOffsetFile = true; } } return hasValidOffsetFile; }
Source:
<code>public void bulk(List<BasicDocumentRevision> revisions) { <START> logger.entering(this.getClass().getCanonicalName(),"bulk",revisions); <END> List<Map> allObjs = new ArrayList<Map>(); for (BasicDocumentRevision obj : revisions) { logger.finer(String.format("Document body: %s",obj.getBody())); allObjs.add(obj.asMap()); } List<Response> responses = couchClient.bulk(allObjs); for (Response r : responses) { logger.fine(String.format("Response: %s",r)); } }</code><technical_language>put this in a static calling methods time</technical_language>

Target:
public void bulk(List<BasicDocumentRevision> revisions) { logger.entering("com.cloudant.sync.replication.CouchClientWrapper","bulk",revisions); List<Map> allObjs = new ArrayList<Map>(); for (BasicDocumentRevision obj : revisions) { logger.finer(String.format("Document body: %s",obj.getBody())); allObjs.add(obj.asMap()); } List<Response> responses = couchClient.bulk(allObjs); for (Response r : responses) { logger.info(String.format("Response: %s",r)); } }
Source:
<code>private String normalizePath(String filePath) { if (filePath == null) return ""; filePath = filePath.trim(); if (filePath.contains(":")) { filePath = filePath.substring(filePath.indexOf(":") + 1); } filePath = filePath.replaceAll("\\\\", "/"); filePath = filePath.toLowerCase(); filePath = filePath.replaceAll("/systemroot/", "/windows/"); filePath = filePath.replaceAll("%systemroot%", "/windows/"); filePath = filePath.replaceAll("device/",""); if (filePath.contains("harddiskvolume[0-9]/")){ <START> filePath = filePath.substring(filePath.indexOf("harddiskvolume[0-9]/") -1); <END> } filePath = filePath.replaceAll("harddiskvolume[0-9]/", ""); return filePath; }</code><technical_language>this next line</technical_language>

Target:
private String normalizePath(String filePath) { if (filePath == null) return ""; filePath = filePath.trim(); if (filePath.contains(":")) { filePath = filePath.substring(filePath.indexOf(":") + 1); } filePath = filePath.replaceAll("\\\\", "/"); filePath = filePath.toLowerCase(); filePath = filePath.replaceAll("/systemroot/", "/windows/"); filePath = filePath.replaceAll("%systemroot%", "/windows/"); filePath = filePath.replaceAll("device/",""); filePath = filePath.substring(filePath.indexOf("harddiskvolume[0-9]/") -1); if (filePath.startsWith("/namedpipe/")) return ""; return filePath; }
Source:
<code>public CompletableFuture<T> execute() { final SnmpRequestDTO snmpRequestDTO = new SnmpRequestDTO(); snmpRequestDTO.setLocation(location); snmpRequestDTO.setSystemId(systemId); snmpRequestDTO.setAgent(agent); snmpRequestDTO.setDescription(description); snmpRequestDTO.setGetRequests(gets); snmpRequestDTO.setWalkRequests(walks); snmpRequestDTO.setTimeToLive(timeToLiveInMilliseconds); <START> snmpRequestDTO.addTracingInfo(RpcRequest.TAG_IP_ADDRESS, InetAddressUtils.toIpAddrString(agent.getAddress())); <END> return client.execute(snmpRequestDTO) .thenApply(this::processResponse); }</code><technical_language>useful add "description" field tracing info - this identify SNMP request is for</technical_language>

Target:
public CompletableFuture<T> execute() { final SnmpRequestDTO snmpRequestDTO = new SnmpRequestDTO(); snmpRequestDTO.setLocation(location); snmpRequestDTO.setSystemId(systemId); snmpRequestDTO.setAgent(agent); snmpRequestDTO.setDescription(description); snmpRequestDTO.setGetRequests(gets); snmpRequestDTO.setWalkRequests(walks); snmpRequestDTO.setTimeToLive(timeToLiveInMilliseconds); snmpRequestDTO.addTracingInfo(RpcRequest.TAG_IP_ADDRESS, InetAddressUtils.toIpAddrString(agent.getAddress())); snmpRequestDTO.addTracingInfo(RpcRequest.TAG_DESCRIPTION, description); return client.execute(snmpRequestDTO) .thenApply(this::processResponse); }