auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void run() { consumerThreadsMap = new HashMap<String, List<FetcherRunnable>>(); topicToConsumerMap = new HashMap<String, String>(); queues = new HashMap<String, BlockingQueue<FetchedDataChunk>>(); allPartitions = new ConcurrentHashMap<String, Map<String, PartitionTopicInfo>>(); Properties prop = new Properties(); try { <START> prop.load(new FileReader(new File("consumer.properties"))); <END> } catch (IOException e) { LOG.error("Oops, got an exception, thread start fail.", e); return; } if (Consumer.config.isAutoCommit()) { int autoCommitIntervalMs = Consumer.config.getAutoCommitIntervalMs(); LOG.info("starting auto committer every " + autoCommitIntervalMs + " ms"); scheduler.scheduleWithRate(new AutoCommitTask(), autoCommitIntervalMs, autoCommitIntervalMs); } try { String serverhost = prop.getProperty("supervisor.host"); int serverport = Integer.parseInt(prop.getProperty("supervisor.port")); init(serverhost, serverport); } catch (IOException e) { LOG.error("Oops, got an exception, thread start fail.", e); return; } super.loop(); }</code><technical_language>do read file</technical_language>

Target:
public void run() { consumerThreadsMap = new HashMap<String, List<FetcherRunnable>>(); queues = new ConcurrentHashMap<String, BlockingQueue<FetchedDataChunk>>(); allPartitions = new HashMap<String, List<PartitionTopicInfo>>(); if (Consumer.config.isAutoCommit()) { int autoCommitIntervalMs = Consumer.config.getAutoCommitIntervalMs(); LOG.info("starting auto committer every " + autoCommitIntervalMs + " ms"); scheduler.setContinueExistingPeriodicTasksAfterShutdownPolicy(false); scheduler.setExecuteExistingDelayedTasksAfterShutdownPolicy(false); scheduler.scheduleAtFixedRate(new AutoCommitTask(), autoCommitIntervalMs, autoCommitIntervalMs, TimeUnit.MILLISECONDS); } try { String supervisorHost = Consumer.config.getSupervisorHost(); int supervisorPort = Consumer.config.getSupervisorPort(); init(supervisorHost, supervisorPort); } catch (IOException e) { LOG.error("Oops, got an exception, thread start fail.", e); return; } super.loop(); }
Source:
<code>public <T> Promise<Response<T>> sendRequest(final Request<T> request, final RequestContext requestContext) { final SettablePromise<Response<T>> promise = Promises.settable(); try { _client.sendRequest(request, requestContext, new PromiseCallbackAdapter<T>(promise)); <START> } catch (Exception e) { <END> promise.fail(e); } return promise; }</code><technical_language>Do want catch Exception throwable</technical_language>

Target:
public <T> Promise<Response<T>> sendRequest(final Request<T> request, final RequestContext requestContext) { final SettablePromise<Response<T>> promise = Promises.settable(); try { _client.sendRequest(request, requestContext, new PromiseCallbackAdapter<T>(promise)); } catch (Throwable e) { promise.fail(e); } return promise; }
Source:
<code>public LeafConditionSettingIterator(LeafCondition condition, EObject domainModel, boolean includeNonValueRelatedSettings) { this.condition = condition; dmrs = new LinkedHashSet<VDomainModelReference>(); this.includeNonValueRelatedSettings = includeNonValueRelatedSettings; iteratorToCurrentChildrenMap = new LinkedHashMap<Iterator<Setting>, Iterator<EObject>>(); expectedStackSize = 1; if (condition.getValueDomainModelReference() != null) { expectedStackSize = expectedStackSize + 1; <START> } else { <END> } iterators = new Stack<Iterator<Setting>>(); final BundleContext bundleContext = FrameworkUtil.getBundle(getClass()).getBundleContext(); final ServiceReference<EMFFormsDatabindingEMF> serviceReference = bundleContext .getServiceReference(EMFFormsDatabindingEMF.class); final EMFFormsDatabindingEMF databinding = bundleContext.getService(serviceReference); try { final Setting setting = databinding.getSetting(condition.getDomainModelReference(), domainModel); final Iterator<Setting> iterator = Collections.singleton(setting).iterator(); iterators.push(iterator); } catch (final DatabindingFailedException ex) { final ServiceReference<ReportService> reportReference = bundleContext .getServiceReference(ReportService.class); final ReportService reportService = bundleContext.getService(reportReference); reportService.report(new AbstractReport(ex, String.format("Could not get the setting iterator for DMR: %s and domain model: %s", condition.getDomainModelReference(), domainModel))); bundleContext.ungetService(reportReference); } bundleContext.ungetService(serviceReference); organizeStack(); }</code><technical_language>empty else</technical_language>

Target:
public LeafConditionSettingIterator(LeafCondition condition, EObject domainModel, boolean includeNonValueRelatedSettings) { isDisposed = false; this.condition = condition; dmrs = new LinkedHashSet<VDomainModelReference>(); this.includeNonValueRelatedSettings = includeNonValueRelatedSettings; iteratorToCurrentChildrenMap = new LinkedHashMap<Iterator<Setting>, Iterator<EObject>>(); expectedStackSize = 1; if (condition.getValueDomainModelReference() != null) { expectedStackSize = expectedStackSize + 1; } iterators = new Stack<Iterator<Setting>>(); try { final Setting setting = getDatabinding().getSetting(condition.getDomainModelReference(), domainModel); final Iterator<Setting> iterator = Collections.singleton(setting).iterator(); iterators.push(iterator); } catch (final DatabindingFailedException ex) { getReportService().report(new AbstractReport(ex, String.format("Could not get the setting iterator for DMR: %s and domain model: %s", condition.getDomainModelReference(), domainModel))); } organizeStack(); }
Source:
<code>public Statement apply(TemplateOptions options) { <START> List<Statement> bootstrap = newArrayList(); <END> if (options.getRunScript() != null) { bootstrap.add(options.getRunScript()); } if (options.getPrivateKey() != null) { bootstrap.add(new InstallRSAPrivateKey(options.getPrivateKey())); } if (bootstrap.size() >= 1) { if (options.getTaskName() == null && !(options.getRunScript() instanceof InitScript)) { options.nameTask("bootstrap"); } return bootstrap.size() == 1 ? bootstrap.get(0) : new StatementList(bootstrap); } return null; }</code><technical_language>ImmutableList.builder()? do need support null entries</technical_language>

