auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public List<RepoCollection> getCollectionVersions(String bucketName, String key) throws RepoException { <START> List<RepoCollection> repoCollections = null; <END> try { sqlService.getReadOnlyConnection(); if (StringUtil.isEmpty(bucketName)) { throw new RepoException(RepoException.Type.NoBucketEntered); } if (StringUtil.isEmpty(key)) { throw new RepoException(RepoException.Type.NoCollectionKeyEntered); } repoCollections = sqlService.listCollectionVersions(bucketName, key); } catch (SQLException e) { throw new RepoException(e); } finally { sqlReleaseConnection(); } return repoCollections; }</code><technical_language>move declaration out here? declare return try block, before</technical_language>

Target:
public List<RepoCollection> getCollectionVersions(String bucketName, String key) throws RepoException { try { sqlService.getReadOnlyConnection(); if (StringUtil.isEmpty(bucketName)) { throw new RepoException(RepoException.Type.NoBucketEntered); } if (StringUtil.isEmpty(key)) { throw new RepoException(RepoException.Type.NoCollectionKeyEntered); } List<RepoCollection> repoCollections = sqlService.listCollectionVersions(bucketName, key); return repoCollections; } catch (SQLException e) { throw new RepoException(e); } finally { sqlReleaseConnection(); } }
Source:
<code>private Description checkMethodInvocation( MethodInvocationTree methodInvocation, LambdaExpressionTree root, VisitorState state) { Symbol.MethodSymbol methodSymbol = ASTHelpers.getSymbol(methodInvocation); if (methodSymbol == null || !methodInvocation.getTypeArguments().isEmpty()) { return Description.NO_MATCH; } ExpressionTree receiver = ASTHelpers.getReceiver(methodInvocation); boolean isLocal = isLocal(methodInvocation); <START> if (!isLocal && !(receiver instanceof IdentifierTree)) { <END> return Description.NO_MATCH; } if (methodInvocation.getArguments().isEmpty() && root.getParameters().size() == 1) { return convertVariableInstanceMethods(methodSymbol, methodInvocation, root, state); } if (methodInvocation.getArguments().size() == root.getParameters().size()) { return convertMethodInvocations(methodSymbol, methodInvocation, root, state); } return Description.NO_MATCH; }</code><technical_language>this prevent fixing static method calls? I static methods receivers (but I incorrect) diff - -> Preconditions.checkNotNull(value) + Preconditions::checkNotNull</technical_language>

Target:
private Description checkMethodInvocation( MethodInvocationTree methodInvocation, LambdaExpressionTree root, VisitorState state) { Symbol.MethodSymbol methodSymbol = ASTHelpers.getSymbol(methodInvocation); if (methodSymbol == null || !methodInvocation.getTypeArguments().isEmpty() || hasExplicitParameterTypes(root, state)) { return Description.NO_MATCH; } ExpressionTree receiver = ASTHelpers.getReceiver(methodInvocation); boolean isLocal = isLocal(methodInvocation); if (!isLocal && !(receiver instanceof IdentifierTree)) { return Description.NO_MATCH; } if (methodInvocation.getArguments().isEmpty() && root.getParameters().size() == 1) { return convertVariableInstanceMethods(methodSymbol, methodInvocation, root, state); } if (methodInvocation.getArguments().size() == root.getParameters().size()) { return convertMethodInvocations(methodSymbol, methodInvocation, root, state); } return Description.NO_MATCH; }
Source:
<code>private long getMaxBytesPerRowForAggregators(IncrementalIndexSchema incrementalIndexSchema) { long maxAggregatorIntermediateSize = Integer.BYTES * incrementalIndexSchema.getMetrics().length; maxAggregatorIntermediateSize += Arrays.stream(incrementalIndexSchema.getMetrics()) .reduce( 0, (sum, aggregator) -> sum += aggregator.getMaxIntermediateSize(), (sum1, sum2) -> sum1 + sum2 ); <START> return maxAggregatorIntermediateSize; <END> }</code><technical_language>elaborate more this? actual size bigger calculated one</technical_language>

Target:
private static long getMaxBytesPerRowForAggregators(IncrementalIndexSchema incrementalIndexSchema) { long maxAggregatorIntermediateSize = Integer.BYTES * incrementalIndexSchema.getMetrics().length; maxAggregatorIntermediateSize += Arrays.stream(incrementalIndexSchema.getMetrics()) .mapToLong(aggregator -> aggregator.getMaxIntermediateSize() + Long.BYTES * 2) .sum(); return maxAggregatorIntermediateSize; }
Source:
<code>public void watchForData(String path) { if (!checkIfPathBelongsToZkRealm(path)) { throw new IllegalArgumentException( "The given path does not map to the ZK realm for this DedicatedZkClient! Path: " + path + " ZK realm sharding key: " + _zkRealmShardingKey); <START> } <END> _rawZkClient.watchForData(path); }</code><technical_language>duplicate code. put exception throwing checkIfPathBelongsToZkRealm validateZkRealmPath() duplicate exception throwing in method. Update: I wrap this a method getZkClient(path) put this check logic in it. getZkClient(path).operation()</technical_language>

Target:
public void watchForData(String path) { checkIfPathContainsShardingKey(path); _rawZkClient.watchForData(path); }
Source:
<code>protected Option[] configurePaxExam() { return options( <START> logLevel(LogLevelOption.LogLevel.DEBUG), <END> useOwnExamBundlesStartLevel(100), systemTimeout(GENERIC_TIMEOUT_MILLISECONDS), when(Boolean.getBoolean("keepRuntimeFolder")).useOptions(keepRuntimeFolder()), cleanCaches(true)); }</code><technical_language>This INFO most</technical_language>

