auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>void testGetAllInspectedTypes() { Set<Class<?>> expectedInspectedTypes = Sets.newSet(pA.class, A.class, B.class, C.class, D.class); inspector.getAllInspectedTypes() <START> .forEach(inspectedType -> assertTrue(expectedInspectedTypes.contains(inspectedType))); <END> }</code><technical_language>Nit: good verify count of inspected types, reverse assertion verify of expectedInspectedTypes contained in getAllInspectedTypes(). current verification allows for getAllInspectedTypes() return a subset of expectedInspectedTypes</technical_language>

Target:
void testGetAllInspectedTypes() { Set<Class<?>> expectedInspectedTypes = Sets.newSet(pA.class, A.class, B.class, C.class, D.class); Set<Class<?>> resultInspectedTypes = inspector.getAllInspectedTypes(); resultInspectedTypes.forEach(resultType -> assertTrue(expectedInspectedTypes.contains(resultType))); expectedInspectedTypes.forEach(expectedType -> assertTrue(resultInspectedTypes.contains(expectedType))); }
Source:
<code><START> private List<SkippedLine> checkAndAddSkip(List<SkippedLine> list, <END> SkippedLine toAdd) { if (toAdd.getSize() > 1) { list.add(toAdd); } return list; }</code><technical_language>This method return void</technical_language>

Target:
private void checkAndAddSkip(List<SkippedLine> list, SkippedLine toAdd) { if (toAdd.getSize() > 1) { list.add(toAdd); } }
Source:
<code>public void set(String field, final String value) { <START> if (!"".equals(field)) { <END> if (isUserDefinedField(field)) { userDefinedFields.put(field, value); String fieldName = getUserDefinedFieldName(field); if (fieldName != null) { userDefinedFieldNames.add(new ControlField(fieldName)); } field = fieldName; } if (field != null) { values.put(field, value); } } }</code><technical_language>I understand this, testing if field name is empty? this removed</technical_language>

Target:
public void set(String field, final String value) { if (field != null && isUserDefinedField(field)) { userDefinedFields.put(field, value); String fieldName = getUserDefinedFieldName(field); if (fieldName != null) { userDefinedFieldNames.add(new ControlField(fieldName)); } field = fieldName; } if (field != null && !"".equals(field)) { values.put(field, value); } }
Source:
<code>public void testPutIfAbsentNoStoreEntryHasCacheWriterEntry() throws Exception { final FakeStore realStore = new FakeStore(Collections.<String, String>emptyMap()); this.store = spy(realStore); final FakeCacheWriter realCache = new FakeCacheWriter(Collections.singletonMap("key", "oldValue")); final Ehcache<String, String> ehcache = this.getEhcache(realCache); <START> assertThat(ehcache.putIfAbsent("key", "value"), is(nullValue())); END> verify(this.store).computeIfAbsent(eq("key"), getAnyFunction()); verifyZeroInteractions(this.spiedResilienceStrategy); assertThat(realStore.getEntryMap().get("key"), equalTo("value")); assertThat(realCache.getEntryMap().get("key"), equalTo("value")); validateStats(ehcache, EnumSet.of(CacheOperationOutcomes.PutIfAbsentOutcome.PUT)); }</code><technical_language>Clarifying this part of #163</technical_language>

Target:
public void testPutIfAbsentNoStoreEntryHasCacheWriterEntry() throws Exception { final FakeStore fakeStore = new FakeStore(Collections.<String, String>emptyMap()); this.store = spy(fakeStore); final FakeCacheWriter fakeWriter = new FakeCacheWriter(Collections.singletonMap("key", "oldValue")); final Ehcache<String, String> ehcache = this.getEhcache(fakeWriter); assertThat(ehcache.putIfAbsent("key", "value"), is(nullValue())); verify(this.store).computeIfAbsent(eq("key"), getAnyFunction()); verifyZeroInteractions(this.spiedResilienceStrategy); assertThat(fakeStore.getEntryMap().get("key"), equalTo("value")); assertThat(fakeWriter.getEntryMap().get("key"), equalTo("value")); validateStats(ehcache, EnumSet.of(CacheOperationOutcomes.PutIfAbsentOutcome.PUT)); }
Source:
<code>public void requestDispose() { <START> if (mH.getLooper().isCurrentThread()) <END> { dispose(); } else { mH.post(new Runnable() { public void run() { dispose(); } }); } mDisposed = true; }</code><technical_language>call dispose() more once. if (mDisposed == true) { return; }</technical_language>

Target:
public void requestDispose() { mDragStateDisposed = true; if (mH.getLooper().isCurrentThread()) { dispose(); } else { mH.post(new Runnable() { public void run() { dispose(); } }); } }
Source:
<code><START> private void updateContext(String resourceName, ZNRecord record) { <END> if (record != null && _initialContextMapHashcode.containsKey(resourceName) && _initialContextMapHashcode.get(resourceName) .equals(Objects.hashCode(record.toString()))) { return; } _contextMap.put(resourceName, record); _contextToUpdate.add(resourceName); }</code><technical_language>I this overkill checking update. updating check for context writes ZK. Otherwise, I update context 10 times, I need convert String time. leverage Java8 stream do checks write ZK, efficient instead of update check</technical_language>

Target:
private void updateContext(String resourceName, ZNRecord record) { _contextMap.put(resourceName, record); _contextToUpdate.add(resourceName); }
Source:
<code>public void registerMetricsCaptor(MetricsCaptor metricsCaptor) { super.registerMetricsCaptor(metricsCaptor); this.sizeGauge = metricsCaptor.gaugeBuilder("spring.integration.channel.queue.size", this, (channel) -> getQueueSize()) .tag("name", getComponentName() == null ? "unknown" : getComponentName()) .tag("type", "channel") .description("The size of queue channel") .build(); this.remainingCapacityGauge = metricsCaptor.gaugeBuilder("spring.integration.channel.queue.remaining.capacity", this, (channel) -> getRemainingCapacity()) .tag("name", getComponentName() == null ? "unknown" : getComponentName()) .tag("type", "channel") <START> .description("The remaining.capacity of queue channel") <END> .build(); }</code><technical_language>suggestion .description("The remaining capacity of queue channel")</technical_language>