Target:
public Statement apply(TemplateOptions options) { ImmutableList.Builder<Statement> builder = ImmutableList.builder(); if (options.getRunScript() != null) { builder.add(options.getRunScript()); } if (options.getPrivateKey() != null) { builder.add(new InstallRSAPrivateKey(options.getPrivateKey())); } ImmutableList<Statement> bootstrap = builder.build(); if (!bootstrap.isEmpty()) { if (options.getTaskName() == null && !(options.getRunScript() instanceof InitScript)) { options.nameTask("bootstrap"); } return bootstrap.size() == 1 ? bootstrap.get(0) : new StatementList(bootstrap); } return null; }
Source:
<code>public void testAddCollectionToAdminUnit() throws UnsupportedOperationException, Exception { PID parentPid = makePid(); AdminUnit parent = repositoryObjectFactory.createAdminUnit(parentPid, null); contentRoot.addMember(parent); treeIndexer.indexAll(baseAddress); String label = "collection_label"; String patronOnly = "false"; MvcResult result = mvc.perform(post("/edit/create/collection/" + parentPid.getId()) .param("label", label) .param("patronOnly", patronOnly)) <START> .andExpect(status().is2xxSuccessful()) <END> .andReturn(); treeIndexer.indexAll(baseAddress); assertChildContainerAdded(parent, label, CollectionObject.class); Map<String, Object> respMap = getMapFromResponse(result); assertEquals(parentPid.getUUID(), respMap.get("pid")); assertEquals("create", respMap.get("action")); }</code><technical_language>parameter staffOnly patronOnly? needs changed in tests</technical_language>

Target:
public void testAddCollectionToAdminUnit() throws UnsupportedOperationException, Exception { PID parentPid = makePid(); AdminUnit parent = repositoryObjectFactory.createAdminUnit(parentPid, null); contentRoot.addMember(parent); treeIndexer.indexAll(baseAddress); String label = "collection_label"; MvcResult result = mvc.perform(post("/edit/create/collection/" + parentPid.getId()) .param("label", label)) .andExpect(status().is2xxSuccessful()) .andReturn(); treeIndexer.indexAll(baseAddress); assertChildContainerAdded(parent, label, CollectionObject.class); Map<String, Object> respMap = getMapFromResponse(result); assertEquals(parentPid.getUUID(), respMap.get("pid")); assertEquals("create", respMap.get("action")); assertPatronDoesNotHaveNonePermission(parent, label); }
Source:
<code>public void testGetUsersInGroupAndSubgroupsWithoutInfiniteLoop() throws Exception { deleteTestObjects(); DocumentModel u1 = getUser("test_u1"); DocumentModel u2 = getUser("test_u2"); DocumentModel u2bis = getUser("test_u2bis"); userManager.createUser(u1); userManager.createUser(u2); userManager.createUser(u2bis); DocumentModel g1 = getGroup("test_g1"); DocumentModel g2 = getGroup("test_g2"); List<String> g1Users = Collections.singletonList("test_u1"); List<String> g2Users = Arrays.asList("test_u2", "test_u2bis"); List<String> g2Groups = Collections.singletonList("test_g1"); List<String> g1Groups = Collections.singletonList("test_g2"); g1.setProperty("group", "members", g1Users); g1.setProperty("group", "subGroups", g1Groups); userManager.createGroup(g1); g2.setProperty("group", "members", g2Users); g2.setProperty("group", "subGroups", g2Groups); userManager.createGroup(g2); List<String> expectedUsersInGroup2 = Arrays.asList("test_u2bis", "test_u2", "test_u1"); List<String> usersInGroupAndSubGroups2 = userManager.getUsersInGroupAndSubGroups("test_g2"); Collections.sort(expectedUsersInGroup2); Collections.sort(usersInGroupAndSubGroups2); assertEquals(expectedUsersInGroup2, usersInGroupAndSubGroups2); List<String> g1AncestorGroups = userManager.getAncestorGroups("test_g1"); <START> assertEquals(Arrays.asList("test_g2", "test_g1"), g1AncestorGroups); <END> }</code><technical_language>order guarantee. a Set for comparison, sort list</technical_language>

Target:
public void testGetUsersInGroupAndSubgroupsWithoutInfiniteLoop() throws Exception { deleteTestObjects(); DocumentModel u1 = getUser("test_u1"); DocumentModel u2 = getUser("test_u2"); DocumentModel u2bis = getUser("test_u2bis"); userManager.createUser(u1); userManager.createUser(u2); userManager.createUser(u2bis); DocumentModel g1 = getGroup("test_g1"); DocumentModel g2 = getGroup("test_g2"); List<String> g1Users = Collections.singletonList("test_u1"); List<String> g2Users = Arrays.asList("test_u2", "test_u2bis"); List<String> g2Groups = Collections.singletonList("test_g1"); List<String> g1Groups = Collections.singletonList("test_g2"); g1.setProperty("group", "members", g1Users); g1.setProperty("group", "subGroups", g1Groups); userManager.createGroup(g1); g2.setProperty("group", "members", g2Users); g2.setProperty("group", "subGroups", g2Groups); userManager.createGroup(g2); List<String> expectedUsersInGroup2 = Arrays.asList("test_u2bis", "test_u2", "test_u1"); List<String> usersInGroupAndSubGroups2 = userManager.getUsersInGroupAndSubGroups("test_g2"); Collections.sort(expectedUsersInGroup2); Collections.sort(usersInGroupAndSubGroups2); assertEquals(expectedUsersInGroup2, usersInGroupAndSubGroups2); List<String> g1AncestorGroups = userManager.getAncestorGroups("test_g1"); assertTrue(CollectionUtils.isEqualCollection(Arrays.asList("test_g2", "test_g1"), g1AncestorGroups)); }
Source:
<code>private ITimeGraphState createTimeGraphState(ITmfStateInterval interval, ITmfStateSystem ss) throws StateSystemDisposedException { long startTime = interval.getStartTime(); long endTime = interval.getEndTime(); long duration = endTime - startTime + 1; Object statusObj = interval.getValue(); if (statusObj instanceof Integer) { int status = (int) statusObj; if (status == StateValues.CPU_STATUS_RUN_USERMODE || status == StateValues.CPU_STATUS_RUN_SYSCALL) { return fTimeEventNames.getUnchecked(interval); } if (status != 0) { Object processName = null; if <START> (execNameIntervals.containsEntry(status, new OverlapComparableInterval(interval))) { processName = execNameIntervals.get(status).first().getInterval().getValue(); <END> } else { int quark = ss.optQuarkAbsolute(Attributes.THREADS, Integer.toString(status), Attributes.EXEC_NAME); if (quark != ITmfStateSystem.INVALID_ATTRIBUTE) { ITmfStateInterval namedInterval = ss.querySingleState(endTime, quark); execNameIntervals.put(status, new OverlapComparableInterval(namedInterval)); processName = namedInterval.getValue(); } } if (processName instanceof String) { return new TimeGraphState(startTime, duration, status, (String) processName + '/' + status); } } return new TimeGraphState(startTime, duration, status); } return new TimeGraphState(startTime, duration, Integer.MIN_VALUE); }</code><technical_language>entire point of comparator I is get exec name interval cache.get(tid, interval), do if query if result null</technical_language>