Target:
protected Option[] configurePaxExam() { return options( logLevel(LogLevelOption.LogLevel.WARN), useOwnExamBundlesStartLevel(100), systemTimeout(GENERIC_TIMEOUT_MILLISECONDS), when(Boolean.getBoolean("keepRuntimeFolder")).useOptions(keepRuntimeFolder()), cleanCaches(true)); }
Source:
<code><START> public void process(AudioStream audioStream) throws UnsupportedAudioFormatException { <END> logger.debug("Received audio stream of format {}", audioStream.getFormat()); if (audioStream instanceof URLAudioStream) { URLAudioStream urlAudioStream = (URLAudioStream) audioStream; sendEvent(urlAudioStream.getURL()); try { audioStream.close(); } catch (IOException e) { } } else { if (audioStream instanceof FixedLengthAudioStream) { String url = audioHTTPServer.serve((FixedLengthAudioStream) audioStream, 10).toString(); sendEvent(url); } else { logger.warn("Only FixedLengthAudioStream are supported for web audio sink"); } } }</code><technical_language>give some details audio stream handling is defined for function? If passes a audio stream a process method is audio stream - closed method in cases - closed method if exception is thrown - closed caller I a consistent behaviour here. - if is instance of URLAudioStream is closed - if is instance of FixedLengthAudioStream is closed max. 10 secnonds - in other cases is closed a AudioStream interface extend InputStream interface closed independent of specific implementation. miss I here</technical_language>

Target:
public void process(AudioStream audioStream) throws UnsupportedAudioFormatException { logger.debug("Received audio stream of format {}", audioStream.getFormat()); if (audioStream instanceof URLAudioStream) { URLAudioStream urlAudioStream = (URLAudioStream) audioStream; sendEvent(urlAudioStream.getURL()); IOUtils.closeQuietly(audioStream); } else { if (audioStream instanceof FixedLengthAudioStream) { String url = audioHTTPServer.serve((FixedLengthAudioStream) audioStream, 10).toString(); sendEvent(url); } else { logger.warn("Only FixedLengthAudioStream are supported for the web audio sink."); IOUtils.closeQuietly(audioStream); } } }
Source:
<code>protected void run() throws Exception { StoredConfig dbconfig = db.getConfig(); RemoteConfig remoteConfig = new RemoteConfig(dbconfig, remote); PubSubConfig pubsubConfig = SubscribeDaemon.getConfig(); List<URIish> uris = remoteConfig.getURIs(); if (uris.isEmpty()) { <START> out.println(MessageFormat.format( <END> CLIText.get().noRemoteUriSubscribe, remote)); return; } String uriRoot = PubSubConfig.getUriRoot(uris.get(0)); String dir = db.getDirectory().getAbsolutePath(); Publisher p = pubsubConfig.getPublisher(uriRoot); if (p == null) { p = new Publisher(uriRoot); pubsubConfig.addPublisher(p); } Subscriber s = p.getSubscriber(remote, dir); if (s == null) p.addSubscriber(new Subscriber(p, remote, dir)); try { SubscribeDaemon.updateConfig(pubsubConfig); } catch (IOException e) { out.println(MessageFormat.format(CLIText.get().cannotWrite, SubscribeDaemon.getConfigFile())); return; } out.println(MessageFormat.format( CLIText.get().didSubscribe, remote, uriRoot)); }</code><technical_language>throw die(msg) instead, this care for error exit codes error stream for error output</technical_language>

Target:
protected void run() throws Exception { StoredConfig dbconfig = db.getConfig(); RemoteConfig remoteConfig = new RemoteConfig(dbconfig, remote); PubSubConfig pubsubConfig = SubscribeDaemon.getConfig(); List<URIish> uris = remoteConfig.getURIs(); if (uris.isEmpty()) throw die(MessageFormat.format( CLIText.get().noRemoteUriSubscribe, remote)); String uriRoot = PubSubConfig.getUriRoot(uris.get(0)); String dir = db.getDirectory().getAbsolutePath(); Publisher p = pubsubConfig.getPublisher(uriRoot); if (p == null) { p = new Publisher(uriRoot); pubsubConfig.addPublisher(p); } Subscriber s = p.getSubscriber(remote, dir); if (s == null) p.addSubscriber(new Subscriber(p, remote, dir)); try { SubscribeDaemon.updateConfig(pubsubConfig); } catch (IOException e) { throw die(MessageFormat.format(CLIText.get().cannotWrite, SubscribeDaemon.getConfigFile())); } out.println(MessageFormat.format( CLIText.get().didSubscribe, remote, uriRoot)); }
Source:
<code>public static boolean isNotEmpty(final Collection coll) { <START> return coll != null && !coll.isEmpty(); <END> }</code><technical_language>simply turn this !isEmpty()</technical_language>

Target:
public static boolean isNotEmpty(final Collection coll) { return !isEmpty(coll); }
Source:
<code>public Person updatePerson(String configName, Person person) { try { <START> Config config = configService.getConfigByName(configName); <END> Person fetchedPerson = personResource.getPersonById(config, person.getUuid()); Person.Address addressForUpdate = fetchedPerson.getPreferredAddress(); if(addressForUpdate != null) { person.getPreferredAddress().setUuid(addressForUpdate.getUuid()); } personResource.updatePersonAddress(config, person.getUuid(), person.getPreferredAddress()); Person.Name nameForUpdate = fetchedPerson.getPreferredName(); person.getPreferredName().setUuid(nameForUpdate.getUuid()); personResource.updatePersonName(config, person.getUuid(), person.getPreferredName()); Person generalInformationForUpdate = prepareGeneralInformationForUpdate(person); Person updated = personResource.updatePerson(config, generalInformationForUpdate); eventRelay.sendEventMessage(new MotechEvent(EventKeys.UPDATED_PERSON_SUBJECT, EventHelper.personParameters(updated))); return updated; } catch (HttpClientErrorException e) { throw new OpenMRSException("Failed to update a person in OpenMRS with id: " + person.getUuid(), e); } }</code><technical_language>add validation for person. I suppose uuid is required here, I right</technical_language>

Target:
public Person updatePerson(String configName, Person person) { Validate.notEmpty(person.getUuid(), "Person uuid cannot be null"); try { Config config = configService.getConfigByName(configName); Person fetchedPerson = personResource.getPersonById(config, person.getUuid()); Person.Address addressForUpdate = fetchedPerson.getPreferredAddress(); if(addressForUpdate != null) { person.getPreferredAddress().setUuid(addressForUpdate.getUuid()); } personResource.updatePersonAddress(config, person.getUuid(), person.getPreferredAddress()); Person.Name nameForUpdate = fetchedPerson.getPreferredName(); person.getPreferredName().setUuid(nameForUpdate.getUuid()); personResource.updatePersonName(config, person.getUuid(), person.getPreferredName()); Person updated = personResource.updatePerson(config, person); eventRelay.sendEventMessage(new MotechEvent(EventKeys.UPDATED_PERSON_SUBJECT, EventHelper.personParameters(updated))); return updated; } catch (HttpClientErrorException e) { throw new OpenMRSException("Failed to update a person in OpenMRS with id: " + person.getUuid(), e); } }
Source:
<code>public void send(Message<?> message, ScopeDescriptor scopeDescription) throws Exception { if (scopeDescription instanceof AggregateScopeDescriptor) { String aggregateIdentifier = ((AggregateScopeDescriptor) scopeDescription).getIdentifier().toString(); Aggregate<T> aggregate = load(aggregateIdentifier); <START> if (aggregate != null) { <END> aggregate.handle(message); } else { logger.debug("Aggregate (with id: " + aggregateIdentifier + ") cannot be loaded. Hence, message '" + message + "' cannot be handled."); } } }</code><technical_language>This is non-null. load() throws AggregateNotFoundException aggregate found</technical_language>

