auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void sendUniqueOutcomeEvent(@NonNull final String name, @NonNull List<OSInfluence> sessionInfluences, @Nullable OneSignal.OutcomeCallback callback) { List<OSInfluence> influences = removeDisableInfluences(sessionInfluences); if (influences.isEmpty()) { OneSignal.Log(OneSignal.LOG_LEVEL.DEBUG, "Unique Outcome disabled for current session"); return; } boolean attributed = false; <START> boolean unAttributed = false; <END> for (OSInfluence influence : influences) { if (influence.getInfluenceType().isAttributed()) { attributed = true; break; } else if (influence.getInfluenceType().isUnattributed()) { unAttributed = true; } } if (attributed) { final List<OSInfluence> uniqueInfluences = getUniqueIds(name, influences); if (uniqueInfluences == null) { OneSignal.Log(OneSignal.LOG_LEVEL.DEBUG, "Measure endpoint will not send because unique outcome already sent for: " + "\nSessionInfluences: " + influences.toString() + "\nOutcome name: " + name); if (callback != null) callback.onSuccess(null); return; } sendAndCreateOutcomeEvent(name, 0, uniqueInfluences, callback); } else if (unAttributed) { if (unattributedUniqueOutcomeEventsSentOnSession.contains(name)) { OneSignal.Log(OneSignal.LOG_LEVEL.DEBUG, "Measure endpoint will not send because unique outcome already sent for: " + "\nSession: " + OSInfluenceType.UNATTRIBUTED + "\nOutcome name: " + name); if (callback != null) callback.onSuccess(null); return; } unattributedUniqueOutcomeEventsSentOnSession.add(name); sendAndCreateOutcomeEvent(name, 0, influences, callback); } else { OneSignal.Log(OneSignal.LOG_LEVEL.VERBOSE, "Outcomes disabled"); } }</code><technical_language>unAttributed unattributed</technical_language>

Target:
private void sendUniqueOutcomeEvent(@NonNull final String name, @NonNull List<OSInfluence> sessionInfluences, @Nullable OneSignal.OutcomeCallback callback) { List<OSInfluence> influences = removeDisabledInfluences(sessionInfluences); if (influences.isEmpty()) { OneSignal.Log(OneSignal.LOG_LEVEL.DEBUG, "Unique Outcome disabled for current session"); return; } boolean attributed = false; for (OSInfluence influence : influences) { if (influence.getInfluenceType().isAttributed()) { attributed = true; break; } } if (attributed) { final List<OSInfluence> uniqueInfluences = getUniqueIds(name, influences); if (uniqueInfluences == null) { OneSignal.Log(OneSignal.LOG_LEVEL.DEBUG, "Measure endpoint will not send because unique outcome already sent for: " + "\nSessionInfluences: " + influences.toString() + "\nOutcome name: " + name); if (callback != null) callback.onSuccess(null); return; } sendAndCreateOutcomeEvent(name, 0, uniqueInfluences, callback); } else { if (unattributedUniqueOutcomeEventsSentOnSession.contains(name)) { OneSignal.Log(OneSignal.LOG_LEVEL.DEBUG, "Measure endpoint will not send because unique outcome already sent for: " + "\nSession: " + OSInfluenceType.UNATTRIBUTED + "\nOutcome name: " + name); if (callback != null) callback.onSuccess(null); return; } unattributedUniqueOutcomeEventsSentOnSession.add(name); sendAndCreateOutcomeEvent(name, 0, influences, callback); } }
Source:
<code>protected void initializeConfiguration( ISynchronizePageConfiguration configuration) { configuration.setProperty(ISynchronizePageConfiguration.P_VIEWER_ID, VIEWER_ID); String modelProvider; if(Activator.getDefault().getPreferenceStore().getBoolean( <START> UIPreferences.SYNC_VIEW_ALWAYS_SHOW_CHANGESET_MODEL)) { <END> modelProvider = GitChangeSetModelProvider.ID; } else { modelProvider = WORKSPACE_MODEL_PROVIDER_ID; } configuration.setProperty( ModelSynchronizeParticipant.P_VISIBLE_MODEL_PROVIDER, modelProvider); super.initializeConfiguration(configuration); configuration.addActionContribution(new GitActionContributor()); }</code><technical_language>usually, please remove curly brackets single line blocks</technical_language>

Target:
protected void initializeConfiguration( ISynchronizePageConfiguration configuration) { configuration.setProperty(ISynchronizePageConfiguration.P_VIEWER_ID, VIEWER_ID); String modelProvider; if (Activator .getDefault() .getPreferenceStore() .getBoolean(UIPreferences.SYNC_VIEW_ALWAYS_SHOW_CHANGESET_MODEL)) modelProvider = GitChangeSetModelProvider.ID; else modelProvider = WORKSPACE_MODEL_PROVIDER_ID; configuration.setProperty( ModelSynchronizeParticipant.P_VISIBLE_MODEL_PROVIDER, modelProvider); super.initializeConfiguration(configuration); configuration.addActionContribution(new GitActionContributor()); }
Source:
<code>private void initSystemDataSource(File sysDSFile) throws DataSourceException { try { System.setProperty("javax.xml.bind.JAXBContextFactory", "com.sun.xml.bind.v2.ContextFactory"); JAXBContext ctx = JAXBContext.newInstance(SystemDataSourcesConfiguration.class); <START> Document doc = DataSourceUtils.convertToDocument(sysDSFile); <END> DataSourceUtils.secureResolveDocument(doc, true); SystemDataSourcesConfiguration sysDS = (SystemDataSourcesConfiguration) ctx.createUnmarshaller(). unmarshal(doc); this.addDataSourceProviders(sysDS.getProviders()); DataSourceRepository dsRepo = this.getDataSourceRepository( MultitenantConstants.SUPER_TENANT_ID); for (DataSourceMetaInfo dsmInfo : sysDS.getDataSources()) { dsmInfo.setSystem(true); dsRepo.addDataSource(dsmInfo); } } catch (Exception e) { throw new DataSourceException("Error in initializing system data sources at '" + sysDSFile.getAbsolutePath() + "' - " + e.getMessage(), e); } }</code><technical_language>correct indentation in line 175 176</technical_language>

