auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private boolean read(ByteBuffer buffer, boolean canTruncate) throws IOException { do { try { int read = m_fc.read(buffer); if (read == -1) { String message = "EOF encountered reading " + m_file + " at position " + m_fc.position() + " expected to be able to read " + buffer.remaining() + " more bytes"; if (canTruncate) { LOG.warn(message); truncateToCurrentReadIndex(); return false; } throw new EOFException(message); } } catch (IOException e) { if (canTruncate) { LOG.warn("Error encountered reading: " + m_file, e); <START> return false; <END> } throw new IOException("Error encountered reading: " + m_file, e); } } while (buffer.hasRemaining()); return true; }</code><technical_language>meaning of returning false truncating? Is file in a consistent state</technical_language>

Target:
private boolean read(ByteBuffer buffer, boolean canTruncate) throws IOException { do { try { int read = m_fc.read(buffer); if (read == -1) { String message = "EOF encountered reading " + m_file + " at position " + m_fc.position() + " expected to be able to read " + buffer.remaining() + " more bytes"; if (canTruncate) { LOG.warn(message); truncateToCurrentReadIndex(); return false; } throw new EOFException(message); } } catch (IOException e) { if (canTruncate) { LOG.warn("Error encountered reading: " + m_file, e); truncateToCurrentReadIndex(); return false; } throw new IOException("Error encountered reading: " + m_file, e); } } while (buffer.hasRemaining()); return true; }
Source:
<code><START> public void deleteAllMetadataRecords(String prefix) { <END> }</code><technical_language>Need implement</technical_language>

Target:
public void deleteAllMetadataRecords(String prefix) { Iterator<DataStore> iter = delegateHandler.getAllDelegatesIterator(); while (iter.hasNext()) { DataStore ds = iter.next(); if (ds instanceof SharedDataStore) { ((SharedDataStore) ds).deleteAllMetadataRecords(prefix); } } }
Source:
<code>public boolean remove(String oxdId) { try { <START> RpObject rpFromPersistance = getRpObject(oxdId, new String[0]); <END> this.persistenceEntryManager.remove(rpFromPersistance); LOG.debug("Removed rp successfully. oxdId: ", oxdId); return true; } catch (Exception e) { LOG.error("Failed to remove rp with oxdId: ", oxdId, e); } return false; }</code><technical_language>here, remove dn fetching entity</technical_language>

Target:
public boolean remove(String oxdId) { try { this.persistenceEntryManager.remove(getDnForRp(oxdId)); LOG.debug("Removed rp successfully. oxdId: ", oxdId); return true; } catch (Exception e) { LOG.error("Failed to remove rp with oxdId: ", oxdId, e); } return false; }
Source:
<code>public void copyAllLeftToRight(Iterable<? extends Diff> differences, Monitor monitor) { long start = 0; if (LOGGER.isDebugEnabled()) { start = System.currentTimeMillis(); LOGGER.debug("copyAllLeftToRight(differences, monitor) - Start"); } ComputeDiffsToMerge computer = new <START> ComputeDiffsToMerge(false, registry, null); <END> for (Diff diff : Iterables.filter(differences, filter)) { if (!AbstractMerger.isInTerminalState(diff)) { Set<Diff> diffsToMerge = computer.getAllDiffsToMergeFor(diff); for (Diff toMerge : diffsToMerge) { if (!AbstractMerger.isInTerminalState(toMerge)) { final IMerger merger = registry.getHighestRankingMerger(toMerge); if (LOGGER.isDebugEnabled()) { LOGGER.debug("copyAllLeftToRight - Selected merger: " + merger.getClass().getSimpleName()); } merger.copyLeftToRight(toMerge, monitor); } } } } if (LOGGER.isDebugEnabled()) { long duration = System.currentTimeMillis() - start; LOGGER.debug("copyAllLeftToRight(differences, monitor) - Stop - Time spent: " + duration + "ms"); } }</code><technical_language>(constructor criterion)</technical_language>

Target:
public void copyAllLeftToRight(Iterable<? extends Diff> differences, Monitor monitor) { long start = 0; if (LOGGER.isDebugEnabled()) { start = System.currentTimeMillis(); LOGGER.debug("copyAllLeftToRight(differences, monitor) - Start"); } ComputeDiffsToMerge computer = new ComputeDiffsToMerge(false, registry); for (Diff diff : Iterables.filter(differences, filter)) { if (!AbstractMerger.isInTerminalState(diff)) { Set<Diff> diffsToMerge = computer.getAllDiffsToMerge(diff); for (Diff toMerge : diffsToMerge) { if (!AbstractMerger.isInTerminalState(toMerge)) { final IMerger merger = registry.getHighestRankingMerger(toMerge); if (LOGGER.isDebugEnabled()) { LOGGER.debug("copyAllLeftToRight - Selected merger: " + merger.getClass().getSimpleName()); } merger.copyLeftToRight(toMerge, monitor); } } } } if (LOGGER.isDebugEnabled()) { long duration = System.currentTimeMillis() - start; LOGGER.debug("copyAllLeftToRight(differences, monitor) - Stop - Time spent: " + duration + "ms"); } }
Source:
<code>public long getBucketStartTime(int index) { <START> return fFirstBucketTime + (long) (index * fBucketDuration + .5); <END> }</code><technical_language>Remove rounding... 3rd strike ;)</technical_language>

Target:
public long getBucketStartTime(int index) { return fFirstBucketTime + (long) (index * fBucketDuration); }
Source:
<code>public void updateToManyRelation(DataStoreTransaction relationTx, Object entity, String relationName, Set<Object> newRelationships, Set<Object> deletedRelationships, RequestScope scope) { relationTx = getRelationTransaction(entity, relationName); <START> DataStoreTransaction entityTransaction = getTransaction(getType(entity.getClass())); <END> entityTransaction.updateToManyRelation(relationTx, entity, relationName, newRelationships, deletedRelationships, scope); }</code><technical_language>correct get type object is EntityDictionary.getType. works DynamicType</technical_language>