Target:
public void send(Message<?> message, ScopeDescriptor scopeDescription) throws Exception { if (canResolve(scopeDescription)) { String aggregateIdentifier = ((AggregateScopeDescriptor) scopeDescription).getIdentifier().toString(); load(aggregateIdentifier).handle(message); } }
Source:
<code>void removeFromIndexes(TransactionContext transactionContext, Object key) { <START> transactionContext = transactionContext == null ? makeTransactionalEventContext() : transactionContext; <END> Stream<IndexedTypeIdentifier> typeIdentifiers = getKnownClasses().stream().map(PojoIndexedTypeIdentifier::new); Set<Work> deleteWorks = typeIdentifiers .flatMap(e -> searchWorkCreator.createPerEntityIdWorks(keyToString(key), e, WorkType.DELETE).stream()) .collect(Collectors.toSet()); performSearchWorks(deleteWorks, transactionContext); }</code><technical_language>Assigning is a bit strange. do if (transactionContext == null) { transactionContext = makeTransactionalEventContext(); }</technical_language>

Target:
void removeFromIndexes(TransactionContext transactionContext, Object key) { transactionContext = transactionContext == null ? makeTransactionalEventContext() : transactionContext; Stream<IndexedTypeIdentifier> typeIdentifiers = getKnownClasses().stream().map(PojoIndexedTypeIdentifier::new); Set<Work> deleteWorks = typeIdentifiers .map(e -> searchWorkCreator.createEntityWork(keyToString(key), e, WorkType.DELETE)) .collect(Collectors.toSet()); performSearchWorks(deleteWorks, transactionContext); }
Source:
<code>public void setIdleMinutesStr(String idleMinutes) { <START> if ("".equals(idleMinutes)) { <END> setIdleMinutes(Integer.MIN_VALUE); } else { setIdleMinutes(Integer.parseInt(idleMinutes)); } }</code><technical_language>want StringUtils.isBlank() empty string</technical_language>

Target:
public void setIdleMinutesStr(String idleMinutes) { if (StringUtils.isBlank(idleMinutes)) { setIdleMinutes(0); } else { setIdleMinutes(Integer.parseInt(idleMinutes)); } }
Source:
<code>public void setup() { CatalogProvider catProvider1 = mock(CatalogProvider.class); <START> when(catProvider1.getId()).thenReturn("cat1"); <END> source = mock(CatalogProvider.class); when(source.getId()).thenReturn("cat1"); subject = mock(Subject.class); properties.put(SecurityConstants.SECURITY_SUBJECT, subject); filterAdapter = new GeotoolsFilterAdapterImpl(); filterBuilder = new GeotoolsFilterBuilder(); testValidationWarningQueryDelegate = new ValidationQueryDelegate(Validation.VALIDATION_WARNINGS); testValidationErrorQueryDelegate = new ValidationQueryDelegate(Validation.VALIDATION_ERRORS); plugin = new ValidationFilterPlugin(filterAdapter, filterBuilder); List<String> attributeMapping = new ArrayList<>(); attributeMapping.add("invalid-state=datamanager,admin"); plugin.setAttributeMap(attributeMapping); }</code><technical_language>Is this mock anything? I else</technical_language>

Target:
public void setup() { source = mock(CatalogProvider.class); when(source.getId()).thenReturn("cat1"); subject = mock(Subject.class); properties.put(SecurityConstants.SECURITY_SUBJECT, subject); filterAdapter = new GeotoolsFilterAdapterImpl(); filterBuilder = new GeotoolsFilterBuilder(); testValidationWarningQueryDelegate = new ValidationQueryDelegate(Validation.VALIDATION_WARNINGS); testValidationErrorQueryDelegate = new ValidationQueryDelegate(Validation.VALIDATION_ERRORS); plugin = new ValidationFilterPlugin(filterBuilder); List<String> attributeMapping = new ArrayList<>(); attributeMapping.add("invalid-state=data-manager,system-admin"); plugin.setAttributeMap(attributeMapping); }
Source:
<code>public ValidationResult isRunningVmsOrVmLeasesForBackupDomain() { List<String> invalidVmsForBackupStorageDomain = new ArrayList<>(); QueryReturnValue ret = getEntitiesWithLeaseIdForStorageDomain(storageDomain.getId()); if (!ret.getSucceeded()) { return new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_RETRIEVE_VMS_FOR_WITH_LEASES); } <START> if (!ret.<List<VmBase>> getReturnValue().isEmpty()) { <END> ret.<List<VmBase>>getReturnValue() .stream() .forEach(vmBase -> invalidVmsForBackupStorageDomain.add(vmBase.getName())); } List<VM> vms = getVmDao().getAllActiveForStorageDomain(storageDomain.getId()); invalidVmsForBackupStorageDomain.addAll(vms.stream() .filter(vm -> vm.getDiskMap() .values() .stream() .filter(DisksFilter.ONLY_IMAGES) .filter(DisksFilter.ONLY_PLUGGED) .map(DiskImage.class::cast) .anyMatch(vmDisk -> vmDisk.getStorageIds().get(0).equals(storageDomain.getId()))) .map(vm -> vm.getName()) .collect(Collectors.toList())); if (!invalidVmsForBackupStorageDomain.isEmpty()) { log.warn("The storage domain could not become backup storage domain since it " + "contains VMs with leases or active disks which are attached to running VMs." + "The following VMs list are: '{}'", invalidVmsForBackupStorageDomain); return new ValidationResult( EngineMessage.ACTION_TYPE_FAILED_RUNNING_VM_OR_VM_LEASES_PRESENT_ON_STORAGE_DOMAIN); } return ValidationResult.VALID; }</code><technical_language>* please extract 'ret.<List<VmBase>> getReturnValue()' a variable * diamond here</technical_language>

