auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void registerWithToken(final Exchange exchange) { enableStatus = true; Request request = exchange.getCurrentRequest(); Token token = request.getToken(); if (token == null) { do { token = tokenGenerator.createToken(false); request.setToken(token); } while (exchangesByToken.putIfAbsent(token, exchange) != null); LOGGER.debug("exchange added with gnerated token {}, {}", token, request); } else { if (token.isEmpty() && request.getCode() == null) { return; } Exchange previous = exchangesByToken.put(token, exchange); if (previous == null) { BlockOption block2 = request.getOptions().getBlock2(); if (block2 != null && block2.getNum() > 1) { <START> LOGGER.warn("New exchange for ongoing blockwise transfer: {}, block {}", token, block2.getNum()); <END> } else { LOGGER.debug("exchange added with token {}, {}", token, request); } } else if (previous != exchange) { if (exchange.getFailedTransmissionCount() == 0 && !request.getOptions().hasBlock1() && !request.getOptions().hasBlock2() && !request.getOptions().hasObserve()) { LOGGER.warn("manual token overrides existing open request: {}", token); } else { LOGGER.debug("exchange replaced with token {}, {}", token, request); } } } }</code><technical_language>face this warn in "normal" condition if transparent block mode. I right</technical_language>

Target:
private void registerWithToken(final Exchange exchange) { enableStatus = true; Request request = exchange.getCurrentRequest(); Token token = request.getToken(); if (token == null) { do { token = tokenGenerator.createToken(false); request.setToken(token); } while (exchangesByToken.putIfAbsent(token, exchange) != null); LOGGER.debug("exchange added with generated token {}, {}", token, request); } else { if (token.isEmpty() && request.getCode() == null) { return; } Exchange previous = exchangesByToken.put(token, exchange); if (previous == null) { BlockOption block2 = request.getOptions().getBlock2(); if (block2 != null) { LOGGER.debug("block2 exchange for block add with token {}", block2.getNum(), token); } else { LOGGER.debug("exchange added with token {}, {}", token, request); } } else if (previous != exchange) { if (exchange.getFailedTransmissionCount() == 0 && !request.getOptions().hasBlock1() && !request.getOptions().hasBlock2() && !request.getOptions().hasObserve()) { LOGGER.warn("manual token overrides existing open request: {}", token); } else { LOGGER.debug("exchange replaced with token {}, {}", token, request); } } else { LOGGER.debug("exchange kept for {}, {}", token, request); } } }
Source:
<code>private static Map<Integer, TurboMilestone> getMilestoneAliasIndex(List<TurboMilestone> milestones) { List<TurboMilestone> sortedMilestones = TurboMilestone.getSortedMilestonesByDueDate(milestones); Optional<Integer> currentMilestoneIndex = getCurrentMilestoneIndex(sortedMilestones); return IntStream .range(0, sortedMilestones.size()) .boxed() .collect(Collectors.toMap( <START> i -> i - currentMilestoneIndex.get(), <END> i -> sortedMilestones.get(i))); }</code><technical_language>this safe if currentMilestoneIndex is empty? cover a test well</technical_language>

Target:
private static Map<Integer, TurboMilestone> getMilestoneAliasIndex(List<TurboMilestone> milestones) { List<TurboMilestone> sortedMilestones = TurboMilestone.sortByDueDate(milestones); Optional<Integer> currentMilestoneIndex = getCurrentMilestoneIndex(sortedMilestones); assert currentMilestoneIndex.isPresent() || !currentMilestoneIndex.isPresent() && sortedMilestones.isEmpty(); return IntStream .range(0, sortedMilestones.size()) .boxed() .collect(Collectors.toMap( i -> i - currentMilestoneIndex.get(), i -> sortedMilestones.get(i))); }
Source:
<code>private void checkNoMaterialize(Sql sql) { final TestConfig testConfig = build(sql); final List<RelNode> results = optimize(testConfig); if (results.isEmpty() || (results.size() == 1 && !RelOptUtil.toString(results.get(0)).contains("MV0"))) { return; } final StringBuilder errMsgBuilder = new StringBuilder(); errMsgBuilder.append("Optimization succeeds out of expectation: "); <START> for (RelNode res: results) { <END> errMsgBuilder.append(RelOptUtil.toString(res)).append("\n"); } throw new AssertionError(errMsgBuilder.toString()); }</code><technical_language>Thanks for PR, @auxten . please correct commit message</technical_language>

Target:
private void checkNoMaterialize(Sql sql) { final TestConfig testConfig = build(sql); final List<RelNode> results = optimize(testConfig); if (results.isEmpty() || (results.size() == 1 && !RelOptUtil.toString(results.get(0)).contains("MV0"))) { return; } final StringBuilder errMsgBuilder = new StringBuilder(); errMsgBuilder.append("Optmization succeeds out of expectation: "); for (RelNode res: results) { errMsgBuilder.append(RelOptUtil.toString(res)).append("\n"); } throw new AssertionError(errMsgBuilder.toString()); }
Source:
<code>public static <T extends TypedSPI> T newTypedServiceInstance(final Class<T> typedService, final String type) { Class<?> instanceClass = TYPED_SERVICE_CLASSES.containsKey(typedService) ? TYPED_SERVICE_CLASSES.get(typedService).get(type) : null; <START> if (instanceClass == null) { <END> throw new JobConfigurationException("Cannot find a typed service class by the interface: @" + typedService.getName() + "and type: " + type); } return (T) newServiceInstance(instanceClass); }</code><technical_language>constants left variable right in = equals conditional expressions; variable left constants right in greater conditional expressions. Ref <LINK_0></technical_language>

