auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private Properties getKafkaProperties(Stage.Context context) { Properties props = new Properties(); props.putAll(conf.kafkaOptions); props.setProperty("bootstrap.servers", conf.brokerURI); props.setProperty("group.id", conf.consumerGroup); props.setProperty("max.poll.records", String.valueOf(batchSize)); props.setProperty(KafkaConstants.KEY_DESERIALIZER_CLASS_CONFIG, conf.keyDeserializer.getKeyClass()); props.setProperty(KafkaConstants.VALUE_DESERIALIZER_CLASS_CONFIG, conf.valueDeserializer.getValueClass()); props.setProperty(KafkaConstants.CONFLUENT_SCHEMA_REGISTRY_URL_CONFIG, StringUtils.join(conf.dataFormatConfig.schemaRegistryUrls, ",")); if(conf.enableAutoCommitOffset) { props.setProperty(KafkaConstants.AUTO_COMMIT_OFFEST, "true"); props.setProperty(KafkaConstants.AUTO_COMMIT_INTERVAL, String.valueOf(conf.autoCommitInterval)); } else { props.setProperty(KafkaConstants.AUTO_COMMIT_OFFEST, "false"); } <START> <END> if(context.isPreview()) { props.setProperty(KafkaConstants.AUTO_OFFSET_RESET_CONFIG, KafkaConstants.AUTO_OFFSET_RESET_PREVIEW_VALUE); } return props; }</code><technical_language>Wonderful, thank sir</technical_language>

Target:
private Properties getKafkaProperties(Stage.Context context) { Properties props = new Properties(); props.putAll(conf.kafkaOptions); props.setProperty("bootstrap.servers", conf.brokerURI); props.setProperty("group.id", conf.consumerGroup); props.setProperty("max.poll.records", String.valueOf(batchSize)); props.setProperty(KafkaConstants.KEY_DESERIALIZER_CLASS_CONFIG, conf.keyDeserializer.getKeyClass()); props.setProperty(KafkaConstants.VALUE_DESERIALIZER_CLASS_CONFIG, conf.valueDeserializer.getValueClass()); props.setProperty(KafkaConstants.CONFLUENT_SCHEMA_REGISTRY_URL_CONFIG, StringUtils.join(conf.dataFormatConfig.schemaRegistryUrls, ",")); props.setProperty(KafkaConstants.AUTO_COMMIT_OFFEST, "false"); if(context.isPreview()) { props.setProperty(KafkaConstants.AUTO_OFFSET_RESET_CONFIG, KafkaConstants.AUTO_OFFSET_RESET_PREVIEW_VALUE); } return props; }
Source:
<code>public BlueZBluetoothDevice(BlueZBridgeHandler adapter, BluetoothAddress address, String name) { super(adapter, address); this.name = name; logger.debug("Creating BlueZ device with address '{}'", address); <START> scheduler.submit(() -> { <END> tinyb.BluetoothDevice tinybDevice = findTinybDevice(address.toString()); if (tinybDevice != null) { setTinybDevice(tinybDevice); } }); }</code><technical_language>This raises issues: * this class "initializes" asynchronously, a caller I idea is "ready used", i.e. is allowed call connect() * scheduled job is cleaned (although argue this is needed anyway) * logic in a constructor a surprise (as in calimero library) prefer this kind logic else, e.g. in connect() method another dedicated one</technical_language>

Target:
public BlueZBluetoothDevice(BlueZBridgeHandler adapter, BluetoothAddress address, String name) { super(adapter, address); this.name = name; logger.debug("Creating BlueZ device with address '{}'", address); }
Source:
<code>public static Optional<ObaRegion> getClosestRegion(Location l) { log.debug("Invoked getClosestRegion() with location " + l.toString()); ObaRegionsResponse response = ObaRegionsRequest.newRequest().call(); ArrayList<ObaRegion> regions = new ArrayList<>(Arrays.asList(response.getRegions())); <START> return Optional.of(RegionUtils.getClosestRegion( <END> regions, l, true)); }</code><technical_language>RegionUtils.getClosestRegion return null, need Optional.ofNullable instead of Optional.of. of raise exception if give null</technical_language>

Target:
public static Optional<ObaRegion> getClosestRegion(Location l) { log.debug("Invoked getClosestRegion() with location " + l.toString()); ObaRegionsResponse response = ObaRegionsRequest.newRequest().call(); ArrayList<ObaRegion> regions = new ArrayList<>(Arrays.asList(response.getRegions())); return Optional.ofNullable(RegionUtils.getClosestRegion( regions, l, true)); }
Source:
<code>private static Bucket storage() { final String key = Manifests.read("Netbout-S3Key"); final com.jcabi.s3.Region region; if (key.matches("[0-9A-Z]{20}")) { region = new com.jcabi.s3.Region.Simple( key, Manifests.read("Netbout-S3Secret") ); } else { <START> final Path temp; <END> try { temp = Files.createTempDirectory( DyAttachment.class.getSimpleName() ); temp.toFile().deleteOnExit(); } catch (final IOException ex) { throw new IllegalStateException(ex); } region = new MkRegion(temp.toFile()); } return region.bucket(Manifests.read("Netbout-S3Bucket")); }</code><technical_language>@dmzaytsev this a File assign: java temp = Files.createTempDirectory(DyAttachment.class.getSimpleName()).toFile() save redundant instantiation for a File in region = new MkRegion(temp.toFile()); region = new MkRegion(temp); temp.deleteOnExit() that,</technical_language>

Target:
private static Bucket storage() { final String key = Manifests.read("Netbout-S3Key"); final com.jcabi.s3.Region region; if (key.matches("[0-9A-Z]{20}")) { region = new com.jcabi.s3.Region.Simple( key, Manifests.read("Netbout-S3Secret") ); } else { final File temp; try { temp = Files.createTempDirectory( DyAttachment.class.getSimpleName() ).toFile(); temp.deleteOnExit(); } catch (final IOException ex) { throw new IllegalStateException(ex); } region = new MkRegion(temp); } return region.bucket(Manifests.read("Netbout-S3Bucket")); }
Source:
<code>public static DatabaseInfo extractDatabaseInfo( Map<String,Value> metadata ) { Value dbValue = metadata.get( "db" ); <START> if ( dbValue == null || dbValue.isNull() || !dbValue.hasType( TYPE_SYSTEM.STRING() ) ) <END> { return DEFAULT_DATABASE_INFO; } else { return new InternalDatabaseInfo( dbValue.asString() ); } }</code><technical_language>throw ProtocolException if !dbValue.hasType( TYPE_SYSTEM.STRING() ) holds</technical_language>