Target:
public ValidationResult isRunningVmsOrVmLeasesForBackupDomain() { List<String> invalidVmsForBackupStorageDomain = new ArrayList<>(); QueryReturnValue ret = getEntitiesWithLeaseIdForStorageDomain(storageDomain.getId()); if (!ret.getSucceeded()) { return new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_RETRIEVE_VMS_FOR_WITH_LEASES); } if (!getRetVal(ret).isEmpty()) { getRetVal(ret).stream().forEach(vmBase -> invalidVmsForBackupStorageDomain.add(vmBase.getName())); } List<VM> vms = getVmDao().getAllActiveForStorageDomain(storageDomain.getId()); invalidVmsForBackupStorageDomain.addAll(vms.stream() .filter(vm -> vm.getDiskMap() .values() .stream() .filter(DisksFilter.ONLY_IMAGES) .filter(DisksFilter.ONLY_PLUGGED) .map(DiskImage.class::cast) .anyMatch(vmDisk -> vmDisk.getStorageIds().get(0).equals(storageDomain.getId()))) .map(vm -> vm.getName()) .collect(Collectors.toList())); if (!invalidVmsForBackupStorageDomain.isEmpty()) { log.warn("Can't update the backup property of the storage domain since it contains VMs with " + "leases or active disks which are attached to running VMs." + "The following VMs list are: '{}'", invalidVmsForBackupStorageDomain); return new ValidationResult( EngineMessage.ACTION_TYPE_FAILED_RUNNING_VM_OR_VM_LEASES_PRESENT_ON_STORAGE_DOMAIN); } return ValidationResult.VALID; }
Source:
<code>public GraphHopper() { chFactoryDecorator.setEnabled(true); lmFactoryDecorator.setEnabled(false); <START> arFactoryDecorator.setEnabled(true); <END> algoDecorators.add(chFactoryDecorator); algoDecorators.add(lmFactoryDecorator); algoDecorators.add(arFactoryDecorator); }</code><technical_language>I enable this default. is need change tests</technical_language>

Target:
public GraphHopper() { chFactoryDecorator.setEnabled(true); lmFactoryDecorator.setEnabled(false); arFactoryDecorator.setEnabled(false); algoDecorators.add(chFactoryDecorator); algoDecorators.add(lmFactoryDecorator); algoDecorators.add(arFactoryDecorator); }
Source:
<code>private void loadApns(SQLiteDatabase db, XmlPullParser parser) { if (parser != null) { try { db.beginTransaction(); while (parser.getEventType() != XmlPullParser.END_DOCUMENT) { try { XmlUtils.nextElement(parser); <START> } catch (XmlPullParserException e) { <END> Log.e(TAG, "Got parser execption while getting next element", e); continue; } ContentValues row = getRow(parser); if (row == null) { continue; } insertAddingDefaults(db, CARRIERS_TABLE, row); } db.setTransactionSuccessful(); } catch (XmlPullParserException e) { Log.e(TAG, "Got XmlPullParserException while loading apns.", e); } catch (IOException e) { Log.e(TAG, "Got IOException while loading apns.", e); } catch (SQLException e) { Log.e(TAG, "Got SQLException while loading apns.", e); } finally { db.endTransaction(); } } }</code><technical_language>Sorry, I understand hide error. I a rooted device OTA contained a bad apns-conf.xml a malformed file. adding this code more problem undetected. I a solution a dialog notification added this code, more effort worth. present a case this a normal user</technical_language>

Target:
private void loadApns(SQLiteDatabase db, XmlPullParser parser) { if (parser != null) { try { db.beginTransaction(); while (parser.getEventType() != XmlPullParser.END_DOCUMENT) { XmlUtils.nextElement(parser); ContentValues row = getRow(parser); if (row == null) { continue; } insertAddingDefaults(db, CARRIERS_TABLE, row); } db.setTransactionSuccessful(); } catch (XmlPullParserException e) { Log.e(TAG, "Got XmlPullParserException while loading apns.", e); } catch (IOException e) { Log.e(TAG, "Got IOException while loading apns.", e); } catch (SQLException e) { Log.e(TAG, "Got SQLException while loading apns.", e); } finally { db.endTransaction(); } } }
Source:
<code>private <R> FusionTask(final String desc, final FusionTask<S, R> predecessor, final PromisePropagator<R, T> propagator) { super(desc); _asyncTask = predecessor._asyncTask; _source = predecessor._source; <START> _predecessor = predecessor.getShallowTraceBuilder(); <END> _propagator = completing(compose(predecessor._propagator, adaptToAcceptTraceContext(propagator))); }</code><technical_language>rename _predecessor _predecessorShallowTraceBuilder... kind of long</technical_language>

Target:
private <R> FusionTask(final String desc, final FusionTask<S, R> predecessor, final PromisePropagator<R, T> propagator) { super(desc); _asyncTask = predecessor._asyncTask; _predecessorShallowTraceBuilder = predecessor.getShallowTraceBuilder(); _propagator = completing(compose(predecessor._propagator, adaptToAcceptTraceContext(propagator))); }
Source:
<code>public AggregateCombiner makeAggregateCombiner() { <START> throw new UOE("[%s] is not supported during ingestion for rollup", getClass().getSimpleName()); <END> }</code><technical_language>Is implement this, is preventing this supported</technical_language>

Target:
public AggregateCombiner makeAggregateCombiner() { return new LongAggregateCombiner() { private long result; @Override public void reset(ColumnValueSelector selector) { result = getTimestamp(selector); } private long getTimestamp(ColumnValueSelector selector) { if (selector instanceof ObjectColumnSelector) { Object input = ((ObjectColumnSelector) selector).get(); return convertLong(timestampSpec, input); } else { return selector.getLong(); } } @Override public void fold(ColumnValueSelector selector) { long other = getTimestamp(selector); if (comparator.compare(result, other) <= 0) { result = other; } } @Override public long getLong() { return result; } }; }
Source:
<code>private boolean isVmDown(VM vm) { <START> return vm != null && vm.getStatus() == VMStatus.Down; <END> }</code><technical_language>get vm == null, removed here</technical_language>