Target:
private void initSystemDataSource(File sysDSFile) throws DataSourceException { try { JAXBContext ctx = JAXBContext.newInstance(SystemDataSourcesConfiguration.class); Document doc = DataSourceUtils.convertToDocument(sysDSFile); DataSourceUtils.secureResolveDocument(doc, true); SystemDataSourcesConfiguration sysDS = (SystemDataSourcesConfiguration) ctx.createUnmarshaller(). unmarshal(doc); this.addDataSourceProviders(sysDS.getProviders()); DataSourceRepository dsRepo = this.getDataSourceRepository( MultitenantConstants.SUPER_TENANT_ID); for (DataSourceMetaInfo dsmInfo : sysDS.getDataSources()) { dsmInfo.setSystem(true); dsRepo.addDataSource(dsmInfo); } } catch (Exception e) { throw new DataSourceException("Error in initializing system data sources at '" + sysDSFile.getAbsolutePath() + "' - " + e.getMessage(), e); } }
Source:
<code><START> private ClientCnxnSocket getClientCnxnSocket() throws IOException { <END> String clientCnxnSocketName = getClientConfig().getProperty( ZKClientConfig.ZOOKEEPER_CLIENT_CNXN_SOCKET); if (clientCnxnSocketName == null) { clientCnxnSocketName = ClientCnxnSocketNIO.class.getName(); } try { Constructor<?> clientCxnConstructor = Class.forName(clientCnxnSocketName).getConstructor(ZKClientConfig.class); ClientCnxnSocket clientCxnSocket = (ClientCnxnSocket) clientCxnConstructor.newInstance(getClientConfig()); return clientCxnSocket; } catch (Exception e) { IOException ioe = new IOException("Couldn't instantiate " + clientCnxnSocketName); ioe.initCause(e); throw ioe; } }</code><technical_language>is strictly necessary this method non-static, is it</technical_language>

Target:
private ClientCnxnSocket getClientCnxnSocket() throws IOException { String clientCnxnSocketName = getClientConfig().getProperty( ZKClientConfig.ZOOKEEPER_CLIENT_CNXN_SOCKET); if (clientCnxnSocketName == null) { clientCnxnSocketName = ClientCnxnSocketNIO.class.getName(); } try { Constructor<?> clientCxnConstructor = Class.forName(clientCnxnSocketName).getDeclaredConstructor(ZKClientConfig.class); ClientCnxnSocket clientCxnSocket = (ClientCnxnSocket) clientCxnConstructor.newInstance(getClientConfig()); return clientCxnSocket; } catch (Exception e) { IOException ioe = new IOException("Couldn't instantiate " + clientCnxnSocketName); ioe.initCause(e); throw ioe; } }
Source:
<code>public String getName() { String name= super.getName(); if (name != null) { name= MessageIds.IGNORED_TEST_PREFIX + name; if (reason != null && <START> reason.length() > 0) { <END> name= name + MessageIds.IGNORED_TEST_REASON_PREFIX + reason; } return name; } return null; }</code><technical_language>!reason.isEmpty()</technical_language>

Target:
public String getName() { String name= super.getName(); if (name != null) { name= MessageIds.IGNORED_TEST_PREFIX + name; if (reason != null && !reason.isEmpty()) { name= name + MessageIds.IGNORED_TEST_REASON_PREFIX + reason; } return name; } return null; }
Source:
<code>public List<User> getUsersWithLimit(int limit) throws IOException { <START> if (limit <= 0) { <END> return get(getFullPath("/"), new TypeReference<List<User>>() { }); } return get(getEncodedPath("?" + LIMIT + "=%s", Integer.toString(limit)), new TypeReference<List<User>>() { }); }</code><technical_language>API return users limit is -1. < -1 throws a 400. check zero case Okta return error message</technical_language>

Target:
public List<User> getUsersWithLimit(int limit) throws IOException { if (limit == -1) { return get(getFullPath("/"), new TypeReference<List<User>>() { }); } return get(getEncodedPath("?" + LIMIT + "=%s", Integer.toString(limit)), new TypeReference<List<User>>() { }); }
Source:
<code>public void tearDown() { account.deleteDB("lightcouch-db-test"); <START> } <END></code><technical_language>this reverted too</technical_language>

Target:
public void tearDown() { account.deleteDB("lightcouch-db-test"); account.shutdown(); }
Source:
<code>public void checkAttributeSemantics(PerunSessionImpl perunSession, Facility facility, Attribute attribute) throws WrongReferenceAttributeValueException { <START> if (attribute.valueAsString() == null) throw new WrongReferenceAttributeValueException(attribute, "Value can't be null"); <END> }</code><technical_language>Nit: is necessary convert String</technical_language>

Target:
public void checkAttributeSemantics(PerunSessionImpl perunSession, Facility facility, Attribute attribute) throws WrongReferenceAttributeValueException { if (attribute.getValue() == null) throw new WrongReferenceAttributeValueException(attribute, "Value can't be null"); }
Source:
<code>public static Module module() { return new CacheModule() { @Override protected void configure() { cache(PARENT_GROUPS_NAME, AccountGroup.UUID.class, new TypeLiteral<Set<AccountGroup.UUID>>() {}) .loader(ParentGroupsLoader.class); cache(SUBGROUPS_NAME, AccountGroup.UUID.class, new TypeLiteral<Set<AccountGroup.UUID>>() {}) .loader(SubgroupsLoader.class); cache(GROUPS_ACCOUNTS, AccountGroup.UUID.class, new TypeLiteral<Set<Account.Id>>() {}) <START> .loader(AccountsOfLoader.class); <END> cache(EXTERNAL_NAME, String.class, new TypeLiteral<Set<AccountGroup.UUID>>() {}) .loader(AllExternalLoader.class); bind(GroupIncludeCacheImpl.class); bind(GroupIncludeCache.class).to(GroupIncludeCacheImpl.class); } }; }</code><technical_language>GroupsAccountsLoader naming consistent other caches</technical_language>