Target:
public static DatabaseInfo extractDatabaseInfo( Map<String,Value> metadata ) { Value dbValue = metadata.get( "db" ); if ( dbValue == null || dbValue.isNull() ) { return DEFAULT_DATABASE_INFO; } else { return new InternalDatabaseInfo( dbValue.asString() ); } }
Source:
<code>public static void addDefaultResourceBundle(String resourceBundleName) { ClassLoader ccl = null; synchronized (classLoaderMap) { ccl = getThreadCurrentThreadGetContextClassLoader(); List<String> bundles = classLoaderMap.get(ccl.hashCode()); if (bundles == null) { bundles = new ArrayList<String>(); classLoaderMap.put(ccl.hashCode(), bundles); bundles.add(XWORK_MESSAGES_BUNDLE); } bundles.remove(resourceBundleName); bundles.add(0, resourceBundleName); } if (LOG.isDebugEnabled()) { <START> LOG.debug("Added default resource bundle '" + resourceBundleName + "' to default resource bundles for the following classloader " + ccl.toString()); <END> } }</code><technical_language>Please #0, #1 variable substitution</technical_language>

Target:
public static void addDefaultResourceBundle(String resourceBundleName) { ClassLoader ccl = null; synchronized (XWORK_MESSAGES_BUNDLE) { ccl = getCurrentThreadContextClassLoader(); List<String> bundles = classLoaderMap.get(ccl.hashCode()); if (bundles == null) { bundles = new ArrayList<String>(); classLoaderMap.put(ccl.hashCode(), bundles); bundles.add(XWORK_MESSAGES_BUNDLE); } bundles.remove(resourceBundleName); bundles.add(0, resourceBundleName); } if (LOG.isDebugEnabled()) { LOG.debug("Added default resource bundle '{}' to default resource bundles for the following classloader '{}'", resourceBundleName, ccl.toString()); } }
Source:
<code>public void testConsistentIdConfiguredInIgniteCfg() throws Exception { defConsistentId = "IgniteCfg consistent id"; Ignite ignite = startGrid(0); assertEquals(defConsistentId, ignite.configuration().getConsistentId()); assertEquals(defConsistentId, ignite.cluster().localNode().consistentId()); <START> info("Consistent id in that case: " + ignite.cluster().localNode().consistentId()); <END> }</code><technical_language>suggestion info("Consistent ID: " + ignite.cluster().localNode().consistentId());</technical_language>

Target:
public void testConsistentIdConfiguredInIgniteCfg() throws Exception { defConsistentId = "IgniteCfg consistent id"; Ignite ignite = startGrid(0); assertEquals(defConsistentId, ignite.configuration().getConsistentId()); assertEquals(defConsistentId, ignite.cluster().localNode().consistentId()); info("Consistent ID: " + ignite.cluster().localNode().consistentId()); }
Source:
<code>protected void updateQuotaByCluster(final Guid defaultQuota, final String quotaName) { Cluster cluster = getModel().getSelectedCluster(); if (cluster == null) { return; } if (!getModel().getQuota().getIsAvailable()) { getModel().getQuota().setItems(null); return; } AsyncDataProvider.getInstance().getAllRelevantQuotasForClusterSorted(new AsyncQuery<>( quotaList -> { UnitVmModel vmModel = getModel(); vmModel.getQuota().setItems(quotaList); if (quotaList == null) { return; } if (!Guid.isNullOrEmpty(defaultQuota)) { boolean hasQuotaInList = false; if (!quotaList.isEmpty()) { hasQuotaInList = defaultQuota.equals(quotaList.get(0).getId()); } <START> if (!hasQuotaInList && !getModel().getIsNew() && !getModel().getIsClone()) { <END> Quota quota = new Quota(); quota.setId(defaultQuota); quota.setQuotaName(quotaName); quotaList.add(0, quota); vmModel.getQuota().setItems(quotaList); vmModel.getQuota().setSelectedItem(quota); } } }), cluster.getId(), defaultQuota); }</code><technical_language>idea is added in edit mode originally</technical_language>

Target:
protected void updateQuotaByCluster(final Guid defaultQuota, final String quotaName) { Cluster cluster = getModel().getSelectedCluster(); if (cluster == null) { return; } if (!getModel().getQuota().getIsAvailable()) { getModel().getQuota().setItems(null); return; } AsyncDataProvider.getInstance().getAllRelevantQuotasForClusterSorted(new AsyncQuery<>( quotaList -> { UnitVmModel vmModel = getModel(); vmModel.getQuota().setItems(quotaList); if (quotaList == null) { return; } if (!Guid.isNullOrEmpty(defaultQuota)) { boolean hasQuotaInList = false; if (!quotaList.isEmpty()) { hasQuotaInList = defaultQuota.equals(quotaList.get(0).getId()); } if (!hasQuotaInList && !getModel().getIsNew()) { Quota quota = new Quota(); quota.setId(defaultQuota); quota.setQuotaName(quotaName); quotaList.add(0, quota); vmModel.getQuota().setItems(quotaList); vmModel.getQuota().setSelectedItem(quota); } } }), cluster.getId(), defaultQuota); }
Source:
<code>public void testRemoteUnix() { host = createLinuxHost(HOST_NAME); assertNotNull(host); String home = "/home/rob/jboss-eap-5.1"; IServer s = createEAP5Server(home); String args = getStartArgsForServer(s); System.out.println(args); <START> assertTrue(args.contains("/home/rob/jboss-eap-5.1/lib/endorsed")); <END> assertTrue(args.contains("/home/rob/jboss-eap-5.1/server")); assertTrue(args.contains("/home/rob/jboss-eap-5.1/bin/native")); }</code><technical_language>I suggest bogus names instead of machine :) Note, I ran tests do work machines - a suggestion for clarity</technical_language>

Target:
public void testRemoteUnix() { host = createLinuxHost(HOST_NAME); assertNotNull(host); String home = "/home/wonkauser/jboss-eap-5.1"; IServer s = createEAP5Server(home); String args = getStartArgsForServer(s); assertTrue(args.contains("/home/wonkauser/jboss-eap-5.1/lib/endorsed")); assertTrue(args.contains("/home/wonkauser/jboss-eap-5.1/server")); assertTrue(args.contains("/home/wonkauser/jboss-eap-5.1/bin/native")); }
Source:
<code>protected String getDescription() { <START> return "Kills a scheduled or running task"; <END> }</code><technical_language>s/Kills/Kill</technical_language>

Target:
protected String getDescription() { return "Kill a scheduled or running task"; }
Source:
<code>public void write(K key, V value) throws Exception { lock.writeLock().lock(); try { <START> LOGGER.info("Key - '{}' ,Value - '{}' successfully wriiten", key, value); <END> data.put(key, new Pair<K, V>(key, value)); } finally { lock.writeLock().unlock(); } }</code><technical_language>Typo: double i</technical_language>