Target:
private boolean isVmDown(VM vm) { return vm.getStatus() == VMStatus.Down; }
Source:
<code>private void setTabAndViewPagerSynchronisation() { viewPager.setFocusableInTouchMode(true); viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() { @Override public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { } @Override public void onPageSelected(int position) { switch (position) { case CONTRIBUTIONS_TAB_POSITION: Timber.d("Contributions tab selected"); tabLayout.getTabAt(CONTRIBUTIONS_TAB_POSITION).select(); isContributionsFragmentVisible = true; <START> ((NearbyParentFragment)contributionsActivityPagerAdapter.getItem(NEARBY_TAB_POSITION)).hideKeyboard(); <END> updateMenuItem(); break; case NEARBY_TAB_POSITION: Timber.d("Nearby tab selected"); tabLayout.getTabAt(NEARBY_TAB_POSITION).select(); isContributionsFragmentVisible = false; updateMenuItem(); NearbyParentFragmentPresenter.getInstance().onTabSelected(); break; default: tabLayout.getTabAt(CONTRIBUTIONS_TAB_POSITION).select(); break; } } @Override public void onPageScrollStateChanged(int state) { } }); tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() { @Override public void onTabSelected(TabLayout.Tab tab) { viewPager.setCurrentItem(tab.getPosition()); } @Override public void onTabUnselected(TabLayout.Tab tab) { } @Override public void onTabReselected(TabLayout.Tab tab) { } }); }</code><technical_language>a function in utils & call activity involve NearbyFragment</technical_language>

Target:
private void setTabAndViewPagerSynchronisation() { viewPager.setFocusableInTouchMode(true); viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() { @Override public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { } @Override public void onPageSelected(int position) { switch (position) { case CONTRIBUTIONS_TAB_POSITION: Timber.d("Contributions tab selected"); tabLayout.getTabAt(CONTRIBUTIONS_TAB_POSITION).select(); isContributionsFragmentVisible = true; ViewUtil.hideKeyboard(tabLayout.getRootView()); updateMenuItem(); break; case NEARBY_TAB_POSITION: Timber.d("Nearby tab selected"); tabLayout.getTabAt(NEARBY_TAB_POSITION).select(); isContributionsFragmentVisible = false; updateMenuItem(); NearbyParentFragmentPresenter.getInstance().onTabSelected(); break; default: tabLayout.getTabAt(CONTRIBUTIONS_TAB_POSITION).select(); break; } } @Override public void onPageScrollStateChanged(int state) { } }); tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() { @Override public void onTabSelected(TabLayout.Tab tab) { viewPager.setCurrentItem(tab.getPosition()); } @Override public void onTabUnselected(TabLayout.Tab tab) { } @Override public void onTabReselected(TabLayout.Tab tab) { } }); }
Source:
<code>private boolean checkQuota() { <START> if (source.overallController.getTotalBufferUsed().get() > source.overallController <END> .getTotalBufferLimit()) { LOG.warn("peer={}, can't read more edits from WAL as buffer usage {}B exceeds limit {}B", this.source.getPeerId(), source.overallController.getTotalBufferUsed().get(), source.overallController.getTotalBufferLimit()); Threads.sleep(sleepForRetries); return false; } return true; }</code><technical_language>Yeah, if Controller is in ReplicationSourceManager, 'overall' redundant</technical_language>

Target:
private boolean checkQuota() { if (source.controller.getTotalBufferUsed().get() > source.controller .getTotalBufferLimit()) { LOG.warn("peer={}, can't read more edits from WAL as buffer usage {}B exceeds limit {}B", this.source.getPeerId(), source.controller.getTotalBufferUsed().get(), source.controller.getTotalBufferLimit()); Threads.sleep(sleepForRetries); return false; } return true; }
Source:
<code>public SolenoidSet(SolenoidSubsystem system, SolenoidState state, BooleanSupplier... booleanSuppliers) { this.system = system; this.state = state; this.booleanSuppliers = booleanSuppliers; <START> requirements = Set.of((Subsystem) system); <END> }</code><technical_language>add this property. Requirements computed solely in getRequirements</technical_language>

Target:
public SolenoidSet(SolenoidSubsystem system, SolenoidState state, BooleanSupplier... booleanSuppliers) { this("SolenoidSet", system, state, booleanSuppliers); }
Source:
<code>public TransientStore getTransientStore() { TransientStoreService tss = Framework.getService(TransientStoreService.class); <START> return tss.getStore(StringUtils.isNotBlank(this.storeName) ? storeName : CACHE_NAME); <END> }</code><technical_language>isNotBlank this user input config file. storeName != null</technical_language>

Target:
public TransientStore getTransientStore() { TransientStoreService tss = Framework.getService(TransientStoreService.class); return tss.getStore(storeName != null ? storeName : CACHE_NAME); }
Source:
<code>public void updateEntry(@RequestBody EntryDTO entryDTO) { Entry entry = entryService.getEntryById(entryDTO.getId()); entry.updateEntry(entryDTO); if (UserUtil.hasRole(0)) { smtpMailSender.sendToUsers(trainingService.getTrainingById(entry.getTraining().getId()).getParticipants(), "Trainings", emailMessages.modifyEntry(entry)); } else { entry.getTraining().setStatus(TrainingStatus.DRAFTED); trainingService.updateTraining(entry.getTraining()); trainingEventService.addEvent(new TrainingEvent(entryDTO)); List<EventDTO> list = new ArrayList<>(); List<Event> events = new ArrayList<>(); events.addAll(trainingEventService.getUnwatchedEvents()); events.addAll(trainingFeedbackEventService.getUnwatchedEvents()); events.addAll(userFeedbackEventService.getUnwatchedEvents()); for (Event event: events){ list.add(event.toEventDTO()); } for (Map.Entry<DeferredResult<List<EventDTO>>, Integer> mapEntry : EventController.eventRequests.entrySet()) { mapEntry.getKey().setResult(list); <START> } <END> smtpMailSender.sendToUsers(userService.getUsersByRole(UserRole.ADMIN), "Changes in training", entryDTO.getEventDescription()); } }</code><technical_language>move this code method is reused</technical_language>