Target:
public static <T extends TypedSPI> T newTypedServiceInstance(final Class<T> typedService, final String type) { Class<?> instanceClass = TYPED_SERVICE_CLASSES.containsKey(typedService) ? TYPED_SERVICE_CLASSES.get(typedService).get(type) : null; if (null == instanceClass) { throw new JobConfigurationException("Cannot find a typed service class by the interface: @" + typedService.getName() + "and type: " + type); } return (T) newServiceInstance(instanceClass); }
Source:
<code>public IssueMetadata(IssueMetadata existingMetadata, String currentUser) { Date lastNonSelfUpdate = new Date(0); Date lastSelfUpdate = new Date(0); boolean isUpdatedByOthers = false; boolean isUpdatedBySelf = false; for (TurboIssueEvent event : existingMetadata.getEvents()) { if (isNewEventByOther(currentUser, event, lastNonSelfUpdate)) { lastNonSelfUpdate = event.getDate(); isUpdatedByOthers = true; } if (isNewEventBySelf(currentUser, event, lastSelfUpdate)){ lastSelfUpdate = event.getDate(); isUpdatedBySelf = true; } } for (Comment comment : existingMetadata.getComments()) { if (isNewCommentByOther(currentUser, comment, lastNonSelfUpdate)) { lastNonSelfUpdate = comment.getCreatedAt(); isUpdatedByOthers = true; } if (isNewCommentBySelf(currentUser, comment, lastSelfUpdate)){ lastSelfUpdate = comment.getCreatedAt(); isUpdatedBySelf = true; } } this.events = new ArrayList<>(existingMetadata.events); this.comments = new ArrayList<>(existingMetadata.comments); this.nonSelfUpdatedAt = LocalDateTime.ofInstant(lastNonSelfUpdate.toInstant(), ZoneId.systemDefault()); <START> this.selfUpdatedAt = LocalDateTime.ofInstant(lastSelfUpdate.toInstant(), ZoneId.systemDefault()); <END> this.nonSelfCommentCount = calculateCommentCount(existingMetadata.getComments(), currentUser, UpdatedKind.OTHER_UPDATED); this.selfCommentCount = calculateCommentCount(existingMetadata.getComments(), currentUser, UpdatedKind.SELF_UPDATED); this.isUpdated = true; this.isUpdatedByOthers = isUpdatedByOthers; this.isUpdatedBySelf = isUpdatedBySelf; }</code><technical_language>Utility.dateToLocalDateTime instead</technical_language>

Target:
public IssueMetadata(IssueMetadata existingMetadata, String currentUser) { Date lastNonSelfUpdate = new Date(0); Date lastSelfUpdate = new Date(0); boolean isUpdatedByOthers = false; boolean isUpdatedBySelf = false; for (TurboIssueEvent event : existingMetadata.getEvents()) { if (isNewEventByOther(currentUser, event, lastNonSelfUpdate)) { lastNonSelfUpdate = event.getDate(); isUpdatedByOthers = true; } if (isNewEventBySelf(currentUser, event, lastSelfUpdate)){ lastSelfUpdate = event.getDate(); isUpdatedBySelf = true; } } for (Comment comment : existingMetadata.getComments()) { if (isNewCommentByOther(currentUser, comment, lastNonSelfUpdate)) { lastNonSelfUpdate = comment.getCreatedAt(); isUpdatedByOthers = true; } if (isNewCommentBySelf(currentUser, comment, lastSelfUpdate)){ lastSelfUpdate = comment.getCreatedAt(); isUpdatedBySelf = true; } } this.events = new ArrayList<>(existingMetadata.events); this.comments = new ArrayList<>(existingMetadata.comments); this.nonSelfUpdatedAt = Utility.dateToLocalDateTime(lastNonSelfUpdate); this.selfUpdatedAt = Utility.dateToLocalDateTime(lastSelfUpdate); this.nonSelfCommentCount = calculateCommentCount(existingMetadata.getComments(), currentUser, UpdatedKind.UPDATED_BY_OTHER); this.selfCommentCount = calculateCommentCount(existingMetadata.getComments(), currentUser, UpdatedKind.UPDATED_BY_SELF); this.isUpdatedByOthers = isUpdatedByOthers; this.isUpdatedBySelf = isUpdatedBySelf; }
Source:
<code>private void handleBinInfo(ITmfEvent event, final Long vpid, final ITmfStateSystemBuilder ss, boolean statedump) { Long baddr = event.getContent().getFieldValue(Long.class, fLayout.fieldBaddr()); Long memsz = event.getContent().getFieldValue(Long.class, fLayout.fieldMemsz()); String path = event.getContent().getFieldValue(String.class, fLayout.fieldPath()); Long hasBuildIdValue = event.getContent().getFieldValue(Long.class, fLayout.fieldHasBuildId()); Long hasDebugLinkValue = event.getContent().getFieldValue(Long.class, fLayout.fieldHasDebugLink()); Long isPicValue = event.getContent().getFieldValue(Long.class, fLayout.fieldIsPic()); if (baddr == null || memsz == null || path == null || hasBuildIdValue == null || hasDebugLinkValue == null || (statedump && isPicValue == null)) { LOGGER.warning(() -> "[UstDebugInfoStateProvider:InvalidBinInfoEvent] event=" + event.toString()); return; } boolean isPic; long ts; if (statedump) { isPic = (checkNotNull(isPicValue).longValue() != 0); Long statedumpStartTime = fLatestStatedumpStarts.get(vpid); <START> if (statedumpStartTime == null) { ts = event.getTimestamp().getValue(); } else { ts = statedumpStartTime; } <END> } else { isPic = true; ts = event.getTimestamp().getValue(); } boolean hasBuildId = (hasBuildIdValue != 0); boolean hasDebugLink = (hasDebugLinkValue != 0); PendingBinInfo p = new PendingBinInfo(hasBuildId, hasDebugLink, vpid, baddr, memsz, path, isPic); processPendingBinInfo(p, ts, ss); }</code><technical_language>this knowledge of calculate timestamp for a pending bininfo is duplicated in 3 places. I this logic: if statedump statedumpTs else eventTs</technical_language>

Target:
private void handleBinInfo(ITmfEvent event, final Long vpid, final ITmfStateSystemBuilder ss, boolean statedump) { Long baddr = event.getContent().getFieldValue(Long.class, fLayout.fieldBaddr()); Long memsz = event.getContent().getFieldValue(Long.class, fLayout.fieldMemsz()); String path = event.getContent().getFieldValue(String.class, fLayout.fieldPath()); Long hasBuildIdValue = event.getContent().getFieldValue(Long.class, fLayout.fieldHasBuildId()); Long hasDebugLinkValue = event.getContent().getFieldValue(Long.class, fLayout.fieldHasDebugLink()); Long isPicValue = event.getContent().getFieldValue(Long.class, fLayout.fieldIsPic()); if (baddr == null || memsz == null || path == null || hasBuildIdValue == null || hasDebugLinkValue == null || (statedump && isPicValue == null)) { LOGGER.warning(() -> "[UstDebugInfoStateProvider:InvalidBinInfoEvent] event=" + event.toString()); return; } boolean isPic = (statedump ? (checkNotNull(isPicValue).longValue() != 0) : true); long ts = getBinInfoTimeStamp(event, vpid, statedump); boolean hasBuildId = (hasBuildIdValue != 0); boolean hasDebugLink = (hasDebugLinkValue != 0); PendingBinInfo p = new PendingBinInfo(hasBuildId, hasDebugLink, vpid, baddr, memsz, path, isPic); processPendingBinInfo(p, ts, ss); }
Source:
<code>public VariantContextWriterBuilder() { if (Defaults.USE_ASYNC_IO_FOR_TRIBBLE) <START> options.add(Options.USE_ASYNC_IO); <END> }</code><technical_language>Add curly braces</technical_language>