Target:
public void write(K key, V value) throws Exception { lock.writeLock().lock(); try { LOGGER.info("Key - '{}', Value - '{}' successfully written", key, value); data.put(key, new Pair<K, V>(key, value)); } finally { lock.writeLock().unlock(); } }
Source:
<code>private DateTimeFormatter getDateTimeFormatterFromCache(String pattern) { DateTimeFormatter dateTimeFormatter = <START> patternDateTimeFormatterCache.getOrDefault(pattern, DateTimeFormat.forPattern(pattern)); <END> patternDateTimeFormatterCache.putIfAbsent(pattern, dateTimeFormatter); return dateTimeFormatter; }</code><technical_language>ConcurrentHashMap, cimply do return patternDateTimeFormatterCache.computeIfAbsent(pattern, DateTimeFormat::forPattern)</technical_language>

Target:
private DateTimeFormatter getDateTimeFormatterFromCache(String pattern) { return patternCache .computeIfAbsent(pattern, missingPattern -> DateTimeFormat.forPattern(missingPattern).withZoneUTC()); }
Source:
<code>public static Vcs extractVcs(File workingDir, Log log) throws IOException { <START> File dotGit = getDotGit(workingDir); <END> Vcs vcs = new Vcs(); vcs.setRevision(extractVcsRevision(dotGit, log)); vcs.setUrl(extractVcsUrl(dotGit, log)); return vcs; }</code><technical_language>I a NullPointerException thrown here, if .git directory (the *getDotGit* method return null). I suggest throwing a FileNotFoundException a clear message here</technical_language>

Target:
public static Vcs extractVcs(File workingDir, Log log) throws IOException { File dotGit = getDotGit(workingDir); if (dotGit == null) { throw new FileNotFoundException("Could not find .git directory for extracting Vcs details"); } Vcs vcs = new Vcs(); vcs.setRevision(extractVcsRevision(dotGit, log)); vcs.setUrl(extractVcsUrl(dotGit, log)); return vcs; }
Source:
<code>public void testRequestsWithContent() throws Exception { HttpClient mockClient = mock(HttpClient.class); <START> org.apache.http.HttpResponse mockResponse = mock(org.apache.http.HttpResponse.class); <END> when(mockClient.execute(any(HttpUriRequest.class))).thenReturn(mockResponse); ApacheHttpTransport transport = new ApacheHttpTransport(mockClient); subtestUnsupportedRequestsWithContent( transport.buildRequest("GET", "<LINK_0>"), "GET"); subtestUnsupportedRequestsWithContent( transport.buildRequest("DELETE", "<LINK_0>"), "DELETE"); subtestUnsupportedRequestsWithContent( transport.buildRequest("HEAD", "<LINK_0>"), "HEAD"); execute(transport.buildRequest("PUT", "<LINK_0>")); execute(transport.buildRequest("POST", "<LINK_0>")); execute(transport.buildRequest("PATCH", "<LINK_0>")); }</code><technical_language>HttpResponse need fully qualified</technical_language>

Target:
public void testRequestsWithContent() throws Exception { HttpClient mockClient = mock(HttpClient.class); HttpResponse mockResponse = mock(HttpResponse.class); when(mockClient.execute(any(HttpUriRequest.class))).thenReturn(mockResponse); ApacheHttpTransport transport = new ApacheHttpTransport(mockClient); subtestUnsupportedRequestsWithContent( transport.buildRequest("GET", "<LINK_0>"), "GET"); subtestUnsupportedRequestsWithContent( transport.buildRequest("DELETE", "<LINK_0>"), "DELETE"); subtestUnsupportedRequestsWithContent( transport.buildRequest("HEAD", "<LINK_0>"), "HEAD"); execute(transport.buildRequest("PUT", "<LINK_0>")); execute(transport.buildRequest("POST", "<LINK_0>")); execute(transport.buildRequest("PATCH", "<LINK_0>")); }
Source:
<code>public void put(final K key, final V value) throws CacheAccessException { accessObserver.begin(); checkKey(key); checkValue(value); while (true) { final long now = timeSource.getTimeMillis(); try { backingMap().compute(key, new BiFunction<K, OffHeapValueHolder<V>, OffHeapValueHolder<V>>() { @Override public OffHeapValueHolder<V> apply(K mappedKey, OffHeapValueHolder<V> mappedValue) { if (mappedValue != null && mappedValue.isExpired(now, TimeUnit.MILLISECONDS)) { mappedValue = null; } if (mappedValue == null) { return newCreateValueHolder(key, value, now); } else { return newUpdatedValueHolder(key, value, mappedValue, now); } } }, false); <START> break; <END> } catch (OversizeMappingException ex) { handleOversizeMappingException(key, ex); } } accessObserver.end(StoreOperationOutcomes.AccessOutcome.WRITE); }</code><technical_language>put accessObserver call return</technical_language>

Target:
public void put(final K key, final V value) throws CacheAccessException { accessObserver.begin(); checkKey(key); checkValue(value); while (true) { final long now = timeSource.getTimeMillis(); try { backingMap().compute(key, new BiFunction<K, OffHeapValueHolder<V>, OffHeapValueHolder<V>>() { @Override public OffHeapValueHolder<V> apply(K mappedKey, OffHeapValueHolder<V> mappedValue) { if (mappedValue != null && mappedValue.isExpired(now, TimeUnit.MILLISECONDS)) { mappedValue = null; } if (mappedValue == null) { return newCreateValueHolder(key, value, now); } else { return newUpdatedValueHolder(key, value, mappedValue, now); } } }, false); accessObserver.end(StoreOperationOutcomes.AccessOutcome.WRITE); return; } catch (OversizeMappingException ex) { handleOversizeMappingException(key, ex); } } }
Source:
<code>public void testSetLTE() { <START> mConnectionUT = <END> new ImsPhoneConnection(mImsPhone, mImsCall, mImsCT, mForeGroundCall, false); assertFalse(mConnectionUT.getCallRadioTech() == ServiceState.RIL_RADIO_TECHNOLOGY_LTE); doReturn(ServiceState.RIL_RADIO_TECHNOLOGY_LTE).when(mImsCall).getRadioTechnology(); mBundle.putString(ImsCallProfile.EXTRA_CALL_RAT_TYPE, ServiceState.RIL_RADIO_TECHNOLOGY_LTE + ""); assertTrue(mConnectionUT.update(mImsCall, Call.State.ACTIVE)); assertTrue(mConnectionUT.getCallRadioTech() == ServiceState.RIL_RADIO_TECHNOLOGY_LTE); }</code><technical_language>m-prefixed names for local variables -- name this connectionUt imsPhoneConnection</technical_language>