Target:
public static Module module() { return new CacheModule() { @Override protected void configure() { cache(PARENT_GROUPS_NAME, AccountGroup.UUID.class, new TypeLiteral<Set<AccountGroup.UUID>>() {}) .loader(ParentGroupsLoader.class); cache(SUBGROUPS_NAME, AccountGroup.UUID.class, new TypeLiteral<Set<AccountGroup.UUID>>() {}) .loader(SubgroupsLoader.class); cache(GROUPS_ACCOUNTS, AccountGroup.UUID.class, new TypeLiteral<Set<Account.Id>>() {}) .loader(GroupsAccountsLoader.class); cache(EXTERNAL_NAME, String.class, new TypeLiteral<Set<AccountGroup.UUID>>() {}) .loader(AllExternalLoader.class); bind(GroupIncludeCacheImpl.class); bind(GroupIncludeCache.class).to(GroupIncludeCacheImpl.class); } }; }
Source:
<code>public void onBuffer(Buffer buffer, int sequenceNumber, int backlog) throws IOException { boolean recycleBuffer = true; try { if (expectedSequenceNumber != sequenceNumber) { onError(new BufferReorderingException(expectedSequenceNumber, sequenceNumber)); return; } final boolean wasEmpty; boolean firstPriorityEvent = false; synchronized (receivedBuffers) { if (isReleased.get()) { return; } wasEmpty = receivedBuffers.isEmpty(); SequenceBuffer sequenceBuffer = new SequenceBuffer(buffer, sequenceNumber); DataType dataType = buffer.getDataType(); if (dataType.hasPriority()) { firstPriorityEvent = addPriorityBuffer(sequenceBuffer); } else { receivedBuffers.add(sequenceBuffer); if (dataType.requiresAnnouncement()) { firstPriorityEvent = addPriorityBuffer(announce(sequenceBuffer)); } } <START> channelStatePersister.checkForBarrier(sequenceBuffer.buffer).ifPresent(id -> { lastBarrierSequenceNumber = sequenceBuffer.sequenceNumber; lastBarrierId = id; }); channelStatePersister.maybePersist(buffer); ++expectedSequenceNumber; } recycleBuffer = false; <END> if (firstPriorityEvent) { notifyPriorityEvent(sequenceNumber); } if (wasEmpty) { notifyChannelNonEmpty(); } if (backlog >= 0) { onSenderBacklog(backlog); } } finally { if (recycleBuffer) { buffer.recycleBuffer(); } } }</code><technical_language>ditto a unit test? (What is scenario is working differently is is supposed working)</technical_language>

Target:
public void onBuffer(Buffer buffer, int sequenceNumber, int backlog) throws IOException { boolean recycleBuffer = true; try { if (expectedSequenceNumber != sequenceNumber) { onError(new BufferReorderingException(expectedSequenceNumber, sequenceNumber)); return; } final boolean wasEmpty; boolean firstPriorityEvent = false; synchronized (receivedBuffers) { if (isReleased.get()) { return; } wasEmpty = receivedBuffers.isEmpty(); SequenceBuffer sequenceBuffer = new SequenceBuffer(buffer, sequenceNumber); DataType dataType = buffer.getDataType(); if (dataType.hasPriority()) { firstPriorityEvent = addPriorityBuffer(sequenceBuffer); } else { receivedBuffers.add(sequenceBuffer); if (dataType.requiresAnnouncement()) { firstPriorityEvent = addPriorityBuffer(announce(sequenceBuffer)); } } channelStatePersister .checkForBarrier(sequenceBuffer.buffer) .filter(id -> id > lastBarrierId) .ifPresent(id -> { lastBarrierId = id; lastBarrierSequenceNumber = sequenceBuffer.sequenceNumber; }); channelStatePersister.maybePersist(buffer); ++expectedSequenceNumber; } recycleBuffer = false; if (firstPriorityEvent) { notifyPriorityEvent(sequenceNumber); } if (wasEmpty) { notifyChannelNonEmpty(); } if (backlog >= 0) { onSenderBacklog(backlog); } } finally { if (recycleBuffer) { buffer.recycleBuffer(); } } }
Source:
<code><START> public void stop() { <END> this.partitionConsumers.forEach((key, value) -> { try { logger.info("Closing event hub consumer for partition {}", key); value.close(); partitionConsumers.remove(key); } catch (IOException ex) { logger.warning("Unable to close event hub consumer for partition {}", key); } }); disposable.dispose(); scheduler.dispose(); logger.info("Stopping the event processor"); }</code><technical_language>This entire story a consumer. suggest like: "Stops this Event Processor instance; If other Event Processors active for consumer group Event Hub, continue processing events responsibility for partitions this Event Processor assigned." important point: Stopping this guarantee else is processing Event Hub / Consumer Group pairing</technical_language>

Target:
public synchronized void stop() { if (!started.compareAndSet(true, false)) { logger.info("Event processor has already stopped"); return; } this.partitionConsumers.forEach((key, value) -> { try { logger.info("Closing event hub consumer for partition {}", key); value.close(); logger.info("Closed event hub consumer for partition {}", key); partitionConsumers.remove(key); } catch (IOException ex) { logger.warning("Unable to close event hub consumer for partition {}", key); } }); runner.dispose(); scheduler.dispose(); }
Source:
<code>private void getEndPointFromConnectionString(String connectionString) { HashMap<String, String> connectionStringPieces = new HashMap<>(); <START> for (String connectionStringPiece : connectionString.split(";")) { <END> String[] kvp = connectionStringPiece.split("=", 2); connectionStringPieces.put(kvp[0].toLowerCase(Locale.ROOT), kvp[1]); } String accountName = connectionStringPieces.get(ACCOUNT_NAME); try { this.endpoint = new URL(String.format("<LINK_0>", accountName)); } catch (MalformedURLException e) { throw new IllegalArgumentException(String.format("There is no valid account for the connection string. " + "Connection String: %s", connectionString)); } }</code><technical_language>a ConnectionStringParser class in Azure Core, this functionality in a lot of places</technical_language>

Target:
private void getEndPointFromConnectionString(String connectionString) { HashMap<String, String> connectionStringPieces = new HashMap<>(); for (String connectionStringPiece : connectionString.split(";")) { String[] kvp = connectionStringPiece.split("=", 2); connectionStringPieces.put(kvp[0].toLowerCase(Locale.ROOT), kvp[1]); } String accountName = connectionStringPieces.get(ACCOUNT_NAME); try { this.endpoint = new URL(String.format("<LINK_0>", accountName)); } catch (MalformedURLException e) { LOGGER.asError().log("There is no valid account for the connection string. " + "Connection String: %s", connectionString); throw new IllegalArgumentException(String.format("There is no valid account for the connection string. " + "Connection String: %s", connectionString)); } }
Source:
<code>public static long hash(byte[] bytes, int offset, int length) { <START> final long m = 0xc6a4a7935bd1e995L; <END> long seed = 1; int i = 0; for (; i + 8 <= length; i += 8) { seed = (seed * m * unsafe.getLong(bytes, (long) ARRAY_BYTE_BASE_OFFSET + offset + i)) ^ (seed >> 27); } long lastWord = 0; for (; i < length; i++) { lastWord = bytes[offset + i] | (lastWord << 8); } return (seed * m * lastWord) ^ (seed << 27); }</code><technical_language>I a private static member</technical_language>