Target:
private ITimeGraphState createTimeGraphState(ITmfStateInterval interval, ITmfStateSystem ss) throws StateSystemDisposedException { long startTime = interval.getStartTime(); long endTime = interval.getEndTime(); long duration = endTime - startTime + 1; Object statusObj = interval.getValue(); Type type = fEntryModelTypes.get(interval.getAttribute()); if (statusObj instanceof Integer) { int status = (int) statusObj; if (type == Type.CPU) { if (status == StateValues.CPU_STATUS_RUN_USERMODE || status == StateValues.CPU_STATUS_RUN_SYSCALL) { return fTimeEventNames.getUnchecked(interval); } } else if (type == Type.CURRENT_THREAD) { Object processName = null; if (fExecNamesCache.containsEntry(status, interval)) { processName = fExecNamesCache.get(status).first().getValue(); } else { int quark = ss.optQuarkAbsolute(Attributes.THREADS, Integer.toString(status), Attributes.EXEC_NAME); if (quark != ITmfStateSystem.INVALID_ATTRIBUTE) { ITmfStateInterval namedInterval = ss.querySingleState(endTime, quark); fExecNamesCache.put(status, namedInterval); processName = namedInterval.getValue(); } } if (processName instanceof String) { return new TimeGraphState(startTime, duration, status, (String) processName + '/' + status); } } return new TimeGraphState(startTime, duration, status); } return new TimeGraphState(startTime, duration, Integer.MIN_VALUE); }
Source:
<code>public boolean isEveryHeaderAllowed(String headers) { Boolean result = false; if (!Strings.isNullOrEmpty(headers)) { if (this.allowedHeadersRaw.equals(ALLOW_ANY_HEADER)) { result = true; } else { <START> for (String header: Splitter.on(HEADER_VALUE_SEPARATOR).split( <END> headers)) { result = this.allowedHeaders.contains(header); if (!result) { break; } } } } if (result) { logger.debug("CORS headers allowed: {}", headers); } else { logger.debug("CORS headers not allowed: {}", headers); } return result; }</code><technical_language>Add space :</technical_language>

Target:
public boolean isEveryHeaderAllowed(String headers) { boolean result = false; if (!Strings.isNullOrEmpty(headers)) { if (this.allowedHeadersRaw.equals(ALLOW_ANY_HEADER)) { result = true; } else { for (String header : Splitter.on(HEADER_VALUE_SEPARATOR).split( headers)) { result = this.allowedHeaders.contains(header); if (!result) { break; } } } } if (result) { logger.debug("CORS headers allowed: {}", headers); } else { logger.debug("CORS headers not allowed: {}", headers); } return result; }
Source:
<code>public PropertyPlaceholderWrapper( DefaultConditionsProvider conditionsProvider, StaticSTSProperties properties) { samlConditionsProvider = conditionsProvider; stsProperties = properties; samlConditionsProvider.setLifetime(DEFAULT_LIFETIME); <START> stsProperties.setSignatureUsername(SystemBaseUrl.EXTERNAL.getHost()); <END> stsProperties.setIssuer(SystemBaseUrl.EXTERNAL.getHost()); stsProperties.setEncryptionUsername(SystemBaseUrl.EXTERNAL.getHost()); }</code><technical_language>STS system user below</technical_language>

Target:
public PropertyPlaceholderWrapper( DefaultConditionsProvider conditionsProvider, StaticSTSProperties properties) { samlConditionsProvider = conditionsProvider; stsProperties = properties; samlConditionsProvider.setLifetime(DEFAULT_LIFETIME); stsProperties.setSignatureUsername(SystemBaseUrl.INTERNAL.getHost()); stsProperties.setIssuer(SystemBaseUrl.INTERNAL.getHost()); stsProperties.setEncryptionUsername(SystemBaseUrl.INTERNAL.getHost()); }
Source:
<code>public Object receiveNewComment(HttpServletRequest request, @SiteParam Site site, @RequestParam("commentTitle") String commentTitle, @RequestParam("comment") String commentBody, @RequestParam("isCompetingInterest") boolean hasCompetingInterest, @RequestParam(value = "ciStatement", required = false) String ciStatement, @RequestParam(value = "target", required = false) String parentArticleDoi, @RequestParam(value = "inReplyTo", required = false) String parentCommentUri) throws IOException { enforceDevFeature("commentsTab"); Map<String, Object> validationErrors = commentValidationService.validate(site, commentTitle, commentBody, hasCompetingInterest, ciStatement); if (!validationErrors.isEmpty()) { return ImmutableMap.of("errors", validationErrors); } parentCommentUri = parentCommentUri == null ? "" : parentCommentUri; URI forwardedUrl = UriUtil.concatenate(soaService.getServerUrl(), COMMENT_NAMESPACE); HttpEntity entity = new StringEntity("{'articleDoi':'" + parentArticleDoi + "','creatorAuthId':'" + request.getRemoteUser() + "','parentCommentId':'" + parentCommentUri + "','title':'" + commentTitle + "','body':'" + commentBody <START> + "','competingInterestStatement':'" + ciStatement + "'}", <END> ContentType.create("application/json")); HttpUriRequest commentPostRequest = HttpMessageUtil.buildEntityPostRequest(forwardedUrl, entity); CloseableHttpResponse response = soaService.getResponse(commentPostRequest); String createdCommentUri = HttpMessageUtil.readResponse(response); response.close(); return ImmutableMap.of("createdCommentUri", createdCommentUri); }</code><technical_language>need build JSON Jackson Gson library. other issues, fields unescaped quotation marks</technical_language>