Target:
public void testSetLTE() { mConnectionUT = new ImsPhoneConnection(mImsPhone, mImsCall, mImsCT, mForeGroundCall, false); assertNotEquals(mConnectionUT.getCallRadioTech(), ServiceState.RIL_RADIO_TECHNOLOGY_LTE); doReturn(ServiceState.RIL_RADIO_TECHNOLOGY_LTE).when(mImsCall).getRadioTechnology(); mBundle.putString(ImsCallProfile.EXTRA_CALL_RAT_TYPE, ServiceState.RIL_RADIO_TECHNOLOGY_LTE + ""); assertTrue(mConnectionUT.update(mImsCall, Call.State.ACTIVE)); assertEquals(mConnectionUT.getCallRadioTech(), ServiceState.RIL_RADIO_TECHNOLOGY_LTE); }
Source:
<code><START> private void removeImageFromDB() { <END> TransactionSupport.executeInScope(TransactionScopeOption.Required, new TransactionMethod<Object>() { @Override public Object runInTransaction() { DiskImage diskImage = getDiskImage(); if (diskImage != null) { getDiskImageDynamicDAO().remove(diskImage.getImageId()); Guid imageTemplate = diskImage.getit_guid(); Guid currentGuid = diskImage.getImageId(); while (!imageTemplate.equals(currentGuid) && !currentGuid.equals(Guid.Empty)) { RemoveChildren(currentGuid); DiskImage image = getDiskImageDao().getSnapshotById(currentGuid); if (image != null) { RemoveSnapshot(image); removeImageFromSnapshotConfiguration( image.getvm_snapshot_id().getValue(), currentGuid); currentGuid = image.getParentId(); } else { currentGuid = Guid.Empty; log.warnFormat( "RemoveImageCommand::RemoveImageFromDB: 'image' (snapshot of image '{0}') is null, cannot remove it.", diskImage.getImageId()); } } getBaseDiskDao().remove(diskImage.getId()); getVmDeviceDAO().remove(new VmDeviceId(diskImage.getId(), null)); } else { log.warn("RemoveImageCommand::RemoveImageFromDB: DiskImage is null, nothing to remove."); } return null; } }); }</code><technical_language>Transaction is opened fun begins</technical_language>

Target:
private void removeImageFromDB() { final DiskImage diskImage = getDiskImage(); final List<Snapshot> updatedSnapshots = prepareSnapshotConfigurationsWithoutImage(diskImage.getId()); TransactionSupport.executeInScope(TransactionScopeOption.Required, new TransactionMethod<Object>() { @Override public Object runInTransaction() { getDiskImageDynamicDAO().remove(diskImage.getImageId()); Guid imageTemplate = diskImage.getit_guid(); Guid currentGuid = diskImage.getImageId(); while (!imageTemplate.equals(currentGuid) && !currentGuid.equals(Guid.Empty)) { RemoveChildren(currentGuid); DiskImage image = getDiskImageDao().getSnapshotById(currentGuid); if (image != null) { RemoveSnapshot(image); currentGuid = image.getParentId(); } else { currentGuid = Guid.Empty; log.warnFormat( "RemoveImageCommand::RemoveImageFromDB: 'image' (snapshot of image '{0}') is null, cannot remove it.", diskImage.getImageId()); } } getBaseDiskDao().remove(diskImage.getId()); getVmDeviceDAO().remove(new VmDeviceId(diskImage.getId(), null)); for (Snapshot s : updatedSnapshots) { getSnapshotDAO().update(s); } return null; } }); }
Source:
<code>protected boolean executeAnalysis(@NonNull IProgressMonitor monitor) throws TmfAnalysisException { ITmfTrace trace = getTrace(); if (trace == null) { System.out.println(1); initialize(false); return false; } IStatus status1 = segmentStoreModule.schedule(); IStatus status2 = stateSystemModule.schedule(); if (!(status1.isOK() && status2.isOK())) { <START> System.out.println(2); <END> cancelSubAnalyses(); initialize(false); return false; } if (!stateSystemModule.waitForInitialization()) { System.out.println(3); initialize(false); return false; } ITmfStateSystem stateSystem = stateSystemModule.getStateSystem(); if (stateSystem == null) { System.out.println(4); initialize(false); return false; } initialize(true); if (!(stateSystemModule.waitForCompletion(monitor) && segmentStoreModule.waitForCompletion(monitor))) { System.out.println(5); return false; } System.out.println("worked!"); return true; }</code><technical_language>remove</technical_language>

Target:
protected boolean executeAnalysis(@NonNull IProgressMonitor monitor) throws TmfAnalysisException { ITmfTrace trace = getTrace(); if (trace == null) { initialize(false); return false; } IStatus status1 = segmentStoreModule.schedule(); IStatus status2 = stateSystemModule.schedule(); if (!(status1.isOK() && status2.isOK())) { cancelSubAnalyses(); initialize(false); return false; } if (!stateSystemModule.waitForInitialization()) { initialize(false); return false; } ITmfStateSystem stateSystem = stateSystemModule.getStateSystem(); if (stateSystem == null) { initialize(false); return false; } initialize(true); if (!(stateSystemModule.waitForCompletion(monitor) && segmentStoreModule.waitForCompletion(monitor))) { return false; } return true; }
Source:
<code>public <T> TypeSerializer<T> getTypeSerializerIn(int index, ClassLoader cl) { Input[] inputs = getInputs(cl); <START> if (index >= inputs.length) { return null; <END> } checkState(inputs[index] instanceof NetworkInput, "Input [%d] was assumed to be network input", index); return (TypeSerializer<T>) ((NetworkInput) inputs[index]).typeSerializer; }</code><technical_language>this happen? return Optional mark @Nullable</technical_language>

Target:
public <T> TypeSerializer<T> getTypeSerializerIn(int index, ClassLoader cl) { InputConfig[] inputs = getInputs(cl); checkState(index < inputs.length); checkState(inputs[index] instanceof NetworkInputConfig, "Input [%s] was assumed to be network input", index); return (TypeSerializer<T>) ((NetworkInputConfig) inputs[index]).typeSerializer; }
Source:
<code>private SourceResponse cloneResponse(SourceResponse sourceResponse) { List<Result> clonedResults = sourceResponse .getResults() .stream() .map(Result::getMetacard) .map(m -> new MetacardImpl(m, m.getMetacardType())) .map(ResultImpl::new) .collect(Collectors.toList()); QueryResponseImpl clonedResponse = new QueryResponseImpl( sourceResponse.getRequest(), clonedResults, true, sourceResponse.getHits(), sourceResponse.getProperties()); Set<ProcessingDetails> detailsOfClonedResponse = clonedResponse.getProcessingDetails(); for (SourceProcessingDetails detailsOfSourceResponse : sourceResponse.getProcessingDetails()) { <START> detailsOfClonedResponse.add(new ProcessingDetailsImpl(detailsOfSourceResponse, "")); <END> } return clonedResponse; }</code><technical_language>want pass source.getId() argument lose source ID, right</technical_language>