Target:
public void updateEntry(@RequestBody EntryDTO entryDTO) { Entry entry = entryService.getEntryById(entryDTO.getId()); entry.updateEntry(entryDTO); if (UserUtil.hasRole(0)) { smtpMailSender.sendToUsers(trainingService.getTrainingById(entry.getTraining().getId()).getParticipants(), "Trainings", emailMessages.modifyEntry(entry)); } else { entry.getTraining().setStatus(TrainingStatus.DRAFTED); trainingService.updateTraining(entry.getTraining()); trainingEventService.addEvent(new TrainingEvent(entryDTO)); for (Map.Entry<DeferredResult<List<EventDTO>>, Integer> mapEntry : EventController.eventRequests.entrySet()) { mapEntry.getKey().setResult(getEvents()); } smtpMailSender.sendToUsers(userService.getUsersByRole(UserRole.ADMIN), "Changes in training", entryDTO.getEventDescription()); } }
Source:
<code>public void setHashedPassword(String hashedPassword) { SharedPreferences.Editor editor = getOpenMRSSharedPreferences().edit(); editor.putString(ApplicationConstants.UserKeys.HASHED_PASSWORD, hashedPassword); <START> editor.commit(); <END> }</code><technical_language>is practice editor.apply() commit() called UI thread</technical_language>

Target:
public void setHashedPassword(String hashedPassword) { SharedPreferences.Editor editor = getOpenMRSSharedPreferences().edit(); editor.putString(ApplicationConstants.UserKeys.HASHED_PASSWORD, hashedPassword); editor.apply(); }
Source:
<code>protected PollingResult compareRemoteRevisionWith(AbstractProject<?, ?> project, Launcher launcher, FilePath workspace, TaskListener listener, SCMRevisionState scmrs) throws IOException, InterruptedException { <START> if(skipNextPoll) { <END> return PollingResult.NO_CHANGES; } AbstractModeDelegate delegate = AccurevMode.findDelegate(this); return delegate.compareRemoteRevisionWith(project, launcher, workspace, listener, scmrs); }</code><technical_language>change project.isBuilding(), set this.project</technical_language>

Target:
protected PollingResult compareRemoteRevisionWith(AbstractProject<?, ?> project, Launcher launcher, FilePath workspace, TaskListener listener, SCMRevisionState scmrs) throws IOException, InterruptedException { if (activeProject == null) { activeProject = project; } else { return PollingResult.NO_CHANGES; } AbstractModeDelegate delegate = AccurevMode.findDelegate(this); return delegate.compareRemoteRevisionWith(project, launcher, workspace, listener, scmrs); }
Source:
<code><START> public void delete() { <END> final String confirmedName = view.getConfirmedName(); if (!project.getProjectName().equals(confirmedName)) { view.showError(view.getWrongConfirmedNameValidationMessage()); return; } view.showBusyIndicator(view.getDeletingMessage()); projectService.call(v -> { deleteProjectEvent.fire(new DeleteProjectEvent(project)); view.hideBusyIndicator(); notificationEvent.fire(new NotificationEvent(view.getDeleteSuccessMessage(), NotificationEvent.NotificationType.SUCCESS)); view.hide(); libraryPlaces.goToOrganizationalUnits(); }, new HasBusyIndicatorDefaultErrorCallback(view)).delete(project.getPomXMLPath(), PROJECT_DELETED); }</code><technical_language>ErrorCallback close "busy indicator."</technical_language>

Target:
public void delete() { final String confirmedName = view.getConfirmedName(); if (!project.getMainModule().getModuleName().equals(confirmedName)) { view.showError(view.getWrongConfirmedNameValidationMessage()); return; } view.showBusyIndicator(view.getDeletingMessage()); projectService.call(v -> { view.hideBusyIndicator(); view.hide(); }, new HasBusyIndicatorDefaultErrorCallback(view)).delete(project.getMainModule().getPomXMLPath(), PROJECT_DELETED); }
Source:
<code>protected static void performOnElement(final GoIntroduceOperation operation) { final GoExpression expression = operation.getExpression(); PsiElement statement = PsiTreeUtil.getParentOfType(expression, GoStatement.class); if (statement == null) { <START> showCannotPerform(operation, RefactoringBundle.message("refactoring.introduce.context.error")); <END> return; } LinkedHashSet<String> suggestedNames = getSuggestedNames(expression); operation.setSuggestedNames(suggestedNames); operation.setOccurrences(getOccurrences(expression, PsiTreeUtil.getParentOfType(statement, GoBlock.class))); final Editor editor = operation.getEditor(); if (editor.getSettings().isVariableInplaceRenameEnabled()) { operation.setName(ContainerUtil.getFirstItem(suggestedNames)); if (ApplicationManager.getApplication().isUnitTestMode()) { operation.setReplaceAll(true); performInplaceIntroduce(operation); return; } OccurrencesChooser.simpleChooser(editor) .showChooser(expression, operation.getOccurrences(), new Pass<OccurrencesChooser.ReplaceChoice>() { @Override public void pass(OccurrencesChooser.ReplaceChoice choice) { operation.setReplaceAll(choice == OccurrencesChooser.ReplaceChoice.ALL); performInplaceIntroduce(operation); } }); } }</code><technical_language>occurs earlier</technical_language>

Target:
protected static void performOnElement(final GoIntroduceOperation operation) { final GoExpression expression = operation.getExpression(); PsiElement statement = PsiTreeUtil.getParentOfType(expression, GoStatement.class); LinkedHashSet<String> suggestedNames = getSuggestedNames(expression); operation.setSuggestedNames(suggestedNames); operation.setOccurrences(getOccurrences(expression, PsiTreeUtil.getTopmostParentOfType(statement, GoBlock.class))); final Editor editor = operation.getEditor(); if (editor.getSettings().isVariableInplaceRenameEnabled()) { operation.setName(ContainerUtil.getFirstItem(suggestedNames)); if (ApplicationManager.getApplication().isUnitTestMode()) { performInplaceIntroduce(operation); return; } OccurrencesChooser.simpleChooser(editor) .showChooser(expression, operation.getOccurrences(), new Pass<OccurrencesChooser.ReplaceChoice>() { @Override public void pass(OccurrencesChooser.ReplaceChoice choice) { operation.setReplaceAll(choice == OccurrencesChooser.ReplaceChoice.ALL); performInplaceIntroduce(operation); } }); } }
Source:
<code>public Collection<CraftingRecipe> getRecipes() { <START> return Collections.unmodifiableList((List<CraftingRecipe>) (List<?>) recipes); <END> }</code><technical_language>this</technical_language>