Target:
public void updateToManyRelation(DataStoreTransaction relationTx, Object entity, String relationName, Set<Object> newRelationships, Set<Object> deletedRelationships, RequestScope scope) { relationTx = getRelationTransaction(entity, relationName); DataStoreTransaction entityTransaction = getTransaction(EntityDictionary.getType(entity)); entityTransaction.updateToManyRelation(relationTx, entity, relationName, newRelationships, deletedRelationships, scope); }
Source:
<code>public void addMembershipToCohort_shouldAddMembershipToCohort() throws Exception { executeDataSet(COHORT_XML); <START> <END> CohortMembership memberToAdd = new CohortMembership(new Patient(4)); service.addMembershipToCohort(service.getCohort(1), memberToAdd); assertTrue(service.getCohort(1).contains(memberToAdd)); }</code><technical_language>nice a sanity check cohort active membership for patient</technical_language>

Target:
public void addMembershipToCohort_shouldAddMembershipToCohort() throws Exception { executeDataSet(COHORT_XML); Patient p = new Patient(4); CohortMembership memberToAdd = new CohortMembership(p); service.addMembershipToCohort(service.getCohort(1), memberToAdd); assertTrue(service.getCohort(1).contains(p)); }
Source:
<code>public String executeSupportRequest(HttpUriRequest request) throws OpenStackException { log.debug("executeSupportRequest " + request.getURI().toString()); CloseableHttpClient httpClient = getHttpClient(); HttpResponse response = null; String result = null; try { response = httpClient.execute(request); log.debug("Status : " + response.getStatusLine().getStatusCode()); if (response.getStatusLine().getStatusCode() == http_code_ok) { InputStream is = response.getEntity().getContent(); result = convertStreamToString(is); log.debug("Result " + result); is.close(); response.getEntity().getContent().close(); } } catch (Exception e) { log.warn("Error in the request, message:" + e.getMessage()); if (response.getStatusLine().getStatusCode() == http_code_accepted) { return response.getStatusLine().getReasonPhrase(); } else { <START> throw new OpenStackException(e.getMessage()); <END> } } return result; }</code><technical_language>Is type of exception suitable for 'keys' service? (OpenStackException)</technical_language>

Target:
public String executeSupportRequest(HttpUriRequest request) { log.debug("executeSupportRequest " + request.getURI().toString()); CloseableHttpClient httpClient = getHttpClient(); HttpResponse response = null; String result = null; try { response = httpClient.execute(request); log.debug("Status : " + response.getStatusLine().getStatusCode()); if (response.getStatusLine().getStatusCode() == http_code_ok) { InputStream is = response.getEntity().getContent(); result = convertStreamToString(is); log.debug("Result " + result); is.close(); response.getEntity().getContent().close(); } } catch (Exception e) { log.warn("Error in the request, message:" + response.getStatusLine().getStatusCode() + " : " + e.getMessage()); } return result; }
Source:
<code>public void sourceNoLongerAdvertised(AdvertisedDataSource source) { if (m_producer != null) try { m_producer.close(); } catch (Exception ignoreIt) m_es.shutdown(); try { if (!m_es.awaitTermination(SHUTDOWN_TIMEOUT_MS, TimeUnit.MILLISECONDS)) { LOG.warn("Forcing executor shutdown on source: " + m_source); try { m_es.shutdownNow(); } catch (Exception e) { LOG.error("Failed to force executor shutdown on source: " + m_source, e); } } } catch (InterruptedException e) { <START> throw new KafkaExportException("Interrupted while awaiting executor shutdown on source:" + m_source, e); <END> } }</code><technical_language>invoking m_es.shutdownNow() throw exception guarantees shutdown</technical_language>

Target:
public void sourceNoLongerAdvertised(AdvertisedDataSource source) { if (m_producer != null) try { m_producer.close(); } catch (Exception ignoreIt) m_es.shutdown(); try { if (!m_es.awaitTermination(SHUTDOWN_TIMEOUT_MS, TimeUnit.MILLISECONDS)) { forceExecutorShutdown(); } } catch (InterruptedException e) { LOG.warn("Interrupted while awaiting executor shutdown on source:" + m_source); forceExecutorShutdown(); } }
Source:
<code>private void downloadDatabase( StoreId localStoreId ) { try { localDatabase.stopForStoreCopy(); startStopOnStoreCopy.stop(); } catch ( Throwable throwable ) { throw new RuntimeException( throwable ); } try { CatchupAddressProvider.UpstreamStrategyBoundAddressProvider upstreamStrategyBoundAddressProvider = new CatchupAddressProvider.UpstreamStrategyBoundAddressProvider( topologyService, selectionStrategyPipeline ); storeCopyProcess.replaceWithStoreFrom( upstreamStrategyBoundAddressProvider, localStoreId ); } catch ( IOException | StoreCopyFailedException | StreamingTransactionsFailedException e ) { <START> log.warn( "Error copying store. Will retry shortly." ); <END> return; } try { localDatabase.start(); startStopOnStoreCopy.start(); } catch ( Throwable throwable ) { throw new RuntimeException( throwable ); } latestTxIdOfUpStream = 0; state = TX_PULLING; applier.refreshFromNewStore(); }</code><technical_language>Attach exception warning</technical_language>

Target:
private void downloadDatabase( StoreId localStoreId ) { try { localDatabase.stopForStoreCopy(); startStopOnStoreCopy.stop(); } catch ( Throwable throwable ) { throw new RuntimeException( throwable ); } try { CatchupAddressProvider.UpstreamStrategyBoundAddressProvider upstreamStrategyBoundAddressProvider = new CatchupAddressProvider.UpstreamStrategyBoundAddressProvider( topologyService, selectionStrategyPipeline ); storeCopyProcess.replaceWithStoreFrom( upstreamStrategyBoundAddressProvider, localStoreId ); } catch ( IOException | StoreCopyFailedException | StreamingTransactionsFailedException e ) { log.warn( "Error copying store. Will retry shortly.", e ); return; } try { localDatabase.start(); startStopOnStoreCopy.start(); } catch ( Throwable throwable ) { throw new RuntimeException( throwable ); } latestTxIdOfUpStream = 0; state = TX_PULLING; applier.refreshFromNewStore(); }
Source:
<code>public void completeQuery(AsyncAPI query, User user, String apiVersion) { AsyncAPIUpdateThread queryUpdateWorker = futureTask.get(); <START> if (queryUpdateWorker != null) { <END> log.debug("Task has not completed"); updater.execute(queryUpdateWorker); futureTask.remove(); } else { log.debug("Task has completed"); } }</code><technical_language>safe null/not-null signify anything. threadlocal is initialized a timeout, non-null thereafter</technical_language>