Target:
public static long hash(byte[] bytes, int offset, int length) { long seed = 1; int i = 0; for (; i + 8 <= length; i += 8) { seed = (seed * M * unsafe.getLong(bytes, (long) ARRAY_BYTE_BASE_OFFSET + offset + i)) ^ (seed >> 27); } long lastWord = 0; for (; i < length; i++) { lastWord = bytes[offset + i] | (lastWord << 8); } return (seed * M * lastWord) ^ (seed << 27); }
Source:
<code>private RefList<Ref> parsePackedRefs(final BufferedReader br) throws IOException { RefList.Builder<Ref> all = new RefList.Builder<Ref>(); Ref last = null; boolean peeled = false; boolean needSort = false; String p; while ((p = br.readLine()) != null) { if (p.charAt(0) == '#') { if (p.startsWith(PACKED_REFS_HEADER)) { p = p.substring(PACKED_REFS_HEADER.length()); peeled = p.contains(PACKED_REFS_PEELED); } continue; } if (p.charAt(0) == '^') { if (last == null) throw new IOException(JGitText.get().peeledLineBeforeRef); ObjectId id = ObjectId.fromString(p.substring(1)); last = new ObjectIdRef.PeeledTag(PACKED, last.getName(), last .getObjectId(), id); all.set(all.size() - 1, last); continue; } int sp = p.indexOf(' '); if (sp < 0) throw new <START> IOException(MessageFormat.format(JGitText .get().packedRefsCorruptionDetected, <END> packedRefsFile.getAbsolutePath())); ObjectId id = ObjectId.fromString(p.substring(0, sp)); String name = copy(p, sp + 1, p.length()); ObjectIdRef cur; if (peeled) cur = new ObjectIdRef.PeeledNonTag(PACKED, name, id); else cur = new ObjectIdRef.Unpeeled(PACKED, name, id); if (last != null && RefComparator.compareTo(last, cur) > 0) needSort = true; all.add(cur); last = cur; } if (needSort) all.sort(); return all.toRefList(); }</code><technical_language>This line wrapping a bit odd me, familiar this project's conventions</technical_language>

Target:
private RefList<Ref> parsePackedRefs(final BufferedReader br) throws IOException { RefList.Builder<Ref> all = new RefList.Builder<Ref>(); Ref last = null; boolean peeled = false; boolean needSort = false; String p; while ((p = br.readLine()) != null) { if (p.charAt(0) == '#') { if (p.startsWith(PACKED_REFS_HEADER)) { p = p.substring(PACKED_REFS_HEADER.length()); peeled = p.contains(PACKED_REFS_PEELED); } continue; } if (p.charAt(0) == '^') { if (last == null) throw new IOException(JGitText.get().peeledLineBeforeRef); ObjectId id = ObjectId.fromString(p.substring(1)); last = new ObjectIdRef.PeeledTag(PACKED, last.getName(), last .getObjectId(), id); all.set(all.size() - 1, last); continue; } int sp = p.indexOf(' '); if (sp < 0) { throw new IOException(MessageFormat.format( JGitText.get().packedRefsCorruptionDetected, packedRefsFile.getAbsolutePath())); } ObjectId id = ObjectId.fromString(p.substring(0, sp)); String name = copy(p, sp + 1, p.length()); ObjectIdRef cur; if (peeled) cur = new ObjectIdRef.PeeledNonTag(PACKED, name, id); else cur = new ObjectIdRef.Unpeeled(PACKED, name, id); if (last != null && RefComparator.compareTo(last, cur) > 0) needSort = true; all.add(cur); last = cur; } if (needSort) all.sort(); return all.toRefList(); }
Source:
<code>private void checkoutBranch(String branchName) throws IllegalStateException, IOException { RevWalk walk = new RevWalk(db); RevCommit head = walk.parseCommit(db.resolve(Constants.HEAD)); RevCommit branch = walk.parseCommit(db.resolve(branchName)); <START> DirCacheCheckout dco = new DirCacheCheckout(db, head.getTree().getId(), <END> db.lockDirCache(), branch.getTree().getId()); dco.setFailOnConflict(true); assertTrue(dco.checkout()); walk.release(); RefUpdate refUpdate = db.updateRef(Constants.HEAD); assertEquals(Result.FORCED, refUpdate.link(branchName)); }</code><technical_language>getId() necessary, RevTree is ObjectId</technical_language>

Target:
private void checkoutBranch(String branchName) throws IllegalStateException, IOException { RevWalk walk = new RevWalk(db); RevCommit head = walk.parseCommit(db.resolve(Constants.HEAD)); RevCommit branch = walk.parseCommit(db.resolve(branchName)); DirCacheCheckout dco = new DirCacheCheckout(db, head.getTree(), db.lockDirCache(), branch.getTree()); dco.setFailOnConflict(true); assertTrue(dco.checkout()); walk.release(); RefUpdate refUpdate = db.updateRef(Constants.HEAD); assertEquals(Result.FORCED, refUpdate.link(branchName)); }
Source:
<code>protected static File searchPath(String path, String... lookFor) { if (path == null) return null; for (String p : path.split(File.pathSeparator)) { for (String command : lookFor) { final File file = new File(p, command); try { if (file.isFile()) { return file.getAbsoluteFile(); } } catch (SecurityException e) { <START> LOG.warn("The path '{}' isn't accessible. Skip it", file.getPath()); END> } } } return null; }</code><technical_language>externalize message JGitText</technical_language>

Target:
protected static File searchPath(String path, String... lookFor) { if (path == null) return null; for (String p : path.split(File.pathSeparator)) { for (String command : lookFor) { final File file = new File(p, command); try { if (file.isFile()) { return file.getAbsoluteFile(); } } catch (SecurityException e) { LOG.warn(MessageFormat.format( JGitText.get().skipNotAccessiblePath, file.getPath())); } } } return null; }
Source:
<code>public void testKSTS() throws Exception { RabbitConnectionFactoryBean fb = new RabbitConnectionFactoryBean(); Log logger = spy(TestUtils.getPropertyValue(fb, "logger", Log.class)); given(logger.isDebugEnabled()).willReturn(true); new DirectFieldAccessor(fb).setPropertyValue("logger", logger); ConnectionFactory rabbitCf = spy(TestUtils.getPropertyValue(fb, "connectionFactory", ConnectionFactory.class)); <START> new DirectFieldAccessor(fb).setPropertyValue("connectionFactory", rabbitCf); <END> fb.setUseSSL(true); fb.setKeyStoreType("JKS"); fb.setKeyStoreResource(new ClassPathResource("test.ks")); fb.setKeyStorePassphrase("secret"); fb.setTrustStoreResource(new ClassPathResource("test.truststore.ks")); fb.setKeyStorePassphrase("secret"); fb.setSecureRandom(SecureRandom.getInstanceStrong()); fb.afterPropertiesSet(); fb.getObject(); ArgumentCaptor<String> captor = ArgumentCaptor.forClass(String.class); verify(logger).debug(captor.capture()); final String log = captor.getValue(); assertThat(log, allOf(containsString("KM: ["), containsString("TM: ["), containsString("random: java."))); }</code><technical_language>Well, is copy/paste existing tests, this rabbitCf mock. So, need spy</technical_language>