Target:
private SourceResponse cloneResponse(SourceResponse sourceResponse) { List<Result> clonedResults = sourceResponse .getResults() .stream() .map(Result::getMetacard) .map(m -> new MetacardImpl(m, m.getMetacardType())) .map(ResultImpl::new) .collect(Collectors.toList()); Set<ProcessingDetails> processingDetails = sourceResponse .getProcessingDetails() .stream() .map(sourceDetails -> new ProcessingDetailsImpl(sourceDetails, source.getId())) .collect(Collectors.toSet()); return new QueryResponseImpl( sourceResponse.getRequest(), clonedResults, true, sourceResponse.getHits(), sourceResponse.getProperties(), processingDetails); }
Source:
<code>private void gateways(Collection<IntegrationNode> nodes, Collection<LinkNode> links, Map<String, MessageChannelNode> channelNodes) { Map<String, MessagingGatewaySupport> gateways = this.applicationContext .getBeansOfType(MessagingGatewaySupport.class); for (Entry<String, MessagingGatewaySupport> entry : gateways.entrySet()) { MessagingGatewaySupport gateway = entry.getValue(); MessageGatewayNode gatewayNode = this.nodeFactory.gatewayNode(entry.getKey(), gateway); nodes.add(gatewayNode); producerLink(links, channelNodes, gatewayNode); } Map<String, GatewayProxyFactoryBean> gpfbs = this.applicationContext .getBeansOfType(GatewayProxyFactoryBean.class); for (Entry<String, GatewayProxyFactoryBean> entry : gpfbs.entrySet()) { Map<Method, MessagingGatewaySupport> methodMap = entry.getValue().getGateways(); int i = 0; for (Entry<Method, MessagingGatewaySupport> gwEntry : methodMap.entrySet()) { MessagingGatewaySupport gateway = gwEntry.getValue(); MessageGatewayNode gatewayNode = this.nodeFactory.gatewayNode( <START> entry.getKey().substring(1) + "." + gwEntry.getKey().getName() + "#" + i++, gateway); <END> nodes.add(gatewayNode); producerLink(links, channelNodes, gatewayNode); } } }</code><technical_language>I longer names Artem suggests. hash+index means totally obvious a full signature is. If some tool in future offering a 'open node in IDE' full signature nice</technical_language>

Target:
private void gateways(Collection<IntegrationNode> nodes, Collection<LinkNode> links, Map<String, MessageChannelNode> channelNodes) { Map<String, MessagingGatewaySupport> gateways = this.applicationContext .getBeansOfType(MessagingGatewaySupport.class); for (Entry<String, MessagingGatewaySupport> entry : gateways.entrySet()) { MessagingGatewaySupport gateway = entry.getValue(); MessageGatewayNode gatewayNode = this.nodeFactory.gatewayNode(entry.getKey(), gateway); nodes.add(gatewayNode); producerLink(links, channelNodes, gatewayNode); } Map<String, GatewayProxyFactoryBean> gpfbs = this.applicationContext .getBeansOfType(GatewayProxyFactoryBean.class); for (Entry<String, GatewayProxyFactoryBean> entry : gpfbs.entrySet()) { Map<Method, MessagingGatewaySupport> methodMap = entry.getValue().getGateways(); for (Entry<Method, MessagingGatewaySupport> gwEntry : methodMap.entrySet()) { MessagingGatewaySupport gateway = gwEntry.getValue(); Method method = gwEntry.getKey(); String signature = method.getName() + "(" + StringUtils.arrayToCommaDelimitedString(method.getParameterTypes()) + ")"; MessageGatewayNode gatewayNode = this.nodeFactory.gatewayNode( entry.getKey().substring(1) + "." + signature, gateway); nodes.add(gatewayNode); producerLink(links, channelNodes, gatewayNode); } } }
Source:
<code>public void testToString(){ final String expectedLinear = "TmfTimestampLinear [ alpha = 314.0, beta = 0.0 ]"; <START> final String expectedOffset = "TmfConstantTransform [ offset=19:00:00.000 000 314 ]"; <END> final String expectedIdentity = "TmfTimestampTransform [ IDENTITY ]"; assertEquals( expectedLinear, TimestampTransformFactory.create(314, 0).toString()); assertEquals( expectedOffset, TimestampTransformFactory.create(1, 314).toString()); assertEquals( expectedOffset, TimestampTransformFactory.create(314).toString()); assertEquals( expectedOffset, TimestampTransformFactory.create(14).composeWith( TimestampTransformFactory.create(300)).toString()); assertEquals( expectedIdentity, TimestampTransformFactory.create(314).composeWith( TimestampTransformFactory.create(-314)).toString()); assertEquals( expectedIdentity, TimestampTransformFactory.create(0).toString()); }</code><technical_language>in America</technical_language>

Target:
public void testToString(){ final String expectedLinear = "TmfTimestampLinear [ alpha = 314.0, beta = 0.0 ]"; final String expectedOffset = "TmfConstantTransform [ offset = 314 ]"; final String expectedIdentity = "TmfTimestampTransform [ IDENTITY ]"; assertEquals( expectedLinear, TimestampTransformFactory.create(314, 0).toString()); assertEquals( expectedOffset, TimestampTransformFactory.create(1, 314).toString()); assertEquals( expectedOffset, TimestampTransformFactory.create(314).toString()); assertEquals( expectedOffset, TimestampTransformFactory.create(14).composeWith( TimestampTransformFactory.create(300)).toString()); assertEquals( expectedIdentity, TimestampTransformFactory.create(314).composeWith( TimestampTransformFactory.create(-314)).toString()); assertEquals( expectedIdentity, TimestampTransformFactory.create(0).toString()); }
Source:
<code>private JobGraph createJobGraph() { preValidate(); jobGraph.setScheduleMode(streamGraph.getScheduleMode()); Map<Integer, byte[]> hashes = defaultStreamGraphHasher.traverseStreamGraphAndGenerateHashes(streamGraph); List<Map<Integer, byte[]>> legacyHashes = new ArrayList<>(legacyStreamGraphHashers.size()); for (StreamGraphHasher hasher : legacyStreamGraphHashers) { legacyHashes.add(hasher.traverseStreamGraphAndGenerateHashes(streamGraph)); } setChaining(hashes, legacyHashes); setPhysicalEdges(); setSlotSharingAndCoLocation(); setManagedMemoryFraction( Collections.unmodifiableMap(jobVertices), Collections.unmodifiableMap(vertexConfigs), Collections.unmodifiableMap(chainedConfigs), <START> id -> streamGraph.getStreamNode(id).getManagedMemoryUseCaseWeights().getOrDefault(ManagedMemoryUseCase.BATCH_OP, 0)); <END> configureCheckpointing(); jobGraph.setSavepointRestoreSettings(streamGraph.getSavepointRestoreSettings()); JobGraphUtils.addUserArtifactEntries(streamGraph.getUserArtifacts(), jobGraph); try { jobGraph.setExecutionConfig(streamGraph.getExecutionConfig()); } catch (IOException e) { throw new IllegalConfigurationException("Could not serialize the ExecutionConfig." + "This indicates that non-serializable types (like custom serializers) were registered"); } return jobGraph; }</code><technical_language>need a static variable for default weight</technical_language>