Target:
public void completeQuery(AsyncAPI query, User user, String apiVersion) { AsyncAPIResultFuture asyncAPIResultFuture = asyncResultFutureThreadLocal.get(); if (asyncAPIResultFuture.isSynchronousTimeout()) { log.debug("Task has not completed"); updater.execute(new AsyncAPIUpdateThread(elide, asyncAPIResultFuture.getAsyncFuture(), query, asyncAPIDao)); asyncResultFutureThreadLocal.remove(); } else { log.debug("Task has completed"); } }
Source:
<code>private boolean hasOSGiManifest(IContainer container) { try { IFile manifestResource = container.getFile(new Path("META-INF/MANIFEST.MF")); if (manifestResource.exists()) { Manifest manifest = new Manifest(); <START> InputStream stream = manifestResource.getContents(); <END> manifest.read(stream); stream.close(); return manifest.getMainAttributes().getValue(Constants.BUNDLE_SYMBOLICNAME) != null; } } catch (Exception ex) { PDEPlugin.log(ex); } return false; }</code><technical_language>try resources</technical_language>

Target:
private boolean hasOSGiManifest(IContainer container) { IFile manifestResource = container.getFile(new Path(ICoreConstants.BUILD_FILENAME_DESCRIPTOR)); if (manifestResource.exists()) { Manifest manifest = new Manifest(); try (InputStream stream = manifestResource.getContents()) { manifest.read(stream); return manifest.getMainAttributes().getValue(Constants.BUNDLE_SYMBOLICNAME) != null; } catch (CoreException | IOException ex) { PDEPlugin.log(ex); } } return false; }
Source:
<code>private List<ImageView> createObjects(int count, Activity activity, ViewGroup parent) { ArrayList<ImageView> objects = new ArrayList<>(count); for (int i = 0; i < count; i++) { ImageView object = new ImageView(activity); int size = getBallSize(); Bitmap circle = createCircle(activity.getResources(), size, size); object.setImageBitmap(circle); object.setLayoutParams(new ActionBar.LayoutParams(size, size)); object.setX(RANDOM.nextInt(parent.getWidth())); object.setY(parent.getHeight()); objects.add(object); <START> object.setX(RANDOM.nextInt(parent.getWidth())); <END> } return objects; }</code><technical_language>need call setX() :)</technical_language>

Target:
private List<ImageView> createObjects(int count, Activity activity, ViewGroup parent) { ArrayList<ImageView> objects = new ArrayList<>(count); for (int i = 0; i < count; i++) { ImageView object = new ImageView(activity); int size = getBallSize(); Bitmap circle = createCircle(activity.getResources(), size, size); object.setImageBitmap(circle); object.setLayoutParams(new ActionBar.LayoutParams(size, size)); object.setX(RANDOM.nextInt(parent.getWidth())); object.setY(parent.getHeight()); objects.add(object); } return objects; }
Source:
<code>public void testGoogleAnalyticsTrackingSettingSerialization() throws Exception { GoogleAnalyticsSetting setting = new GoogleAnalyticsSetting(); setting.setEnable(false); <START> String jsonTwo = mapper.writeValueAsString(setting); <END> System.out.println(jsonTwo); Assert.assertEquals(jsonTwo, "{\"enable\":false}"); }</code><technical_language>jsonOne. This is assuming numeral part of variable name is expected number of fields in serialized version. If case, elaborate naming convention</technical_language>

Target:
public void testGoogleAnalyticsTrackingSettingSerialization() throws Exception { GoogleAnalyticsSetting setting = new GoogleAnalyticsSetting(); setting.setEnable(false); String json = mapper.writeValueAsString(setting); System.out.println(json); Assert.assertEquals(json, "{\"enable\":false}"); }
Source:
<code>public void run(final int iteration) { <START> final int workload = memoryStore.getNumBlocks(); <END> final long sleepTime = workload * computationRate; LOG.log(Level.INFO, "iteration start: {0}, workload: {1}, computationRate: {2}, sleepTime: {3}", new Object[]{iteration, workload, computationRate, sleepTime}); try { Thread.sleep(sleepTime); } catch (final InterruptedException e) { throw new RuntimeException("InterruptedException during sleeping", e); } final int finWorkload = memoryStore.getNumBlocks(); LOG.log(Level.INFO, "iteration finish: {0}, finWorkload: {1}", new Object[]{iteration, finWorkload}); }</code><technical_language>numBlocks? numLocalBlocks</technical_language>

Target:
public void run(final int iteration) { final int numBlocks = memoryStore.getNumBlocks(); final long sleepTime = numBlocks * computationRate; LOG.log(Level.INFO, "iteration start: {0}, numBlocks: {1}, computationRate: {2}, sleepTime: {3}", new Object[]{iteration, numBlocks, computationRate, sleepTime}); try { Thread.sleep(sleepTime); } catch (final InterruptedException e) { throw new RuntimeException("InterruptedException during sleeping", e); } final int numBlocksAfterSleep = memoryStore.getNumBlocks(); LOG.log(Level.INFO, "iteration finish: {0}, numBlocks after sleep: {1}", new Object[]{iteration, numBlocksAfterSleep}); }
Source:
<code>public List<NuxeoOAuth2Token> getTokens(@Context HttpServletRequest request) throws IOException, RestOperationException { if (!((NuxeoPrincipal)getContext().getCoreSession().getPrincipal()).isAdministrator()) { <START> return Collections.emptyList(); <END> } return getTokens(); }</code><technical_language>Return FORBIDDEN too. need play nice if user rights call this</technical_language>

Target:
public List<NuxeoOAuth2Token> getTokens(@Context HttpServletRequest request) throws IOException, RestOperationException { checkPermission(); return getTokens(); }
Source:
<code>private static boolean isExcluded(Collection<String> excludedGroups, String... groups) { <START> boolean noGroups = (groups == null || groups.length == 0); <END> if (!excludedGroups.isEmpty() && noGroups) { return true; } return isMemberOf(excludedGroups, groups); }</code><technical_language>groups null</technical_language>

Target:
private static boolean isExcluded(Collection<String> excludedGroups, String... groups) { if (!excludedGroups.isEmpty() && groups.length == 0) { return true; } return isMemberOf(excludedGroups, groups); }
Source:
<code>private boolean doTest() { try { <START> this.channel.stat(this.channel.getHome()); <END> return true; } catch (Exception e) { return false; } }</code><technical_language>jschSession.sendKeepAliveMsg() work for us</technical_language>