Target:
public VariantContextWriterBuilder() { if (Defaults.USE_ASYNC_IO_FOR_TRIBBLE) { options.add(Options.USE_ASYNC_IO); } }
Source:
<code>private void unregisterAllInstances() { synchronized (_instanceMonitorMap) { <START> _instanceMonitorMap.values().forEach(monitor -> monitor.unregister()); <END> } }</code><technical_language>This is right. please change back</technical_language>

Target:
private void unregisterAllInstances() { synchronized (_instanceMonitorMap) { unregisterInstances(_instanceMonitorMap.keySet()); } }
Source:
<code>private void fetchLangLinks() { if (languageEntries == null) { <START> new LangLinksClient().request(title.getWikiSite(), <END> title, new LangLinksClient.Callback() { @Override public void success(@NonNull Call<MwQueryResponse<LangLinks>> call, @NonNull List<PageTitle> links) { languageEntries = links; updateLanguageEntriesSupported(languageEntries); sortLanguageEntriesByMru(languageEntries); displayLangLinks(); } @Override public void failure(@NonNull Call<MwQueryResponse<LangLinks>> call, @NonNull Throwable caught) { ViewAnimations.crossFade(langLinksProgress, langLinksError); langLinksError.setError(caught); } }); } else { displayLangLinks(); } }</code><technical_language>Feel free skip this feedback I recommend holding a reference client a patch do request management Activity destruction</technical_language>

Target:
private void fetchLangLinks() { if (languageEntries == null) { client.request(title.getWikiSite(), title, new LangLinksClient.Callback() { @Override public void success(@NonNull Call<MwQueryResponse<LangLinks>> call, @NonNull List<PageTitle> links) { languageEntries = links; callback.updateLanguageEntriesSupported(languageEntries); callback.sortLanguageEntriesByMru(languageEntries); displayLangLinks(); } @Override public void failure(@NonNull Call<MwQueryResponse<LangLinks>> call, @NonNull Throwable caught) { ViewAnimations.crossFade(langLinksProgress, langLinksError); langLinksError.setError(caught); } }); } else { displayLangLinks(); } }
Source:
<code>private void createDeleteTool(ToolSection toolSection, DiagramElementMapping... mappings) { if (!globalDeleteTool) { DeleteElementDescription deleteElement = ToolFactory.eINSTANCE.createDeleteElementDescription(); deleteElement.setName(baseId + "global.delete"); deleteElement.setLabel("Delete Tool"); toolSection.getOwnedTools().add(deleteElement); for (DiagramElementMapping dem : mappings) { deleteElement.getMappings().add(dem); } } else { for (DiagramElementMapping dem : mappings) { DeleteElementDescription deleteElement = ToolFactory.eINSTANCE.createDeleteElementDescription(); <START> deleteElement.setName("global.delete" + "." + ((ClassDiagramPattern) dem).getBaseId()); <END> deleteElement.setLabel("Delete Tool" + " " + dem.getLabel()); toolSection.getOwnedTools().add(deleteElement); deleteElement.getMappings().add(dem); } } }</code><technical_language>ClassCastExeption !!! dem.getId: id of mapping here, base id of a class diagram pattern ! if this compile, casting a mapping a class diagram pattern, try launch action</technical_language>

Target:
private void createDeleteTool(ToolSection toolSection, DiagramElementMapping... mappings) { if (!globalDeleteTool) { DeleteElementDescription deleteElement = ToolFactory.eINSTANCE.createDeleteElementDescription(); deleteElement.setName(baseId + "global.delete"); deleteElement.setLabel("Delete Tool"); toolSection.getOwnedTools().add(deleteElement); for (DiagramElementMapping dem : mappings) { deleteElement.getMappings().add(dem); } } else { for (DiagramElementMapping dem : mappings) { DeleteElementDescription deleteElement = ToolFactory.eINSTANCE.createDeleteElementDescription(); deleteElement.setName(baseId + ".global.delete" + "." + baseId); deleteElement.setLabel("Delete Tool" + " " + dem.getLabel()); toolSection.getOwnedTools().add(deleteElement); deleteElement.getMappings().add(dem); } } }
Source:
<code>public static void setAliases(Map<String, String> aliases) { SimpleUnitFormat format = AbstractNetCDFUnitFormat.getNewInstance(); Unit bel = ONE.transform(new LogConverter(10)); format.alias(bel.divide(10), "dB"); for (Unit u : NonSI.getInstance().getUnits()) { if (u.getSymbol() != null && unknownSymbol(format, u.getSymbol())) { <START> System.out.println(u.getSymbol() + " -> " + u); <END> format.alias(u, u.getSymbol()); } } format.label(AbstractUnit.ONE, "unitless"); for (Map.Entry<String, String> entry : aliases.entrySet()) { try { format.alias(format.parse(entry.getValue()), entry.getKey()); } catch (ParserException ex) { throw new RuntimeException( "Failed to parse " + entry.getKey() + " -> " + entry.getValue(), ex); } } FORMAT = format; }</code><technical_language>System.out here... coming tests development</technical_language>

Target:
public static void setAliases(Map<String, String> aliases) { SimpleUnitFormat format = AbstractNetCDFUnitFormat.getNewInstance(); Unit bel = ONE.transform(new LogConverter(10)); format.alias(bel.divide(10), "dB"); for (Unit u : NonSI.getInstance().getUnits()) { if (u.getSymbol() != null && unknownSymbol(format, u.getSymbol())) { format.alias(u, u.getSymbol()); } } format.label(AbstractUnit.ONE, "unitless"); for (Map.Entry<String, String> entry : aliases.entrySet()) { try { format.alias(format.parse(entry.getValue()), entry.getKey()); } catch (ParserException ex) { LOGGER.log( Level.WARNING, "Failed to parse " + entry.getKey() + " -> " + entry.getValue() + ", skipped.", ex); } } FORMAT = format; }
Source:
<code>public void persistState(String checkpointId) { if (!isTopologyStateful) { throw new RuntimeException("Could not save a non-stateful topology's state"); } if (spout instanceof IStatefulComponent) { ((IStatefulComponent) spout).preSave(checkpointId); } else { <START> LOG.info("Trying to checkponit a non stateful component. Send empty state"); <END> } collector.sendOutState(instanceState, checkpointId); }</code><technical_language>Do need a LOG.info(..) here</technical_language>