Target:
private JobGraph createJobGraph() { preValidate(); jobGraph.setScheduleMode(streamGraph.getScheduleMode()); Map<Integer, byte[]> hashes = defaultStreamGraphHasher.traverseStreamGraphAndGenerateHashes(streamGraph); List<Map<Integer, byte[]>> legacyHashes = new ArrayList<>(legacyStreamGraphHashers.size()); for (StreamGraphHasher hasher : legacyStreamGraphHashers) { legacyHashes.add(hasher.traverseStreamGraphAndGenerateHashes(streamGraph)); } setChaining(hashes, legacyHashes); setPhysicalEdges(); setSlotSharingAndCoLocation(); setManagedMemoryFraction( Collections.unmodifiableMap(jobVertices), Collections.unmodifiableMap(vertexConfigs), Collections.unmodifiableMap(chainedConfigs), id -> Optional.ofNullable(streamGraph.getStreamNode(id).getManagedMemoryUseCaseWeights().get(ManagedMemoryUseCase.BATCH_OP))); configureCheckpointing(); jobGraph.setSavepointRestoreSettings(streamGraph.getSavepointRestoreSettings()); JobGraphUtils.addUserArtifactEntries(streamGraph.getUserArtifacts(), jobGraph); try { jobGraph.setExecutionConfig(streamGraph.getExecutionConfig()); } catch (IOException e) { throw new IllegalConfigurationException("Could not serialize the ExecutionConfig." + "This indicates that non-serializable types (like custom serializers) were registered"); } return jobGraph; }
Source:
<code>private boolean isRecoverable(String message) { List<String> knownFailures = Arrays.asList( <START> "Connection refused", "Connection reset", "Connection timed out", "No route to host", "Premature connection close" <END> ); for (String s : knownFailures) { if (message.startsWith(s)) return true; } return false; }</code><technical_language>this list a static field in this class re-generating for failed connection attempt</technical_language>

Target:
private boolean isRecoverable(String message) { for (String s : RECOVERABLE_FAILURES) { if (message.startsWith(s)) return true; } return false; }
Source:
<code>public PersistentNode(CuratorFramework client, final CreateMode mode, boolean useProtection, final String basePath, byte[] initData) { this.useProtection = useProtection; this.client = Preconditions.checkNotNull(client, "client cannot be null"); this.basePath = PathUtils.validatePath(basePath); this.mode = Preconditions.checkNotNull(mode, "mode cannot be null"); final byte[] data = Preconditions.checkNotNull(initData, "data cannot be null"); backgroundCallback = new BackgroundCallback() { @Override public void processResult(CuratorFramework client, CuratorEvent event) throws Exception { String path = null; boolean nodeExists = false; if ( event.getResultCode() == KeeperException.Code.NODEEXISTS.intValue() ) { path = event.getPath(); nodeExists = true; } else if ( event.getResultCode() == KeeperException.Code.OK.intValue() ) { path = event.getName(); } else if ( event.getResultCode() == KeeperException.Code.NOAUTH.intValue() ) { <START> log.warn("Client does not have authorisation to write ephemeral node at path {}", event.getPath()); <END> authFailure.set(true); return; } if ( path != null ) { authFailure.set(false); nodePath.set(path); watchNode(); if ( nodeExists ) { client.setData().inBackground(setDataCallback).forPath(getActualPath(), getData()); } else { initialisationComplete(); } } else { createNode(); } } }; createMethod = useProtection ? client.create().creatingParentContainersIfNeeded().withProtection() : client.create().creatingParentContainersIfNeeded(); this.data.set(Arrays.copyOf(data, data.length)); }</code><technical_language>This log message refers ephemeral is longer necessarily case</technical_language>

Target:
public PersistentNode(CuratorFramework client, final CreateMode mode, boolean useProtection, final String basePath, byte[] initData) { this.useProtection = useProtection; this.client = Preconditions.checkNotNull(client, "client cannot be null"); this.basePath = PathUtils.validatePath(basePath); this.mode = Preconditions.checkNotNull(mode, "mode cannot be null"); final byte[] data = Preconditions.checkNotNull(initData, "data cannot be null"); backgroundCallback = new BackgroundCallback() { @Override public void processResult(CuratorFramework client, CuratorEvent event) throws Exception { String path = null; boolean nodeExists = false; if ( event.getResultCode() == KeeperException.Code.NODEEXISTS.intValue() ) { path = event.getPath(); nodeExists = true; } else if ( event.getResultCode() == KeeperException.Code.OK.intValue() ) { path = event.getName(); } else if ( event.getResultCode() == KeeperException.Code.NOAUTH.intValue() ) { log.warn("Client does not have authorisation to write node at path {}", event.getPath()); authFailure.set(true); return; } if ( path != null ) { authFailure.set(false); nodePath.set(path); watchNode(); if ( nodeExists ) { client.setData().inBackground(setDataCallback).forPath(getActualPath(), getData()); } else { initialisationComplete(); } } else { createNode(); } } }; createMethod = useProtection ? client.create().creatingParentContainersIfNeeded().withProtection() : client.create().creatingParentContainersIfNeeded(); this.data.set(Arrays.copyOf(data, data.length)); }
Source:
<code>public void testConfigureFromManifestWithoutServer() throws Exception { <START> Context context = mock(Context.class); <END> PackageManager packageManager = mock(PackageManager.class); ApplicationInfo appInfo = mock(ApplicationInfo.class); Bundle metaData = setupMockMetaData(context, packageManager, appInfo); when(metaData.getString(PARSE_SERVER_URL)).thenReturn(null); when(metaData.getString(PARSE_APPLICATION_ID)).thenReturn(appId); when(metaData.getString(PARSE_CLIENT_KEY)).thenReturn(clientKey); Parse.initialize(context); }</code><technical_language>Roboelectric a mocked Context class. Do need do this setup mocking? <LINK_0></technical_language>