Target:
private boolean doTest() { try { this.channel.lstat(this.channel.getHome()); return true; } catch (Exception e) { return false; } }
Source:
<code>@Override public VirtualMachineTO implement(VirtualMachineProfile vm) { <START> vmwareVmImplementer = ComponentContext.inject(new VmwareVmImplementer(this)); <END> return vmwareVmImplementer.implement(vm); }</code><technical_language>@Inject annotation</technical_language>

Target:
@Override public VirtualMachineTO implement(VirtualMachineProfile vm) { vmwareVmImplementer.setGlobalNestedVirtualisationEnabled(VmwareEnableNestedVirtualization.value()); vmwareVmImplementer.setGlobalNestedVPerVMEnabled(VmwareEnableNestedVirtualizationPerVM.value()); return vmwareVmImplementer.implement(vm, toVirtualMachineTO(vm), getClusterId(vm.getId())); }
Source:
<code>public void put(MessageWriteSet messageSetToWrite) throws StoreException { checkStarted(); if (messageSetToWrite.getMessageSetInfo().isEmpty()) { throw new IllegalArgumentException("Message write set cannot be empty"); } checkDuplicates(messageSetToWrite); CloudWriteChannel cloudWriter = new CloudWriteChannel(this, messageSetToWrite.getMessageSetInfo()); messageSetToWrite.writeTo(cloudWriter); <START> logPutCountsPeriodically(); <END> }</code><technical_language>I feel logPutCountsPeriodically() depends put method. is, if put method, for some reason, is invoked logPutCountsPeriodically() called. I thinking if a background thread periodically log put counts option. do think</technical_language>

Target:
public void put(MessageWriteSet messageSetToWrite) throws StoreException { checkStarted(); if (messageSetToWrite.getMessageSetInfo().isEmpty()) { throw new IllegalArgumentException("Message write set cannot be empty"); } checkDuplicates(messageSetToWrite); CloudWriteChannel cloudWriter = new CloudWriteChannel(this, messageSetToWrite.getMessageSetInfo()); messageSetToWrite.writeTo(cloudWriter); logCountsPeriodically(); }
Source:
<code>public AttributeDefinition getAttributeDefinition() { AttributeDefinition attr = new AttributeDefinition(); attr.setNamespace(AttributesManager.NS_GROUP_RESOURCE_ATTR_DEF); attr.setFriendlyName("projectName"); <START> attr.setDisplayName("projectName"); <END> attr.setType(String.class.getName()); attr.setDescription("Name of project, directory where the project exists."); return attr; }</code><technical_language>Please, text "Project name" (Name fixed sending this pool request) thank you</technical_language>

Target:
public AttributeDefinition getAttributeDefinition() { AttributeDefinition attr = new AttributeDefinition(); attr.setNamespace(AttributesManager.NS_GROUP_RESOURCE_ATTR_DEF); attr.setFriendlyName("projectName"); attr.setDisplayName("Project name"); attr.setType(String.class.getName()); attr.setDescription("Name of project, directory where the project exists."); return attr; }
Source:
<code>private void InitVdsBroker() { log.infoFormat("vdsBroker({0},{1})", _vds.gethost_name(), _vds.getport()); <START> String clusterVersion = Config.DefaultConfigurationVersion; <END> if (_vds != null) { clusterVersion = _vds.getvds_group_compatibility_version().getValue(); } int clientTimeOut = Config.<Integer> GetValue(ConfigValues.vdsTimeout, clusterVersion) * 1000; int connectionTimeOut = Config.<Integer>GetValue(ConfigValues.vdsConnectionTimeout, clusterVersion) * 1000; int clientRetries = Config.<Integer>GetValue(ConfigValues.vdsRetries, clusterVersion); Pair<VdsServerConnector, HttpClient> returnValue = XmlRpcUtils.getConnection(_vds.gethost_name(), _vds.getport(), clientTimeOut, connectionTimeOut, clientRetries, VdsServerConnector.class, Config.<Boolean> GetValue(ConfigValues.UseSecureConnectionWithServers)); _vdsProxy = new VdsServerWrapper(returnValue.getFirst(), returnValue.getSecond()); }</code><technical_language>Hi, Thanks for elaborating previous patch :) problem this code is - a. clear (but nice explained ;) ) b. I understand fear NPE, want protect (as more 99% of exceptions NPEs), I options vds compatibility version, I of wrong. do think? understand issue is String clusterVersion = Config.DefaultConfigurationVersion; code. Thanks</technical_language>

Target:
private void InitVdsBroker() { log.infoFormat("vdsBroker({0},{1})", _vds.gethost_name(), _vds.getport()); String clusterVersion = _vds.getvds_group_compatibility_version().getValue(); int clientTimeOut = Config.<Integer> GetValue(ConfigValues.vdsTimeout, clusterVersion) * 1000; int connectionTimeOut = Config.<Integer>GetValue(ConfigValues.vdsConnectionTimeout, clusterVersion) * 1000; int clientRetries = Config.<Integer>GetValue(ConfigValues.vdsRetries, clusterVersion); Pair<VdsServerConnector, HttpClient> returnValue = XmlRpcUtils.getConnection(_vds.gethost_name(), _vds.getport(), clientTimeOut, connectionTimeOut, clientRetries, VdsServerConnector.class, Config.<Boolean> GetValue(ConfigValues.UseSecureConnectionWithServers)); _vdsProxy = new VdsServerWrapper(returnValue.getFirst(), returnValue.getSecond()); }
Source:
<code>public List<ProcessDTO> findAll(String sort, Integer offset, Integer size, Map filters) throws DataException { <START> <END> if (Objects.equals(filters, null) || filters.isEmpty()) { return findAll(sort, offset, size); } ProzessverwaltungForm form = (ProzessverwaltungForm) Helper.getManagedBeanValue("#{ProzessverwaltungForm}"); Map<String, String> filterMap = (Map<String, String>) filters; BoolQueryBuilder query = null; for (Map.Entry<String, String> entry : filterMap.entrySet()) { boolean isTemplate = form.getModusAnzeige().equals("vorlagen"); query = serviceManager.getFilterService().queryBuilder(entry.getValue(), ObjectType.PROCESS, isTemplate, false, false); if (!form.isShowClosedProcesses()) { query.must(serviceManager.getProcessService().getQuerySortHelperStatus(false)); } if (!form.isShowArchivedProjects()) { query.must(serviceManager.getProcessService().getQueryProjectArchived(false)); } } return convertJSONObjectsToDTOs(searcher.findDocuments(query.toString(), sort, offset, size), false); }</code><technical_language>this method is called in ProzessverwaltungForm - displays processes templates</technical_language>

