auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public long getRetainedSizeInBytes() { long size = getInitialRetainedSizeInBytes(); for (int i = 0; i < decodedBlocks.length; i++) { size += decodedBlocks[i].getRetainedSizeInBytes(); } for (int i = 0; i < partitionBuffer.length; i++) { <START> size += partitionBuffer[i].getRetainedSizeInBytes(); <END> } return size; }</code><technical_language>double counting. partitionBuffer[i].getInitialRetainedSizeInBytes() is included here. a single method, getRetainedSizeInBytes. is confusing error prone</technical_language>

Target:
public long getRetainedSizeInBytes() { long size = 0; for (int i = 0; i < partitionBuffers.length; i++) { size += partitionBuffers[i].getRetainedSizeInBytes(); } for (int i = 0; i < decodedBlocks.length; i++) { size += decodedBlocks[i] == null ? 0 : decodedBlocks[i].getRetainedSizeInBytes(); } return size; }
Source:
<code>public ImageDescriptor getImageDescriptor() { return <START> DebugUITools.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_DUPLICATE_CONFIG); <END> }</code><technical_language>This IMG_WIZBAN_EXPORT_CONFIGS duplicate export icons currently</technical_language>

Target:
public ImageDescriptor getImageDescriptor() { return DebugUITools.getImageDescriptor(IInternalDebugUIConstants.IMG_WIZBAN_IMPORT_CONFIGS); }
Source:
<code>private boolean signalIsForUs(ITmfTrace sender) { if (sender == sp.getTrace()) { return true; <START> } else if (sender instanceof TmfExperiment) { <END> TmfExperiment exp = (TmfExperiment) sender; for (ITmfTrace childTrace : exp.getTraces()) { if (childTrace == sp.getTrace()) { return true; } } } return false; }</code><technical_language>exist then, do TmfTraceManager.getTraceSet(trace), returns array of traces (so real traces for experiment, trace for a normal trace). useful here</technical_language>

Target:
private boolean signalIsForUs(ITmfTrace sender) { if (sender == sp.getTrace()) { return true; } else if (sender instanceof TmfExperiment) { for (ITmfTrace childtrace : TmfTraceManager.getTraceSet(sender)) { if (sp.getTrace() == childtrace) { return true; } } } return false; }
Source:
<code>public NettyAsyncHttpClient build() { HttpClient nettyHttpClient = HttpClient.create() .port(port) .wiretap(enableWiretap) .tcpConfiguration(tcpConfig -> { if (nioEventLoopGroup != null) { tcpConfig = tcpConfig.runOn(nioEventLoopGroup); } if (proxyOptions == null) { return tcpConfig; } ProxyProvider.Proxy nettyProxy; switch (proxyOptions.type()) { case HTTP: nettyProxy = ProxyProvider.Proxy.HTTP; break; case SOCKS4: nettyProxy = ProxyProvider.Proxy.SOCKS4; break; case SOCKS5: nettyProxy = ProxyProvider.Proxy.SOCKS5; break; default: throw logger.logExceptionAsWarning(new IllegalStateException("Unknown Proxy type '" + proxyOptions.type() + "' in use. Not configuring Netty proxy.")); } <START> return tcpConfig.proxy(ts -> ts.type(nettyProxy).address(proxyOptions.address())); <END> }); return new NettyAsyncHttpClient(nettyHttpClient); }</code><technical_language>this change</technical_language>

Target:
public NettyAsyncHttpClient build() { HttpClient nettyHttpClient = HttpClient.create() .port(port) .wiretap(enableWiretap) .tcpConfiguration(tcpConfig -> { if (nioEventLoopGroup != null) { tcpConfig = tcpConfig.runOn(nioEventLoopGroup); } if (proxyOptions != null) { ProxyProvider.Proxy nettyProxy; switch (proxyOptions.type()) { case HTTP: nettyProxy = ProxyProvider.Proxy.HTTP; break; case SOCKS4: nettyProxy = ProxyProvider.Proxy.SOCKS4; break; case SOCKS5: nettyProxy = ProxyProvider.Proxy.SOCKS5; break; default: throw logger.logExceptionAsWarning(new IllegalStateException("Unknown Proxy type '" + proxyOptions.type() + "' in use. Not configuring Netty proxy.")); } return tcpConfig.proxy(ts -> ts.type(nettyProxy).address(proxyOptions.address())); } return tcpConfig; }); return new NettyAsyncHttpClient(nettyHttpClient); }
Source:
<code>public PassiveScannerOptionsPanel(I18N messages) { setName(messages.getString("pscan.options.main.name")); setLayout(new GridBagLayout()); scanOnlyInScopeCheckBox = new JCheckBox(messages.getString("pscan.options.main.label.scanOnlyInScope")); scanFuzzerMessagesCheckBox = new JCheckBox(messages.getString("pscan.options.main.label.scanFuzzerMessages")); int row = 0; add(scanOnlyInScopeCheckBox, LayoutHelper.getGBC(0, row, 1, 0.0D, 0)); row++; <START> add(scanFuzzerMessagesCheckBox, LayoutHelper.getGBC(0, row, 1, 0.0D, 0)); <END> add(new JLabel(), LayoutHelper.getGBC(0, 10, 1, 0.5D, 1.0D)); }</code><technical_language>Replace a createParallelGroup (and add scanOnlyInScopeCheckBox scanFuzzerMessagesCheckBox). for vertical group a createSequentialGroup</technical_language>

Target:
public PassiveScannerOptionsPanel(I18N messages) { setName(messages.getString("pscan.options.main.name")); GroupLayout layout = new GroupLayout(this); setLayout(layout); layout.setAutoCreateGaps(true); layout.setAutoCreateContainerGaps(true); scanOnlyInScopeCheckBox = new JCheckBox(messages.getString("pscan.options.main.label.scanOnlyInScope")); scanFuzzerMessagesCheckBox = new JCheckBox(messages.getString("pscan.options.main.label.scanFuzzerMessages")); layout.setHorizontalGroup( layout.createParallelGroup() .addComponent(scanOnlyInScopeCheckBox) .addComponent(scanFuzzerMessagesCheckBox)); layout.setVerticalGroup( layout.createSequentialGroup() .addComponent(scanOnlyInScopeCheckBox) .addComponent(scanFuzzerMessagesCheckBox)); }
Source:
<code>void activate() { multimap.values() .forEach(EnrichmentFunction::activate); LinkedListMultimap<? extends Class<?>, ? extends EnrichmentFunction<?, ?, ?>> compacted = multimap.values() .stream() .filter(EnrichmentFunction::isActive) .collect(toMultimap(EnrichmentFunction::sourceClass, <START> e -> e, <END> LinkedListMultimap::create)); multimap = ImmutableMultimap.copyOf(compacted); }</code><technical_language>Function.identity() here</technical_language>