Target:
public void registerMetricsCaptor(MetricsCaptor metricsCaptor) { super.registerMetricsCaptor(metricsCaptor); this.sizeGauge = metricsCaptor.gaugeBuilder("spring.integration.channel.queue.size", this, (channel) -> getQueueSize()) .tag("name", getComponentName() == null ? "unknown" : getComponentName()) .tag("type", "channel") .description("The size of the queue channel") .build(); this.remainingCapacityGauge = metricsCaptor.gaugeBuilder("spring.integration.channel.queue.remaining.capacity", this, (channel) -> getRemainingCapacity()) .tag("name", getComponentName() == null ? "unknown" : getComponentName()) .tag("type", "channel") .description("The remaining capacity of the queue channel") .build(); }
Source:
<code>VmDeviceUtils(VmStaticDao vmStaticDao, VmDeviceDao vmDeviceDao, ClusterDao clusterDao, VmTemplateDao vmTemplateDao, VmHandler vmHandler, MacPoolPerCluster macPoolPerCluster, RngDeviceUtils rngDeviceUtils, VideoDeviceSettings videoDeviceSettings, OsRepository osRepository) { this.vmStaticDao = vmStaticDao; this.vmDeviceDao = vmDeviceDao; this.clusterDao = clusterDao; this.vmTemplateDao = vmTemplateDao; this.vmHandler = vmHandler; this.macPoolPerCluster = macPoolPerCluster; this.rngDeviceUtils = rngDeviceUtils; this.videoDeviceSettings = videoDeviceSettings; this.osRepository = osRepository; <START> this.compensationContext = null; <END> }</code><technical_language>redundant</technical_language>

Target:
VmDeviceUtils(VmStaticDao vmStaticDao, VmDeviceDao vmDeviceDao, ClusterDao clusterDao, VmTemplateDao vmTemplateDao, VmHandler vmHandler, MacPoolPerCluster macPoolPerCluster, RngDeviceUtils rngDeviceUtils, VideoDeviceSettings videoDeviceSettings, OsRepository osRepository) { this.vmStaticDao = vmStaticDao; this.vmDeviceDao = vmDeviceDao; this.clusterDao = clusterDao; this.vmTemplateDao = vmTemplateDao; this.vmHandler = vmHandler; this.macPoolPerCluster = macPoolPerCluster; this.rngDeviceUtils = rngDeviceUtils; this.videoDeviceSettings = videoDeviceSettings; this.osRepository = osRepository; }
Source:
<code>private void handleFinishedContext(final String contextId, final Optional<ActiveContext> parentContext) { <START> if (contextIdToWorkerContexts.containsKey(contextId)) { <END> handleFinishedWorkerContext(contextId); } else if (contextIdToServerContexts.containsKey(contextId)) { handleFinishedServerContext(contextId); } else if (contextIdToRootContexts.remove(contextId) != null) { LOG.log(Level.INFO, "Root context {0} is closed. Its evaluator will be released soon.", contextId); } else if (deletedWorkerContextIds.remove(contextId) || deletedServerContextIds.remove(contextId)) { LOG.log(Level.INFO, "The context {0} is closed by EM's Delete.", contextId); final String rootContextId = parentContext.get().getId(); final ActiveContext rootContext = contextIdToRootContexts.remove(rootContextId); rootContext.close(); } else { LOG.log(Level.WARNING, "Untracked context: {0}", contextId); if (parentContext.isPresent()) { LOG.log(Level.INFO, "Close a context {0}, which is a parent of the finished context whose id is {1}", new Object[]{parentContext, contextId}); parentContext.get().close(); } } }</code><technical_language>This if-else branch complicated for readers follow. I easier if a description for cases case, for example: // case1. Worker is finished if (condition1) { ... // case2. Server is finished } else if (condition2) { ... } sound</technical_language>

Target:
private void handleFinishedContext(final String contextId, final Optional<ActiveContext> parentContext) { if (contextIdToWorkerContexts.containsKey(contextId)) { handleFinishedWorkerContext(contextId); } else if (contextIdToServerContexts.containsKey(contextId)) { handleFinishedServerContext(contextId); } else if (contextIdToRootContexts.remove(contextId) != null) { LOG.log(Level.INFO, "Root context {0} is closed. Its evaluator will be released soon.", contextId); } else if (deletedWorkerContextIds.remove(contextId) || deletedServerContextIds.remove(contextId)) { LOG.log(Level.INFO, "The context {0} is closed by EM's Delete.", contextId); if (!parentContext.isPresent()) { throw new RuntimeException("Root context of the deleted worker/server context does not exist"); } final String rootContextId = parentContext.get().getId(); final ActiveContext rootContext = contextIdToRootContexts.remove(rootContextId); rootContext.close(); } else { LOG.log(Level.WARNING, "Untracked context: {0}", contextId); if (parentContext.isPresent()) { LOG.log(Level.INFO, "Close a context {0}, which is a parent of the finished context whose id is {1}", new Object[]{parentContext, contextId}); parentContext.get().close(); } } }
Source:
<code>protected RemoteOperationResult<ArrayList<RemoteFile>> run(OwnCloudClient client) { RemoteOperationResult<ArrayList<RemoteFile>> result; mLocalFolder = getStorageManager().getFileByPath(mLocalFolder.getRemotePath()); if (OCFile.ROOT_PATH.equals(mLocalFolder.getRemotePath()) && syncVersionAndProfileEnabled) { OwnCloudVersion serverVersion = syncCapabilitiesAndGetServerVersion(); syncUserProfile(); } SynchronizeFolderOperation syncOp = new SynchronizeFolderOperation( mContext, mLocalFolder.getRemotePath(), mAccount, <START> System.currentTimeMillis(), <END> false, false, false ); result = syncOp.execute(client, getStorageManager()); sendLocalBroadcast( EVENT_SINGLE_FOLDER_CONTENTS_SYNCED, mLocalFolder.getRemotePath(), result); if (result.isSuccess()) { updateShareIconsInFiles(client); } sendLocalBroadcast( EVENT_SINGLE_FOLDER_SHARES_SYNCED, mLocalFolder.getRemotePath(), result); return result; }</code><technical_language>removing this line, serverVersion is needed, is it</technical_language>