Target:
public List<ProcessDTO> findAll(String sort, Integer offset, Integer size, Map filters) throws DataException { ProzessverwaltungForm form = (ProzessverwaltungForm) Helper.getManagedBeanValue("#{ProzessverwaltungForm}"); if (Objects.equals(form, null)) { form = new ProzessverwaltungForm(); } boolean isTemplate = Objects.equals(form.getDisplayMode(), ObjectMode.TEMPLATE); Map<String, String> filterMap = (Map<String, String>) filters; BoolQueryBuilder query = null; if (Objects.equals(filters, null) || filters.isEmpty()) { return convertJSONObjectsToDTOs(findBySort(false, false, isTemplate, sort, offset, size), false); } for (Map.Entry<String, String> entry : filterMap.entrySet()) { query = serviceManager.getFilterService().queryBuilder(entry.getValue(), ObjectType.PROCESS, isTemplate, false, false); if (!form.isShowClosedProcesses()) { query.must(serviceManager.getProcessService().getQuerySortHelperStatus(false)); } if (!form.isShowArchivedProjects()) { query.must(serviceManager.getProcessService().getQueryProjectArchived(false)); } } String queryString = ""; if (!Objects.equals(query, null)) { queryString = query.toString(); } return convertJSONObjectsToDTOs(searcher.findDocuments(queryString, sort, offset, size), false); }
Source:
<code>public void registerConsumer( EventConsumer consumer, String publisherName, String... eventTypes) { if (consumer == null) { throw new InvalidParameterException("Consumer must not be null"); } <START> Set<String> eventTypesSet = new HashSet<>(); <END> if (eventTypes != null) { eventTypesSet.addAll(asList(eventTypes)); } regMgmtLock.lock(); try { log.debug( "registerConsumer " + consumer.getClass().getCanonicalName() + " for " + publisherName); RegisteredPublisher publisher = nameToPublisher.get(publisherName); if (publisher == null) { danglingConsumers.add( new RegisteredConsumer(consumer, eventTypesSet, publisherName)); } else { publisher.addConsumer(new RegisteredConsumer(consumer, eventTypesSet)); } } finally { regMgmtLock.unlock(); } }</code><technical_language>Worth empty set (i.e. Collections.emptySet()) null/empty instead</technical_language>

Target:
public void registerConsumer( EventConsumer consumer, String publisherName, String... eventTypes) { if (consumer == null) { throw new InvalidParameterException("Consumer must not be null"); } Set<String> eventTypesSet = eventTypes == null ? emptySet() : new HashSet<>(asList(eventTypes)); regMgmtLock.lock(); try { log.debug( "registerConsumer " + consumer.getClass().getCanonicalName() + " for " + publisherName); RegisteredPublisher publisher = nameToPublisher.get(publisherName); if (publisher == null) { danglingConsumers.add( new RegisteredConsumer(consumer, eventTypesSet, publisherName)); } else { publisher.addConsumer(new RegisteredConsumer(consumer, eventTypesSet)); } } finally { regMgmtLock.unlock(); } }
Source:
<code>private static ImmutableList<String> getImports(final Ds3Request ds3Request) { <START> ImmutableSet.Builder<String> importsBuilder = ImmutableSet.builder(); <END> importsBuilder = getImportsFromParamList(importsBuilder, ds3Request.getRequiredQueryParams()); importsBuilder = getImportsFromParamList(importsBuilder, ds3Request.getOptionalQueryParams()); return importsBuilder.build().asList(); }</code><technical_language>Missing Final</technical_language>

Target:
private static ImmutableList<String> getImports(final Ds3Request ds3Request) { final ImmutableSet.Builder<String> importsBuilder = ImmutableSet.builder(); importsBuilder.addAll(getImportsFromParamList(ds3Request.getRequiredQueryParams())); importsBuilder.addAll(getImportsFromParamList(ds3Request.getOptionalQueryParams())); return importsBuilder.build().asList(); }
Source:
<code>private AWSCredentialsProvider getCredentialsProvider() { <START> if (null == awsSecretKey || null == awsAccessKey) { <END> return new AWSCredentialsProvider() { @Override public AWSCredentials getCredentials() { return new BasicAWSCredentials(awsAccessKey, awsSecretKey); } @Override public void refresh() { } }; } return new DefaultAWSCredentialsProviderChain(); }</code><technical_language>This backwards. This attempt create BasicAWSCredentials awsSecretKey awsAccessKey is provided</technical_language>

Target:
private AWSCredentialsProvider getCredentialsProvider() { if (null != awsSecretKey && null != awsAccessKey) { return new AWSCredentialsProvider() { @Override public AWSCredentials getCredentials() { return new BasicAWSCredentials(awsAccessKey, awsSecretKey); } @Override public void refresh() { } }; } return new DefaultAWSCredentialsProviderChain(); }
Source:
<code>protected abstract BatchJob createJob(ProcessContext process) throws Exception; protected void logParameters(ProcessContext process) { List<Parameter<?, ?>> parameters = getParameters(); StringBuilder output = new StringBuilder(); <START> output.append("Parameter:\n\n"); <END> appendParameterValues(process, output, parameters, Parameter::shouldBeNormalLogged); process.log(ProcessLog.info().withMessage(output.toString().trim())); if (parameters.stream().anyMatch(Parameter::shouldBeSystemLogged)) { logSystemParameters(process, parameters); } }</code><technical_language>i18n</technical_language>

Target:
protected abstract BatchJob createJob(ProcessContext process) throws Exception; protected void logParameters(ProcessContext process) { List<Parameter<?, ?>> parameters = getParameters(); makeParameterLog(process, parameters, Parameter.LogVisibility.NORMAL).ifPresent(process::log); makeParameterLog(process, parameters, Parameter.LogVisibility.SYSTEM).ifPresent(processLog -> process.log( processLog.asSystemMessage())); }
Source:
<code>public WikiArticleEditMode clickCloseButton() { waitForElementByElement(closeButton); scrollAndClick(closeButton); <START> PageObjectLogging.log("updateVideoButton", "update video button clicked", true); <END> return new WikiArticleEditMode(driver); }</code><technical_language>part of this commit change "updateVideoButton" message consistent method name "clickCloseButton" :)</technical_language>