Target:
void activate() { multimap.values() .forEach(EnrichmentFunction::activate); LinkedListMultimap<? extends Class<?>, ? extends EnrichmentFunction<?, ?, ?>> compacted = multimap.values() .stream() .filter(EnrichmentFunction::isActive) .collect(toMultimap(EnrichmentFunction::sourceClass, Function.identity(), LinkedListMultimap::create)); multimap = ImmutableMultimap.copyOf(compacted); }
Source:
<code>public final ModelAndView display(String idString, ModelMap model) throws IOException { return prepare(model, create, verb + " " + qcTarget + " QCs", LimsUtils.parseIds(idString).stream() .flatMap(WhineyFunction.rethrow(this::load)) <START> .sorted(new Comparator<QcDto>() { <END> @Override public int compare(QcDto o1, QcDto o2) { return o1.getEntityAlias().compareTo(o2.getEntityAlias()); } }) .collect(Collectors.toList())); }</code><technical_language>do .sorted(Comparator.comparing(QcDto::getEntityAlias))</technical_language>

Target:
public final ModelAndView display(String idString, ModelMap model) throws IOException { return prepare(model, create, verb + " " + qcTarget + " QCs", LimsUtils.parseIds(idString).stream() .flatMap(WhineyFunction.rethrow(this::load)) .sorted(Comparator.comparing(QcDto::getEntityAlias)) .collect(Collectors.toList())); }
Source:
<code>public void testUnmarshallTopLevelEventWithEdgesEmptyProperties() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_CATCHING_INTERMEDIATE_EVENT_FILE_PATH); assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM); IntermediateSignalEventCatching emptyEvent = getCatchingIntermediateNodeById(diagram, EMPTY_WITH_OUTGOING_EDGE_TOP_LEVEL_EVENT_ID, HAS_NO_INCOME_EDGE, HAS_OUTGOING_EDGE); assertGeneralSet(emptyEvent.getGeneral(), EMPTY_VALUE, EMPTY_VALUE); <START> assertSignalEventExecutionSet(emptyEvent.getExecutionSet(), EMPTY_VALUE, NON_CANCELLING, ""); <END> assertDataIOSet(emptyEvent.getDataIOSet(), EMPTY_VALUE); }</code><technical_language>suggestion assertSignalEventExecutionSet(emptyEvent.getExecutionSet(), EMPTY_VALUE, NON_CANCELLING, EMPTY_VALUE);</technical_language>

Target:
public void testUnmarshallTopLevelEventWithEdgesEmptyProperties() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_CATCHING_INTERMEDIATE_EVENT_FILE_PATH); assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM); IntermediateSignalEventCatching emptyEvent = getCatchingIntermediateNodeById(diagram, EMPTY_WITH_OUTGOING_EDGE_TOP_LEVEL_EVENT_ID, HAS_NO_INCOME_EDGE, HAS_OUTGOING_EDGE); assertGeneralSet(emptyEvent.getGeneral(), EMPTY_VALUE, EMPTY_VALUE); assertSignalEventExecutionSet(emptyEvent.getExecutionSet(), EMPTY_VALUE, NON_CANCELLING, EMPTY_VALUE); assertDataIOSet(emptyEvent.getDataIOSet(), EMPTY_VALUE); }
Source:
<code>public static short getNetmaskShortForm(String netmask) throws KuraException { if (netmask == null) { <START> throw new KuraException(KuraErrorCode.INTERNAL_ERROR, "netmask is null"); <END> } int netmaskValue = NetworkUtil.convertIp4Address(netmask); boolean hitZero = false; int displayMask = 1 << 31; int count = 0; for (int c = 1; c <= 32; c++) { if ((netmaskValue & displayMask) == 0) { hitZero = true; } else { if (hitZero) { s_logger.error("received invalid mask: " + netmask); throw new KuraException(KuraErrorCode.INTERNAL_ERROR, "received invalid mask: " + netmask); } count++; } netmaskValue <<= 1; } return (short) count; }</code><technical_language>Needs KuraRuntimeException. exists utility class Preconditions performs necessary checks. reuse that</technical_language>

Target:
public static short getNetmaskShortForm(String netmask) { if (netmask == null) { throw new IllegalArgumentException("netmask is null"); } int netmaskValue = NetworkUtil.convertIp4Address(netmask); boolean hitZero = false; int displayMask = 1 << 31; int count = 0; for (int c = 1; c <= 32; c++) { if ((netmaskValue & displayMask) == 0) { hitZero = true; } else { if (hitZero) { s_logger.error("received invalid mask: " + netmask); throw new IllegalArgumentException("netmask is invalid: " + netmask); } count++; } netmaskValue <<= 1; } return (short) count; }
Source:
<code>public void processElement(ProcessContext context) { Variant variant = context.element(); CallSimilarityCalculator callSimilarityCalculator = callSimilarityCalculatorFactory.get(isReferenceMajor(variant)); FluentIterable<KV<Call, Call>> pairs = <START> PairGenerator.<Call, ImmutableList<Call>>allPairs(getSamplesWithVariant(variant), false, <END> new VariantUtils.CallComparator()); for (KV<Call, Call> pair : pairs) { accumulateCallSimilarity(callSimilarityCalculator, pair.getKey(), pair.getValue()); } }</code><technical_language>consider inlining pairs single reference site avoid explicitly mention FluentIterable type</technical_language>

Target:
public void processElement(ProcessContext context) { Variant variant = context.element(); CallSimilarityCalculator callSimilarityCalculator = callSimilarityCalculatorFactory.get(isReferenceMajor(variant)); for (KV<Call, Call> pair : PairGenerator.WITHOUT_REPLACEMENT.allPairs( getSamplesWithVariant(variant), VariantUtils.CALL_COMPARATOR)) { accumulateCallSimilarity(callSimilarityCalculator, pair.getKey(), pair.getValue()); } }
Source:
<code>public String findGPUHost() { List<Hosts> hosts = find(); for(Hosts host: hosts){ <START> if(host.getNumGpus() > 0){ <END> return host.getHostname(); } } return null; }</code><technical_language>Check if (host.getNumGpus() >0 && host.isAnacondaEnabled())</technical_language>