Target:
public void persistState(String checkpointId) { LOG.info("Persisting state for checkpoint: " + checkpointId); if (!isTopologyStateful) { throw new RuntimeException("Could not save a non-stateful topology's state"); } if (spout instanceof IStatefulComponent) { ((IStatefulComponent) spout).preSave(checkpointId); } collector.sendOutState(instanceState, checkpointId); }
Source:
<code>public void build_createANewRadiologyOrderSearchCriteriaInstanceWithToEffectiveStartDateIfToEffectiveStartDateIsSet() throws Exception { DateFormat format = new SimpleDateFormat("yyyy-MM-dd"); Date toEffectiveStartDate = format.parse("2016-05-01"); radiologyOrderSearchCriteria = new RadiologyOrderSearchCriteria.Builder().withToEffectiveStartDate(toEffectiveStartDate) .build(); <START> assertTrue(radiologyOrderSearchCriteria.getToEffectiveStartDate() <END> .equals(toEffectiveStartDate)); assertNull(radiologyOrderSearchCriteria.getPatient()); assertFalse(radiologyOrderSearchCriteria.getIncludeVoided()); assertNull(radiologyOrderSearchCriteria.getUrgency()); assertNull(radiologyOrderSearchCriteria.getFromEffectiveStartDate()); }</code><technical_language>@bgeVam assertThat(,is())</technical_language>

Target:
public void build_createANewRadiologyOrderSearchCriteriaInstanceWithToEffectiveStartDateIfToEffectiveStartDateIsSet() throws Exception { DateFormat format = new SimpleDateFormat("yyyy-MM-dd"); Date toEffectiveStartDate = format.parse("2016-05-01"); radiologyOrderSearchCriteria = new RadiologyOrderSearchCriteria.Builder().withToEffectiveStartDate(toEffectiveStartDate) .build(); assertThat(radiologyOrderSearchCriteria.getToEffectiveStartDate(), is(toEffectiveStartDate)); assertNull(radiologyOrderSearchCriteria.getPatient()); assertFalse(radiologyOrderSearchCriteria.getIncludeVoided()); assertNull(radiologyOrderSearchCriteria.getUrgency()); assertNull(radiologyOrderSearchCriteria.getFromEffectiveStartDate()); }
Source:
<code>public String toString() { StringBuilder sb = new StringBuilder(getClass().getName()); <START> sb.append("={id='"); <END> sb.append(getId()); sb.append("', hostId='"); sb.append(getHostId()); sb.append("', order='"); sb.append(getOrder()); sb.append("', type='"); sb.append(getType()); sb.append("', ip='"); sb.append(getIp()); sb.append("', port='"); sb.append(getPort()); sb.append("', user='"); sb.append(getUser()); sb.append("', password='"); sb.append(getPassword() == null || getPassword().length() < 1 ? "" : "***"); sb.append("', encryptOptions='"); sb.append(getEncryptOptions()); sb.append("', options='"); sb.append(getOptions()); sb.append("'}"); return sb.toString(); }</code><technical_language>FYI, consider a ToStringBuilder of apache lang commons. catch I is password handling. a PasswordString class toString put "***" of a "toPasswordString" get "real content" needed? In general I suggest ToStringBuilder applicable. I understand if here, able it, this is common, well, in actual usage instead of toString() FenceAgent</technical_language>

Target:
public String toString() { return ToStringBuilder.forInstance(this) .append("id", getId()) .append("hostId", getHostId()) .append("order", getOrder()) .append("type", getType()) .append("ip", getIp()) .append("port", getPort()) .append("user", getUser()) .appendFiltered("password", getPassword()) .append("encryptOptions", getEncryptOptions()) .append("options", getOptions()) .build(); }
Source:
<code>@Test public void customSampler() throws Exception { String path = "/foo"; SamplerFunction<HttpRequest> sampler = (HttpRuleSampler.newBuilder() .putRule(pathStartsWith(path), Sampler.NEVER_SAMPLE) .build()); <START> httpTracing = httpTracing.toBuilder().serverSampler(sampler).build(); <END> init(); Request request = new Request.Builder().url(url(path)).build(); try (Response response = client.newCall(request).execute()) { assertThat(response.isSuccessful()).isTrue(); } }</code><technical_language>nit: extra parenthesis function</technical_language>

Target:
@Test public void customSampler() throws Exception { String path = "/foo"; SamplerFunction<HttpRequest> sampler = HttpRuleSampler.newBuilder() .putRule(pathStartsWith(path), Sampler.NEVER_SAMPLE) .build(); httpTracing = httpTracing.toBuilder().serverSampler(sampler).build(); init(); Request request = new Request.Builder().url(url(path)).build(); try (Response response = client.newCall(request).execute()) { assertThat(response.isSuccessful()).isTrue(); } }
Source:
<code>static SharedCache build(int L1capacity, long maxCacheSizeBytes) { checkArgument(L1capacity >= 0); checkArgument(maxCacheSizeBytes >= 0, "Cache size can't be < 0, 0 meaning no cache at all"); if (0L == maxCacheSizeBytes) { return NO_CACHE; } <START> <END> int initialCapacityCount = 1_000_000; int concurrencyLevel = 16; CacheBuilder<Object, Object> cacheBuilder = CacheBuilder.newBuilder(); cacheBuilder = cacheBuilder.maximumWeight(maxCacheSizeBytes); cacheBuilder.weigher(Impl.WEIGHER); cacheBuilder.initialCapacity(initialCapacityCount); cacheBuilder.concurrencyLevel(concurrencyLevel); cacheBuilder.recordStats(); Impl.SizeTracker sizeTracker = new Impl.SizeTracker(); cacheBuilder.removalListener(sizeTracker); Cache<Key, byte[]> byteCache = cacheBuilder.build(); return new Impl(L1capacity, byteCache, sizeTracker); }</code><technical_language>1-2 sentence dox, please. Please describe diff L1 L2 cache</technical_language>