Target:
public WikiArticleEditMode clickCloseButton() { waitForElementByElement(closeButton); scrollAndClick(closeButton); PageObjectLogging.log("clickCloseButton", "close button clicked", true); return new WikiArticleEditMode(driver); }
Source:
<code>InflightRequest(HttpServletRequest req) { String query = req.getQueryString(); url = req.getRequestURL() + (query == null ? "" : "?" + query); startTime = System.currentTimeMillis(); userName = Jenkins.getAuthentication().getName(); <START> referer = ((StaplerRequest)req).getReferer(); <END> }</code><technical_language>Unsafe cast. I recommend check class default field if is <code> StaplerRequest</code></technical_language>

Target:
InflightRequest(HttpServletRequest req) { String query = req.getQueryString(); url = req.getRequestURL() + (query == null ? "" : "?" + query); startTime = System.currentTimeMillis(); userName = Jenkins.getAuthentication().getName(); referer = req.getHeader("Referer"); }
Source:
<code>private Guid getClusterId() { Guid clusterId = getParameters().getVdsGroupId(); if (Guid.Empty.equals(getParameters().getVdsGroupId())) { clusterId = Guid.createGuidFromStringDefaultEmpty( Config.<String> getValue(ConfigValues.AutoRegistrationDefaultVdsGroupID)); log.debug( "Cluster id was not provided for registering the host {}, the cluster id is taken from the config value {}", getParameters().getVdsName(), clusterId, ConfigValues.AutoRegistrationDefaultVdsGroupID.name()); } if (Guid.isNullOrEmpty(clusterId)) { VdsGroupDAO clusterDao = getDbFacade().getVdsGroupDao(); VDSGroup cluster = clusterDao.getByName("Default"); if (cluster != null) { clusterId = cluster.getId(); } else { List<VDSGroup> clusters = clusterDao.getAll(); <START> if (clusters.isEmpty()) { <END> clusterId = clusters.get(0).getId(); } } } return clusterId; }</code><technical_language>this condition reverted - else, index-out-of-boundaries-exception guaranteed</technical_language>

Target:
private Guid getClusterId() { Guid clusterId = getParameters().getVdsGroupId(); if (Guid.Empty.equals(getParameters().getVdsGroupId())) { clusterId = Guid.createGuidFromStringDefaultEmpty( Config.<String> getValue(ConfigValues.AutoRegistrationDefaultVdsGroupID)); log.debug( "Cluster id was not provided for registering the host {}, the cluster id is taken from the config value {}", getParameters().getVdsName(), clusterId, ConfigValues.AutoRegistrationDefaultVdsGroupID.name()); } if (Guid.isNullOrEmpty(clusterId)) { VdsGroupDAO clusterDao = getDbFacade().getVdsGroupDao(); VDSGroup cluster = clusterDao.getByName("Default"); if (cluster != null) { clusterId = cluster.getId(); } else { List<VDSGroup> clusters = clusterDao.getAll(); if (!clusters.isEmpty()) { clusterId = clusters.get(0).getId(); } } } return clusterId; }
Source:
<code>private void notifyBridgeAboutChildHandlerInitialization(final Thing thing) { final Bridge bridge = getBridge(thing.getBridgeUID()); if (bridge != null) { ThreadPoolManager.getPool(THING_MANAGER_THREADPOOL_NAME).execute(new Runnable() { @Override public void run() { try { BridgeHandler bridgeHandler = bridge.getHandler(); if (bridgeHandler != null) { bridgeHandler.childHandlerInitialized(thing.getHandler(), thing); } } catch (Exception ex) { logger.error("Exception occured during bridge handler notification ('" + bridge.getUID() + "') about handler initialization of child '{}' '" + thing.getUID() + "': " <START> + ex.getMessage(), ex); <END> } } }); } }</code><technical_language>wrong commit, touched this line instead of string concatenation</technical_language>

Target:
private void notifyBridgeAboutChildHandlerInitialization(final Thing thing) { final Bridge bridge = getBridge(thing.getBridgeUID()); if (bridge != null) { ThreadPoolManager.getPool(THING_MANAGER_THREADPOOL_NAME).execute(new Runnable() { @Override public void run() { try { BridgeHandler bridgeHandler = bridge.getHandler(); if (bridgeHandler != null) { bridgeHandler.childHandlerInitialized(thing.getHandler(), thing); } } catch (Exception e) { logger.error( "Exception occured during bridge handler ('{}') notification about handler initialization of child '{}': {}", bridge.getUID(), thing.getUID(), e.getMessage(), e); } } }); } }
Source:
<code>public Observable<List<Product>> getProducts(final int page, final Long collectionId, final Set<String> tags, final Collection.SortOrder sortOrder) { if (page < 1) { throw new IllegalArgumentException("page is a 1-based index, value cannot be less than 1"); } final String tagsQueryStr = tags != null && !tags.isEmpty() ? TextUtils.join(",", tags.toArray()) : null; final String sortOrderStr; <START> if (collectionId != null) { <END> sortOrderStr = sortOrder != null ? sortOrder.toString() : Collection.SortOrder.COLLECTION_DEFAULT.toString(); } else { sortOrderStr = null; } return retrofitService .getProducts(appId, collectionId, tagsQueryStr, sortOrderStr, page, pageSize) .retryWhen(networkRetryPolicyProvider.provide()) .doOnNext(new RetrofitSuccessHttpStatusCodeHandler<>()) .compose(new UnwrapRetrofitBodyTransformer<ProductListings, List<Product>>()) .onErrorResumeNext(new BuyClientExceptionHandler<List<Product>>()) .observeOn(callbackScheduler); }</code><technical_language>This refactored if/else if/else, instead of conditional operator</technical_language>