Target:
public String findGPUHost() { List<Hosts> hosts = find(); for(Hosts host: hosts){ if(host.getNumGpus() > 0 && host.getCondaEnabled()){ return host.getHostname(); } } return null; }
Source:
<code>public static void output(@AggregationState PrecisionRecallState state, BlockBuilder out) { Iterator<BucketResult> resultsIterator = getResultsIterator(state); BlockBuilder entryBuilder = out.beginBlockEntry(); while (resultsIterator.hasNext()) { <START> final BucketResult result = resultsIterator.next(); <END> DoubleType.DOUBLE.writeDouble( entryBuilder, result.falsePositive / result.negative); } out.closeEntry(); }</code><technical_language>Remove final</technical_language>

Target:
public static void output(@AggregationState PrecisionRecallState state, BlockBuilder out) { Iterator<BucketResult> resultsIterator = getResultsIterator(state); BlockBuilder entryBuilder = out.beginBlockEntry(); while (resultsIterator.hasNext()) { BucketResult result = resultsIterator.next(); DoubleType.DOUBLE.writeDouble( entryBuilder, result.getFalsePositive() / result.getNegative()); } out.closeEntry(); }
Source:
<code>public void testClearCache() throws IOException, ExecutionException, InterruptedException { this.warmCache(); HttpResponse response = httpClient().method("GET").path("/_filter_join/cache/stats").execute(); assertThat(response.getStatusCode(), equalTo(RestStatus.OK.getStatus())); <START> System.out.println(response); <END> Map<String, Object> map = XContentHelper.convertToMap(new BytesArray(response.getBody().getBytes("UTF-8")), false).v2(); Map nodes = (Map) map.get("nodes"); for (Object node : nodes.values()) { Map stats = (Map) ((Map) node).get("stats"); assertThat((Integer) stats.get("size"), equalTo(1)); } response = httpClient().method("GET").path("/_filter_join/cache/clear").execute(); assertThat(response.getStatusCode(), equalTo(RestStatus.OK.getStatus())); System.out.println(response); response = httpClient().method("GET").path("/_filter_join/cache/stats").execute(); assertThat(response.getStatusCode(), equalTo(RestStatus.OK.getStatus())); map = XContentHelper.convertToMap(new BytesArray(response.getBody().getBytes("UTF-8")), false).v2(); nodes = (Map) map.get("nodes"); for (Object node : nodes.values()) { Map stats = (Map) ((Map) node).get("stats"); assertThat((Integer) stats.get("size"), equalTo(0)); } }</code><technical_language>debug leftover</technical_language>

Target:
public void testClearCache() throws IOException, ExecutionException, InterruptedException { this.warmCache(); HttpResponse response = httpClient().method("GET").path("/_filter_join/cache/stats").execute(); assertThat(response.getStatusCode(), equalTo(RestStatus.OK.getStatus())); Map<String, Object> map = XContentHelper.convertToMap(new BytesArray(response.getBody().getBytes("UTF-8")), false).v2(); Map nodes = (Map) map.get("nodes"); for (Object node : nodes.values()) { Map stats = (Map) ((Map) node).get("stats"); assertThat((Integer) stats.get("size"), equalTo(1)); } response = httpClient().method("GET").path("/_filter_join/cache/clear").execute(); assertThat(response.getStatusCode(), equalTo(RestStatus.OK.getStatus())); response = httpClient().method("GET").path("/_filter_join/cache/stats").execute(); assertThat(response.getStatusCode(), equalTo(RestStatus.OK.getStatus())); map = XContentHelper.convertToMap(new BytesArray(response.getBody().getBytes("UTF-8")), false).v2(); nodes = (Map) map.get("nodes"); for (Object node : nodes.values()) { Map stats = (Map) ((Map) node).get("stats"); assertThat((Integer) stats.get("size"), equalTo(0)); } }
Source:
<code>protected boolean canDoAction() { if (!isVmExist() || !acquireLockInternal()) { return false; } if (getParameters().getDiskInfo().isShareable() && getStorageDomain().getStorageType() == StorageType.GLUSTERFS) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_SHAREABLE_DISKS_NOT_SUPPORTED_ON_GLUSTER_DOMAIN); <START> } <END> VM vm = getVm(); if (vm != null) { if (!canRunActionOnNonManagedVm()) { return false; } updateDisksFromDb(); if (!isDiskCanBeAddedToVm(getParameters().getDiskInfo(), vm) || !isDiskPassPciAndIdeLimit(getParameters().getDiskInfo())) { return false; } } if (DiskStorageType.IMAGE == getParameters().getDiskInfo().getDiskStorageType()) { return checkIfImageDiskCanBeAdded(vm); } if (DiskStorageType.LUN == getParameters().getDiskInfo().getDiskStorageType()) { return checkIfLunDiskCanBeAdded(); } return true; }</code><technical_language>This done checkIfImageDiskCanBeAdded(VM). If disk is a direct LUN, getStorageDomain().getStorageType() thrown NPE</technical_language>

Target:
protected boolean canDoAction() { if (!isVmExist() || !acquireLockInternal()) { return false; } VM vm = getVm(); if (vm != null) { if (!canRunActionOnNonManagedVm()) { return false; } updateDisksFromDb(); if (!isDiskCanBeAddedToVm(getParameters().getDiskInfo(), vm) || !isDiskPassPciAndIdeLimit(getParameters().getDiskInfo())) { return false; } } if (DiskStorageType.IMAGE == getParameters().getDiskInfo().getDiskStorageType()) { return checkIfImageDiskCanBeAdded(vm); } if (DiskStorageType.LUN == getParameters().getDiskInfo().getDiskStorageType()) { return checkIfLunDiskCanBeAdded(); } return true; }
Source:
<code>private void writeVersion(DefaultInputModule module, ScannerReport.Component.Builder builder) { String version = getVersion(module); if (version != null) { <START> checkArgument(version.length() <= 100, "The version name must not be longer then 100 characters"); <END> builder.setVersion(version); } }</code><technical_language>@bartfastiel try fail soon possible. I suggest do check in ProjectReactorValidator</technical_language>