Target:
protected RemoteOperationResult<ArrayList<RemoteFile>> run(OwnCloudClient client) { RemoteOperationResult<ArrayList<RemoteFile>> result; mLocalFolder = getStorageManager().getFileByPath(mLocalFolder.getRemotePath()); if (OCFile.ROOT_PATH.equals(mLocalFolder.getRemotePath()) && syncVersionAndProfileEnabled) { syncUserProfile(); } SynchronizeFolderOperation syncOp = new SynchronizeFolderOperation( mContext, mLocalFolder.getRemotePath(), mAccount, System.currentTimeMillis(), false, false, false ); result = syncOp.execute(client, getStorageManager()); sendLocalBroadcast( EVENT_SINGLE_FOLDER_CONTENTS_SYNCED, mLocalFolder.getRemotePath(), result); if (result.isSuccess()) { updateShareIconsInFiles(client); } sendLocalBroadcast( EVENT_SINGLE_FOLDER_SHARES_SYNCED, mLocalFolder.getRemotePath(), result); return result; }
Source:
<code>private void acquireRemoteIfNeeded(InvocationContext ctx, AbstractDataCommand command, boolean localNodeIsLockOwner) throws Throwable { <START> if (hasSkipLocking(command)) <END> return; Object key = command.getKey(); boolean needBackupLocks = ctx.isOriginLocal() && (!localNodeIsLockOwner | isStateTransferInProgress()); if (needBackupLocks && !command.hasFlag(Flag.CACHE_MODE_LOCAL)) { final TxInvocationContext txContext = (TxInvocationContext) ctx; LocalTransaction localTransaction = (LocalTransaction) txContext.getCacheTransaction(); final boolean alreadyLocked = localTransaction.getAffectedKeys().contains(key); if (alreadyLocked) { log.tracef("We already have lock for key %s, skip remote lock acquisition", key); return; } else { LockControlCommand lcc = cf.buildLockControlCommand( key, command.getFlags(), txContext.getGlobalTransaction()); invokeNextInterceptor(ctx, lcc); } } ((TxInvocationContext) ctx).addAffectedKey(key); }</code><technical_language>entry points covered ensure locks skipped this unneeded. If want for sanity checks, update other acquireRemoteIfNeeded method consistent</technical_language>

Target:
private void acquireRemoteIfNeeded(InvocationContext ctx, AbstractDataCommand command, boolean localNodeIsLockOwner) throws Throwable { Object key = command.getKey(); boolean needBackupLocks = ctx.isOriginLocal() && (!localNodeIsLockOwner || isStateTransferInProgress()); if (needBackupLocks && !command.hasFlag(Flag.CACHE_MODE_LOCAL)) { final TxInvocationContext txContext = (TxInvocationContext) ctx; LocalTransaction localTransaction = (LocalTransaction) txContext.getCacheTransaction(); final boolean alreadyLocked = localTransaction.getAffectedKeys().contains(key); if (alreadyLocked) { log.tracef("We already have lock for key %s, skip remote lock acquisition", key); return; } else { LockControlCommand lcc = cf.buildLockControlCommand( key, command.getFlags(), txContext.getGlobalTransaction()); invokeNextInterceptor(ctx, lcc); } } ((TxInvocationContext) ctx).addAffectedKey(key); }
Source:
<code>private void getImageList(String inputHTML, StringBuffer imageFileList) { String outputHTML = inputHTML; <START> String Lower = outputHTML.toLowerCase(); <END> int img = Lower.indexOf("img "); imageFileList.setLength(0); boolean first = true; while (img != -1) { int src = Lower.indexOf("src=", img); if (src != -1) { src += 4; char qte = Lower.charAt(src); int iEnd = Lower.indexOf(qte, src + 1); if (first) { imageFileList.append(inputHTML.substring(src + 1, iEnd)); first = false; } else { imageFileList.append("," + outputHTML.substring(src + 1, iEnd)); } img = Lower.indexOf("img ", src); } else { img = -1; } } }</code><technical_language>naming convention - capitalized</technical_language>

Target:
private void getImageList(String inputHTML, StringBuffer imageFileList) { String outputHtml = inputHTML; String Lower = outputHtml.toLowerCase(); int img = Lower.indexOf("img "); imageFileList.setLength(0); boolean first = true; while (img != -1) { int src = Lower.indexOf("src=", img); if (src != -1) { src += 4; char qte = Lower.charAt(src); int iEnd = Lower.indexOf(qte, src + 1); if (first) { imageFileList.append(inputHTML.substring(src + 1, iEnd)); first = false; } else { imageFileList.append("," + outputHtml.substring(src + 1, iEnd)); } img = Lower.indexOf("img ", src); } else { img = -1; } } }
Source:
<code>public static <V1, V2> Set<V2> transformSetLazily(Set<V1> original, Function<V1, V2> function) { <START> Set<V2> transformed = Sets.newLinkedHashSetWithExpectedSize(original <END> .size()); LazyTransformSet<V1, V2> lazyTransformSet = (new Transformers()). new LazyTransformSet<>(original, function); Iterator<V2> iterator = lazyTransformSet.iterator(); while(iterator.hasNext()) { transformed.add(iterator.next()); } return transformed; }</code><technical_language>need this</technical_language>

Target:
public static <V1, V2> Set<V2> transformSetLazily(Set<V1> original, Function<V1, V2> function) { return new LazyTransformSet<V1, V2>(original, function); }
Source:
<code>protected void cacheForever(final HttpServletResponse rsp) { final long now = System.currentTimeMillis(); <START> rsp.setHeader("Cache-Control", "max-age=31536000,public"); <END> rsp.setDateHeader("Expires", now + 31536000000L); rsp.setDateHeader("Date", now); }</code><technical_language>proxies parse multiple entries a Cache-Control line. Do need both, max-age</technical_language>

Target:
protected void cacheForever(final HttpServletResponse rsp) { final long now = System.currentTimeMillis(); rsp.setHeader("Cache-Control", "public, max-age=31536000"); rsp.setDateHeader("Expires", now + 31536000000L); rsp.setDateHeader("Date", now); }
Source:
<code><START> final Object getValue(ValueNode value) <END> { if (value.isNull()) { return null; } if (value.numberType() != null) { switch (value.numberType()) { case LONG: return value.longValue(); case DOUBLE: return value.doubleValue(); case FLOAT: return value.floatValue(); case INT: return value.intValue(); case BIG_DECIMAL: return value.decimalValue(); case BIG_INTEGER: return value.bigIntegerValue(); default: return value.asText(); } } if (value.isBoolean()) { return value.asBoolean(); } if (value.canConvertToInt()) { return value.asInt(); } if (value.canConvertToLong()) { return value.asLong(); } return value.asText(); }</code><technical_language>I recommend changing method accessibility for testing purpose. In this case means unit test method tested a higher level</technical_language>