Target:
static SharedCache build(int L1capacity, long maxCacheSizeBytes) { checkArgument(L1capacity >= 0); checkArgument(maxCacheSizeBytes >= 0, "Cache size can't be < 0, 0 meaning no cache at all"); if (0L == maxCacheSizeBytes) { return NO_CACHE; } int initialCapacityCount = 1_000_000; int concurrencyLevel = 16; CacheBuilder<Object, Object> cacheBuilder = CacheBuilder.newBuilder(); cacheBuilder = cacheBuilder.maximumWeight(maxCacheSizeBytes); cacheBuilder.weigher(Impl.SizeTracker.WEIGHER); cacheBuilder.initialCapacity(initialCapacityCount); cacheBuilder.concurrencyLevel(concurrencyLevel); cacheBuilder.recordStats(); Impl.SizeTracker sizeTracker = new Impl.SizeTracker(); cacheBuilder.removalListener(sizeTracker); Cache<Key, byte[]> byteCache = cacheBuilder.build(); return new Impl(L1capacity, byteCache, sizeTracker); }
Source:
<code>protected void executeCommand() { getParameters().setEntityInfo(new EntityInfo(VdcObjectType.VmTemplate, getVmTemplateId())); setSucceeded(true); if <START> (!images.isEmpty()) <END> { List<DiskImage> imageToRemove = new ArrayList<>(); for (DiskImage image : images) { if (image.getStorageIds().get(0).equals(getParameters().getStorageDomainId())) { image.setStorageIds(Collections.singletonList(getParameters().getStorageDomainId())); image.setStoragePoolId(getParameters().getStoragePoolId()); imageToRemove.add(image); } } RemoveAllVmImagesParameters removeAllVmImagesParameters = new RemoveAllVmImagesParameters(getVmId(), imageToRemove); removeAllVmImagesParameters.setParentCommand(getActionType()); removeAllVmImagesParameters.setEntityInfo(getParameters().getEntityInfo()); removeAllVmImagesParameters.setForceDelete(true); removeAllVmImagesParameters.setParentParameters(getParameters()); ActionReturnValue vdcRetValue = runInternalActionWithTasksContext(ActionType.RemoveAllVmImages, removeAllVmImagesParameters); if (vdcRetValue.getSucceeded()) { getReturnValue().getVdsmTaskIdList().addAll(vdcRetValue.getInternalVdsmTaskIdList()); } else { getReturnValue().setFault(vdcRetValue.getFault()); setSucceeded(false); } } vmAndTemplatesGenerationsDao.deleteOvfGenerations(Collections.singletonList(ovfEntityData.getEntityId())); unregisteredOVFDataDao.removeEntity(ovfEntityData.getEntityId(), null); unregisteredDisksDao.removeUnregisteredDiskRelatedToVM(ovfEntityData.getEntityId(), null); }</code><technical_language>initialize empty list, in some scenarios (i.e., "initUnregisteredTemplate()" failed) "images" null</technical_language>

Target:
protected void executeCommand() { getParameters().setEntityInfo(new EntityInfo(VdcObjectType.VmTemplate, getVmTemplateId())); setSucceeded(true); if (images != null && !images.isEmpty()) { List<DiskImage> imageToRemove = new ArrayList<>(); for (DiskImage image : images) { if (image.getStorageIds().get(0).equals(getParameters().getStorageDomainId())) { image.setStorageIds(Collections.singletonList(getParameters().getStorageDomainId())); image.setStoragePoolId(getParameters().getStoragePoolId()); imageToRemove.add(image); } } RemoveAllVmImagesParameters removeAllVmImagesParameters = new RemoveAllVmImagesParameters(getVmId(), imageToRemove); removeAllVmImagesParameters.setParentCommand(getActionType()); removeAllVmImagesParameters.setEntityInfo(getParameters().getEntityInfo()); removeAllVmImagesParameters.setForceDelete(true); removeAllVmImagesParameters.setParentParameters(getParameters()); ActionReturnValue vdcRetValue = runInternalActionWithTasksContext(ActionType.RemoveAllVmImages, removeAllVmImagesParameters); if (vdcRetValue.getSucceeded()) { getReturnValue().getVdsmTaskIdList().addAll(vdcRetValue.getInternalVdsmTaskIdList()); } else { getReturnValue().setFault(vdcRetValue.getFault()); setSucceeded(false); } } vmAndTemplatesGenerationsDao.deleteOvfGenerations(Collections.singletonList(ovfEntityData.getEntityId())); unregisteredOVFDataDao.removeEntity(ovfEntityData.getEntityId(), null); unregisteredDisksDao.removeUnregisteredDiskRelatedToVM(ovfEntityData.getEntityId(), null); }
Source:
<code>private List<Rule> getRules( FeatureCollection features, String property, Class<?> propertyType, int classNumber, boolean open, boolean normalize, String functionName) { try { final Function classify = <START> FF.function( <END> functionName, FF.property(property), FF.literal(classNumber), FF.literal(outputPercentages)); Classifier groups = (Classifier) classify.evaluate(features); if (groups instanceof RangedClassifier) if (open) return openRangedRules( (RangedClassifier) groups, property, propertyType, normalize); else return closedRangedRules( (RangedClassifier) groups, property, propertyType, normalize); else if (groups instanceof ExplicitClassifier) return this.explicitRules((ExplicitClassifier) groups, property, propertyType); } catch (Exception e) { if (LOGGER.isLoggable(Level.INFO)) LOGGER.log( Level.INFO, "Failed to build " + functionName + " Classification" + e.getLocalizedMessage(), e); } return null; }</code><technical_language>Problematic function optional values end (see GeoTools review)</technical_language>

Target:
private List<Rule> getRules( FeatureCollection features, String property, Class<?> propertyType, int classNumber, boolean open, boolean normalize, String functionName) { try { final Function classify; if (functionName.equals("EqualArea")) { classify = FF.function( functionName, FF.property(property), FF.literal(classNumber), FF.literal(""), FF.literal(outputPercentages)); } else { classify = FF.function( functionName, FF.property(property), FF.literal(classNumber), FF.literal(outputPercentages)); } Classifier groups = (Classifier) classify.evaluate(features); if (groups instanceof RangedClassifier) if (open) return openRangedRules( (RangedClassifier) groups, property, propertyType, normalize); else return closedRangedRules( (RangedClassifier) groups, property, propertyType, normalize); else if (groups instanceof ExplicitClassifier) return this.explicitRules((ExplicitClassifier) groups, property, propertyType); } catch (Exception e) { if (LOGGER.isLoggable(Level.INFO)) LOGGER.log( Level.INFO, "Failed to build " + functionName + " Classification" + e.getLocalizedMessage(), e); } return null; }
Source:
<code><START> public SetVdsStatusVDSCommandParameters() { <END> _status = VDSStatus.Unassigned; nonOperationalReason = NonOperationalReason.NONE; }</code><technical_language>in some of ctors assigment is for some not, remove please</technical_language>