Target:
private void writeVersion(DefaultInputModule module, ScannerReport.Component.Builder builder) { String version = getVersion(module); if (version != null) { builder.setVersion(version); } }
Source:
<code>public void validateSubscriptionChange(final Subscription old, final SubscriptionBase newValue) throws SubscriptionUpdateConflictException { if (!Objects.equals(newValue.getConsumerGroup(), old.getConsumerGroup())) { throw new SubscriptionUpdateConflictException("Not allowed to change subscription consumer group"); } if (!Objects.equals(newValue.getEventTypes(), old.getEventTypes())) { throw new SubscriptionUpdateConflictException("Not allowed to change subscription event types"); } if (!Objects.equals(newValue.getOwningApplication(), old.getOwningApplication())) { throw new SubscriptionUpdateConflictException("Not allowed to change owning application"); } if (!Objects.equals(newValue.getReadFrom(), old.getReadFrom())) { throw new SubscriptionUpdateConflictException("Not allowed to change read from"); } if (!Objects.equals(newValue.getInitialCursors(), old.getInitialCursors())) { throw new SubscriptionUpdateConflictException("Not allowed to change initial cursors"); } <START> authorizationValidator.validateAuthorization(old.asResource(), newValue.asBaseResource()); <END> }</code><technical_language>call newValue.asBaseResource() - create a resource a name. I fine create a resource a name for a subscription is created yet, in this user modifies subscription exists I id a resource name</technical_language>

Target:
public void validateSubscriptionChange(final Subscription old, final SubscriptionBase newValue) throws SubscriptionUpdateConflictException { if (!Objects.equals(newValue.getConsumerGroup(), old.getConsumerGroup())) { throw new SubscriptionUpdateConflictException("Not allowed to change subscription consumer group"); } if (!Objects.equals(newValue.getEventTypes(), old.getEventTypes())) { throw new SubscriptionUpdateConflictException("Not allowed to change subscription event types"); } if (!Objects.equals(newValue.getOwningApplication(), old.getOwningApplication())) { throw new SubscriptionUpdateConflictException("Not allowed to change owning application"); } if (!Objects.equals(newValue.getReadFrom(), old.getReadFrom())) { throw new SubscriptionUpdateConflictException("Not allowed to change read from"); } if (!Objects.equals(newValue.getInitialCursors(), old.getInitialCursors())) { throw new SubscriptionUpdateConflictException("Not allowed to change initial cursors"); } authorizationValidator.validateAuthorization(old.asResource(), newValue.asBaseResource(old.getId())); }
Source:
<code>public void onResume() { super.onResume(); <START> if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) { <END> titleEditText.post(new Runnable() { @Override public void run() { titleEditText.clearFocus(); } }); } }</code><technical_language>bad natural place put this blurb :( Kind of irks this repeated thrice I a fan of multiple base classes</technical_language>

Target:
public void onResume() { super.onResume(); if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) { SoftKeyboardUtil.clearViewFocus(titleEditText); } }
Source:
<code>private Predicate<Application> isLongWaitingApplications() { return application -> { LocalDate remindDate = application.getRemindDate(); if (remindDate == null) { Integer daysBeforeRemindForWaitingApplications = settingsService.getSettings().getAbsenceSettings().getDaysBeforeRemindForWaitingApplications(); LocalDate minDateForNotification = application.getApplicationDate() .plusDays(daysBeforeRemindForWaitingApplications); return minDateForNotification.isBefore(ZonedDateTime.now(UTC).toLocalDate()); } else { <START> return !remindDate.isEqual(ZonedDateTime.now(UTC).toLocalDate()); <END> } }; }</code><technical_language>Localdate.now(utc)</technical_language>

Target:
private Predicate<Application> isLongWaitingApplications() { return application -> { LocalDate remindDate = application.getRemindDate(); if (remindDate == null) { Integer daysBeforeRemindForWaitingApplications = settingsService.getSettings().getAbsenceSettings().getDaysBeforeRemindForWaitingApplications(); LocalDate minDateForNotification = application.getApplicationDate() .plusDays(daysBeforeRemindForWaitingApplications); return minDateForNotification.isBefore(LocalDate.now(UTC)); } else { return !remindDate.isEqual(LocalDate.now(UTC)); } }; }
Source:
<code>void testMapPasswordBase64EncodedTrue() { CustomLdapUserDetailsMapper userDetailsMapper = new CustomLdapUserDetailsMapper(); userDetailsMapper.setBase64EncodedPassword(true); <START> String encodedPassword = userDetailsMapper.mapPassword("{MD5}X03MO1qnZdYdgyfeuILPmQ=="); assertThat(encodedPassword).isEqualTo("{MD5}5f4dcc3b5aa765d61d8327deb882cf99"); encodedPassword = userDetailsMapper.mapPassword("e2JjcnlwdH0kMmEkMTAkbHB3bHh5anZYS3pOMWNjQ3J3MlBCdVp4LmVWZXNXYmZtVGJzckNib01VLmdzTldWY1pXTWk="); assertThat(encodedPassword).isEqualTo("{bcrypt}$2a$10$lpwlxyjvXKzN1ccCrw2PBuZx.eVesWbfmTbsrCboMU.gsNWVcZWMi"); <END> }</code><technical_language>suggestion String encodedPassword = userDetailsMapper.mapPassword("{MD5}X03MO1qnZdYdgyfeuILPmQ=="); assertThat(encodedPassword).isEqualTo("{MD5}5f4dcc3b5aa765d61d8327deb882cf99"); encodedPassword = userDetailsMapper.mapPassword("e2JjcnlwdH0kMmEkMTAkbHB3bHh5anZYS3pOMWNjQ3J3MlBCdVp4LmVWZXNXYmZtVGJzckNib01VLmdzTldWY1pXTWk="); assertThat(encodedPassword).isEqualTo("{bcrypt}$2a$10$lpwlxyjvXKzN1ccCrw2PBuZx.eVesWbfmTbsrCboMU.gsNWVcZWMi");</technical_language>

Target:
public void testMapPasswordBase64EncodedTrue() { CustomLdapUserDetailsMapper userDetailsMapper = new CustomLdapUserDetailsMapper(); userDetailsMapper.setUserPasswordEncoded(true); String encodedPassword = userDetailsMapper.mapPassword("{MD5}X03MO1qnZdYdgyfeuILPmQ=="); assertThat(encodedPassword).isEqualTo("{MD5}5f4dcc3b5aa765d61d8327deb882cf99"); encodedPassword = userDetailsMapper.mapPassword("e2JjcnlwdH0kMmEkMTAkbHB3bHh5anZYS3pOMWNjQ3J3MlBCdVp4LmVWZXNXYmZtVGJzckNib01VLmdzTldWY1pXTWk="); assertThat(encodedPassword).isEqualTo("{bcrypt}$2a$10$lpwlxyjvXKzN1ccCrw2PBuZx.eVesWbfmTbsrCboMU.gsNWVcZWMi"); }
Source:
<code>public boolean getNextBatch(ResultWriter writer, int batchSize) { try { response = searchBuilder .setSize(batchSize) .setFrom(pos) .execute() .actionGet(); } catch (Exception e) { <START> e.printStackTrace(); <END> return false; } SearchHits hits = response.getHits(); SearchHit[] res = hits.hits(); int amount = Math.min(batchSize, res.length); for (int i = 0; i < amount; i++) { SearchHit hit = hits.getAt(i); writer.add(new NodeKey(hit.getId()), hit.getScore()); } pos += amount; return pos < hits.getTotalHits(); }</code><technical_language>Is handle this exception? logged printed</technical_language>