Target:
private Object getValue(ValueNode value) { if (value.isNull()) { return null; } if (value.numberType() != null) { switch (value.numberType()) { case LONG: return value.longValue(); case DOUBLE: return value.doubleValue(); case FLOAT: return value.floatValue(); case INT: return value.intValue(); case BIG_DECIMAL: return value.decimalValue(); case BIG_INTEGER: return value.bigIntegerValue(); default: return value.asText(); } } if (value.isBoolean()) { return value.asBoolean(); } return value.asText(); }
Source:
<code>private AudioFocusRequestCompat( int focusGain, OnAudioFocusChangeListener onAudioFocusChangeListener, Handler focusChangeHandler, AudioAttributesCompat audioFocusRequestCompat, boolean pauseOnDuck, boolean acceptsDelayedFocusGain) { mFocusGain = focusGain; mFocusChangeHandler = focusChangeHandler; mAudioAttributesCompat = audioFocusRequestCompat; mPauseOnDuck = pauseOnDuck; mAcceptsDelayedFocusGain = acceptsDelayedFocusGain; if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O && mFocusChangeHandler.getLooper() != Looper.getMainLooper()) { mOnAudioFocusChangeListener = new OnAudioFocusChangeListenerHandlerCompat( onAudioFocusChangeListener, focusChangeHandler); } else { mOnAudioFocusChangeListener = onAudioFocusChangeListener; } if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { <START> mPlatformAudioFocusRequest <END> = new AudioFocusRequest.Builder(mFocusGain) .setAudioAttributes(getAudioAttributes()) .setAcceptsDelayedFocusGain(mAcceptsDelayedFocusGain) .setWillPauseWhenDucked(mPauseOnDuck) .setOnAudioFocusChangeListener( mOnAudioFocusChangeListener, mFocusChangeHandler) .build(); } else { mPlatformAudioFocusRequest = null; } }</code><technical_language>'framework'</technical_language>

Target:
private AudioFocusRequestCompat( int focusGain, OnAudioFocusChangeListener onAudioFocusChangeListener, Handler focusChangeHandler, AudioAttributesCompat audioFocusRequestCompat, boolean pauseOnDuck, boolean acceptsDelayedFocusGain) { mFocusGain = focusGain; mFocusChangeHandler = focusChangeHandler; mAudioAttributesCompat = audioFocusRequestCompat; mPauseOnDuck = pauseOnDuck; mAcceptsDelayedFocusGain = acceptsDelayedFocusGain; if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O && mFocusChangeHandler.getLooper() != Looper.getMainLooper()) { mOnAudioFocusChangeListener = new OnAudioFocusChangeListenerHandlerCompat( onAudioFocusChangeListener, focusChangeHandler); } else { mOnAudioFocusChangeListener = onAudioFocusChangeListener; } if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { mFrameworkAudioFocusRequest = new AudioFocusRequest.Builder(mFocusGain) .setAudioAttributes(getAudioAttributes()) .setAcceptsDelayedFocusGain(mAcceptsDelayedFocusGain) .setWillPauseWhenDucked(mPauseOnDuck) .setOnAudioFocusChangeListener( mOnAudioFocusChangeListener, mFocusChangeHandler) .build(); } else { mFrameworkAudioFocusRequest = null; } }
Source:
<code>public Object getChild(String id) { Iterator<RegistryPageContributor> iterator = <START> subPages.iterator(); <END> while (iterator.hasNext()) { RegistryPageContributor next = iterator.next(); if (next.getPageId().equals(id)) { return next; } } return null; }</code><technical_language>I a foreach loop shorter easier read - a lambda expression in future</technical_language>

Target:
public Object getChild(String id) { return subPages.stream().filter(c -> c.getPageId().equals(id)).findFirst().orElse(null); }
Source:
<code>public List<PoolQuantityDTO> getDryRun(Consumer consumer, String serviceLevelOverride) { List<PoolQuantity> poolQuantities = new ArrayList<PoolQuantity>(); try { Owner owner = consumer.getOwner(); if (consumer.isDev()) { if (config.getBoolean(ConfigProperties.STANDALONE) || !poolCurator.hasActiveEntitlementPools(consumer.getOwner(), null)) { throw new ForbiddenException(i18n.tr( "Development units may only be used on hosted servers" + " and with orgs that have active subscriptions." )); } String sku = consumer.getFact("dev_sku"); Pool devPool = poolCurator.findDevPool(consumer); if (devPool != null) { poolManager.deletePool(devPool); } devPool = poolManager.createPool(assembleDevPool(consumer, sku)); poolQuantities.add(new PoolQuantity(devPool, 1)); } else { poolQuantities = poolManager.getBestPools( consumer, null, null, owner, serviceLevelOverride, null); } log.debug("Created Pool Quantity list: {}", poolQuantities); } catch (EntitlementRefusedException e) { if (log.isDebugEnabled()) { log.debug("consumer dry-run errors:", consumer.getUuid()); for (Entry<String, ValidationResult> entry : e.getResults().entrySet()) { log.debug("errors for pool id: {}", entry.getKey()); for (ValidationError error : entry.getValue().getErrors()) { log.debug(error.getResourceKey()); } } } } List<PoolQuantityDTO> result = new ArrayList<PoolQuantityDTO>(); for (PoolQuantity pq : poolQuantities) { result.add(this.modelTranslator.translate(pq, PoolQuantityDTO.class)); <START> } <END> return result; }</code><technical_language>translation done resource layer</technical_language>

Target:
public List<PoolQuantity> getDryRun(Consumer consumer, String serviceLevelOverride) { List<PoolQuantity> result = new ArrayList<PoolQuantity>(); try { Owner owner = consumer.getOwner(); if (consumer.isDev()) { if (config.getBoolean(ConfigProperties.STANDALONE) || !poolCurator.hasActiveEntitlementPools(consumer.getOwner(), null)) { throw new ForbiddenException(i18n.tr( "Development units may only be used on hosted servers" + " and with orgs that have active subscriptions." )); } String sku = consumer.getFact("dev_sku"); Pool devPool = poolCurator.findDevPool(consumer); if (devPool != null) { poolManager.deletePool(devPool); } devPool = poolManager.createPool(assembleDevPool(consumer, sku)); result.add(new PoolQuantity(devPool, 1)); } else { result = poolManager.getBestPools( consumer, null, null, owner, serviceLevelOverride, null); } log.debug("Created Pool Quantity list: {}", result); } catch (EntitlementRefusedException e) { if (log.isDebugEnabled()) { log.debug("consumer dry-run errors:", consumer.getUuid()); for (Entry<String, ValidationResult> entry : e.getResults().entrySet()) { log.debug("errors for pool id: {}", entry.getKey()); for (ValidationError error : entry.getValue().getErrors()) { log.debug(error.getResourceKey()); } } } } return result; }
Source:
<code>public Transceiver read(final String journalKey, final String slug) { return new EntityTransceiver() { @Override protected ArticleCollection fetchEntity() { ArticleCollection result = DataAccessUtils.uniqueResult(hibernateTemplate.execute(new HibernateCallback<List<ArticleCollection>>() { @Override public List<ArticleCollection> doInHibernate(Session session) { <START> Query query = session.createQuery("" + <END> "select c " + "from ArticleCollection as c inner join c.journal as j " + "where c.slug=:slug and j.journalKey=:journalKey"); query.setString("slug", slug); query.setString("journalKey", journalKey); return query.list(); } })); if (result == null) { String message = String.format("No collection exists in journal=%s with slug=%s", journalKey, slug); throw new RestClientException(message, HttpStatus.NOT_FOUND); } return result; } @Override protected Object getView(AmbraEntity entity) { return entity; } }; }</code><technical_language>This query similar query defined line 64. easy combine doInHibernate methods</technical_language>