Target:
public SetVdsStatusVDSCommandParameters() { _status = VDSStatus.Unassigned; nonOperationalReason = NonOperationalReason.NONE; stopSpmFailureLogged = false; }
Source:
<code>public static int size(JsonNode node) { int size = 0; if (node instanceof ArrayNode) { for (Iterator<JsonNode> elements = ((ArrayNode) node).elements(); elements.hasNext();) { size += size(elements.next()); } } else if (node instanceof ObjectNode) { for (Iterator<Map.Entry<String, JsonNode>> fields = ((ObjectNode) node).fields(); fields.hasNext();) { Map.Entry<String, JsonNode> field = fields.next(); size += field.getKey().length(); size += size(field.getValue()); } } else if (node instanceof NumericNode) { size += 4; } else { <START> size += node.asText().length(); <END> } return size; }</code><technical_language>No, null passed JsonUtils.size() in this context, this is place throw a NPE. Null a concern this copied from</technical_language>

Target:
public static int size(JsonNode node) { if (node == null) { return 0; } int size = 0; if (node instanceof ArrayNode) { for (Iterator<JsonNode> elements = ((ArrayNode) node).elements(); elements.hasNext();) { size += size(elements.next()); } } else if (node instanceof ObjectNode) { for (Iterator<Map.Entry<String, JsonNode>> fields = ((ObjectNode) node).fields(); fields.hasNext();) { Map.Entry<String, JsonNode> field = fields.next(); size += field.getKey().length(); size += size(field.getValue()); } } else if (node instanceof NumericNode) { size += 4; } else { size += node.asText().length(); } return size; }
Source:
<code>public List<ServerModule> getModules() { List<ServerModule> childModules = new ArrayList<ServerModule>(); List<TreeItem> childModuleTreeItems = this.treeItem.getItems(); <START> for (TreeItem item : childModuleTreeItems) { <END> childModules.add(new ServerModule(item, view)); } return childModules; }</code><technical_language>I getTreeItem defined access treeItem, implemented it. Instead of direct access</technical_language>

Target:
public List<ServerModule> getModules() { List<ServerModule> childModules = new ArrayList<ServerModule>(); List<TreeItem> childModuleTreeItems = getTreeItem().getItems(); for (TreeItem item : childModuleTreeItems) { childModules.add(new ServerModule(item, view)); } return childModules; }
Source:
<code><START> synchronized void setOps(final SelectionKey key, final int ops) { <END> if (currentThread() == this) { try { key.interestOps(key.interestOps() | ops); } catch (CancelledKeyException ignored) } else if (OLD_LOCKING) { final SynchTask task = new SynchTask(); queueTask(task); try { selector.wakeup(); key.interestOps(key.interestOps() | ops); } catch (CancelledKeyException ignored) { } finally { task.done(); } } else { try { key.interestOps(key.interestOps() | ops); if (polling) selector.wakeup(); } catch (CancelledKeyException ignored) { } } }</code><technical_language>synchronizing "this" here. data is protected this synchronization</technical_language>

Target:
void setOps(final SelectionKey key, final int ops) { if (currentThread() == this) { try { synchronized(key) { key.interestOps(key.interestOps() | ops); } } catch (CancelledKeyException ignored) } else if (OLD_LOCKING) { final SynchTask task = new SynchTask(); queueTask(task); try { selector.wakeup(); synchronized(key) { key.interestOps(key.interestOps() | ops); } } catch (CancelledKeyException ignored) { } finally { task.done(); } } else { try { synchronized(key) { key.interestOps(key.interestOps() | ops); } if (polling) selector.wakeup(); } catch (CancelledKeyException ignored) { } } }
Source:
<code>public void shouldLoadMultipleJavaModules_ToolchainsXML() throws IOException { OutputValidator validator = assumeJava9Property() .setForkJvm() .activateProfile( "use-toolchains" ) <START> .addGoal( "--toolchains" ) <END> .addGoal( System.getProperty( "maven.toolchains.file" ) ) .execute( "verify" ) .verifyErrorFree( 1 ); validator.verifyTextInLog( "loaded class java.sql.SQLException" ) .verifyTextInLog( "loaded class javax.xml.ws.Holder" ) .verifyTextInLog( "loaded class javax.transaction.TransactionManager" ) .verifyTextInLog( "loaded class javax.transaction.InvalidTransactionException" ) .verifyTextInLog( "loaded class javax.xml.bind.JAXBException" ) .verifyTextInLog( "java.specification.version=9" ); }</code><technical_language>changed 2 1? tests</technical_language>

Target:
public void shouldLoadMultipleJavaModules_ToolchainsXML() throws IOException { OutputValidator validator = assumeJava9Property() .setForkJvm() .activateProfile( "use-toolchains" ) .addGoal( "--toolchains" ) .addGoal( System.getProperty( "maven.toolchains.file" ) ) .execute( "verify" ) .verifyErrorFree( 1 ); validator.verifyTextInLog( "loaded class java.sql.SQLException" ) .verifyTextInLog( "loaded class javax.xml.ws.Holder" ) .verifyTextInLog( "loaded class javax.xml.bind.JAXBException" ) .verifyTextInLog( "loaded class javax.transaction.TransactionManager" ) .verifyTextInLog( "loaded class javax.transaction.InvalidTransactionException" ) .verifyTextInLog( "java.specification.version=9" ); }
Source:
<code>public MessageChannel getInputChannel() { <START> return this.inputChannel == null ? null : this.inputChannel; <END> }</code><technical_language>Overdid: if null, return null :smile: other side null. ctor: Assert.notNull(inputChannel, "inputChannel null");</technical_language>

Target:
public MessageChannel getInputChannel() { return this.inputChannel; }
Source:
<code>public void updateJobAndTasksStatuses(final InternalJob job, final Set<TaskId> taskIds, TaskStatus taskStatus) { <START> executeReadWriteTransaction(new SessionWork<Void>() { <END> @Override public Void doInTransaction(Session session) { updateTasksStatuses(taskIds, taskStatus, session); JobInfo jobInfo = job.getJobInfo(); session.getNamedQuery("updateJobAndTasksState") .setParameter("status", jobInfo.getStatus()) .setParameter("numberOfFailedTasks", jobInfo.getNumberOfFailedTasks()) .setParameter("numberOfFaultyTasks", jobInfo.getNumberOfFaultyTasks()) .setParameter("numberOfInErrorTasks", jobInfo.getNumberOfInErrorTasks()) .setParameter("inErrorTime", jobInfo.getInErrorTime()) .setParameter("lastUpdatedTime", new Date().getTime()) .setParameter("jobId", jobId(job)) .executeUpdate(); return null; } }); }</code><technical_language>a lambda here</technical_language>