Target:
public Observable<List<Product>> getProducts(final int page, final Long collectionId, final Set<String> tags, final Collection.SortOrder sortOrder) { if (page < 1) { throw new IllegalArgumentException("page is a 1-based index, value cannot be less than 1"); } String sortOrderStr = sortOrder != null ? sortOrder.toString() : Collection.SortOrder.COLLECTION_DEFAULT.toString(); if (collectionId == null) { sortOrderStr = null; } final String tagsQueryStr = tags != null && !tags.isEmpty() ? TextUtils.join(",", tags.toArray()) : null; return retrofitService .getProducts(appId, collectionId, tagsQueryStr, sortOrderStr, page, pageSize) .retryWhen(networkRetryPolicyProvider.provide()) .doOnNext(new RetrofitSuccessHttpStatusCodeHandler<>()) .compose(new UnwrapRetrofitBodyTransformer<ProductListings, List<Product>>()) .onErrorResumeNext(new BuyClientExceptionHandler<List<Product>>()) .observeOn(callbackScheduler); }
Source:
<code>public void process(WatchedEvent event) { if ( LOG_EVENTS ) { log.debug("ConnectState watcher: " + event); } final boolean eventTypeNone = event.getType() == Watcher.Event.EventType.None; if ( eventTypeNone ) { boolean wasConnected = isConnected.get(); boolean newIsConnected = checkState(event.getState(), wasConnected); if ( newIsConnected != wasConnected ) { isConnected.set(newIsConnected); connectionStartMs = System.currentTimeMillis(); } } <START> assert waitOnExpiredEvent(event.getState()); <END> for ( Watcher parentWatcher : parentWatchers ) { OperationTrace trace = new OperationTrace("connection-state-parent-process", tracer.get(), getSessionId()); parentWatcher.process(event); trace.commit(); } if (eventTypeNone) handleState(event.getState()); }</code><technical_language>is this meant work? assuming assertions enabled in testing? If need some logic executed testing some sort of internal flag indicating this</technical_language>

Target:
public void process(WatchedEvent event) { if ( LOG_EVENTS ) { log.debug("ConnectState watcher: " + event); } final boolean eventTypeNone = event.getType() == Watcher.Event.EventType.None; if ( eventTypeNone ) { boolean wasConnected = isConnected.get(); boolean newIsConnected = checkState(event.getState(), wasConnected); if ( newIsConnected != wasConnected ) { isConnected.set(newIsConnected); connectionStartMs = System.currentTimeMillis(); } } if (debugWaitOnExpiredEvent && event.getState() == Event.KeeperState.Expired) { waitOnExpiredEvent(); } for ( Watcher parentWatcher : parentWatchers ) { OperationTrace trace = new OperationTrace("connection-state-parent-process", tracer.get(), getSessionId()); parentWatcher.process(event); trace.commit(); } if (eventTypeNone) handleState(event.getState()); }
Source:
<code>private String buildFastForwardMessage(MergeResult mergeResult, Ref oldHead) { <START> final StringBuilder messageBuilder = new StringBuilder(); <END> final Integer returnCode; ObjectId oldHeadId = oldHead.getObjectId(); messageBuilder.append("Updating ").append(oldHeadId.abbreviate(SHORT_COMMIT_ID_LENGTH).name()) .append("..").append(mergeResult.getNewHead().abbreviate(SHORT_COMMIT_ID_LENGTH).name()) .append(EOL); messageBuilder.append(mergeResult.getMergeStatus().toString()); return messageBuilder.toString(); }</code><technical_language>Unused variable</technical_language>

Target:
private String buildFastForwardMessage(MergeResult mergeResult, Ref oldHead) { final StringBuilder messageBuilder = new StringBuilder(); ObjectId oldHeadId = oldHead.getObjectId(); messageBuilder.append("Updating ").append(oldHeadId.abbreviate(SHORT_COMMIT_ID_LENGTH).name()) .append("..").append(mergeResult.getNewHead().abbreviate(SHORT_COMMIT_ID_LENGTH).name()) .append(EOL); messageBuilder.append(mergeResult.getMergeStatus().toString()); return messageBuilder.toString(); }
Source:
<code>private Optional<CompactReader.Factory<RowData>> createCompactReaderFactory(Context context) { DataType producedDataType = schema.toRowDataType(); if (bulkReaderFormat != null) { BulkFormat<RowData, FileSourceSplit> format = bulkReaderFormat.createRuntimeDecoder( createSourceContext(context), producedDataType); return Optional.of(CompactBulkReader.factory(format)); } else if (formatFactory != null) { InputFormat<RowData, ?> format = formatFactory.createReader(createReaderContext()); if (format instanceof FileInputFormat) { return Optional.of(FileInputFormatCompactReader.factory((FileInputFormat<RowData>) format)); } } else if (deserializationFormat != null) { DeserializationSchema<RowData> decoder = deserializationFormat.createRuntimeDecoder( createSourceContext(context), getFormatDataType()); <START> int[] projectedFields = IntStream.of(0, schema.getFieldCount()).toArray(); <END> DeserializationSchemaAdapter format = new DeserializationSchemaAdapter( decoder, schema, projectedFields, partitionKeys, defaultPartName); return Optional.of(CompactBulkReader.factory(format)); } return Optional.empty(); }</code><technical_language>IntStream.range</technical_language>

Target:
private Optional<CompactReader.Factory<RowData>> createCompactReaderFactory(Context context) { DataType producedDataType = schema.toRowDataType(); if (bulkReaderFormat != null) { BulkFormat<RowData, FileSourceSplit> format = bulkReaderFormat.createRuntimeDecoder( createSourceContext(context), producedDataType); return Optional.of(CompactBulkReader.factory(format)); } else if (formatFactory != null) { InputFormat<RowData, ?> format = formatFactory.createReader(createReaderContext()); if (format instanceof FileInputFormat) { return Optional.of(FileInputFormatCompactReader.factory((FileInputFormat<RowData>) format)); } } else if (deserializationFormat != null) { DeserializationSchema<RowData> decoder = deserializationFormat.createRuntimeDecoder( createSourceContext(context), getFormatDataType()); int[] projectedFields = IntStream.range(0, schema.getFieldCount()).toArray(); DeserializationSchemaAdapter format = new DeserializationSchemaAdapter( decoder, schema, projectedFields, partitionKeys, defaultPartName); return Optional.of(CompactBulkReader.factory(format)); } return Optional.empty(); }
Source:
<code>public QueryResponse getChromosomes(@RequestParam(name = "species") String species, HttpServletResponse response) throws IllegalOpenCGACredentialsException, IOException { <START> if (species == null || species.isEmpty()) { <END> response.setStatus(HttpServletResponse.SC_BAD_REQUEST); return setQueryResponse("Please specify a species"); } MultiMongoDbFactory.setDatabaseNameForCurrentThread(DBAdaptorConnector.getDBName(species)); List<String> chromosomeList = variantEntityRepository.findDistinctChromosomes(); QueryResult<String> queryResult = Utils.buildQueryResult(chromosomeList); return setQueryResponse(queryResult); }</code><technical_language>null check unnecessary</technical_language>