Target:
public void testKSTS() throws Exception { RabbitConnectionFactoryBean fb = new RabbitConnectionFactoryBean(); Log logger = spy(TestUtils.getPropertyValue(fb, "logger", Log.class)); given(logger.isDebugEnabled()).willReturn(true); new DirectFieldAccessor(fb).setPropertyValue("logger", logger); fb.setUseSSL(true); fb.setKeyStoreType("JKS"); fb.setKeyStoreResource(new ClassPathResource("test.ks")); fb.setKeyStorePassphrase("secret"); fb.setTrustStoreResource(new ClassPathResource("test.truststore.ks")); fb.setKeyStorePassphrase("secret"); fb.setSecureRandom(SecureRandom.getInstanceStrong()); fb.afterPropertiesSet(); fb.getObject(); ArgumentCaptor<String> captor = ArgumentCaptor.forClass(String.class); verify(logger).debug(captor.capture()); final String log = captor.getValue(); assertThat(log, allOf(containsString("KM: ["), containsString("TM: ["), containsString("random: java."))); }
Source:
<code>public static <T> BasicEList<T> newBasicEList(T... elements) { BasicEList<T> result = new BasicEList<T>(elements.length); <START> result.addAll(Arrays.asList(elements)); <END> return result; }</code><technical_language>This a performance improvement. (And a tab character appeared in file.)</technical_language>

Target:
public static <T> BasicEList<T> newBasicEList(T... elements) { BasicEList<T> result = new BasicEList<T>(elements.length); System.arraycopy(elements, 0, result.data, 0, elements.length); return result; }
Source:
<code>public void theGetActualMeterReadsRequestIsReceived(final Map<String, String> settings) throws Throwable { final ActualMeterReadsRequest request = ActualMeterReadsRequestFactory.fromParameterMap(settings); final ActualMeterReadsAsyncResponse asyncResponse = this.requestClient.doRequest(request); <START> assertNotNull("asyncResponse should not be null", asyncResponse); <END> ScenarioContext.current().put(PlatformKeys.KEY_CORRELATION_UID, asyncResponse.getCorrelationUid()); }</code><technical_language>capital 'AsyncResponse'</technical_language>

Target:
public void theGetActualMeterReadsRequestIsReceived(final Map<String, String> settings) throws Throwable { final ActualMeterReadsRequest request = ActualMeterReadsRequestFactory.fromParameterMap(settings); final ActualMeterReadsAsyncResponse asyncResponse = this.requestClient.doRequest(request); assertNotNull("AsyncResponse should not be null", asyncResponse); ScenarioContext.current().put(PlatformKeys.KEY_CORRELATION_UID, asyncResponse.getCorrelationUid()); }
Source:
<code>public static int doSendInvite(String accountEmail, String currentUserEmail, String instructorName) { int rv = 0; try { emailMessage = Friend.readFile(friendEmailFile, StandardCharsets.UTF_8); <START> emailMessage = emailMessage.replace("<instructor>", instructorName); <END> emailMessage = emailMessage.replace("<contactEmail>", contactEmail); Xclient = new XmlRpcClient(); XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl(); config.setServerURL(new URL(friendUrl)); Xclient.setTransportFactory(new XmlRpcSun15HttpTransportFactory(Xclient)); Xclient.setConfig(config); Object[] params = new Object[]{contactEmail, referrerUrl, emailMessage, new String[]{accountEmail}, currentUserEmail}; Object[] results = (Object[]) Xclient.execute("sendInvites", params); if (results != null && results.length == 1) { rv = ((Integer) results[0]).intValue(); } } catch (Exception e) { M_log.warn("Friend doSendInvite(): email address=" + accountEmail + " " + e.getMessage()); } return rv; }</code><technical_language>Is a reason this a case-sensitive match? If a case-insensitive match avoid frustrating typos</technical_language>

Target:
public CreateAccountResponse doSendInvite(String accountEmail, String currentUserEmail, String instructorName) { M_log.debug("Friend doSendInvite() called"); CreateAccountResponse response = CreateAccountResponse.RUNTIME_PROBLEM; int rv = 0; try { HashMap<String, String> map = new HashMap<String,String>(); map.put(INSTRUCTOR_NAME_TAG, instructorName); map.put(CONTACT_EMAIL_TAG, contactEmail); emailMessage = Friend.readFile(friendEmailFile, StandardCharsets.UTF_8); emailMessage = replacePlaceHolders(emailMessage, map); Object[] params = new Object[]{contactEmail, referrerUrl, emailMessage, new String[]{accountEmail}, currentUserEmail}; Object[] results = (Object[]) Xclient.execute(SEND_INVITES_WS, params); if (results != null && results.length == 1) { rv = ((Integer) results[0]).intValue(); } } catch (Exception e) { M_log.warn("Friend doSendInvite(): email address=" + accountEmail + " " + e.getMessage()); } if(rv == -1){ response = CreateAccountResponse.INVALID_EMAIL; } if(rv == 0){ response = CreateAccountResponse.RUNTIME_PROBLEM; } if(rv == 1){ response = CreateAccountResponse.INVITATION_SUCCESSFULLY_SENT; } return response; }
Source:
<code>protected boolean checkSriovHotPlugSupported() { if (!FeatureSupported.sriovHotPlugSupported(getVm().getVdsGroupCompatibilityVersion())) { <START> addCanDoActionMessage(EngineMessage.HOT_PLUG_UNPLUG_PASSTHROUGH_VNIC_NOT_SUPPORTED); return false; <END> } return true; }</code><technical_language>pls replace return failCanDoAction(EngineMessage.HOT_PLUG_UNPLUG_PASSTHROUGH_VNIC_NOT_SUPPORTED);</technical_language>