Target:
public Object receiveNewComment(HttpServletRequest request, @SiteParam Site site, @RequestParam("commentTitle") String commentTitle, @RequestParam("comment") String commentBody, @RequestParam("isCompetingInterest") boolean hasCompetingInterest, @RequestParam(value = "ciStatement", required = false) String ciStatement, @RequestParam(value = "target", required = false) String parentArticleDoi, @RequestParam(value = "inReplyTo", required = false) String parentCommentUri) throws IOException { enforceDevFeature("commentsTab"); Map<String, Object> validationErrors = commentValidationService.validate(site, commentTitle, commentBody, hasCompetingInterest, ciStatement); if (!validationErrors.isEmpty()) { return ImmutableMap.of("errors", validationErrors); } URI forwardedUrl = UriUtil.concatenate(soaService.getServerUrl(), COMMENT_NAMESPACE); ArticleComment comment = new ArticleComment(parentArticleDoi, request.getRemoteUser(), parentCommentUri, commentTitle, commentBody, ciStatement); String articleCommentJson = new Gson().toJson(comment); HttpEntity entity = new StringEntity(articleCommentJson, ContentType.create("application/json")); HttpUriRequest commentPostRequest = HttpMessageUtil.buildEntityPostRequest(forwardedUrl, entity); try (CloseableHttpResponse response = soaService.getResponse(commentPostRequest)) { String createdCommentUri = HttpMessageUtil.readResponse(response); return ImmutableMap.of("createdCommentUri", createdCommentUri); } }
Source:
<code>public void testRefreshingHostedTool() { ApiClient webClient = getWebClient(); ContainersApi containersApi = new ContainersApi(webClient); HostedApi hostedApi = new HostedApi(webClient); DockstoreTool hostedTool = hostedApi.createHostedTool("awesomeTool", "cwl", "quay.io", "coolNamespace"); thrown.expect(ApiException.class); DockstoreTool refreshedTool = containersApi.refresh(hostedTool.getId()); refreshedTool.getUsers().forEach(entryUser -> { <START> Assert.assertNotEquals("refresh() endpoint should have user profiles", null, entryUser.getUserProfiles()); <END> }); }</code><technical_language>check non-empty in case</technical_language>

Target:
public void testRefreshingHostedTool() { ApiClient webClient = getWebClient(); ContainersApi containersApi = new ContainersApi(webClient); HostedApi hostedApi = new HostedApi(webClient); DockstoreTool hostedTool = hostedApi.createHostedTool("awesomeTool", "cwl", "quay.io", "coolNamespace"); thrown.expect(ApiException.class); DockstoreTool refreshedTool = containersApi.refresh(hostedTool.getId()); Assert.assertTrue("There should be at least one user of the workflow", refreshedTool.getUsers().size() > 0); refreshedTool.getUsers().forEach(entryUser -> { Assert.assertNotEquals("refresh() endpoint should have user profiles", null, entryUser.getUserProfiles()); }); }
Source:
<code><START> public void should_throw_a_PageNotFoundException_when_no_page_is_found_for_id_in_mapping() throws Exception { <END> final SPageMapping mapping = mock(SPageMapping.class); final SPage page = mock(SPage.class); when(mapping.getId()).thenReturn(1L); when(pageService.getPage(1L)).thenThrow(SBonitaReadException.class); when(pageMappingService.get("apiExtension|GET|myPathTemplate")).thenReturn(mapping); expectedException.expect(PageNotFoundException.class); pageAPIDelegate.getPageByMappingKey("apiExtension|GET|myPathTemplate"); }</code><technical_language>retrieve exception</technical_language>

Target:
public void should_throw_a_PageNotFoundException_when_no_page_is_found_for_id_in_mapping() throws Exception { final SPageMapping mapping = mock(SPageMapping.class); final SPage page = mock(SPage.class); when(mapping.getId()).thenReturn(1L); when(pageService.getPage(1L)).thenThrow(SObjectNotFoundException.class); when(pageMappingService.get("apiExtension|GET|myPathTemplate")).thenReturn(mapping); expectedException.expect(PageNotFoundException.class); pageAPIDelegate.getPageByMappingKey("apiExtension|GET|myPathTemplate"); }
Source:
<code>public PdbHeader getPdbHeader(String pdbId) throws PdbHeaderNotFoundException, PdbHeaderWebServiceException { Optional<PdbHeader> pdbHeader = null; try { pdbHeader = this.cachedExternalResourceFetcher.fetchAndCache(pdbId); pdbHeader.ifPresent(x -> x.setPdbId(pdbId)); } catch (HttpClientErrorException e) { throw new PdbHeaderWebServiceException(pdbId, e.getResponseBodyAsString(), e.getStatusCode()); } catch (ResourceMappingException e) { throw new PdbHeaderNotFoundException(pdbId); } catch (ResourceAccessException e) { throw new PdbHeaderWebServiceException(pdbId, e.getMessage()); } <START> return pdbHeader.map(x -> x).orElseThrow(() -> new PdbHeaderNotFoundException(pdbId)); <END> }</code><technical_language>ifPresent for clarity? map(x -> x) is confusing</technical_language>

Target:
public PdbHeader getPdbHeader(String pdbId) throws PdbHeaderNotFoundException, PdbHeaderWebServiceException { Optional<PdbHeader> pdbHeader = null; try { pdbHeader = Optional.of(this.cachedExternalResourceFetcher.fetchAndCache(pdbId)); pdbHeader.ifPresent(x -> x.setPdbId(pdbId)); } catch (HttpClientErrorException e) { throw new PdbHeaderWebServiceException(pdbId, e.getResponseBodyAsString(), e.getStatusCode()); } catch (ResourceMappingException e) { throw new PdbHeaderNotFoundException(pdbId); } catch (ResourceAccessException e) { throw new PdbHeaderWebServiceException(pdbId, e.getMessage()); } try { return pdbHeader.get(); } catch(NoSuchElementException e) { throw new PdbHeaderNotFoundException(pdbId); } }
Source:
<code>private void setRequestId(HttpBaseMethod method) { deleteHeaderForAllRequests(OC_X_REQUEST_ID); String requestId = RandomUtils.generateRandomUUID(); addHeaderForAllRequests(OC_X_REQUEST_ID, requestId); <START> Timber.d("Executing " + method.getClass().getSimpleName() + " in request with id " + requestId); <END> }</code><technical_language>if this sense method.getClass().getSimpleName() Timber loge automatic class name</technical_language>