Target:
public boolean getNextBatch(ResultWriter writer, int batchSize) { query.put("from", pos); query.put("size", batchSize); try { EsResponse res = client.search(index, type, query); Document hits = (Document) res.get("hits"); totalHits = hits.getInteger("total"); List items = hits.getArray("hits"); for (Object doc : items) { Document hit = (Document) doc; String nodeKey = hit.getString("_id"); float score = (hit.getDouble("_score").floatValue()); writer.add(new NodeKey(nodeKey), score); pos++; } return pos < totalHits; } catch (IOException e) { return false; } }
Source:
<code>public Collection<Object> get() { <START> return emptyList(); <END> }</code><technical_language>Nitpicking: more compact a constructor KeysSupplier(Collection<Object>, boolean)</technical_language>

Target:
public Collection<Object> get() { return keys; }
Source:
<code>protected void addToQueue(Exchange exchange, boolean copy) throws SedaConsumerNotAvailableException { BlockingQueue<Exchange> queue = null; QueueReference queueReference = endpoint.getQueueReference(); if (queueReference != null) { queue = queueReference.getQueue(); } if (queue == null) { throw new SedaConsumerNotAvailableException("No queue available on endpoint: " + endpoint, exchange); } boolean empty = !queueReference.hasConsumers(); if (empty) { if (endpoint.isFailIfNoConsumers()) { throw new SedaConsumerNotAvailableException("No consumers available on endpoint: " + endpoint, exchange); } else if (endpoint.isDiscardIfNoConsumers()) { log.debug("Discard message as no active consumers on endpoint: {}", endpoint); return; } } Exchange target = exchange; if (copy) { target = prepareCopy(exchange, true); } log.trace("Adding Exchange to queue: {}", target); if (blockWhenFull && offerTimeout == 0) { try { queue.put(target); } catch (InterruptedException e) { log.debug("Put interrupted, are we stopping? {}", isStopping() || isStopped()); } } else if(blockWhenFull && offerTimeout > 0) { try { <START> queue.offer(target, offerTimeout, TimeUnit.MILLISECONDS); <END> } catch (InterruptedException e) { log.debug("offer interrupted, are we stopping? {}", isStopping() || isStopped()); } } else { queue.add(target); } }</code><technical_language>I would've expected result of this call checked. "false" throw IllegalStateException. is for caller if message successfully added</technical_language>

Target:
protected void addToQueue(Exchange exchange, boolean copy) throws SedaConsumerNotAvailableException { boolean offerTime; BlockingQueue<Exchange> queue = null; QueueReference queueReference = endpoint.getQueueReference(); if (queueReference != null) { queue = queueReference.getQueue(); } if (queue == null) { throw new SedaConsumerNotAvailableException("No queue available on endpoint: " + endpoint, exchange); } boolean empty = !queueReference.hasConsumers(); if (empty) { if (endpoint.isFailIfNoConsumers()) { throw new SedaConsumerNotAvailableException("No consumers available on endpoint: " + endpoint, exchange); } else if (endpoint.isDiscardIfNoConsumers()) { log.debug("Discard message as no active consumers on endpoint: {}", endpoint); return; } } Exchange target = exchange; if (copy) { target = prepareCopy(exchange, true); } log.trace("Adding Exchange to queue: {}", target); if (blockWhenFull && offerTimeout == 0) { try { queue.put(target); } catch (InterruptedException e) { log.debug("Put interrupted, are we stopping? {}", isStopping() || isStopped()); } } else if (blockWhenFull && offerTimeout > 0) { try { offerTime = queue.offer(target, offerTimeout, TimeUnit.MILLISECONDS); if (!offerTime) { throw new IllegalStateException("Fails to insert element into queue, " + "after timeout of" + offerTimeout + "milliseconds"); } } catch (InterruptedException e) { log.debug("Offer interrupted, are we stopping? {}", isStopping() || isStopped()); } } else { queue.add(target); } }
Source:
<code>static <K, V> java.util.Map<K, Collection<V>> toJavaMap(Multimap<K, V> multimap) { final java.util.Map<K, Collection<V>> javaMap = new java.util.HashMap<>(); final Supplier<Collection<V>> javaContainerSupplier; <START> final ContainerType containerType = multimap.getContainerType(); <END> if (containerType == ContainerType.SEQ) { javaContainerSupplier = java.util.ArrayList::new; } else if (containerType == ContainerType.SET) { javaContainerSupplier = java.util.HashSet::new; } else if (containerType == ContainerType.SORTED_SET) { javaContainerSupplier = java.util.TreeSet::new; } else { throw new IllegalStateException("Unknown ContainerType: " + containerType); } for (Tuple2<K, V> t : multimap) { javaMap.computeIfAbsent(t._1, k -> javaContainerSupplier.get()).add(t._2); } return javaMap; }</code><technical_language>change this switch instead, ContainerType is enum extract separate method, get rid of break statements, e.g.: java @Override public java.util.Map<K, Collection<V>> toJavaMap() { final java.util.Map<K, Collection<V>> javaMap = new java.util.HashMap<>(); final Supplier<Collection<V>> supplier = getJavaContainerSupplier(); for (Tuple2<K, V> t : this) { javaMap.computeIfAbsent(t._1, -> supplier.get()).add(t._2); } return javaMap; } private Supplier<Collection<V>> getJavaContainerSupplier() { switch (containerType) { case SEQ: return java.util.ArrayList::new; case SET: return java.util.HashSet::new; case SORTED_SET: return java.util.TreeSet::new; default: throw new IllegalStateException("Unknown ContainerType: " + containerType); } } edit, better, enum extended a supplier parameter</technical_language>