Target:
protected boolean checkSriovHotPlugSupported() { if (!FeatureSupported.sriovHotPlugSupported(getVm().getVdsGroupCompatibilityVersion())) { return failValidation(EngineMessage.HOT_PLUG_UNPLUG_PASSTHROUGH_VNIC_NOT_SUPPORTED); } return true; }
Source:
<code>public String removeQueryStringsFromURL(String url) { if (url.contains("?")) { return url.substring(0, url.indexOf("?")); } <START> else return url; <END> }</code><technical_language>remove else add pair of curly brackets</technical_language>

Target:
public String removeQueryStringsFromURL(String url) { if (url.contains("?")) { return url.substring(0, url.indexOf("?")); } return url; }
Source:
<code>public GrpcBackedCommandMessage(Command command, Serializer serializer) { <START> this.command = command; <END> this.serializedPayload = new LazyDeserializingObject<>(new GrpcSerializedObject(command.getPayload()), serializer); this.metaDataSupplier = new GrpcMetaData(command.getMetaDataMap(), serializer); }</code><technical_language>invoke GrpcBackedCommandMessage(Command, LazyDeserializingObject, Supplier) constructor</technical_language>

Target:
public GrpcBackedCommandMessage(Command command, Serializer serializer) { this( command, new LazyDeserializingObject<>(new GrpcSerializedObject(command.getPayload()), serializer), new GrpcMetaData(command.getMetaDataMap(), serializer) ); }
Source:
<code>private DiskImage createMetadataDisk(VM vm, Snapshot snapshot) { List<Guid> guids = Guid.createGuidListFromString(snapshot.getMemoryVolume()); StorageDomainStatic sd = validateStorageDomainExistsInDb(snapshot, guids.get(0), guids.get(4), guids.get(5)); DiskImage disk = isMemoryDiskAlreadyExistsInDb(snapshot, guids.get(4), guids.get(5)); if (sd == null || disk != null) { return null; } DiskImage memoryDisk = MemoryUtils.createSnapshotMetadataDisk(MemoryUtils.generateMemoryDiskDescription(vm, snapshot.getDescription())); memoryDisk.setId(guids.get(4)); memoryDisk.setImageId(guids.get(5)); memoryDisk.setStorageIds(new ArrayList<>(Collections.singletonList(guids.get(0)))); memoryDisk.setStoragePoolId(guids.get(1)); memoryDisk.setCreationDate(snapshot.getCreationDate()); memoryDisk.setActive(true); <START> memoryDisk.setWipeAfterDelete(vm.getDiskList().stream().anyMatch(d -> d.isWipeAfterDelete())); <END> return memoryDisk; }</code><technical_language>consistent DiskImage::isWipeAfterDelete please</technical_language>

Target:
private DiskImage createMetadataDisk(VM vm, Snapshot snapshot) { List<Guid> guids = Guid.createGuidListFromString(snapshot.getMemoryVolume()); StorageDomainStatic sd = validateStorageDomainExistsInDb(snapshot, guids.get(0), guids.get(4), guids.get(5)); DiskImage disk = isMemoryDiskAlreadyExistsInDb(snapshot, guids.get(4), guids.get(5)); if (sd == null || disk != null) { return null; } DiskImage memoryDisk = MemoryUtils.createSnapshotMetadataDisk(MemoryUtils.generateMemoryDiskDescription(vm, snapshot.getDescription())); memoryDisk.setId(guids.get(4)); memoryDisk.setImageId(guids.get(5)); memoryDisk.setStorageIds(new ArrayList<>(Collections.singletonList(guids.get(0)))); memoryDisk.setStoragePoolId(guids.get(1)); memoryDisk.setCreationDate(snapshot.getCreationDate()); memoryDisk.setActive(true); memoryDisk.setWipeAfterDelete(vm.getDiskList().stream().anyMatch(DiskImage::isWipeAfterDelete)); return memoryDisk; }
Source:
<code>public void finishBundle(DoFn<KV<String, Iterable<Mutation>>, Void>.Context c) throws Exception { <START> synchronized(this) { <END> if (mutators != null) { for (BufferedMutator bufferedMutator : mutators.values()) { try { bufferedMutator.flush(); } catch (RetriesExhaustedWithDetailsException exception) { logExceptions(c, exception); rethrowException(exception); } } } mutators.clear(); } super.finishBundle(c); }</code><technical_language>synchronized</technical_language>

Target:
public void finishBundle(DoFn<KV<String, Iterable<Mutation>>, Void>.Context c) throws Exception { for (BufferedMutator bufferedMutator : mutators.values()) { try { bufferedMutator.flush(); } catch (RetriesExhaustedWithDetailsException exception) { logExceptions(c, exception); rethrowException(exception); } } mutators.clear(); super.finishBundle(c); }
Source:
<code>public void eventReceived(Action action, ConfigMap configMap) { logger.debug("Received event for configMap {}, details: {}", action, configMap.getMetadata().getName(), configMap.getData()); switch (action) { <START> case ADDED: callbackHandler.onAdded(Collections.singletonList(new KubernetesConfigMap(configMap))); break; case MODIFIED: callbackHandler.onModified(Collections.singletonList(new KubernetesConfigMap(configMap))); break; case ERROR: callbackHandler.onError(Collections.singletonList(new KubernetesConfigMap(configMap))); break; case DELETED: callbackHandler.onDeleted(Collections.singletonList(new KubernetesConfigMap(configMap))); break; default: logger.debug("Ignore handling event for configMap {}", action, configMap.getMetadata().getName()); <END> break; } }</code><technical_language>Minor: deduplicate codes generating singleton list switch</technical_language>