Target:
public Transceiver read(final String journalKey, final String slug) { return new EntityTransceiver() { @Override protected ArticleCollection fetchEntity() { ArticleCollection result = getCollection(journalKey, slug); if (result == null) { String message = String.format("No collection exists in journal=%s with slug=%s", journalKey, slug); throw new RestClientException(message, HttpStatus.NOT_FOUND); } return result; } @Override protected Object getView(AmbraEntity entity) { return entity; } }; }
Source:
<code>private static BoundedContextAction aggregateRepositoryDispatch() { return new BoundedContextAction() { @Override public void perform(BoundedContext context) { final AggregateRepository<?, ?> repository = Given.aggregateRepo(context); repository.initStorage(InMemoryStorageFactory.getInstance()); try { repository.dispatch(Given.validCommand()); } catch (IllegalStateException e) { <START> Assert.assertTrue(e.getMessage().contains("No record found for command ID: EMPTY")); <END> } } }; }</code><technical_language>do check that? is related StandFunnel functionality. Also, read: dispatch a Given.validCommand(); in this case returned some event, raise exception</technical_language>

Target:
private static BoundedContextAction aggregateRepositoryDispatch() { return new BoundedContextAction() { @Override public void perform(BoundedContext context) { final AggregateRepository<?, ?> repository = Given.aggregateRepo(context); repository.initStorage(InMemoryStorageFactory.getInstance()); try { repository.dispatch(Given.validCommand()); } catch (IllegalStateException e) { if (!e.getMessage() .contains("No record found for command ID: EMPTY")) { throw e; } } } }; }
Source:
<code>public void userAuthDevIdResult() throws Exception { <START> DeviceAuthorizationResult deviceAuthorizationResult = deviceAccessAuthorizationService.isUserAuthorized(deviceIds); <END> Assert.assertEquals(deviceAuthorizationResult.getAuthorizedDevices().size(), 5, "Expected 5 authorized devices for admin user"); Assert.assertEquals(deviceAuthorizationResult.getUnauthorizedDevices().size(), 0, "Expected 0 un-authorized devices for admin user"); }</code><technical_language>Line more 120 characters</technical_language>

Target:
public void userAuthDevIdResult() throws Exception { PrivilegedCarbonContext.getThreadLocalCarbonContext().setUsername(ADMIN_USER); DeviceAuthorizationResult deviceAuthorizationResult = deviceAccessAuthorizationService. isUserAuthorized(deviceIds); Assert.assertEquals(deviceAuthorizationResult.getAuthorizedDevices().size(), 5, "Expected 5 authorized devices for admin user"); Assert.assertEquals(deviceAuthorizationResult.getUnauthorizedDevices().size(), 0, "Expected 0 un-authorized devices for admin user"); }
Source:
<code>private HttpServletRequest createWebRequest(String uri, String... parameters) { WebRequest request = new PostMethodWebRequest("http://localhost" + uri); if (Const.SystemParams.PAGES_REQUIRING_ORIGIN_VALIDATION.contains(uri)) { request.setHeaderField("referer", "http://localhost"); String sessionId = sc.getSession(true).getId(); String token = CryptoHelper.computeSessionToken(sessionId); request.setParameter(Const.ParamsNames.SESSION_TOKEN, token); } Map<String, List<String>> paramMultiMap = new HashMap<>(); for (int i = 0; i < parameters.length; i = i + 2) { String key = parameters[i]; if (paramMultiMap.get(key) == null) { paramMultiMap.put(key, new ArrayList<String>()); } paramMultiMap.get(key).add(parameters[i + 1]); } paramMultiMap.forEach((key, value) -> { <START> List<String> values = value; <END> request.setParameter(key, values.toArray(new String[values.size()])); }); try { InvocationContext ic = sc.newInvocation(request); return ic.getRequest(); } catch (Exception e) { throw new RuntimeException(e); } }</code><technical_language>This necessary this block inlined</technical_language>

Target:
private HttpServletRequest createWebRequest(String uri, String... parameters) { WebRequest request = new PostMethodWebRequest("http://localhost" + uri); if (Const.SystemParams.PAGES_REQUIRING_ORIGIN_VALIDATION.contains(uri)) { request.setHeaderField("referer", "http://localhost"); String sessionId = sc.getSession(true).getId(); String token = CryptoHelper.computeSessionToken(sessionId); request.setParameter(Const.ParamsNames.SESSION_TOKEN, token); } Map<String, List<String>> paramMultiMap = new HashMap<>(); for (int i = 0; i < parameters.length; i = i + 2) { String key = parameters[i]; if (paramMultiMap.get(key) == null) { paramMultiMap.put(key, new ArrayList<String>()); } paramMultiMap.get(key).add(parameters[i + 1]); } paramMultiMap.forEach((key, values) -> request.setParameter(key, values.toArray(new String[values.size()]))); try { InvocationContext ic = sc.newInvocation(request); return ic.getRequest(); } catch (Exception e) { throw new RuntimeException(e); } }
Source:
<code>public int readInteger() { ++ decodedPosition; if (decodedPosition == decoded.length) { <START> byte[] tempEncode = new byte[bitWidth]; <END> encoded.position(encodedPos); if (encodedPos + bitWidth > encoded.limit()) { Arrays.fill(tempEncode, (byte)0); encoded.get(tempEncode, 0, encoded.limit() - encodedPos); packer.unpack8Values(ByteBuffer.wrap(tempEncode), 0, decoded, 0); } else { packer.unpack8Values(encoded, encodedPos, decoded, 0); } encodedPos += bitWidth; decodedPosition = 0; } return decoded[decodedPosition]; }</code><technical_language>this in if line 50. right</technical_language>