Target:
private void setRequestId(HttpBaseMethod method) { deleteHeaderForAllRequests(OC_X_REQUEST_ID); String requestId = RandomUtils.generateRandomUUID(); addHeaderForAllRequests(OC_X_REQUEST_ID, requestId); Timber.d("Executing in request with id %s", requestId); }
Source:
<code>public HiveWriter(HiveFileWriter fileWriter, Optional<String> partitionName, UpdateMode updateMode, String fileName, String writePath, String targetPath, Consumer<HiveWriter> onCommit, HiveWriterStats hiveWriterStats) { this.fileWriter = requireNonNull(fileWriter, "fileWriter is null"); this.partitionName = requireNonNull(partitionName, "partitionName is null"); this.updateMode = requireNonNull(updateMode, "updateMode is null"); this.fileName = requireNonNull(fileName, "fileName is null"); this.writePath = requireNonNull(writePath, "writePath is null"); this.targetPath = requireNonNull(targetPath, "targetPath is null"); <START> this.onCommit = onCommit; <END> this.hiveWriterStats = requireNonNull(hiveWriterStats); }</code><technical_language>omit requireNonNull onCommit</technical_language>

Target:
public HiveWriter( HiveFileWriter fileWriter, Optional<String> partitionName, UpdateMode updateMode, String fileName, String writePath, String targetPath, Consumer<HiveWriter> onCommit, HiveWriterStats hiveWriterStats) { this.fileWriter = requireNonNull(fileWriter, "fileWriter is null"); this.partitionName = requireNonNull(partitionName, "partitionName is null"); this.updateMode = requireNonNull(updateMode, "updateMode is null"); this.fileName = requireNonNull(fileName, "fileName is null"); this.writePath = requireNonNull(writePath, "writePath is null"); this.targetPath = requireNonNull(targetPath, "targetPath is null"); this.onCommit = requireNonNull(onCommit, "onCommit is null"); this.hiveWriterStats = requireNonNull(hiveWriterStats, "hiveWriterStats is null"); }
Source:
<code>public void init (RuleConfig rc, RuleConfigTableModel model) { this.rc = rc; this.model = model; this.removeAllFields(); this.addReadOnlyField(FIELD_KEY, rc.getKey(), false); this.addReadOnlyField(FIELD_DEFAULT, rc.getDefaultValue(), false); this.addTextField(FIELD_VALUE, rc.getValue()); String desc = ""; if (Constant.messages.containsKey(rc.getKey())) { desc = Constant.messages.getString(rc.getKey()); } this.addMultilineField(FIELD_DESC, desc); <START> ZapTextArea descField = ((ZapTextArea)this.getField(FIELD_DESC)); <END> descField.setEditable(false); descField.setWrapStyleWord(true); }</code><technical_language>surrounding parentheses removed</technical_language>

Target:
public void init (RuleConfig rc, RuleConfigTableModel model) { this.rc = rc; this.model = model; this.removeAllFields(); this.addReadOnlyField(FIELD_KEY, rc.getKey(), false); this.addReadOnlyField(FIELD_DEFAULT, rc.getDefaultValue(), false); this.addTextField(FIELD_VALUE, rc.getValue()); String desc = ""; if (Constant.messages.containsKey(rc.getKey())) { desc = Constant.messages.getString(rc.getKey()); } this.addMultilineField(FIELD_DESC, desc); ZapTextArea descField = (ZapTextArea)this.getField(FIELD_DESC); descField.setEditable(false); descField.setWrapStyleWord(true); }
Source:
<code><START> public String getUDN() { <END> if (udn == null) { ZonePlayerConfiguration configuration = getConfigAs(ZonePlayerConfiguration.class); udn = configuration.udn; } return udn; }</code><technical_language>Is a specific reason for defining udn member variable (Line 163), assigning this a value, afterwards? calling getConfigAs() etc. time, latest time (even change ofter all)</technical_language>

Target:
public String getUDN() { return getConfigAs(ZonePlayerConfiguration.class).udn; }
Source:
<code>public String toString() { <START> return "SecretEnvVar [secretName=" + secretName + ", secretKey=" + secretKey + ", getKey()=" + getKey() + ", potional=" + String.valueOf(getOptional()) + "]"; <END> }</code><technical_language>suggestion return "SecretEnvVar [secretName=" + secretName + ", secretKey=" + secretKey + ", getKey()=" + getKey() + ", optional=" + String.valueOf(getOptional()) + "]";</technical_language>

Target:
public String toString() { return "SecretEnvVar [secretName=" + secretName + ", secretKey=" + secretKey + ", getKey()=" + getKey() + ", optional=" + String.valueOf(getOptional()) + "]"; }
Source:
<code>private File createFileFromAttachement(Attachment attachment) { try (InputStream inputStream = attachment.getDataHandler().getInputStream()) { if (inputStream == null) { LOGGER.debug("No file attachment found"); return null; } if (inputStream.available() == 0) { inputStream.reset(); } String filename = getFileName(attachment.getContentDisposition()); if (!filename.endsWith(JAR_EXT) && !filename.endsWith(KAR_EXT)) { LOGGER.debug("Wrong file type: {}", FilenameUtils.getExtension(filename)); Response.ResponseBuilder responseBuilder = Response.serverError(); responseBuilder.status(HttpStatus.UNSUPPORTED_MEDIA_TYPE_415); <START> return null; <END> } File uploadDir = new File(defaultFileLocation); if (!uploadDir.exists() && uploadDir.mkdirs()) { LOGGER.info("Unable to make directory {}", uploadDir.getAbsolutePath()); } File newFile = new File(uploadDir, filename); FileUtils.copyInputStreamToFile(inputStream, newFile); return newFile; } catch (IOException e) { LOGGER.debug("Unable to write file", e); return null; } }</code><technical_language>this message printed if uploadDir.mkdirs() returns false? right printing Unable directory if creates successfully</technical_language>