Target:
public void updateJobAndTasksStatuses(final InternalJob job, final Set<TaskId> taskIds, TaskStatus taskStatus) { executeReadWriteTransaction((SessionWork<Void>) session -> { updateTasksStatuses(taskIds, taskStatus, session); JobInfo jobInfo = job.getJobInfo(); session.getNamedQuery("updateJobAndTasksState") .setParameter("status", jobInfo.getStatus()) .setParameter("numberOfFailedTasks", jobInfo.getNumberOfFailedTasks()) .setParameter("numberOfFaultyTasks", jobInfo.getNumberOfFaultyTasks()) .setParameter("numberOfInErrorTasks", jobInfo.getNumberOfInErrorTasks()) .setParameter("inErrorTime", jobInfo.getInErrorTime()) .setParameter("lastUpdatedTime", new Date().getTime()) .setParameter("jobId", jobId(job)) .executeUpdate(); return null; }); }
Source:
<code>private String getWeatherData(String url) { try { String httpResponse = HttpUtil.executeUrl("GET", url, 30 * 1000); logger.trace("http response: {}", httpResponse); return httpResponse; } catch (IOException e) { <START> logger.warn("I/O Exception occurred while retrieving weather data.", e); <END> return null; } }</code><technical_language>This is a fully expected situation, e.g. if do Internet access. this log a warn (just debug) set status OFFLINE-COMMUNICATION_ERROR</technical_language>

Target:
private String getWeatherData(String url) { try { String httpResponse = HttpUtil.executeUrl("GET", url, 30 * 1000); logger.trace("http response: {}", httpResponse); return httpResponse; } catch (IOException e) { logger.debug("I/O Exception occurred while retrieving weather data.", e); updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, "I/O Exception occurred while retrieving weather data."); return null; } }
Source:
<code>public void init() { get( "/events", (req, res) -> { try { res.type("text/event-stream; charset=UTF-8"); res.header("Connection", "keep-alive"); res.header("Cache-Control", "no-cache"); res.status(200); PrintWriter out = res.raw().getWriter(); synchronized (listeners) { listeners.add(out); } out.write(HEARTBEAT); out.flush(); while (true) { out.write(HEARTBEAT); if (out.checkError()) { break; } Thread.sleep(1000); } listeners.remove(out); <START> return "Event Source setup successful"; <END> } catch (Exception e) { LOGGER.error("Event Source configuration error"); } res.status(500); return "Event Source configuration error: Server error"; }); }</code><technical_language>is this message misleading</technical_language>

Target:
public void init() { get( "/events/:id", (req, res) -> { try { String sourceId = req.params(":id"); if (listeners.size() >= 5) { notifyListener(sourceId, new EventType("CLOSE")); res.status(429); return "Too many HTTP connections - cannot create new Event Source"; } res.type("text/event-stream; charset=UTF-8"); res.header("Connection", "keep-alive"); res.header("Cache-Control", "no-cache"); PrintWriter out = res.raw().getWriter(); res.status(200); listeners.put(sourceId, out); while (!out.checkError()) { out.write(HEARTBEAT); out.flush(); Thread.sleep(15000); } notifyListener(sourceId, new EventType("CLOSE")); listeners.remove(sourceId); return "Event Source connection closed"; } catch (Exception e) { LOGGER.error("Event Source configuration error"); } res.status(500); return "Event Source configuration error: Server error"; }); }
Source:
<code>private boolean isSlyList(TagNode node) { <START> return "data-sly-list".equals(node.getAttributes().iterator().next().getName()); <END> }</code><technical_language>checking attribute here. if attribute is place</technical_language>