Target:
public int readInteger() { ++ decodedPosition; if (decodedPosition == decoded.length) { encoded.position(encodedPos); if (encodedPos + bitWidth > encoded.limit()) { byte[] tempEncode = new byte[bitWidth]; encoded.get(tempEncode, 0, encoded.limit() - encodedPos); packer.unpack8Values(ByteBuffer.wrap(tempEncode), 0, decoded, 0); } else { packer.unpack8Values(encoded, encodedPos, decoded, 0); } encodedPos += bitWidth; decodedPosition = 0; } return decoded[decodedPosition]; }
Source:
<code><START> @Override public boolean exists(Path f) throws IOException { <END> statIncrement(CALL_EXIST); return super.exists(f); }</code><technical_language>Override new line</technical_language>

Target:
public boolean exists(Path f) throws IOException { statIncrement(CALL_EXIST); return super.exists(f); }
Source:
<code>public void shutdown() { for (DBBPool.BBContainer c : m_readBBContainers) { c.discard(); } <START> m_readBBContainers.clear(); <END> }</code><technical_language>m_totalAvailable needs cleared well</technical_language>

Target:
public void shutdown() { for (DBBPool.BBContainer c : m_readBBContainers) { c.discard(); } m_readBBContainers.clear(); m_totalAvailable.set(0); }
Source:
<code>private void getUrl(StringBuilder buf) { String f = item.getSearchUrl(); if(f.startsWith("/")) { <START> buf.setLength(0); <END> buf.append(f); } else { if(buf.length()==0 || buf.charAt(buf.length()-1)!='/') buf.append('/'); buf.append(f); } }</code><technical_language>This smells incompatible change</technical_language>

Target:
private void getUrl(StringBuilder buf) { if(parent!=null) { parent.getUrl(buf); } String f = item.getSearchUrl(); if(f.startsWith("/")) { buf.setLength(0); buf.append(f); } else { if(buf.length()==0 || buf.charAt(buf.length()-1)!='/') buf.append('/'); buf.append(f); } }
Source:
<code>public static boolean allUnique(List<String> argListNames) { <START> return argListNames.stream().allMatch(new HashSet<>()::add); <END> }</code><technical_language>new HashSet<>(list).size() == list.size();</technical_language>

Target:
public static boolean allUnique(List<String> argListNames) { return argListNames.size() == new HashSet<>(argListNames).size(); }
Source:
<code>protected void prepareTestData() { testData = loadDataBundle("/FeedbackRequestAccessLinksResendPageUiTest.json"); String student1GoogleId = TestProperties.TEST_STUDENT1_ACCOUNT; <START> String student1Email = student1GoogleId + "@gmail.com"; <END> testData.accounts.get("alice.tmms").googleId = student1GoogleId; testData.accounts.get("alice.tmms").email = student1Email; testData.students.get("alice.tmms@SHomeUiT.CS2104").email = student1Email; testData.students.get("alice.tmms@SHomeUiT.CS1101").googleId = student1GoogleId; testData.students.get("alice.tmms@SHomeUiT.CS1101").email = student1Email; testData.students.get("alice.tmms@SHomeUiT.CS4215").googleId = student1GoogleId; testData.students.get("alice.tmms@SHomeUiT.CS4215").email = student1Email; testData.students.get("alice.tmms@SHomeUiT.CS4221").googleId = student1GoogleId; testData.students.get("alice.tmms@SHomeUiT.CS4221").email = student1Email; studentEmailAddress = student1Email; removeAndRestoreDataBundle(testData); FeedbackSessionAttributes gracedFeedbackSession = BackDoor.getFeedbackSession("SHomeUiT.CS2104", "Graced Feedback Session"); Calendar fsCalendar = Calendar.getInstance(); fsCalendar.add(Calendar.DATE, -10); gracedFeedbackSession.setStartTime(fsCalendar.getTime().toInstant()); gracedFeedbackSession.setSessionVisibleFromTime(fsCalendar.getTime().toInstant()); fsCalendar.add(Calendar.DATE, +20); gracedFeedbackSession.setEndTime(fsCalendar.getTime().toInstant()); BackDoor.editFeedbackSession(gracedFeedbackSession); }</code><technical_language>studentEmailAddress here</technical_language>

Target:
protected void prepareTestData() { testData = loadDataBundle("/FeedbackRequestAccessLinksResendPageUiTest.json"); String student1GoogleId = TestProperties.TEST_STUDENT1_ACCOUNT; studentEmailAddress = student1GoogleId + "@gmail.com"; testData.accounts.get("alice.tmms").googleId = student1GoogleId; testData.accounts.get("alice.tmms").email = studentEmailAddress; testData.students.get("alice.tmms@SHomeUiT.CS2104").email = studentEmailAddress; testData.students.get("alice.tmms@SHomeUiT.CS1101").googleId = student1GoogleId; testData.students.get("alice.tmms@SHomeUiT.CS1101").email = studentEmailAddress; testData.students.get("alice.tmms@SHomeUiT.CS4215").googleId = student1GoogleId; testData.students.get("alice.tmms@SHomeUiT.CS4215").email = studentEmailAddress; testData.students.get("alice.tmms@SHomeUiT.CS4221").googleId = student1GoogleId; testData.students.get("alice.tmms@SHomeUiT.CS4221").email = studentEmailAddress; removeAndRestoreDataBundle(testData); FeedbackSessionAttributes gracedFeedbackSession = BackDoor.getFeedbackSession("SHomeUiT.CS2104", "Graced Feedback Session"); gracedFeedbackSession.setStartTime(Instant.now().minus(Duration.ofDays(10))); gracedFeedbackSession.setSessionVisibleFromTime(Instant.now().minus(Duration.ofDays(10))); gracedFeedbackSession.setEndTime(Instant.now().plus(Duration.ofDays(10))); BackDoor.editFeedbackSession(gracedFeedbackSession); }
Source:
<code>private void copyTitle() { List<BibEntry> selectedBibEntries = stateManager.getSelectedEntries(); List<String> titles = selectedBibEntries.stream() <START> .filter(bibEntry -> bibEntry.getTitle().isPresent()) <END> .map(bibEntry -> bibEntry.getTitle().get()) .collect(Collectors.toList()); if (titles.isEmpty()) { dialogService.notify(Localization.lang("None of the selected entries have titles.")); return; } final String copiedTitles = String.join("\n", titles); clipBoardManager.setContent(copiedTitles); if (titles.size() == selectedBibEntries.size()) { dialogService.notify(Localization.lang("Copied") + " '" + JabRefDialogService.shortenDialogMessage(copiedTitles) + "'."); } else { dialogService.notify(Localization.lang("Warning: %0 out of %1 entries have undefined title.", Integer.toString(selectedBibEntries.size() - titles.size()), Integer.toString(selectedBibEntries.size()))); } }</code><technical_language>a flatmap used</technical_language>