Target:
static <K, V> java.util.Map<K, Collection<V>> toJavaMap(Multimap<K, V> multimap) { final java.util.Map<K, Collection<V>> javaMap = new java.util.HashMap<>(); final Supplier<Collection<V>> javaContainerSupplier = multimap.getContainerType().getJavaContainerSupplier(); for (Tuple2<K, V> t : multimap) { javaMap.computeIfAbsent(t._1, k -> javaContainerSupplier.get()).add(t._2); } return javaMap; }
Source:
<code>private void initGlusterPeerProcess() { List<VDS> vdsList = getVdsDAO().getAllForVdsGroupWithStatus(getVdsGroupId(), VDSStatus.Up); if (vdsList != null && vdsList.size() > 1) { VDS upServer = null; for (VDS vds : vdsList) { if (!Guid.OpEquality(getVdsId(), vds.getId()) <START> && vds.getstatus() == VDSStatus.Up) { <END> upServer = vds; break; } } if (upServer != null) { if (!hostExists(getGlusterPeers(upServer.getId()), getVds())) { String newServerName = getVds().gethost_name().isEmpty() ? getVds().getManagmentIp() : getVds().gethost_name(); glusterPeerProbe(upServer.getId(), newServerName); } } } }</code><technical_language>vdsList contains servers, is need check status here</technical_language>

Target:
private void initGlusterPeerProcess() { List<VDS> vdsList = getVdsDAO().getAllForVdsGroupWithStatus(getVdsGroupId(), VDSStatus.Up); if (vdsList != null && vdsList.size() > 1) { VDS upServer = null; for (VDS vds : vdsList) { if (!Guid.OpEquality(getVdsId(), vds.getId())) { upServer = vds; break; } } if (upServer != null) { if (!hostExists(getGlusterPeers(upServer.getId()), getVds())) { try { glusterPeerProbe(upServer.getId(), getVds().gethost_name()); } catch (Exception e) { log.errorFormat("Could not peer probe the gluster server {0}. Error: {1}", getVds().getvds_name(), e.getMessage()); } } } } }
Source:
<code>private String transform(String word) { int wordLength = word.length(); if (wordLength < transformations.minLen) { return word; } for (int i = Math.min(wordLength, 9); i >= <START> 3; i--) <END> { String wordEnding = word.substring(wordLength - i); if (transformations.map.containsKey(wordEnding)) { return word.replace(wordEnding, transformations.map.get(wordEnding)); } } return word; }</code><technical_language>transformations.minLen I</technical_language>

Target:
private String transform(String word) { int wordLength = word.length(); if (wordLength < transformations.minLen) { return word; } for (int i = Math.min(wordLength, transformations.maxLen); i >= transformations.minLen; i--) { String wordEnding = word.substring(wordLength - i); String replacement = transformations.map.get(wordEnding); if (replacement != null) { return word.replace(wordEnding, replacement); } } return word; }
Source:
<code>private void parametersPrecondition(String title, String url) { if ((invalidParam(title)) || invalidParam(url)) { <START> throw new RuntimeException("Invalid arguments: need URL and TITLE"); <END> } }</code><technical_language>I throw InvalidArgumetException</technical_language>

Target:
private void parametersPrecondition(String title, String url) { if ((invalidParam(title)) || invalidParam(url)) { throw new IllegalArgumentException("Invalid arguments: need URL and TITLE"); } }
Source:
<code>private void pausePartitions() { Validate.isTrue(_consumer != null); LOG.info("List of partitions to pause changed for datastream: {}. The list is: {}", _datastream.getName(), _pausedSourcePartitions); Set<TopicPartition> partitionsToPause = new HashSet<>(); Set<TopicPartition> pausedPartitions = _consumer.paused(); Set<TopicPartition> assignedPartitions = _consumer.assignment(); for (String source : _pausedSourcePartitions.keySet()) { <START> for (String partition : _pausedSourcePartitions.get(source)) { <END> partitionsToPause.add(new TopicPartition(source, Integer.parseInt(partition))); } } partitionsToPause.retainAll(assignedPartitions); _consumer.resume(pausedPartitions); LOG.info("Resumed these partitions: {}", pausedPartitions); _consumer.pause(partitionsToPause); LOG.info("Paused these partitions: {}", partitionsToPause); _pausedPartitionsUpdatedCount++; }</code><technical_language>I this is needed simplified further: simplified further? for source topic: - resume assigned partitions - pause partitions in hash map</technical_language>

Target:
private void pausePartitions() { _pausedPartitionsUpdatedCount++; Validate.isTrue(_consumer != null); LOG.info("List of partitions to pause changed for datastream: {}. The list is: {}", _datastream.getName(), _pausedSourcePartitions); Set<TopicPartition> partitionsToPause = new HashSet<>(); Set<TopicPartition> pausedPartitions = _consumer.paused(); Set<TopicPartition> assignedPartitions = _consumer.assignment(); for (String source : _pausedSourcePartitions.keySet()) { for (String partition : _pausedSourcePartitions.get(source)) { partitionsToPause.add(new TopicPartition(source, Integer.parseInt(partition))); } } partitionsToPause.retainAll(assignedPartitions); if (partitionsToPause.equals(pausedPartitions)) { return; } _consumer.resume(pausedPartitions); LOG.info("Resumed these partitions: {}", pausedPartitions); _consumer.pause(partitionsToPause); LOG.info("Paused these partitions: {}", partitionsToPause); }
Source:
<code>private boolean shouldBeApplied(Connection connection, Collection<Map.Entry<Address, List<Integer>>> partitions, int partitionStateVersion, boolean partitionStateVersionExist, PartitionTable current) { if (partitions.isEmpty()) { if (logger.isFinestEnabled()) { logFailure(connection, partitionStateVersion, partitionStateVersionExist, current, "response is empty"); } return false; } <START> if (!current.connection.equals(connection)) { <END> if (logger.isFinestEnabled()) { logFailure(connection, partitionStateVersion, partitionStateVersionExist, current, "response is from old connection"); } return false; } if (partitionStateVersionExist && partitionStateVersion <= current.partitionSateVersion) { if (logger.isFinestEnabled()) { logFailure(connection, partitionStateVersion, partitionStateVersionExist, current, "response state version is old"); } return false; } return true; }</code><technical_language>if current.connection is null? is possible</technical_language>