Target:
private boolean isSlyList(TagNode node) { return node.getAttributes().stream() .anyMatch(attribute -> "data-sly-list".equals(attribute.getName())); }
Source:
<code>public void stop() { <START> for (Entry<CacheType,BlockCache> e : this.caches.entrySet()) { <END> ((LruBlockCache) e.getValue()).shutdown(); } super.stop(); }</code><technical_language>This code written following, map in superclass need visible. java for(CacheType ct : CacheType.values()) { //not if values() is correct enum method name ((LruBlockCache) getBlockCache(ct)).shutdown(); }</technical_language>

Target:
public void stop() { for (CacheType type : CacheType.values()) { LruBlockCache cache = ((LruBlockCache) this.getBlockCache(type)); if (null != cache) { cache.shutdown(); } } super.stop(); }
Source:
<code>public void newIssue() { logger.info("Navigating to New Issue page"); if (isBrowserActive()) { runBrowserOperation(() -> { if (!driver.getCurrentUrl().equals(GitHubURL.getPathForNewIssue())) { driver.get(GitHubURL.getPathForNewIssue()); } }); <START> } <END> else{ resetBrowser(); newIssue(); } }</code><technical_language>this format } else {</technical_language>

Target:
public void newIssue() { logger.info("Navigating to New Issue page"); runBrowserOperation(() -> { if (!driver.getCurrentUrl().equals(GitHubURL.getPathForNewIssue())) { driver.get(GitHubURL.getPathForNewIssue()); } }); }
Source:
<code><START> public void removeFromJobs(boolean isGlobal, ITmfTrace jobTrace) { <END> Map<ITmfTrace, Job> updateJobs = isGlobal ? fUpdateJobsGlobal : fUpdateJobsPartial; Job job = updateJobs.remove(jobTrace); if (job != null) { job.cancel(); } }</code><technical_language>package visible</technical_language>

Target:
void removeFromJobs(boolean isGlobal, ITmfTrace jobTrace) { Map<ITmfTrace, Job> updateJobs = isGlobal ? fUpdateJobsGlobal : fUpdateJobsPartial; Job job = updateJobs.remove(jobTrace); if (job != null) { job.cancel(); } }
Source:
<code>public void findAllTest() throws Exception { getClient().perform(get("/api/eperson/groups")) <START> .andExpect(status().isForbidden()); <END> String token = getAuthToken(admin.getEmail(), password); getClient(token).perform(get("/api/eperson/groups")) .andExpect(status().isOk()) .andExpect(content().contentType(contentType)) .andExpect(jsonPath("$._embedded.groups", hasSize(2))) .andExpect(jsonPath("$._embedded.groups", Matchers.containsInAnyOrder( GroupMatcher.matchGroupWithName("Administrator"), GroupMatcher.matchGroupWithName("Anonymous") ))) ; }</code><technical_language>isUnauthorized 403 client is authenticated</technical_language>

Target:
public void findAllTest() throws Exception { getClient().perform(get("/api/eperson/groups")) .andExpect(status().isUnauthorized()); String token = getAuthToken(admin.getEmail(), password); getClient(token).perform(get("/api/eperson/groups")) .andExpect(status().isOk()) .andExpect(content().contentType(contentType)) .andExpect(jsonPath("$._embedded.groups", hasSize(2))) .andExpect(jsonPath("$._embedded.groups", Matchers.containsInAnyOrder( GroupMatcher.matchGroupWithName("Administrator"), GroupMatcher.matchGroupWithName("Anonymous") ))) ; }
Source:
<code>private void reEncryptMasterKey(final SmartMeteringDeviceDto smartMeteringDevice) throws ProtocolAdapterException { <START> if (smartMeteringDevice.getMasterKey() == null || smartMeteringDevice.getMasterKey().length <= 0) { <END> return; } final byte[] reEncryptedMasterKey = this.securityKeyService.reEncryptKey(smartMeteringDevice.getMasterKey(), SecurityKeyType.E_METER_MASTER); smartMeteringDevice.setMasterKey(reEncryptedMasterKey); }</code><technical_language>array's length negative, check for length <= 0 odd. In this case, simpler do like: if (ArrayUtils.isEmpty(smartMeteringDevice.getMasterKey())) { ... } A similar remark other re-encrypt methods modified in this class</technical_language>

Target:
private void reEncryptMasterKey(final SmartMeteringDeviceDto smartMeteringDevice) throws ProtocolAdapterException { if (ArrayUtils.isEmpty(smartMeteringDevice.getMasterKey())) { return; } final byte[] reEncryptedMasterKey = this.securityKeyService.reEncryptKey(smartMeteringDevice.getMasterKey(), SecurityKeyType.E_METER_MASTER); smartMeteringDevice.setMasterKey(reEncryptedMasterKey); }
Source:
<code>boolean matchesUser(LDUser user) { JsonElement userValue = valueOf(user, attribute); if (userValue == null) { return false; } if (userValue.isJsonArray()) { JsonArray array = userValue.getAsJsonArray(); for (JsonElement jsonElement : array) { if (!jsonElement.isJsonPrimitive()) { logger.error("Invalid custom attribute value in user object: " + jsonElement); return false; } if (matchAny(jsonElement.getAsJsonPrimitive())) { return maybeNegate(true); } } return maybeNegate(false); } <START> if (userValue.isJsonPrimitive()) { <END> return maybeNegate(matchAny(userValue.getAsJsonPrimitive())); } logger.warn("Got unexpected user attribute type: " + userValue.getClass().getName() + " for user key: " + user.getKey() + " and attribute: " + attribute); return false; }</code><technical_language>Suggest making this else if control flow more obvious</technical_language>

Target:
boolean matchesUser(LDUser user) { JsonElement userValue = valueOf(user, attribute); if (userValue == null) { return false; } if (userValue.isJsonArray()) { JsonArray array = userValue.getAsJsonArray(); for (JsonElement jsonElement : array) { if (!jsonElement.isJsonPrimitive()) { logger.error("Invalid custom attribute value in user object: " + jsonElement); return false; } if (matchAny(jsonElement.getAsJsonPrimitive())) { return maybeNegate(true); } } return maybeNegate(false); } else if (userValue.isJsonPrimitive()) { return maybeNegate(matchAny(userValue.getAsJsonPrimitive())); } logger.warn("Got unexpected user attribute type: " + userValue.getClass().getName() + " for user key: " + user.getKey() + " and attribute: " + attribute); return false; }
Source:
<code>public ElasticsearchTableDescription( @JsonProperty("tableName") String tableName, @JsonProperty("schemaName") String schemaName, @JsonProperty("host") String host, @JsonProperty("port") int port, @JsonProperty("clusterName") String clusterName, @JsonProperty("index") String index, @JsonProperty("indexExactMatch") boolean indexExactMatch, @JsonProperty("type") String type, @JsonProperty("columns") Optional<List<ElasticsearchColumn>> columns) { checkArgument(!isNullOrEmpty(tableName), "tableName is null or is empty"); checkArgument(!isNullOrEmpty(host), "hostis null or is empty"); checkArgument(!isNullOrEmpty(clusterName), "clusterName is null or is empty"); checkArgument(!isNullOrEmpty(index), "index is null or is empty"); checkArgument(!isNullOrEmpty(type), "type is null or is empty"); this.tableName = tableName; this.schemaName = schemaName; this.host = host; this.port = port; this.clusterName = clusterName; this.index = index; this.indexExactMatch = indexExactMatch; this.type = type; <START> this.columns = requireNonNull(columns, "columns is null"); <END> }</code><technical_language>group checks move requireNonNull check do assignment here</technical_language>

Target:
public ElasticsearchTableDescription( @JsonProperty("tableName") String tableName, @JsonProperty("schemaName") String schemaName, @JsonProperty("host") String host, @JsonProperty("port") int port, @JsonProperty("clusterName") String clusterName, @JsonProperty("index") String index, @JsonProperty("indexExactMatch") boolean indexExactMatch, @JsonProperty("type") String type, @JsonProperty("columns") Optional<List<ElasticsearchColumn>> columns) { checkArgument(!isNullOrEmpty(tableName), "tableName is null or empty"); checkArgument(!isNullOrEmpty(host), "host is null or empty"); checkArgument(!isNullOrEmpty(clusterName), "clusterName is null or empty"); checkArgument(!isNullOrEmpty(index), "index is null or empty"); checkArgument(!isNullOrEmpty(type), "type is null or empty"); requireNonNull(columns, "columns is null"); this.tableName = tableName; this.schemaName = schemaName; this.host = host; this.port = port; this.clusterName = clusterName; this.index = index; this.indexExactMatch = indexExactMatch; this.type = type; this.columns = columns; }
Source:
<code>public String probeState() { List<String> repositoryNames = Framework.getService(RepositoryService.class).getRepositoryNames(); <START> List<String> probes = repositoryNames.stream().map(this::probeRepository).collect(Collectors.toList()); <END> if (probes.contains(MIGRATION_STATE_RELATION)) { return MIGRATION_STATE_RELATION; } else if (probes.contains(MIGRATION_STATE_PROPERTY)) { return MIGRATION_STATE_PROPERTY; } return MIGRATION_STATE_SECURED; }</code><technical_language>a Set contains</technical_language>

Target:
public String probeState() { List<String> repositoryNames = Framework.getService(RepositoryService.class).getRepositoryNames(); if (repositoryNames.stream().map(this::probeRepository).anyMatch(isEqual(MIGRATION_STATE_RELATION))) { return MIGRATION_STATE_RELATION; } return MIGRATION_STATE_PROPERTY; }