Target:
private void copyTitle() { List<BibEntry> selectedBibEntries = stateManager.getSelectedEntries(); List<String> titles = selectedBibEntries.stream() .filter(bibEntry -> bibEntry.getTitle().isPresent()) .map(bibEntry -> bibEntry.getTitle().get()) .collect(Collectors.toList()); if (titles.isEmpty()) { dialogService.notify(Localization.lang("None of the selected entries have titles.")); return; } final String copiedTitles = String.join("\n", titles); clipBoardManager.setContent(copiedTitles); if (titles.size() == selectedBibEntries.size()) { dialogService.notify(Localization.lang("Copied '%0' to clipboard.", JabRefDialogService.shortenDialogMessage(copiedTitles))); } else { dialogService.notify(Localization.lang("Warning: %0 out of %1 entries have undefined title.", Integer.toString(selectedBibEntries.size() - titles.size()), Integer.toString(selectedBibEntries.size()))); } }
Source:
<code>public void switch_statement() { Result result = Result.createFor("SwitchStatement"); <START> <END> }</code><technical_language>This test assertions. verify existence of variable a in scope</technical_language>

Target:
public void switch_statement() { Result result = Result.createFor("SwitchStatement"); assertThat(result.symbol("a", 16)).isSameAs(result.reference(18, 28)); assertThat(result.symbol("a", 20)).isSameAs(result.reference(21, 24)); }
Source:
<code><START> public List<SelectItem> getNewspaperBatchesItems() { <END> if (Objects.isNull(newspaperBatchesItems)) { try { newspaperBatchesItems = NewspaperProcessesMigrator.getNewspaperBatches().stream() .map(batchTransfer -> new SelectItem(batchTransfer.getId(), batchTransfer.getTitle())) .collect(Collectors.toList()); } catch (DataException | DAOException | IOException e) { Helper.setErrorMessage(e.getLocalizedMessage(), logger, e); return Collections.emptyList(); } } return newspaperBatchesItems; }</code><technical_language>Please Batches instead of SelectItems</technical_language>

Target:
public List<BatchDTO> getNewspaperBatchesItems() { if (Objects.isNull(newspaperBatchesItems)) { try { newspaperBatchesItems = NewspaperProcessesMigrator.getNewspaperBatches(); } catch (DataException | DAOException | IOException e) { Helper.setErrorMessage(e.getLocalizedMessage(), logger, e); return Collections.emptyList(); } } return newspaperBatchesItems; }
Source:
<code>public String toString() { <START> return "TableHandle{" + <END> "connectorId=" + connectorId + ", connectorHandle=" + connectorHandle + ", layout=" + layout + '}'; }</code><technical_language>toStringHelper</technical_language>

Target:
public String toString() { return toStringHelper(this) .add("connectorId", connectorId) .add("connectorHandle", connectorHandle) .add("layout", layout) .toString(); }
Source:
<code>public boolean runWESCommand(String jsonString, File localPrimaryDescriptorFile, File zippedEntry) { try { String tags = "WorkflowExecutionService"; String jsonContent = null; try { jsonContent = new String(java.nio.file.Files.readAllBytes(Paths.get(jsonString)), StandardCharsets.UTF_8); } catch (IOException ioe) { <START> ioe.printStackTrace(); <END> } List<File> workflowAttachment = new ArrayList<>(); addFilesToWorkflowAttachment(workflowAttachment, this.zippedEntry); workflowAttachment.add(localPrimaryDescriptorFile); System.out.println("runWESCommand: json content is: " + jsonContent); System.out.println("runWESCommand: jsonString is: " + jsonString); System.out.println("runWESCommand: workflow absolute path is: " + localPrimaryDescriptorFile.getAbsolutePath()); String workflowURL = localPrimaryDescriptorFile.getName(); System.out.println("runWESCommand: workflow URI is: " + workflowURL); File jsonInputFile = new File(jsonString); workflowAttachment.add(jsonInputFile); for (int i = 0; i < workflowAttachment.size(); i++) { String str = new String(workflowAttachment.get(i).getName()); System.out.println("runWESCommand: workflow attachment " + i + " is: " + str); } RunId response = clientWorkflowExecutionServiceApi.runWorkflow(jsonInputFile, "CWL", "v1.0", tags, "", workflowURL, workflowAttachment); System.out.println("Launched WES run with id: " + response.toString()); } catch (io.swagger.wes.client.ApiException e) { e.printStackTrace(); return false; } return true; }</code><technical_language>logger printing stack traces</technical_language>

Target:
public void runWESCommand(String jsonString, File localPrimaryDescriptorFile, File zippedEntry) { String workflowURL = localPrimaryDescriptorFile.getName(); final File tempDir = Files.createTempDir(); List<File> workflowAttachment = new ArrayList<>(); addFilesToWorkflowAttachment(workflowAttachment, this.zippedEntry, tempDir); workflowAttachment.add(localPrimaryDescriptorFile); File jsonInputFile = new File(jsonString); workflowAttachment.add(jsonInputFile); String languageType = this.languageType.toString().toUpperCase(); String workflowTypeVersion = WORKFLOW_TYPE_VERSION; if ("CWL".equals(languageType.toUpperCase())) { workflowTypeVersion = "v" + WORKFLOW_TYPE_VERSION; } try { RunId response = clientWorkflowExecutionServiceApi.runWorkflow(jsonInputFile, languageType, workflowTypeVersion, TAGS, "", workflowURL, workflowAttachment); System.out.println("Launched WES run with id: " + response.toString()); } catch (io.swagger.wes.client.ApiException e) { LOG.error("Error launching WES run", e); } finally { try { FileUtils.deleteDirectory(tempDir); } catch (IOException ioe) { LOG.error("Could not delete temporary directory" + tempDir + " for workflow attachment files", ioe); } } }
Source:
<code>private boolean checkFourLetterWord(final Channel channel, ChannelBuffer message, final int len) throws IOException { if (!FourLetterCommands.isKnown(len)) { return false; } String cmd = FourLetterCommands.getCommandString(len); if (!FourLetterCommands.isEnabled(cmd)) { LOG.debug("Command is not executed because it is not white listed.", cmd); <START> return true; <END> } channel.setInterestOps(0).awaitUninterruptibly(); LOG.info("Processing " + cmd + " command from " + channel.getRemoteAddress()); packetReceived(); final PrintWriter pwriter = new PrintWriter( new BufferedWriter(new SendBufferWriter())); if (len == FourLetterCommands.setTraceMaskCmd) { ByteBuffer mask = ByteBuffer.allocate(8); message.readBytes(mask); mask.flip(); long traceMask = mask.getLong(); ZooTrace.setTextTraceLevel(traceMask); SetTraceMaskCommand setMask = new SetTraceMaskCommand(pwriter, this, traceMask); setMask.start(); return true; } else { CommandExecutor commandExecutor = new CommandExecutor(); return commandExecutor.execute(this, pwriter, len, zkServer,factory); } }</code><technical_language>cleanup selection key selector</technical_language>