Target:
public QueryResponse getChromosomes(@RequestParam(name = "species") String species, HttpServletResponse response) throws IllegalOpenCGACredentialsException, IOException { if (species.isEmpty()) { response.setStatus(HttpServletResponse.SC_BAD_REQUEST); return setQueryResponse("Please specify a species"); } MultiMongoDbFactory.setDatabaseNameForCurrentThread(DBAdaptorConnector.getDBName(species)); List<String> chromosomeList = variantEntityRepository.findDistinctChromosomes(); QueryResult<String> queryResult = Utils.buildQueryResult(chromosomeList); return setQueryResponse(queryResult); }
Source:
<code>public void discontinueOrderWithNonCodedReason_shouldPopulateCorrectAttributesOnBothOrders() throws Exception { executeDataSet("org/openmrs/api/include/OrderServiceTest-globalProperties.xml"); OrderService orderService = Context.getOrderService(); Order order = orderService.getOrderByOrderNumber("111"); Date discontinueDate = new Date(); String discontinueReasonNonCoded = "Test if I can discontinue this"; Order discontinueOrder = orderService.discontinueOrder(order, discontinueReasonNonCoded, discontinueDate); Assert.assertEquals(order.getDateStopped(), discontinueDate); Assert.assertNotNull(discontinueOrder); Assert.assertNotNull(discontinueOrder.getId()); Assert.assertEquals(discontinueOrder.getAction(), Action.DISCONTINUE); <START> Assert.assertEquals(discontinueOrder.getDiscontinuedReasonNonCoded(), discontinueReasonNonCoded); <END> }</code><technical_language>supposed test if previousOrder field set</technical_language>

Target:
public void discontinueOrderWithNonCodedReason_shouldPopulateCorrectAttributesOnBothOrders() throws Exception { executeDataSet("org/openmrs/api/include/OrderServiceTest-globalProperties.xml"); OrderService orderService = Context.getOrderService(); Order order = orderService.getOrderByOrderNumber("111"); Date discontinueDate = new Date(); String discontinueReasonNonCoded = "Test if I can discontinue this"; Order discontinueOrder = orderService.discontinueOrder(order, discontinueReasonNonCoded, discontinueDate); Assert.assertEquals(order.getDateStopped(), discontinueDate); Assert.assertNotNull(discontinueOrder); Assert.assertNotNull(discontinueOrder.getId()); Assert.assertEquals(discontinueOrder.getAction(), Action.DISCONTINUE); Assert.assertEquals(discontinueOrder.getDiscontinuedReasonNonCoded(), discontinueReasonNonCoded); Assert.assertEquals(discontinueOrder.getPreviousOrder(), order); }
Source:
<code>private void createOtherOptions(Composite basicTop) { Composite otherOptionsGroup = new Composite(basicTop, SWT.NONE); otherOptionsGroup.setLayout(new GridLayout()); otherOptionsGroup.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create()); Label label = new Label(otherOptionsGroup, SWT.WRAP); label.setText(Messages.getString("ValgrindOptionsTab.OtherOptionsLabel")); otherOptionsText = new Text(otherOptionsGroup, SWT.BORDER); <START> otherOptionsText.addSelectionListener(selectListener); <END> otherOptionsText.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create()); }</code><technical_language>this is a Text Box, need 'modifyListener' Spinner widgets. modifying contents of text box register needing 'apply' changed</technical_language>

Target:
private void createOtherOptions(Composite basicTop) { Composite otherOptionsGroup = new Composite(basicTop, SWT.NONE); otherOptionsGroup.setLayout(new GridLayout()); otherOptionsGroup.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create()); Label label = new Label(otherOptionsGroup, SWT.WRAP); label.setText(Messages.getString("ValgrindOptionsTab.ExtraOptionsLabel")); label.setToolTipText(Messages.getString("ValgrindOptionsTab.ExtraOptionsTooltip")); otherOptionsText = new Text(otherOptionsGroup, SWT.BORDER); otherOptionsText.setToolTipText(Messages.getString("ValgrindOptionsTab.ExtraOptionsTooltip")); otherOptionsText.addModifyListener(modifyListener); otherOptionsText.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create()); }
Source:
<code>public AnonymousSpec anonymous(){ if (this.anonymous == null) { this.anonymous = new AnonymousSpec(); } <START> return this.anonymous.authorities("ROLE_USER"); <END> }</code><technical_language>This ROLE_ANONYMOUS. defaults in AnonymousSpec delete</technical_language>

Target:
public AnonymousSpec anonymous(){ if (this.anonymous == null) { this.anonymous = new AnonymousSpec(); } return this.anonymous; }
Source:
<code>private Filter translateType(String jsonText) { final FilterFactory2 ff = parse.getFilterFactory(); Expression dimension = ff.function("dimension", ff.function("geometry")); switch (jsonText) { case "Point": <START> return ff.equals(dimension, ff.literal(0)); <END> case "LineString": return ff.equals(dimension, ff.literal(1)); case "Polygon": return ff.and( ff.equals(dimension, ff.literal(2)), ff.not(ff.equals(ff.function("isCoverage"), ff.literal(true)))); default: return null; } }</code><technical_language>I happy either, geometryType capture coverage cleanly</technical_language>

Target:
private Filter translateType(String jsonText) { final FilterFactory2 ff = parse.getFilterFactory(); Expression dimension = ff.function("dimension", ff.function("geometry")); switch (jsonText) { case TYPE_POINT: return ff.equals(dimension, ff.literal(0)); case TYPE_LINE: return ff.equals(dimension, ff.literal(1)); case TYPE_POLYGON: return ff.and( ff.equals(dimension, ff.literal(2)), ff.not(ff.equals(ff.function("isCoverage"), ff.literal(true)))); default: return null; } }
Source:
<code>public PrefixSearchableContentSupplier make(@Nonnull MultiLanguageStringProperty source) { return entity -> { <START> StringList tokens = new StringList(); <END> ((Map<String, String>) source.getValue(entity)).forEach((key, value) -> tokens.add(value)); return tokens; }; }</code><technical_language>this intermediate step, transform a BiConsumer accepts entity a StringBuilder BiConsumer<PrefixSearchableEntity, Consumer<String>> invoke (entity, this::addContentString)</technical_language>

Target:
public PrefixSearchableContentConsumer make(@Nonnull MultiLanguageStringProperty source) { return (entity, consumer) -> { ((Map<String, String>) source.getValue(entity)).forEach((key, value) -> { consumer.accept(value); }); }; }