Target:
private File createFileFromAttachement(Attachment attachment) { InputStream inputStream = null; try { inputStream = attachment.getDataHandler().getInputStream(); if (inputStream == null) { LOGGER.debug("No file attachment found"); return null; } if (inputStream.available() == 0) { inputStream.reset(); } String filename = getFileName(attachment.getContentDisposition()); if (!filename.endsWith(JAR_EXT) && !filename.endsWith(KAR_EXT)) { LOGGER.debug("Wrong file type: {}", FilenameUtils.getExtension(filename)); return null; } File uploadDir = new File(defaultFileLocation); if (!uploadDir.exists() && !uploadDir.mkdirs()) { LOGGER.info("Unable to make directory {}", uploadDir.getAbsolutePath()); } File newFile = new File(uploadDir, filename); FileUtils.copyInputStreamToFile(inputStream, newFile); return newFile; } catch (IOException e) { LOGGER.debug("Unable to write file", e); return null; } finally { IOUtils.closeQuietly(inputStream); } }
Source:
<code>protected int run() throws Exception { boolean errorOccurred = false; final Jenkins jenkins = Jenkins.getInstance(); if (jenkins == null) { stderr.println("The Jenkins instance has not been started, or was already shut down!"); return -1; } final HashSet<String> hs = new HashSet<String>(); hs.addAll(nodes); for (String node_s : hs) { Node node = null; try { node = jenkins.getNode(node_s); if(node == null) { stderr.format("No such node '%s'\n", node_s); errorOccurred = true; continue; } node.toComputer().doDoDelete(); <START> } catch (AccessDeniedException2 e) { <END> stderr.println(e.getMessage()); errorOccurred = true; continue; } catch (Exception e) { final String errorMsg = String.format("Unexpected exception occurred during deletion of node '%s': %s", node == null ? "(null)" : node.toComputer().getName(), e.getMessage()); stderr.println(errorMsg); LOGGER.warning(errorMsg); errorOccurred = true; continue; } } return errorOccurred ? -1 : 0; }</code><technical_language>org.acegisecurity.AccessDeniedException IMO</technical_language>

Target:
protected int run() throws Exception { boolean errorOccurred = false; final Jenkins jenkins = Jenkins.getInstance(); if (jenkins == null) { stderr.println("The Jenkins instance has not been started, or was already shut down!"); return -1; } final HashSet<String> hs = new HashSet<String>(); hs.addAll(nodes); for (String node_s : hs) { Node node = null; try { node = jenkins.getNode(node_s); if(node == null) { stderr.format("No such node '%s'\n", node_s); errorOccurred = true; continue; } node.toComputer().doDoDelete(); } catch (AccessDeniedException e) { stderr.println(e.getMessage()); errorOccurred = true; continue; } catch (Exception e) { final String errorMsg = String.format("Unexpected exception occurred during deletion of node '%s': %s", node == null ? "(null)" : node.toComputer().getName(), e.getMessage()); stderr.println(errorMsg); LOGGER.warning(errorMsg); errorOccurred = true; continue; } } return errorOccurred ? -1 : 0; }
Source:
<code>public void whenNodeIsShutdown() throws Throwable { Address address = getAddress(local); local.shutdown(); DummyOperation op = new DummyOperation(null); InternalCompletableFuture<Object> future = operationService.invokeOnTarget(null, op, address); CountDownLatch latch = new CountDownLatch(1); AtomicReference<Throwable> reference = new AtomicReference<>(); future.andThen(new ExecutionCallback<Object>() { @Override public void onResponse(Object response) { } @Override public void onFailure(Throwable t) { reference.set(t); latch.countDown(); } }); assertOpenEventually(latch); <START> throw reference.get(); <END> }</code><technical_language>inspect exception here, as; assertInstanceOf(...), instead of throwing it? this style, HazelcastInstanceNotActiveException thrown another place in test, test passes</technical_language>

Target:
public void whenNodeIsShutdown() throws Throwable { Address address = getAddress(local); local.shutdown(); DummyOperation op = new DummyOperation(null); InternalCompletableFuture<Object> future = operationService.invokeOnTarget(null, op, address); CountDownLatch latch = new CountDownLatch(1); AtomicReference<Throwable> reference = new AtomicReference<>(); future.andThen(new ExecutionCallback<Object>() { @Override public void onResponse(Object response) { } @Override public void onFailure(Throwable t) { reference.set(t); latch.countDown(); } }); assertOpenEventually(latch); assertInstanceOf(HazelcastInstanceNotActiveException.class, reference.get()); }
Source:
<code>public synchronized void emit(final List<WireRecord> wireRecords) { requireNonNull(wireRecords, message.wireRecordsNonNull()); if (!(this.wireComponent instanceof WireEmitter)) { return; } <START> retrieveWireConfigurationsIfAbsent(); <END> if (this.wireConfigurations.isEmpty()) { return; } final WireEnvelope wireEnvelope = new WireEnvelope(this.componentPid, wireRecords); for (final WireConfiguration wc : this.wireConfigurations) { final Wire wire = wc.getWire(); if (wire == null) { continue; } final String filter = wc.getFilter(); if (filter == null) { wire.update(wireEnvelope); continue; } final WireEnvelope filteredWireEnvelope = getFilteredWireEnvelope(wireRecords, wireEnvelope, filter); wire.update(filteredWireEnvelope); } fireEmitEvent(); }</code><technical_language>tested I able reproduce issue more, problem here: basically this.wireConfigurations is modified is filled time retrieveWireConfigurationsIfAbsent(). if create a wire graph, save attach more components existing emitter, new components receive envelopes WireSupportImpl.wireConfigurations field updated, new wires. If restart Kura work retrieveWireConfigurationsIfAbsent() is called time find wires, including new ones</technical_language>

Target:
public synchronized void emit(final List<WireRecord> wireRecords) { requireNonNull(wireRecords, message.wireRecordsNonNull()); if (!(this.wireComponent instanceof WireEmitter)) { return; } retrieveWireConfigurationsIfNeeded(); final WireEnvelope wireEnvelope = new WireEnvelope(this.componentPid, wireRecords); for (final WireConfiguration wc : this.wireConfigurations) { final Wire wire = wc.getWire(); if (wire == null) { continue; } final String filter = wc.getFilter(); if (filter == null) { wire.update(wireEnvelope); continue; } final WireEnvelope filteredWireEnvelope = getFilteredWireEnvelope(wireRecords, wireEnvelope, filter); wire.update(filteredWireEnvelope); } fireEmitEvent(); }
Source:
<code>SettingsItemReader getReader() { return new StreamSettingsItemReader(this) { @Override public void readFromStream(@NonNull InputStream inputStream) throws IOException, IllegalArgumentException { OutputStream output; <START> if (!file.exists() || file.exists() && shouldReplace) { <END> output = new FileOutputStream(file); } else { output = new FileOutputStream(renameFile(file)); } byte[] buffer = new byte[BUFFER]; int count; try { while ((count = inputStream.read(buffer)) != -1) { output.write(buffer, 0, count); } output.flush(); } finally { Algorithms.closeStream(output); } } }; }</code><technical_language>Simplify</technical_language>