Target:
public void testConfigureFromManifestWithoutServer() throws Exception { Bundle metaData = setupMockMetaData(); when(metaData.getString(PARSE_SERVER_URL)).thenReturn(null); when(metaData.getString(PARSE_APPLICATION_ID)).thenReturn(appId); when(metaData.getString(PARSE_CLIENT_KEY)).thenReturn(clientKey); Parse.initialize(RuntimeEnvironment.application); }
Source:
<code>private void addVmRngDevice() { VmRngDevice rngDev = getParameters().getRngDevice(); if (rngDev != null) { rngDev.setVmId(getParameters().getVmId()); RngDeviceParameters params = new RngDeviceParameters(rngDev, true); VdcReturnValueBase result = getBackend().runInternalAction(VdcActionType.AddRngDevice, params); if (!result.getSucceeded()) { <START> getReturnValue().setSucceeded(false); <END> } } }</code><technical_language>this roll vm creation? if so, created disks? i belong in part of execution do db updates</technical_language>

Target:
private void addVmRngDevice() { VmRngDevice rngDev = getParameters().getRngDevice(); if (rngDev != null) { RngDeviceParameters params = new RngDeviceParameters(rngDev, true); VdcReturnValueBase result = getBackend().runInternalAction(VdcActionType.AddRngDevice, params); if (!result.getSucceeded()) { throw new IllegalStateException("Couldn't add RNG device."); } } }
Source:
<code>public void testGetModelsAfter2000UsingPipeline() { List<String> models = FunctionalProgramming.getModelsAfter2000(cars); <START> assertEquals(models, Arrays.asList("Avenger", "Wrangler", "Focus", "Cascada")); <END> }</code><technical_language>above, argument ordering issue in assertEquals()</technical_language>

Target:
public void testGetModelsAfter2000UsingPipeline() { List<String> models = FunctionalProgramming.getModelsAfter2000(cars); assertEquals(Arrays.asList("Avenger", "Wrangler", "Focus", "Cascada"), models); }
Source:
<code>public String getCookies() { StringBuilder ret = new StringBuilder(); ArrayList<org.openqa.selenium.Cookie> cookies = new ArrayList<>(browserManagement .getCurrentWebDriver().manage().getCookies()); for (int i = 0; i < cookies.size(); i++) { <START> ret.append(cookies.get(i).getName()).append("=").append(cookies.get(i).getValue()); <END> if (i != cookies.size() - 1) { ret.append("; "); } } return ret.toString(); }</code><technical_language>diff -.append("=") +.append('=') ? :)</technical_language>

Target:
public String getCookies() { StringBuilder ret = new StringBuilder(); ArrayList<org.openqa.selenium.Cookie> cookies = new ArrayList<>(browserManagement .getCurrentWebDriver().manage().getCookies()); for (int i = 0; i < cookies.size(); i++) { ret.append(cookies.get(i).getName()).append('=').append(cookies.get(i).getValue()); if (i != cookies.size() - 1) { ret.append("; "); } } return ret.toString(); }
Source:
<code>private String formatColumnDefinition(ColumnDefinition column) { <START> StringBuilder sb = new StringBuilder(formatExpression(column.getName(), parameters)) <END> .append(" ").append(column.getType()); if (!column.isNullable()) { sb.append(" NOT NULL"); } if (column.getComment().isPresent()) { sb.append(" COMMENT ").append(formatStringLiteral(column.getComment().get())); } sb.append(formatPropertiesSingleLine(column.getProperties())); return sb.toString(); }</code><technical_language>break this java StringBuilder sb = new StringBuilder() .append(formatExpression(column.getName(), parameters)) .append(" ").append(column.getType());</technical_language>

Target:
private String formatColumnDefinition(ColumnDefinition column) { StringBuilder sb = new StringBuilder() .append(formatExpression(column.getName(), parameters)) .append(" ").append(column.getType()); if (!column.isNullable()) { sb.append(" NOT NULL"); } column.getComment().ifPresent(comment -> sb.append(" COMMENT ").append(formatStringLiteral(comment))); sb.append(formatPropertiesSingleLine(column.getProperties())); return sb.toString(); }
Source:
<code>public abstract void executeTask() throws MojoExecutionException, MojoFailureException; protected void resolveDocker() { DockerClientConfig config = DefaultDockerClientConfig.createDefaultConfigBuilder() .withDockerHost(dockerHost) .withApiVersion(API_VERSION) .build(); docker = DockerClientBuilder.getInstance(config).build(); try { docker.infoCmd().exec(); } catch (Exception e) { String message; if (dockerHost.equals(DEFAULT_HOST_LINUX)) { message = "Couldn't connect to docker under default docker host address for linux"; boolean isUserWantChangeUrl = promptYesNo("Do You want to change docker host address?"); if (isUserWantChangeUrl) { dockerHost = prompt("Type updated host url (You can save this property later by calling openmrs-sdk:setup with defined -DdockerHost)"); resolveDocker(); } else { throw new RuntimeException(message, e); } } else { message = "Could not run `docker info`. If you are using 'Docker Toolbox', please make sure you run the SDK command from the 'Docker Toolbox' terminal."; <START> } <END> showMessage(message); throw new RuntimeException(message, e); } }</code><technical_language>Please change this behavior follows: 1. IF Linux: connect Docker dockerHostUrl. Please Docker is running if 'Docker Toolbox', please run SDK command 'Docker Toolbox' terminal. If Docker host URL is correct, please reset default passing -DdockerHost parameter set manually -DdockerHost="correct/url". 2. IF Linux: connect Docker dockerHostUrl. If Docker host URL is correct, please reset default passing -DdockerHost parameter set manually -DdockerHost="correct/url". In cases stop execution. If -DdockerHost is a value, run wizard guess correct URL. If user a it</technical_language>

Target:
public abstract void executeTask() throws MojoExecutionException, MojoFailureException; protected void resolveDocker() { DockerClientConfig config = DefaultDockerClientConfig.createDefaultConfigBuilder() .withDockerHost(dockerHost) .withApiVersion(API_VERSION) .build(); docker = DockerClientBuilder.getInstance(config).build(); try { docker.infoCmd().exec(); } catch (Exception e) { if (SystemUtils.IS_OS_LINUX) { throw new RuntimeException(LINUX_UNABLE_TO_CONNECT_MESSAGE, e); } else { throw new RuntimeException(NOT_LINUX_UNABLE_TO_CONNECT_MESSAGE, e); } } }
Source:
<code>public PagedIterable<ModelData> createModels(List<String> models) { <START> return new PagedIterable<>(digitalTwinsAsyncClient.createModels(models, Context.NONE)); <END> }</code><technical_language>correct, this API is added in master</technical_language>