Target:
public Collection<CraftingRecipe> getRecipes() { return Collections.unmodifiableList((List<CraftingRecipe>) (List<?>) this.recipes); }
Source:
<code>public Boolean squashChangeRequest(final String spaceName, final String repositoryAlias, final Long changeRequestId, final String commitMessage) { final Repository repository = resolveRepository(spaceName, repositoryAlias); final ChangeRequest changeRequest = getChangeRequestById(spaceName, repositoryAlias, false, changeRequestId); final Git git = getGitFromBranch(repository, changeRequest.getSourceBranch()); final String startCommit = changeRequest.getStartCommitId(); <START> git.squash(changeRequest.getSourceBranch(), <END> startCommit, commitMessage); return mergeChangeRequest(spaceName, repositoryAlias, changeRequestId); }</code><technical_language>Is ok squash source branch? I mean, history lost</technical_language>

Target:
public Boolean squashChangeRequest(final String spaceName, final String repositoryAlias, final Long changeRequestId, final String commitMessage) { final Repository repository = resolveRepository(spaceName, repositoryAlias); final ChangeRequest changeRequest = getChangeRequestById(spaceName, repositoryAlias, false, changeRequestId); final Git git = getGitFromBranch(repository, changeRequest.getSourceBranch()); final String startCommit = changeRequest.getStartCommitId(); final boolean result = mergeChangeRequest(spaceName, repositoryAlias, changeRequestId); git.squash(changeRequest.getTargetBranch(), startCommit, commitMessage); return result; }
Source:
<code>public void createCheckRunNoAnnotations() throws Exception { GHCheckRun checkRun = gitHub.getRepository("jglick/github-api-test") .createCheckRun("quick", "4a929d464a2fae7ee899ce603250f7dab304bc4b") <START> .withConclusion(GHCheckRun.Conclusion.NEUTRAL) <END> .withOutput("Quick note", "nothing more to see here") .done() .create(); assertEquals("completed", checkRun.getStatus()); assertEquals(0, checkRun.getOutput().getAnnotationsCount()); assertEquals(538002758, checkRun.id); }</code><technical_language>Conclusion is optional competedAt is set. need test for that</technical_language>

Target:
public void createCheckRunNoAnnotations() throws Exception { GHCheckRun checkRun = gitHub.getRepository("jglick/github-api-test") .createCheckRun("quick", "4a929d464a2fae7ee899ce603250f7dab304bc4b") .withConclusion(GHCheckRun.Conclusion.NEUTRAL) .add(new GHCheckRunBuilder.Output("Quick note", "nothing more to see here")) .create(); assertEquals("completed", checkRun.getStatus()); assertEquals(0, checkRun.getOutput().getAnnotationsCount()); assertEquals(546384705, checkRun.id); }
Source:
<code>public void topologyVersion() { <START> System.out.println("test with event type: " + testLabel); <END> System.out.println("event = " + evt); System.out.println("topology version = " + topVer); AffinityTopologyVersion topVer = evt instanceof DiscoveryCustomEvent ? null : this.topVer; assertEquals(topVer, sut.topologyVersion()); }</code><technical_language>please log instead of println</technical_language>

Target:
public void topologyVersion() { LOG.info("test with event type: " + testLabel); LOG.info("event = " + evt); LOG.info("topology version = " + topVer); AffinityTopologyVersion topVer = evt instanceof DiscoveryCustomEvent ? null : this.topVer; assertEquals(topVer, sut.topologyVersion()); }
Source:
<code>protected void updateExternalVnicProfilesPerTargetCluster() { final Map<Cluster, Set<VnicProfileMappingEntity>> result = new HashMap<>(); <START> getEntities().getItems().stream().forEach( <END> importTemplateData -> updateExternalVnicProfilesPerTargetCluster( importTemplateData.getEntity().getInterfaces(), importTemplateData.getCluster().getSelectedItem(), result)); setExternalVnicProfilesPerTargetCluster(result); }</code><technical_language>need stream a Collection apply forEach it. getEntities().getItems().forEach</technical_language>

Target:
protected void updateExternalVnicProfilesPerTargetCluster() { final Map<Cluster, Set<VnicProfileMappingEntity>> result = new HashMap<>(); getEntities().getItems().forEach( importTemplateData -> updateExternalVnicProfilesPerTargetCluster( importTemplateData.getEntity().getInterfaces(), importTemplateData.getCluster().getSelectedItem(), result)); setExternalVnicProfilesPerTargetCluster(result); }
Source:
<code>public static Date convertLocalDateToUtc(Date localDate, double localTimeZone) { Calendar localCal = dateToCalendar(localDate); <START> localCal.add(Calendar.MILLISECOND, (int) (60 * 60 * 1000 * (-localTimeZone))); <END> return localCal.getTime(); }</code><technical_language>Calendar.MINUTE</technical_language>

Target:
public static Date convertLocalDateToUtc(Date localDate, double localTimeZone) { Calendar localCal = dateToCalendar(localDate); localCal.add(Calendar.MINUTE, (int) (60 * (-localTimeZone))); return localCal.getTime(); }
Source:
<code>public Map<String, ValidationReport> uploadProject(final Project project, final File archive, final String fileType, final User uploader, final Props additionalProps) throws ProjectManagerException { log.info("Uploading files to " + project.getName()); final Map<String, ValidationReport> reports; final Props prop = new Props(this.props); prop.putAll(additionalProps); File file = null; try { file = unzipProject(archive, fileType); <START> reports = validateProject(project, archive, file, prop); <END> final FlowLoader loader = this.flowLoaderFactory.createFlowLoader(file); loader.loadProjectFlow(project, file); final ValidationReport report = generateFlowLoaderReport(project); reports.put(DIRECTORY_FLOW_REPORT_KEY, report); } finally { cleanUpProjectTempDir(file); } if (!isReportStatusValid(reports, project)) { return reports; } persistProject(project, archive, uploader); cleanUpProjectOldInstallations(project); return reports; }</code><technical_language>If is validation error, is safe load save project</technical_language>