Target:
public void eventReceived(Action action, ConfigMap configMap) { logger.debug("Received event for configMap {}, details: {}", action, configMap.getMetadata().getName(), configMap.getData()); final List<KubernetesConfigMap> configMaps = Collections.singletonList(new KubernetesConfigMap(configMap)); switch (action) { case ADDED: callbackHandler.onAdded(configMaps); break; case MODIFIED: callbackHandler.onModified(configMaps); break; case ERROR: callbackHandler.onError(configMaps); break; case DELETED: callbackHandler.onDeleted(configMaps); break; default: logger.debug("Ignore handling event for configMap {}", action, configMap.getMetadata().getName()); break; } }
Source:
<code>protected void doDelivery(ResourceDeliveryMessage theMsg, CanonicalSubscription theSubscription, EncodingEnum thePayloadType, IGenericClient theClient, IBaseResource thePayloadResource) { IClientExecutable<?, ?> operation; switch (theMsg.getOperationType()) { case CREATE: case UPDATE: if (thePayloadResource == null || thePayloadResource.isEmpty()) { if (thePayloadType != null) { operation = theClient.create().resource(thePayloadResource); } else { sendNotification(theMsg); return; } } else { if (thePayloadType != null) { operation = theClient.update().resource(thePayloadResource); } else { sendNotification(theMsg); return; } } break; case DELETE: operation = theClient.delete().resourceById(theMsg.getPayloadId(myFhirContext)); break; default: ourLog.warn("Ignoring delivery message of type: {}", theMsg.getOperationType()); return; } if (thePayloadType != null) { operation.encoded(thePayloadType); } ourLog.info("Delivering rest-hook payload for {}", theMsg.getOperationType(), thePayloadResource.getIdElement().toUnqualified().getValue(), theSubscription.getIdElement(myFhirContext).toUnqualifiedVersionless().getValue()); try { operation.execute(); } catch (ResourceNotFoundException e) { <START> ourLog.error("Cannot reach " + theMsg.getSubscription().getEndpointUrl(), e); <END> throw e; } }</code><technical_language>I guess matter error() message, for consistency this "Cannot reach {}", theMsg.getSubscription().getEndpointUrl()</technical_language>

Target:
protected void doDelivery(ResourceDeliveryMessage theMsg, CanonicalSubscription theSubscription, EncodingEnum thePayloadType, IGenericClient theClient, IBaseResource thePayloadResource) { IClientExecutable<?, ?> operation; switch (theMsg.getOperationType()) { case CREATE: case UPDATE: if (thePayloadResource == null || thePayloadResource.isEmpty()) { if (thePayloadType != null) { operation = theClient.create().resource(thePayloadResource); } else { sendNotification(theMsg); return; } } else { if (thePayloadType != null) { operation = theClient.update().resource(thePayloadResource); } else { sendNotification(theMsg); return; } } break; case DELETE: operation = theClient.delete().resourceById(theMsg.getPayloadId(myFhirContext)); break; default: ourLog.warn("Ignoring delivery message of type: {}", theMsg.getOperationType()); return; } if (thePayloadType != null) { operation.encoded(thePayloadType); } ourLog.info("Delivering rest-hook payload for {}", theMsg.getOperationType(), thePayloadResource.getIdElement().toUnqualified().getValue(), theSubscription.getIdElement(myFhirContext).toUnqualifiedVersionless().getValue()); try { operation.execute(); } catch (ResourceNotFoundException e) { ourLog.error("Cannot reach ", theMsg.getSubscription().getEndpointUrl()); ourLog.error("Exception: ", e); throw e; } }
Source:
<code>public void afterPropertiesSet() throws Exception { if (this.propertyAccessors.isEmpty()) { this.loadDefaultPropertyAccessors(this.propertyAccessors); } this.beanResolver = new BeanFactoryResolver(this.beanFactory); ConversionService conversionService = IntegrationContextUtils.getConversionService(this.beanFactory); if (conversionService != null) { this.typeConverter = new StandardTypeConverter(conversionService); } Collection<SpelFunctionRegistrar> spelFunctionRegistrars = <START> IntegrationContextUtils.beansOfTypeIncludingAncestors(this.beanFactory, SpelFunctionRegistrar.class); <END> for (SpelFunctionRegistrar spelFunctionRegistrar : spelFunctionRegistrars) { Map<String, Method> functions = spelFunctionRegistrar.getFunctions(); for (String key : functions.keySet()) { if (!this.functions.containsKey(key)) { this.functions.put(key, functions.get(key)); } } } Collection<SpelPropertyAccessorRegistrar> propertyAccessorRegistrars = IntegrationContextUtils.beansOfTypeIncludingAncestors(this.beanFactory, SpelPropertyAccessorRegistrar.class); for (SpelPropertyAccessorRegistrar propertyAccessorRegistrar : propertyAccessorRegistrars) { this.propertyAccessors.addAll(propertyAccessorRegistrar.getPropertyAccessors()); } }</code><technical_language>Yes, I agree - @SpelFunctions inheritable. need parent registrars in collection in right order</technical_language>

Target:
public void afterPropertiesSet() throws Exception { if (this.propertyAccessors.isEmpty()) { this.loadDefaultPropertyAccessors(this.propertyAccessors); } if (this.applicationContext != null) { this.beanResolver = new BeanFactoryResolver(this.applicationContext); ConversionService conversionService = IntegrationContextUtils.getConversionService(this.applicationContext); if (conversionService != null) { this.typeConverter = new StandardTypeConverter(conversionService); } Map<String, SpelFunctionFactoryBean> functionFactoryBeanMap = BeanFactoryUtils.beansOfTypeIncludingAncestors(this.applicationContext, SpelFunctionFactoryBean.class); for (SpelFunctionFactoryBean spelFunctionFactoryBean : functionFactoryBeanMap.values()) { if (!this.functions.containsKey(spelFunctionFactoryBean.getFunctionName())) { this.functions.put(spelFunctionFactoryBean.getFunctionName(), spelFunctionFactoryBean.getObject()); } } try { SpelPropertyAccessorRegistrar propertyAccessorRegistrar = this.applicationContext.getBean(SpelPropertyAccessorRegistrar.class); this.propertyAccessors.addAll(propertyAccessorRegistrar.getPropertyAccessors()); } catch (NoSuchBeanDefinitionException e) { } } }
Source:
<code>protected void validateEnterpriseRepo() { if (warningComponent != null) { warningComponent.setLinkText(""); if (!isEnterpriseTargetRuntime()) { return; } warningComponent.setLinkText(Messages.NewProjectExamplesStacksRequirementsPage_Checking_Enterprise_Maven_Repo_Availability, false); IStatus enterpriseRepoStatus = enterpriseRepoStatusMap.get(version); if (enterpriseRepoStatus != null) { updateWarningComponent(enterpriseRepoStatus); return; } final IStatus[] checkResult = new IStatus[1]; Job job = new Job(Messages.NewProjectExamplesStacksRequirementsPage_Check_Maven_Repo_Job) { @Override protected IStatus run(IProgressMonitor monitor) { if (StacksArchetypeUtil.getRequiredDependencies(version) == null) { checkResult[0] = MavenArtifactHelper.checkEnterpriseRequirementsAvailable(projectExample); } else { checkResult[0] = MavenArtifactHelper.checkRequirementsAvailable(version); } return Status.OK_STATUS; } }; job.addJobChangeListener(new JobChangeAdapter() { public void done(IJobChangeEvent event) { enterpriseRepoStatusMap.put(version, checkResult[0]); Display.getDefault().syncExec( new Runnable() { public void run() { <START> updateWarningComponent(checkResult[0]); <END> } }); }; }); job.schedule(); } }</code><technical_language>if job running I pressed finish cancel ? chance of updatewarningcomponent messing components destroyed</technical_language>