Target:
private boolean shouldBeApplied(Connection connection, Collection<Map.Entry<Address, List<Integer>>> partitions, int partitionStateVersion, boolean partitionStateVersionExist, PartitionTable current) { if (partitions.isEmpty()) { if (logger.isFinestEnabled()) { logFailure(connection, partitionStateVersion, partitionStateVersionExist, current, "response is empty"); } return false; } if (!connection.equals(current.connection)) { if (logger.isFinestEnabled()) { logFailure(connection, partitionStateVersion, partitionStateVersionExist, current, "response is from old connection"); } return false; } if (partitionStateVersionExist && partitionStateVersion <= current.partitionSateVersion) { if (logger.isFinestEnabled()) { logFailure(connection, partitionStateVersion, partitionStateVersionExist, current, "response state version is old"); } return false; } return true; }
Source:
<code>public void tearDown(ITestDevice device, IBuildInfo buildInfo, Throwable e) throws DeviceNotAvailableException { if (e instanceof DeviceNotAvailableException) { CLog.e("Device %s is not available. Teardown() skipped.", device.getSerialNumber()); return; } else { for (String apkPkgName : mApkInstalled) { super.uninstallPackage(device, apkPkgName); } if (!mTestApexInfoList.isEmpty()) { <START> device.deleteFile(APEX_DATA_DIR + "*"); device.deleteFile(STAGING_DATA_DIR + "*"); device.deleteFile(SESSION_DATA_DIR + "*"); device.reboot(); <END> } } }</code><technical_language>This similar cleanUpStagedAndActiveSession method is a reason paths</technical_language>

Target:
public void tearDown(ITestDevice device, IBuildInfo buildInfo, Throwable e) throws DeviceNotAvailableException { if (e instanceof DeviceNotAvailableException) { CLog.e("Device %s is not available. Teardown() skipped.", device.getSerialNumber()); return; } else { if (mTestApexInfoList.isEmpty()) { super.tearDown(device, buildInfo, e); } else { for (String apkPkgName : mApkInstalled) { super.uninstallPackage(device, apkPkgName); } if (!mTestApexInfoList.isEmpty()) { device.deleteFile(APEX_DATA_DIR + "*"); device.deleteFile(STAGING_DATA_DIR + "*"); device.deleteFile(SESSION_DATA_DIR + "*"); device.reboot(); } } } }
Source:
<code>public void setMetadataAccessRestrictionEnabled() { String metadataRestriction = SIDriver.driver().getConfiguration().getMetadataRestrictionEnabled(); metadataAccessRestrictionEnabled = metadataRestriction.equals(SQLConfiguration.METADATA_RESTRICTION_NATIVE) || metadataRestriction.equals(SQLConfiguration.METADATA_RESTRICTION_RANGER); <START> SpliceLogUtils.trace(LOG,"metadataAccessRestritionEnabled=%b",metadataAccessRestrictionEnabled); <END> }</code><technical_language>change SpliceLogUtils.trace() SpliceLogUtils.info(), this way, boot time default logging option. print metadataRestriction directly? Thanks</technical_language>

Target:
public void setMetadataAccessRestrictionEnabled() { String metadataRestriction = SIDriver.driver().getConfiguration().getMetadataRestrictionEnabled(); metadataAccessRestrictionEnabled = metadataRestriction.equals(SQLConfiguration.METADATA_RESTRICTION_NATIVE) || metadataRestriction.equals(SQLConfiguration.METADATA_RESTRICTION_RANGER); SpliceLogUtils.info(LOG,"metadataAccessRestritionEnabled=%s",metadataRestriction); }
Source:
<code>public void init() throws Exception { setupUserData(); apiPublisher = new APIPublisherRestClient(publisherURL); apiPublisher.login(SUPER_USER, SUPER_USER_LOGIN_PW); apiPublisherAdmin = new APIPublisherRestClient(publisherURL); apiPublisherAdmin.login(ADMIN_LOGIN_USERNAME, ADMIN_LOGIN_PW); String swaggerFilePath = resourceLocation + "swaggerFiles" + File.separator + "APIScopeTest1.json"; File swaggerFile = new File(swaggerFilePath); String swaggerContent = readFromFile(swaggerFile.getAbsolutePath()); JSONObject swaggerJson = new JSONObject(swaggerContent); String apiContext = swaggerJson.get("basePath").toString(); APIRequest apiRequest = new APIRequest(apiName, apiContext, apiVisibility, apiVersion, "", "Gold", new URL(backendEndPoint)); HttpResponse serviceResponse = apiPublisher.addAPI(apiRequest); verifyResponse(serviceResponse); APILifeCycleStateRequest updateRequest = new APILifeCycleStateRequest(apiName, SUPER_USER, APILifeCycleState.PUBLISHED); serviceResponse = apiPublisher.changeAPILifeCycleStatus(updateRequest); verifyResponse(serviceResponse); <START> <END> }</code><technical_language>publishing API need wait for deployment</technical_language>

Target:
public void init() throws Exception { setupUserData(); apiPublisher = new APIPublisherRestClient(publisherURL); apiPublisher.login(SUPER_USER, SUPER_USER_LOGIN_PW); apiPublisherAdmin = new APIPublisherRestClient(publisherURL); apiPublisherAdmin.login(ADMIN_LOGIN_USERNAME, ADMIN_LOGIN_PW); String swaggerFilePath = resourceLocation + "swaggerFiles" + File.separator + "APIScopeTest1.json"; File swaggerFile = new File(swaggerFilePath); String swaggerContent = readFromFile(swaggerFile.getAbsolutePath()); JSONObject swaggerJson = new JSONObject(swaggerContent); String apiContext = swaggerJson.get("basePath").toString(); APIRequest apiRequest = new APIRequest(apiName, apiContext, apiVisibility, apiVersion, "", "Gold", new URL(backendEndPoint)); HttpResponse serviceResponse = apiPublisher.addAPI(apiRequest); verifyResponse(serviceResponse); APILifeCycleStateRequest updateRequest = new APILifeCycleStateRequest(apiName, SUPER_USER, APILifeCycleState.PUBLISHED); serviceResponse = apiPublisher.changeAPILifeCycleStatus(updateRequest); verifyResponse(serviceResponse); waitForAPIDeploymentSync(SUPER_USER, apiName, apiVersion, APIMIntegrationConstants.IS_API_EXISTS); }
Source:
<code>protected void onGetStyles(View element, StyleAccumulator styles) { for (Method method : getViewGetters()) { boolean caught = false; try { @Nullable ViewDebug.ExportedProperty annotation = getExportedAnnotation(method); final Object returnedValue = method.invoke(element); final String cssName = convertGetterNameToCssName(method.getName()); if (method.getName().equals("getId")) { @Nullable String id = getIdAttribute(element); if (id == null) { styles.store("id", "(none)", false); } else { styles.store("id", id, false); } } else { if (method.getReturnType() == int.class) { int intValue = (int) returnedValue; if (canIntBeMappedToString(annotation)) { styles.store( cssName, intValue + "(" + mapIntToStringUsingAnnotations(intValue, annotation) + ")", false); } else { styles.store(cssName, String.valueOf(intValue), isDefaultValue(intValue, annotation)); } } else if (method.getReturnType() == float.class) { float floatValue = (float) returnedValue; styles.store(cssName, String.valueOf(floatValue), isDefaultValue(floatValue, annotation)); } } } catch (IllegalAccessException e) { caught = true; } catch (InvocationTargetException e) { caught = true; } finally { if (caught) { <START> LogUtil.w("(THIS SHOULD NOT HAPPEN) failed to get the style of element id=" + <END> getIdAttribute(element)); } } } }</code><technical_language>spewing out THIS HAPPEN ... if case LogUtil.e :)</technical_language>