Target:
SettingsItemReader getReader() { return new StreamSettingsItemReader(this) { @Override public void readFromStream(@NonNull InputStream inputStream) throws IOException, IllegalArgumentException { OutputStream output; if (!file.exists() || shouldReplace) { output = new FileOutputStream(file); } else { output = new FileOutputStream(renameFile(file)); } byte[] buffer = new byte[BUFFER]; int count; try { while ((count = inputStream.read(buffer)) != -1) { output.write(buffer, 0, count); } output.flush(); } finally { Algorithms.closeStream(output); } } }; }
Source:
<code>public void delete(TransactionState transactionState, Delete delete) throws IOException { final long startTimestamp = transactionState.getStartTimestamp(); boolean issueGet = false; final Put deleteP = new Put(delete.getRow(), startTimestamp); final Get deleteG = new Get(delete.getRow()); Map<byte[], List<KeyValue>> fmap = delete.getFamilyMap(); if (fmap.isEmpty()) { issueGet = true; } for (List<KeyValue> kvl : fmap.values()) { for (KeyValue kv : kvl) { switch(KeyValue.Type.codeToType(kv.getType())) { case DeleteColumn: deleteP.add(kv.getFamily(), kv.getQualifier(), startTimestamp, null); break; case DeleteFamily: deleteG.addFamily(kv.getFamily()); issueGet = true; break; case Delete: if (kv.getTimestamp() == HConstants.LATEST_TIMESTAMP) { deleteP.add(kv.getFamily(), kv.getQualifier(), startTimestamp, null); break; } else { throw new UnsupportedOperationException("Cannot delete specific versions on Snapshot Isolation."); } } } } if (issueGet) { <START> Result result = this.get(deleteG); <END> for (Entry<byte[], NavigableMap<byte[], NavigableMap<Long, byte[]>>> entryF : result.getMap().entrySet()) { byte[] family = entryF.getKey(); for (Entry<byte[], NavigableMap<Long, byte[]>> entryQ : entryF.getValue().entrySet()) { byte[] qualifier = entryQ.getKey(); deleteP.add(family, qualifier, null); } } } transactionState.addWrittenRow(new RowKeyFamily(delete.getRow(), getTableName(), deleteP.getFamilyMap())); put(deleteP); }</code><technical_language>I transactional Get here, get existing qualifiers for a snapshot, takes care of adding get readRows if needs to</technical_language>

Target:
public void delete(TransactionState transactionState, Delete delete) throws IOException { final long startTimestamp = transactionState.getStartTimestamp(); boolean issueGet = false; final Put deleteP = new Put(delete.getRow(), startTimestamp); final Get deleteG = new Get(delete.getRow()); Map<byte[], List<KeyValue>> fmap = delete.getFamilyMap(); if (fmap.isEmpty()) { issueGet = true; } for (List<KeyValue> kvl : fmap.values()) { for (KeyValue kv : kvl) { switch(KeyValue.Type.codeToType(kv.getType())) { case DeleteColumn: deleteP.add(kv.getFamily(), kv.getQualifier(), startTimestamp, null); break; case DeleteFamily: deleteG.addFamily(kv.getFamily()); issueGet = true; break; case Delete: if (kv.getTimestamp() == HConstants.LATEST_TIMESTAMP) { deleteP.add(kv.getFamily(), kv.getQualifier(), startTimestamp, null); break; } else { throw new UnsupportedOperationException("Cannot delete specific versions on Snapshot Isolation."); } } } } if (issueGet) { Result result = this.get(transactionState, deleteG); for (Entry<byte[], NavigableMap<byte[], NavigableMap<Long, byte[]>>> entryF : result.getMap().entrySet()) { byte[] family = entryF.getKey(); for (Entry<byte[], NavigableMap<Long, byte[]>> entryQ : entryF.getValue().entrySet()) { byte[] qualifier = entryQ.getKey(); deleteP.add(family, qualifier, null); } } } transactionState.addWrittenRow(new RowKeyFamily(delete.getRow(), getTableName(), deleteP.getFamilyMap())); put(deleteP); }
Source:
<code>private void updateEnableStates() { boolean enabledCodeMining= getCheckBox(PREF_CODEMINING_ENABLED).getSelection(); if (enabledCodeMining) { boolean showReferences= getCheckBox(PREF_SHOW_REFERENCES).getSelection(); getCheckBox(PREF_SHOW_REFERENCES_ON_CLASSES).setEnabled(showReferences); getCheckBox(PREF_SHOW_REFERENCES_ON_FIELDS).setEnabled(showReferences); getCheckBox(PREF_SHOW_REFERENCES_ON_METHODS).setEnabled(showReferences); boolean <START> showImplementations= getCheckBox(PREF_SHOW_IMPLEMENTATIONS).getSelection(); <END> } else { atLeastOneCheckBox.setEnabled(false); fFilteredPrefTree.setEnabled(false); } }</code><technical_language>local variable is results in a warning</technical_language>

Target:
private void updateEnableStates() { boolean enabledCodeMining= getCheckBox(PREF_CODEMINING_ENABLED).getSelection(); if (enabledCodeMining) { boolean showReferences= getCheckBox(PREF_SHOW_REFERENCES).getSelection(); getCheckBox(PREF_SHOW_REFERENCES_ON_CLASSES).setEnabled(showReferences); getCheckBox(PREF_SHOW_REFERENCES_ON_FIELDS).setEnabled(showReferences); getCheckBox(PREF_SHOW_REFERENCES_ON_METHODS).setEnabled(showReferences); getCheckBox(PREF_SHOW_IMPLEMENTATIONS).getSelection(); } else { atLeastOneCheckBox.setEnabled(false); fFilteredPrefTree.setEnabled(false); } }
Source:
<code>public void removeFactory(@ApiParam(value = "Factory ID", required = true) @PathParam("id") String id, @Context UriInfo uriInfo) throws ForbiddenException, NotFoundException, ApiException { Factory factory = factoryStore.getFactory(id); if (factory == null) { <START> LOG.warn("Factory URL with id is not found.", id); <END> throw new NotFoundException("Factory with id " + id + " is not found."); } final User user = EnvironmentContext.getCurrent().getUser(); if (user == null) { throw new ForbiddenException("User needs to be logged in to remove a factory"); } String userId = user.getId(); if (userId == null || userId.isEmpty()) { throw new ApiException("Invalid factory without author stored"); } Author author = factory.getCreator(); if (author == null) { throw new ApiException("Invalid factory without author stored"); } if (!userId.equals(author.getUserId())) { throw new ForbiddenException("Only user that has issue the factory can delete it"); } factoryStore.removeFactory(id); }</code><technical_language>Do log log debug level</technical_language>