Target:
protected void validateEnterpriseRepo() { if (exampleInitialized && warningComponent != null) { warningComponent.setLinkText(""); if (!isEnterpriseTargetRuntime()) { return; } warningComponent.setLinkText(Messages.NewProjectExamplesStacksRequirementsPage_Checking_Enterprise_Maven_Repo_Availability, false); IStatus enterpriseRepoStatus = enterpriseRepoStatusMap.get(version); if (enterpriseRepoStatus != null) { updateWarningComponent(enterpriseRepoStatus); return; } final IStatus[] checkResult = new IStatus[1]; stopMavenRepoCheckJob(); job = new Job(Messages.NewProjectExamplesStacksRequirementsPage_Check_Maven_Repo_Job) { @Override protected IStatus run(IProgressMonitor monitor) { if (StacksArchetypeUtil.getRequiredDependencies(version) == null) { checkResult[0] = MavenArtifactHelper.checkEnterpriseRequirementsAvailable(projectExample); } else { checkResult[0] = MavenArtifactHelper.checkRequirementsAvailable(version); } return Status.OK_STATUS; } }; job.addJobChangeListener(new JobChangeAdapter() { public void done(IJobChangeEvent event) { enterpriseRepoStatusMap.put(version, checkResult[0]); final IStatus status = event.getResult().isOK()?checkResult[0]:event.getResult(); Display.getDefault().syncExec( new Runnable() { public void run() { updateWarningComponent(status); } }); }; }); job.schedule(); } }
Source:
<code>public void newColumn( final int columnIndex ) { final List<BaseColumn> expandedColumns = model.getExpandedColumns(); <START> final BaseColumn baseColumn1 = expandedColumns.get( columnIndex ); <END> index.columns.add( new ColumnBuilder( model, baseColumn1 ).build() ); int rowIndex = 0; for ( final List<DTCellValue52> row : model.getData() ) { final BaseColumn baseColumn = model.getExpandedColumns().get( columnIndex ); final Rule rule = getRule( rowIndex ); new CellBuilder( index, model, columnIndex, utils, baseColumn ).build( rule, row ); rowIndex++; } }</code><technical_language>I picky, is this variable called baseColumn_1_</technical_language>

Target:
public void newColumn( final int columnIndex ) { index.columns.add( new ColumnBuilder( model, model.getExpandedColumns().get( columnIndex ) ).build() ); int rowIndex = 0; for ( final List<DTCellValue52> row : model.getData() ) { final BaseColumn baseColumn = model.getExpandedColumns().get( columnIndex ); final Rule rule = getRule( rowIndex ); new CellBuilder( index, model, columnIndex, utils, baseColumn ).build( rule, row ); rowIndex++; } }
Source:
<code>public void getParameterName_OldAnnotation() throws NoSuchMethodException { <START> String actualResult = getParameterNameWithMethodNameAndParamIndex(TEST_METHOD_1, FIRST_INDEX); <END> assertEquals(SECOND_NAME_METHOD_ANNOTATION, actualResult); }</code><technical_language>Abbreviation for variable name: Result -> res. abbreviation rules</technical_language>

Target:
public void getParameterName_OldAnnotation() throws NoSuchMethodException { String actualRes = getParameterNameWithMethodNameAndParamIndex(TEST_METHOD_1, FIRST_INDEX); assertEquals(SECOND_NAME_METHOD_ANNOTATION, actualRes); }
Source:
<code>private void replayModificationsInTransaction(PrepareCommand command, boolean onePhaseCommit) throws Throwable { TransactionManager tm = txManager(); tm.begin(); try { replayModifications(command); } finally { int status = -1; try { status = tm.getStatus(); <START> } catch (Exception e) <END> LocalTransaction localTx = txTable().getLocalTransaction(tm.getTransaction()); localTx.setFromRemoteSite(true); if (onePhaseCommit) { if( status == Status.STATUS_ACTIVE ) { log.tracef("Committing remotely originated tx %s as it is 1PC", command.getGlobalTransaction()); tm.commit(); } else { log.tracef("Rolling back remotely originated tx %s as it is 1PC", command.getGlobalTransaction()); tm.rollback(); } } else { remote2localTx.put(command.getGlobalTransaction(), localTx.getGlobalTransaction()); } tm.suspend(); } }</code><technical_language>swallow this, trace-log it.</technical_language>

Target:
private void replayModificationsInTransaction(PrepareCommand command, boolean onePhaseCommit) throws Throwable { TransactionManager tm = txManager(); boolean replaySuccessful = false; try { tm.begin(); replayModifications(command); replaySuccessful = true; } finally { LocalTransaction localTx = txTable().getLocalTransaction( tm.getTransaction() ); localTx.setFromRemoteSite(true); if (onePhaseCommit) { if( replaySuccessful ) { log.tracef("Committing remotely originated tx %s as it is 1PC", command.getGlobalTransaction()); tm.commit(); } else { log.tracef("Rolling back remotely originated tx %s", command.getGlobalTransaction()); tm.rollback(); } } else { remote2localTx.put(command.getGlobalTransaction(), localTx.getGlobalTransaction()); tm.suspend(); } } }
Source:
<code>public void addStream(long id, File streamFile) throws CTFException { final File file = streamFile; if (file == null) { throw new CTFException("cannot create a stream with no file"); } <START> ICTFStream stream = fStreams.computeIfAbsent(id, k -> new CTFStream(this)); <END> if (stream instanceof CTFStream) { CTFStream ctfStream = (CTFStream) stream; ctfStream.addInput(new CTFStreamInput(stream, file)); } else { throw new CTFException("Stream does not support adding input"); } }</code><technical_language>method ref</technical_language>

Target:
public void addStream(long id, File streamFile) throws CTFException { final File file = streamFile; if (file == null) { throw new CTFException("cannot create a stream with no file"); } ICTFStream stream = fStreams.computeIfAbsent(id, ctfStream -> new CTFStream(this)); if (stream instanceof CTFStream) { CTFStream ctfStream = (CTFStream) stream; ctfStream.addInput(new CTFStreamInput(stream, file)); } else { throw new CTFException("Stream does not support adding input"); } }