Target:
protected void onGetStyles(View element, StyleAccumulator styles) { List<ViewCSSProperty> properties = getViewProperties(); for (int i = 0, size = properties.size(); i < size; i++) { ViewCSSProperty property = properties.get(i); try { getStyleFromValue( element, property.getCSSName(), property.getValue(element), property.getAnnotation(), styles); } catch (IllegalAccessException | InvocationTargetException e) { LogUtil.e(e, "failed to get style property " + property.getCSSName() + " of element= " + element.toString()); } } }
Source:
<code>private static void fixProperty(FixReport entity, BasicSchema schema, InfoDictionary info, String metaValue, String infoValue, String attribute) { String key = attributes.get(attribute); if (metaValue == null && infoValue != null) { doSaveAction(schema, attribute, infoValue); <START> entity.addFix("Add '" + key + "' to metadata from info dictionary"); <END> } else if (metaValue != null && infoValue != null && !metaValue.equals(infoValue)) { doSaveAction(info, attribute, metaValue); entity.addFix("Add '" + attribute + "' to info dictionary from metadata"); } }</code><technical_language>added</technical_language>

Target:
private static void fixProperty(FixReport entity, BasicSchema schema, InfoDictionary info, String metaValue, String infoValue, String attribute) { String key = attributes.get(attribute); if (metaValue == null && infoValue != null) { doSaveAction(schema, attribute, infoValue); entity.addFix("Added '" + key + "' to metadata from info dictionary"); } else if (metaValue != null && infoValue != null && !metaValue.equals(infoValue)) { doSaveAction(info, attribute, metaValue); entity.addFix("Added '" + attribute + "' to info dictionary from metadata"); } }
Source:
<code><START> private void cleanUp() { <END> mDOMProvider.postAndWait(new Runnable() { @Override public void run() { mDOMProvider.setListener(null); mShadowDOM = null; mObjectIdMapper.clear(); mDOMProvider.dispose(); } }); mDOMProvider = null; }</code><technical_language>move this lifecycle method addref/release grouped</technical_language>

Target:
private void cleanUp() { mDocumentProvider.postAndWait(new Runnable() { @Override public void run() { mDocumentProvider.setListener(null); mShadowDocument = null; mObjectIdMapper.clear(); mDocumentProvider.dispose(); mDocumentProvider = null; } }); mUpdateListeners.clear(); }
Source:
<code>public void setColor(String newColor) throws IOException { <START> repo.root.retrieve().method("PATCH") <END> .with("name", name) .with("color", newColor) .with("description", description) .to(url); }</code><technical_language>This (and similarly setDescription()) needs update field this, local GHLabel immediately falls out of sync upstream one. a pre-existing bug, exacerbated adding another mutable field, possibly want do java GHLabel label = repo.getLabel("foo"); label.setColor("ffffff"); label.setDescription("bar"); Ideally, able update multiple fields in a single network call, live long I do weird stuff work java repo.getLabel("foo").setColor("ffffff"); repo.getLabel("foo").setDescription("bar"); need send fields PATCH request, API docs clear & I tried</technical_language>

Target:
public void setColor(String newColor) throws IOException { repo.root.retrieve().method("PATCH") .withPreview(SYMMETRA) .with("name", name) .with("color", newColor) .with("description", description) .to(url); }
Source:
<code>protected boolean <START> drawChild(@NonNull <END> Canvas canvas, @NonNull View child, long drawingTime) { if (mDisappearingFragmentChildren != null && mDisappearingFragmentChildren.size() > 0 && getChildCount() > 1) { if (child == mHoldView) { boolean more = false; for (int i = mDisappearingFragmentChildren.size() - 1; i >= 0; i--) { more |= super.drawChild( canvas, mDisappearingFragmentChildren.get(i), drawingTime); } return more; } else if (mDisappearingFragmentChildren.contains(child)) { return false; } } return super.drawChild(canvas, child, drawingTime); }</code><technical_language>I want override dispatchDraw() drawChild(). If multiple children this doubles drawing of disappearing children</technical_language>

Target:
protected boolean drawChild(@NonNull Canvas canvas, @NonNull View child, long drawingTime) { if (mDisappearingFragmentChildren != null && mDisappearingFragmentChildren.size() > 0) { if (mDisappearingFragmentChildren.contains(child)) { return false; } } return super.drawChild(canvas, child, drawingTime); }
Source:
<code>private void persistEngineSession(String sessionId) { SessionInfo sessionInfo = getSessionInfo(sessionId); if (sessionInfo != null) { EngineSession engineSession = new EngineSession(); engineSession.setEngineSessionId(sessionId); DbUser user = getUser(sessionId, false); engineSession.setUserId(user.getId()); engineSession.setUserName(user.getLoginName()); engineSession.setGroupIds(user.getGroupIds()); engineSession.setRoleIds(getSystemRolesForUser(user.getId(), user.isAdmin() ? false : true)); <START> getDbFacade().getEngineSessionDao().save(engineSession); <END> } }</code><technical_language>do get primary key</technical_language>

Target:
private void persistEngineSession(String sessionId) { SessionInfo sessionInfo = getSessionInfo(sessionId); if (sessionInfo != null) { EngineSession engineSession = new EngineSession(); engineSession.setEngineSessionId(sessionId); DbUser user = getUser(sessionId, false); engineSession.setUserId(user.getId()); engineSession.setUserName(user.getLoginName()); engineSession.setGroupIds(user.getGroupIds()); sessionToIdMap.put(sessionId, getDbFacade().getEngineSessionDao().save(engineSession)); } }
Source:
<code>private Boolean containsEntryInternal(V value) { <START> return cache.entrySet().stream().anyMatch(kCollectionEntry -> kCollectionEntry.getValue().contains(value)); <END> }</code><technical_language>This run in parallel; parallelStream. rename kCollectionEntry, please</technical_language>

Target:
private Boolean containsEntryInternal(V value) { return cache.entrySet().parallelStream().anyMatch(entry -> entry.getValue().contains(value)); }