Target:
private boolean checkFourLetterWord(final Channel channel, ChannelBuffer message, final int len) throws IOException { if (!FourLetterCommands.isKnown(len)) { return false; } String cmd = FourLetterCommands.getCommandString(len); channel.setInterestOps(0).awaitUninterruptibly(); packetReceived(); final PrintWriter pwriter = new PrintWriter( new BufferedWriter(new SendBufferWriter())); if (!FourLetterCommands.isEnabled(cmd)) { LOG.debug("Command is not executed because it is not in the whitelist.", cmd); NopCommand nopCmd = new NopCommand(pwriter, this, cmd + " is not executed because it is not in the whitelist."); nopCmd.start(); return true; } LOG.info("Processing " + cmd + " command from " + channel.getRemoteAddress()); if (len == FourLetterCommands.setTraceMaskCmd) { ByteBuffer mask = ByteBuffer.allocate(8); message.readBytes(mask); mask.flip(); long traceMask = mask.getLong(); ZooTrace.setTextTraceLevel(traceMask); SetTraceMaskCommand setMask = new SetTraceMaskCommand(pwriter, this, traceMask); setMask.start(); return true; } else { CommandExecutor commandExecutor = new CommandExecutor(); return commandExecutor.execute(this, pwriter, len, zkServer,factory); } }
Source:
<code>public void checkOpenFileFeatureTest() throws Exception { createProject(PROJECT_NAME); projectExplorer.waitItem(PROJECT_NAME); dashboard.open(); dashboard.selectFactoriesOnDashbord(); dashboardFactories.clickOnAddFactoryBtn(); dashboardFactories.selectWorkspaceForCreation(testWorkspace.getName()); dashboardFactories.setFactoryName(FACTORY_NAME); dashboardFactories.clickOnCreateFactoryBtn(); dashboardFactories.selectAction(OPEN_FILE); dashboardFactories.enterParamValue(OPEN_FILE_URL); dashboardFactories.clickAddOnAddAction(); dashboardFactories.clickOnOpenFactory(); String currentWin = seleniumWebDriver.getWindowHandle(); <START> seleniumWebDriver.switchToNoneCurrentWindow(currentWin); <END> loadingBehaviorPage.waitWhileLoadPageIsClosed(); seleniumWebDriverHelper.switchFromDashboardAndWaitProjectExplorer(); projectExplorer.waitItem(PROJECT_NAME); editor.waitTabIsPresent("web-java-spring", ELEMENT_TIMEOUT_SEC); }</code><technical_language>move SeleniumWebDriver#switchToNoneCurrentWindow(currentWin) method **SeleniumWebDriverHelper** well, we</technical_language>

Target:
public void checkOpenFileFeatureTest() throws Exception { createProject(PROJECT_NAME); projectExplorer.waitItem(PROJECT_NAME); dashboard.open(); dashboard.selectFactoriesOnDashbord(); dashboardFactories.clickOnAddFactoryBtn(); dashboardFactories.selectWorkspaceForCreation(testWorkspace.getName()); dashboardFactories.setFactoryName(FACTORY_NAME); dashboardFactories.clickOnCreateFactoryBtn(); dashboardFactories.selectAction(OPEN_FILE); dashboardFactories.enterParamValue(OPEN_FILE_URL); dashboardFactories.clickAddOnAddAction(); dashboardFactories.clickOnOpenFactory(); String currentWin = seleniumWebDriver.getWindowHandle(); seleniumWebDriverHelper.switchToNextWindow(currentWin); loadingBehaviorPage.waitWhileLoadPageIsClosed(); seleniumWebDriverHelper.switchToIdeFrameAndWaitAvailability(); projectExplorer.waitItem(PROJECT_NAME); editor.waitTabIsPresent("web-java-spring", ELEMENT_TIMEOUT_SEC); }
Source:
<code>private void putResize (K key, V value) { K[] keyTable = this.keyTable; V[] valueTable = this.valueTable; <START> int b = place(key); <END> for (int i = b; ; i = (i + 1) & mask) { if (keyTable[i] == null) { keyTable[i] = key; valueTable[i] = value; break; } } if (++size >= threshold) { resize(keyTable.length << 1); } }</code><technical_language>b is once, for(i = place(key) ) => GC thank ;)</technical_language>

Target:
private void putResize (K key, V value) { K[] keyTable = this.keyTable; V[] valueTable = this.valueTable; for (int i = place(key); ; i = (i + 1) & mask) { if (keyTable[i] == null) { keyTable[i] = key; valueTable[i] = value; break; } } ++size; }
Source:
<code><START> public PcapTimestampScale getTimestampPrecision() { <END> if (getTsResolNg(fInterfaceID - 1) == 6) { return PcapTimestampScale.MICROSECOND; } return PcapTimestampScale.NANOSECOND; }</code><technical_language>This method belong in PcapNgFile is global timestamp precision file</technical_language>

Target:
public PcapTimestampScale getTimestampPrecision() { return PcapTimestampScale.MICROSECOND; }
Source:
<code>public String getCassandraVersion() { <START> ResultSet result = executeWithSession(session -> session.execute("select release_version from system.local where key = 'local'")); <END> Row versionRow = result.one(); if (versionRow != null) { return versionRow.getString("release_version"); } return null; }</code><technical_language>this condition do</technical_language>

Target:
public VersionNumber getCassandraVersion() { ResultSet result = executeWithSession(session -> session.execute("select release_version from system.local")); Row versionRow = result.one(); if (versionRow == null) { throw new PrestoException(CASSANDRA_VERSION_ERROR, "The cluster version is not available. " + "Please make sure that the Cassandra cluster is up and running, " + "and that the contact points are specified correctly."); } return VersionNumber.parse(versionRow.getString("release_version")); }