Target:
public List<ModelData> createModels(List<String> models) { return createModelsWithResponse(models, Context.NONE).getValue(); }
Source:
<code>public void setUp() { SharedPreferences sharedPreferences = PreferenceManager .getDefaultSharedPreferences(InstrumentationRegistry.getTargetContext()); for (String setting : allSettings) { initialSettings.put(setting, sharedPreferences.getBoolean(setting, false)); } SharedPreferences.Editor editor = sharedPreferences.edit(); editor.putBoolean(Constants.RESTRICTED_LOGIN_ACCEPTED, false); editor.putBoolean(Constants.CREATE_AT_SCHOOL_USER, true); editor.apply(); <START> Reflection.setPrivateField(Constants.class, "DEFAULT_ROOT", Environment.getExternalStorageDirectory() <END> .getAbsolutePath() + "/Pocket Code"); baseActivityTestRule.launchActivity(null); idlingResource = baseActivityTestRule.getActivity().getIdlingResource(); Espresso.registerIdlingResources(idlingResource); UiTestUtils.setFakeToken(baseActivityTestRule.getActivity(), false); }</code><technical_language>this run in default root again? if necessary, nicer ways achieve that. default root is reflected out (the reflection is currently in place in espresso setup) in BaseActivityInstrumentationRule "pocket code ui test". i this in setup, setup project folder zipped deleted projects, in teardown unzipped deleted zip. i thought this isnt nice leads a lot of storage operations zipping single test, if instrumenter crashes, projects stay zipped in folder, etc... i switched reflecting DEFAULT_ROOT "pocket code ui test" folder, test deletes this test runs. nice effect if run a single test, inspect project xmls, in place test finished, next test clean in startup. if for some reason do need production "pocket code" folder, write ActivityInstrumentationRule do reflection deals existing projects itself. in short: do is nice, first, get rid of reflections making ActivityInstrumentationRule, second, applies if do rule, deal existing projects cleanup. (keep in mind cornercases a project this name, etc...) if real good reason do reflection here, "pocket code uitests" work another way</technical_language>

Target:
public void setUp() { SharedPreferences sharedPreferences = PreferenceManager .getDefaultSharedPreferences(InstrumentationRegistry.getTargetContext()); for (String setting : allSettings) { initialSettings.put(setting, sharedPreferences.getBoolean(setting, false)); } initialTokenSetting = sharedPreferences.getString(Constants.TOKEN, Constants.NO_TOKEN); SharedPreferences.Editor editor = sharedPreferences.edit(); editor.putBoolean(Constants.RESTRICTED_LOGIN_ACCEPTED, false); editor.putBoolean(Constants.CREATE_AT_SCHOOL_USER, false); editor.apply(); ServerCalls.useTestUrl = true; baseActivityTestRule.launchActivity(null); idlingResource = baseActivityTestRule.getActivity().getIdlingResource(); Espresso.registerIdlingResources(idlingResource); setFakeToken(baseActivityTestRule.getActivity(), false); }
Source:
<code>public List<ChangeItem> call() throws Exception { TransactionTokenDelta txDelta = new TransactionTokenDelta(sourceTx, destinationTx); Callable<List<ChangeItem>> callable; <START> BranchId branch = null; <END> if (txDelta.areOnTheSameBranch()) { callable = new LoadDeltasBetweenTxsOnTheSameBranch(getLogger(), getSession(), getJdbcClient(), joinFactory, txDelta, applicQuery); branch = txDelta.getStartTx().getBranch(); } else { BranchId mergeBranch = getJdbcClient().fetch(BranchId.SENTINEL, SELECT_MERGE_BRANCH_UUID, sourceTx.getBranch(), destinationTx.getBranch()); branch = sourceTx.getBranch(); TransactionId mergeTx = TransactionId.SENTINEL; if (mergeBranch.isValid()) { mergeTx = getJdbcClient().fetch(TransactionId.SENTINEL, SELECT_MERGE_BRANCH_HEAD_TX, mergeBranch); } callable = new LoadDeltasBetweenBranches(getLogger(), getSession(), getJdbcClient(), joinFactory, sourceTx.getBranch(), destinationTx.getBranch(), destinationTx, mergeBranch, mergeTx, applicQuery); } List<ChangeItem> changes = callAndCheckForCancel(callable); changes.addAll(missingChangeItemFactory.createMissingChanges(this, getSession(), changes, sourceTx, destinationTx, applicQuery)); Callable<List<ChangeItem>> computeChanges = new ComputeNetChangeCallable(changes); changes = callAndCheckForCancel(computeChanges); AddSyntheticArtifactChangeData addArtifactData = new AddSyntheticArtifactChangeData(changes, getJdbcClient(), branch); return addArtifactData.doWork(); }</code><technical_language>initialize BranchId.SENTINEL</technical_language>

Target:
public List<ChangeItem> call() throws Exception { TransactionTokenDelta txDelta = new TransactionTokenDelta(sourceTx, destinationTx); Callable<List<ChangeItem>> callable; BranchId branch = BranchId.SENTINEL; if (txDelta.areOnTheSameBranch()) { callable = new LoadDeltasBetweenTxsOnTheSameBranch(getLogger(), getSession(), getJdbcClient(), joinFactory, txDelta, applicQuery); branch = txDelta.getStartTx().getBranch(); } else { BranchId mergeBranch = getJdbcClient().fetch(BranchId.SENTINEL, SELECT_MERGE_BRANCH_UUID, sourceTx.getBranch(), destinationTx.getBranch()); branch = sourceTx.getBranch(); TransactionId mergeTx = TransactionId.SENTINEL; if (mergeBranch.isValid()) { mergeTx = getJdbcClient().fetch(TransactionId.SENTINEL, SELECT_MERGE_BRANCH_HEAD_TX, mergeBranch); } callable = new LoadDeltasBetweenBranches(getLogger(), getSession(), getJdbcClient(), joinFactory, sourceTx.getBranch(), destinationTx.getBranch(), destinationTx, mergeBranch, mergeTx, applicQuery); } List<ChangeItem> changes = callAndCheckForCancel(callable); changes.addAll(missingChangeItemFactory.createMissingChanges(this, getSession(), changes, sourceTx, destinationTx, applicQuery)); Callable<List<ChangeItem>> computeChanges = new ComputeNetChangeCallable(changes); changes = callAndCheckForCancel(computeChanges); AddSyntheticArtifactChangeData addArtifactData = new AddSyntheticArtifactChangeData(changes, getJdbcClient(), branch); return addArtifactData.doWork(); }