Target:
public void removeFactory(@ApiParam(value = "Factory ID", required = true) @PathParam("id") String id, @Context UriInfo uriInfo) throws ForbiddenException, NotFoundException, ApiException { final User user = EnvironmentContext.getCurrent().getUser(); if (user == null) { throw new ForbiddenException("No authenticated user"); } Factory factory = factoryStore.getFactory(id); if (factory == null) { throw new NotFoundException("Factory with id " + id + " is not found."); } String userId = user.getId(); factoryEditValidator.validate(factory, userId); factoryStore.removeFactory(id); }
Source:
<code>private static void partitionMethod(Method method, Map<String, Object> partitions) { String partitionKey = method.getName() + '/' + method.getParameterCount(); Object existingPartition = partitions.putIfAbsent(partitionKey, method); if (existingPartition instanceof Method) { partitions.put(partitionKey, new MethodPartition((Method) existingPartition, method)); <START> } else if (existingPartition instanceof MethodPartition) { <END> ((MethodPartition) existingPartition).addCandidate(method); } }</code><technical_language>nit, remove condition check expect Method MethodPartition if else is added fail instead of silently ignored</technical_language>

Target:
private static void partitionMethod(Method method, Map<String, Object> partitions) { String partitionKey = method.getName() + '/' + method.getParameterCount(); Object existingPartition = partitions.putIfAbsent(partitionKey, method); if (existingPartition == null) { } else if (existingPartition instanceof Method) { partitions.put(partitionKey, new MethodPartition((Method) existingPartition, method)); } else { ((MethodPartition) existingPartition).addCandidate(method); } }
Source:
<code>public ZonedDateTime parse(String string) throws Exception { ZonedDateTime date; DateTimeFormatter df = this.getDateFormat(); ObjectHelper.notNull(this.pattern, "pattern"); <START> date = ZonedDateTime.parse(string, df); <END> return date; }</code><technical_language>change this initialize date another reason perhaps?: suggestion ZonedDateTime date = ZonedDateTime.parse(string, df);</technical_language>

Target:
public ZonedDateTime parse(String string) throws Exception { DateTimeFormatter df = this.getDateFormat(); ObjectHelper.notNull(this.pattern, "pattern"); return ZonedDateTime.parse(string, df); }
Source:
<code>public void adsRecoveryPageFairOasis() { String url = urlBuilder.getUrlForPath(WIKIA, getUrlArticlePageFairRecovery()); AdsRecoveryObject adsRecoveryObject = new AdsRecoveryObject(driver, url, DESKTOP_SIZE); adsRecoveryObject.wait.forElementPresent(AdsRecoveryObject.PF_RECOVERED_ADS_SELECTOR); adsRecoveryObject.triggerAdSlot(AdsContent.BOTTOM_LB) .wait <START> .forElementPresent(By.cssSelector("div[id*=BOTTOM_LEADERBOARD][adonis-marker]")); <END> List<WebElement> recoveredAds = adsRecoveryObject.getRecoveredAds(AdsRecoveryObject.PF_RECOVERED_ADS_SELECTOR); Assert.assertEquals(recoveredAds.size(), 3); adsRecoveryObject.assertIfAllRecoveredSlotHasCorrectSizeAndBackground(recoveredAds); }</code><technical_language>extract selector const extract this function</technical_language>

Target:
public void adsRecoveryPageFairOasis() { String url = urlBuilder.getUrlForPath(WIKIA, getUrlArticlePageFairRecovery()); AdsRecoveryObject adsRecoveryObject = new AdsRecoveryObject(driver, url, DESKTOP_SIZE); adsRecoveryObject.wait.forElementPresent(AdsRecoveryObject.PF_RECOVERED_ADS_SELECTOR); adsRecoveryObject.triggerAdSlot(AdsContent.BOTTOM_LB) .wait .forElementPresent(By.cssSelector(RECOVERED_BOTTOM_LEADERBOARD_SELECTOR)); List<WebElement> recoveredAds = adsRecoveryObject.getRecoveredAds(AdsRecoveryObject.PF_RECOVERED_ADS_SELECTOR); Assert.assertEquals(recoveredAds.size(), 3); adsRecoveryObject.assertIfAllRecoveredSlotHasCorrectSizeAndBackground(recoveredAds); }
Source:
<code>public String getPackage(String basePackage, SchemaAndTable schemaAndTable) { <START> return basePackage; <END> }</code><technical_language>this delegate appendSchema</technical_language>

Target:
public String getPackage(String basePackage, SchemaAndTable schemaAndTable) { return appendSchema(basePackage, schemaAndTable.getSchema()); }
Source:
<code>public void testIsProperUtilsClass() throws ReflectiveOperationException { assertUtilsClassHasPrivateConstructor(Main.class, <START> TestUtils.CheckConstructorIsPrivate.FALSE); <END> }</code><technical_language>2 methods? assertUtilsClassHasPrivateConstructor assertUtilsClassHasNonPrivateConstructor? I dislike enums values TRUE/FALSE. Boolean</technical_language>

Target:
public void testIsProperUtilsClass() throws ReflectiveOperationException { assertUtilsClassHasPrivateConstructor(Main.class, false); }
Source:
<code>protected ExecutorService createDefaultBatchPool(){ return Executors.newCachedThreadPool( new ThreadFactoryBuilder() <START> .setNameFormat(BATCH_POOL_THREAD_NAME + "-d") <END> .setDaemon(true) .build()); }</code><technical_language>nit: BATCH_POOL_THREAD_NAME? append "-d" here? "-%d"</technical_language>

Target:
protected static ExecutorService createDefaultBatchPool(){ return Executors.newCachedThreadPool( new ThreadFactoryBuilder() .setNameFormat(BATCH_POOL_THREAD_NAME + "-%d") .setDaemon(true) .build()); }
Source:
<code><START> private static @NotNull String nodeDescription(ClusterNode node) { <END> return node.getClass().getSimpleName() + " [id=" + node.id() + ", addrs=" + node.addresses() + ", order=" + node.order() + ", ver=" + node.version() + ", isClient=" + node.isClient() + ", consistentId=" + node.consistentId() + "]"; }</code><technical_language>@NotNull annotation. <LINK_0></technical_language>

Target:
private static String nodeDescription(ClusterNode node) { return node.getClass().getSimpleName() + " [id=" + node.id() + ", addrs=" + node.addresses() + ", order=" + node.order() + ", ver=" + node.version() + ", isClient=" + node.isClient() + ", consistentId=" + node.consistentId() + "]"; }