Target:
public Map<String, ValidationReport> uploadProject(final Project project, final File archive, final String fileType, final User uploader, final Props additionalProps) throws ProjectManagerException { log.info("Uploading files to " + project.getName()); final Map<String, ValidationReport> reports; final Props prop = new Props(this.props); prop.putAll(additionalProps); File file = null; final FlowLoader loader; try { file = unzipProject(archive, fileType); reports = validateProject(project, archive, file, prop); loader = this.flowLoaderFactory.createFlowLoader(file); reports.put(DIRECTORY_FLOW_REPORT_KEY, loader.loadProjectFlow(project, file)); } finally { cleanUpProjectTempDir(file); } if (!isReportStatusValid(reports, project)) { return reports; } persistProject(project, loader, archive, uploader); cleanUpProjectOldInstallations(project); return reports; }
Source:
<code><START> private LogicalType determineTimestampSpecLogicalType(Schema schema, String timestampSpecField) <END> { for (Schema.Field field : schema.getFields()) { if (field.name().equals(timestampSpecField)) { this.timestampSpecLogicalType = field.schema().getLogicalType(); return this.timestampSpecLogicalType; } } return null; }</code><technical_language>Please annotate @Nullable well</technical_language>

Target:
private LogicalType determineTimestampSpecLogicalType(Schema schema, String timestampSpecField) { for (Schema.Field field : schema.getFields()) { if (field.name().equals(timestampSpecField)) { return field.schema().getLogicalType(); } } return null; }
Source:
<code>public PeriodSegmentGranularity( @JsonProperty("period") Period period, @JsonProperty("origin") DateTime origin, @JsonProperty("timeZone") DateTimeZone tz ) { this.periodGranularity = new PeriodGranularity(period, origin, tz); <START> this.granularityType = GranularityType.estimatedGranularityType(period); <END> }</code><technical_language>Is this expected this call throw IAE if period match of predefined granularities</technical_language>

Target:
public PeriodSegmentGranularity( @JsonProperty("period") Period period, @JsonProperty("origin") DateTime origin, @JsonProperty("timeZone") DateTimeZone tz ) { this.periodGranularity = new PeriodGranularity(period, origin, tz); this.granularityType = GranularityType.fromPeriod(period); }
Source:
<code>public void callPublicMethodWithSeveralFloatParams() { Assert.assertNull(controller.getModel().getFloatValue()); <START> float value1 = 1F; <END> float value2 = 2F; float value3 = 3F; controller.invoke(PUBLIC_WITH_SEVERAL_FLOAT_PARAMS_ACTION, new Param(PARAM_NAME_1, value1), new Param(PARAM_NAME_2, value2), new Param(PARAM_NAME_3, value3)); Assert.assertEquals(controller.getModel().getFloatValue().floatValue(), value1 + value2 + value3); }</code><technical_language>final</technical_language>

Target:
public void callPublicMethodWithSeveralFloatParams() { Assert.assertNull(controller.getModel().getFloatValue()); final float value1 = 1F; final float value2 = 2F; final float value3 = 3F; controller.invoke(PUBLIC_WITH_SEVERAL_FLOAT_PARAMS_ACTION, new Param(PARAM_NAME_1, value1), new Param(PARAM_NAME_2, value2), new Param(PARAM_NAME_3, value3)); Assert.assertEquals(controller.getModel().getFloatValue().floatValue(), value1 + value2 + value3); }
Source:
<code>public void describe(StreamApplicationDescriptor appDescriptor) { EventHubsSystemDescriptor systemDescriptor = new EventHubsSystemDescriptor("eventhubs") .withDefaultStreamOffsetDefault(SystemStreamMetadata.OffsetType.OLDEST); StringSerde serde = new StringSerde(); EventHubsInputDescriptor<KV<String, String>> inputDescriptor = systemDescriptor.getInputDescriptor(INPUT_STREAM_ID, EVENTHUBS_NAMESPACE, EVENTHUBS_INPUT_ENTITY, serde) .withSasKeyName(EVENTHUBS_SAS_KEY_NAME) .withSasKey(EVENTHUBS_SAS_KEY_TOKEN); EventHubsOutputDescriptor<KV<String, String>> outputDescriptor = systemDescriptor.getOutputDescriptor(OUTPUT_STREAM_ID, EVENTHUBS_NAMESPACE, EVENTHUBS_OUTPUT_ENTITY, serde) <START> .withSasKeyName(EVENTHUBS_SAS_KEY_NAME) <END> .withSasKey(EVENTHUBS_SAS_KEY_TOKEN); MessageStream<KV<String, String>> eventhubInput = appDescriptor.getInputStream(inputDescriptor); OutputStream<KV<String, String>> eventhubOutput = appDescriptor.getOutputStream(outputDescriptor); eventhubInput .map((message) -> { System.out.println("Sending: "); System.out.println("Received Key: " + message.getKey()); System.out.println("Received Message: " + message.getValue()); return message; }) .sendTo(eventhubOutput); }</code><technical_language>configs used</technical_language>

Target:
public void describe(StreamApplicationDescriptor appDescriptor) { EventHubsSystemDescriptor systemDescriptor = new EventHubsSystemDescriptor("eventhubs"); StringSerde serde = new StringSerde(); EventHubsInputDescriptor<KV<String, String>> inputDescriptor = systemDescriptor.getInputDescriptor(INPUT_STREAM_ID, EVENTHUBS_NAMESPACE, EVENTHUBS_INPUT_ENTITY, serde) .withSasKeyName(appDescriptor.getConfig().get(EVENTHUBS_SAS_KEY_NAME_CONFIG)) .withSasKey(appDescriptor.getConfig().get(EVENTHUBS_SAS_KEY_TOKEN_CONFIG)); EventHubsOutputDescriptor<KV<String, String>> outputDescriptor = systemDescriptor.getOutputDescriptor(OUTPUT_STREAM_ID, EVENTHUBS_NAMESPACE, EVENTHUBS_OUTPUT_ENTITY, serde) .withSasKeyName(appDescriptor.getConfig().get(EVENTHUBS_SAS_KEY_NAME_CONFIG)) .withSasKey(appDescriptor.getConfig().get(EVENTHUBS_SAS_KEY_TOKEN_CONFIG)); MessageStream<KV<String, String>> eventhubInput = appDescriptor.getInputStream(inputDescriptor); OutputStream<KV<String, String>> eventhubOutput = appDescriptor.getOutputStream(outputDescriptor); eventhubInput .map((message) -> { System.out.println("Sending: "); System.out.println("Received Key: " + message.getKey()); System.out.println("Received Message: " + message.getValue()); return message; }) .sendTo(eventhubOutput); }