auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void processAddRequest(final BookieProtocol.ParsedAddRequest r, final Channel c) { WriteEntryProcessor write = WriteEntryProcessor.create(r, c, this); if (null == writeThreadPool) { write.run(); } else if (r.isHighPriority()) { <START> highPriorityThreadPool.submit(write); <END> } else { try { writeThreadPool.submitOrdered(r.getLedgerId(), write); } catch (RejectedExecutionException e) { if (LOG.isDebugEnabled()) { LOG.debug("Failed to process request to add entry at {}:{}. Too many pending requests", r.ledgerId, r.entryId); } write.sendResponse(BookieProtocol.ETOOMANYREQUESTS, ResponseBuilder.buildErrorResponse(BookieProtocol.ETOOMANYREQUESTS, r), addRequestStats); } } }</code><technical_language>I handling logic normal writes. If highPriorityThreadPool type of scheduler writeThreadPool readThreadPool, reuse choose scheduler based priority reuse logic line 481-487</technical_language>

Target:
private void processAddRequest(final BookieProtocol.ParsedAddRequest r, final Channel c) { WriteEntryProcessor write = WriteEntryProcessor.create(r, c, this); final OrderedSafeExecutor threadPool; if (r.isHighPriority()) { threadPool = highPriorityThreadPool; } else { threadPool = writeThreadPool; } if (null == threadPool) { write.run(); } else { try { threadPool.submitOrdered(r.getLedgerId(), write); } catch (RejectedExecutionException e) { if (LOG.isDebugEnabled()) { LOG.debug("Failed to process request to add entry at {}:{}. Too many pending requests", r.ledgerId, r.entryId); } write.sendResponse(BookieProtocol.ETOOMANYREQUESTS, ResponseBuilder.buildErrorResponse(BookieProtocol.ETOOMANYREQUESTS, r), addRequestStats); } } }
Source:
<code>public BundleGroupExtractor(Map<String, BundleInfo> bundles, String version) { this.bundles = bundles; this.version = version; <START> for (BundleInfo bundle : bundles.values()) { registerBundle(bundle); } <END> generateGroups(version); }</code><technical_language>bundles.values().forEach(this::registerBundle)</technical_language>

Target:
public BundleGroupExtractor(Map<String, BundleInfo> bundles, String version) { this.bundles = bundles; this.version = version; bundles.values().forEach(this::registerBundle); generateGroups(version); }
Source:
<code>protected void outputQuotedString(String s) throws IOException { if (s == null || s.length() == 0) { return; } final String xa0 = Character.toString((char)0xa0); <START> for (Iterator<String> iter = new StringCodepointsIterable(s).iterator(); iter.hasNext();) { <END> String codepoint = iter.next(); switch (codepoint) { case "<": _out.write("&lt;"); break; case ">": _out.write("&gt;"); break; case "&": _out.write("&amp;"); break; case "\"": _out.write("&quot;"); break; case "\n": _out.write("&#xa;"); break; case "\r": _out.write("&#xd;"); break; case "\t": _out.write("&#x9;"); break; case "\u00A0": _out.write("&#xa0;"); break; default: if (codepoint.length() == 1) { char c = codepoint.charAt(0); if (replaceWithQuestionMark(c)) { _out.write('?'); } else { _out.write(c); } } else { _out.write(codepoint); } break; } } }</code><technical_language>this a for-each loop hide ugliness is Java Iterators</technical_language>

Target:
protected void outputQuotedString(String s) throws IOException { if (s == null || s.length() == 0) { return; } for (String codepoint : new StringCodepointsIterable(s)) { switch (codepoint) { case "<": _out.write("&lt;"); break; case ">": _out.write("&gt;"); break; case "&": _out.write("&amp;"); break; case "\"": _out.write("&quot;"); break; case "\n": _out.write("&#xa;"); break; case "\r": _out.write("&#xd;"); break; case "\t": _out.write("&#x9;"); break; case "\u00A0": _out.write("&#xa0;"); break; default: if (codepoint.length() == 1) { char c = codepoint.charAt(0); if (replaceWithQuestionMark(c)) { _out.write('?'); } else { _out.write(c); } } else { _out.write(codepoint); } break; } } }
Source:
<code>for (Change.Status s : Change.Status.values()) { <START> VALUES.put(s.name().toLowerCase(), s); <END> }</code><technical_language>canonicalize(s)</technical_language>

Target:
for (Change.Status s : Change.Status.values()) { VALUES.put(canonicalize(s), s); }
Source:
<code>private Properties getRunningPlatformProperties() { Properties props = new Properties(); for (String <START> PROPS : <END> EquinoxBundlesState.PROPS) { String value = context.getProperty(PROPS); if (value != null) { props.setProperty(PROPS, value); } } return props; }</code><technical_language>Variable constant name</technical_language>

Target:
private Properties getRunningPlatformProperties() { Properties props = new Properties(); for (String property : EquinoxBundlesState.PROPS) { String value = context.getProperty(property); if (value != null) { props.setProperty(property, value); } } return props; }
Source:
<code>public void onCascadeEvent(BeforeAccountRemovedEvent event) throws Exception { for (WorkspaceImpl workspace : iterate( (maxItems, skipCount) -> workspaceManager.getByNamespace( event.getAccount().getName(), false, maxItems, skipCount))) { <START> if (WorkspaceStatus.RUNNING.equals(workspace.getStatus())) { <END> String owner = workspace.getRuntime().getOwner(); if (owner.equals(EnvironmentContext.getCurrent().getSubject().getUserId())) { workspaceManager.stopWorkspace(workspace.getId(), Collections.emptyMap()); } else { EnvironmentContext current = EnvironmentContext.getCurrent(); try { EnvironmentContext.reset(); workspaceManager.stopWorkspace(workspace.getId(), Collections.emptyMap()); } finally { EnvironmentContext.setCurrent(current); } } } workspaceManager.removeWorkspace(workspace.getId()); } }</code><technical_language>other statuses e.g. STARTING</technical_language>

Target:
public void onCascadeEvent(BeforeAccountRemovedEvent event) throws Exception { boolean nonStoppedExists = false; for (WorkspaceImpl workspace : iterate( (maxItems, skipCount) -> workspaceManager.getByNamespace( event.getAccount().getName(), false, maxItems, skipCount))) { if (STOPPED.equals(workspace.getStatus())) { workspaceManager.removeWorkspace(workspace.getId()); continue; } nonStoppedExists = true; if (STOPPING.equals(workspace.getStatus())) { continue; } tryStopAndRemoveWithSA(workspace); } if (!nonStoppedExists) { return; } for (WorkspaceImpl workspace : iterate( (maxItems, skipCount) -> workspaceManager.getByNamespace( event.getAccount().getName(), false, maxItems, skipCount))) { if (!STOPPED.equals(workspace.getStatus())) { throw new ConflictException("User has workspace that is not stopped yet. Try again"); } } }
Source:
<code>private void launchUpdateActivity() { Intent i = new Intent(getApplicationContext(), UpdateActivity.class); i.putExtra(AppManagerActivity.KEY_LAUNCH_FROM_MANAGER, true); <START> startActivityForResult(i, CommCareHomeActivity.UPGRADE_APP); <END> }</code><technical_language>this change UPGRADE_APP</technical_language>

Target:
private void launchUpdateActivity() { Intent i = new Intent(getApplicationContext(), UpdateActivity.class); i.putExtra(AppManagerActivity.KEY_LAUNCH_FROM_MANAGER, true); startActivityForResult(i, UPGRADE_APP); }
Source:
<code>public void stop() { if ( shouldClose.compareAndSet( false, true ) ) { machine.terminate(); <START> if ( !hasPendingJobs() ) <END> { processNextBatch( 0 ); } } }</code><technical_language>#close() called instead of this if statement</technical_language>

Target:
public void stop() { if ( shouldClose.compareAndSet( false, true ) ) { machine.terminate(); enqueueInternal( ignore -> { } ); } }
Source:
<code>private void logAction(String action) { <START> String shortURI = URI; <END> shortURI = shortURI.replaceAll("^.*\\/", ""); shortURI = shortURI.replaceAll("\\.[^.]+$", ""); String message = action + " " + shortURI; Integer progress = controller.getProgress(); Integer duration = controller.getDuration(); if (progress != null && duration != null) { message += " " + formatTime(progress) + "/" + formatTime(duration); } Logger.log("audio", message); }</code><technical_language>I calculate short URI constructor, if a bug in this middle of a play/pause/user action in kind of odd part of code</technical_language>

Target:
private void logAction(String action) { String message = action + " " + shortURI; Integer progress = controller.getProgress(); Integer duration = controller.getDuration(); if (progress != null && duration != null) { message += " " + formatTime(progress) + "/" + formatTime(duration); } Logger.log("audio", message); }
Source:
<code>private RealmAwareZkClient buildRealmAwareZkClient( RealmAwareZkClient.RealmAwareZkClientConfig clientConfig, String zkAddress, ZkClientType zkClientType) { RealmAwareZkClient zkClient; try { zkClient = new FederatedZkClient( new RealmAwareZkClient.RealmAwareZkConnectionConfig.Builder().build(), clientConfig); <START> } catch (IllegalStateException | IllegalArgumentException | IOException | InvalidRoutingDataException e) { <END> if (zkAddress.isEmpty()) { throw new IllegalStateException( "Not able to connect on multi-realm mode, caused by: " + e.getMessage()); } LOG.info("Not able to connect on multi-realm mode, caused by: {}. " + "Connecting on single-realm mode to ZK: {}.", e.getMessage(), zkAddress); switch (zkClientType) { case DEDICATED: zkClient = DedicatedZkClientFactory.getInstance().buildZkClient( new HelixZkClient.ZkConnectionConfig(zkAddress), clientConfig.createHelixZkClientConfig()); break; case SHARED: default: zkClient = SharedZkClientFactory.getInstance().buildZkClient( new HelixZkClient.ZkConnectionConfig(zkAddress), clientConfig.createHelixZkClientConfig()); break; } } return zkClient; }</code><technical_language>circumstances IllegalArgumentException thrown</technical_language>

Target:
private RealmAwareZkClient buildRealmAwareZkClient( RealmAwareZkClient.RealmAwareZkClientConfig clientConfig, String zkAddress, ZkClientType zkClientType) { if (Boolean.getBoolean(SystemPropertyKeys.MULTI_ZK_ENABLED)) { try { return new FederatedZkClient( new RealmAwareZkClient.RealmAwareZkConnectionConfig.Builder().build(), clientConfig); } catch (IllegalStateException | IOException | InvalidRoutingDataException e) { throw new HelixException("Not able to connect on multi-realm mode.", e); } } RealmAwareZkClient zkClient; switch (zkClientType) { case DEDICATED: zkClient = DedicatedZkClientFactory.getInstance() .buildZkClient(new HelixZkClient.ZkConnectionConfig(zkAddress), clientConfig.createHelixZkClientConfig()); break; case SHARED: default: zkClient = SharedZkClientFactory.getInstance() .buildZkClient(new HelixZkClient.ZkConnectionConfig(zkAddress), clientConfig.createHelixZkClientConfig()); zkClient .waitUntilConnected(HelixZkClient.DEFAULT_CONNECTION_TIMEOUT, TimeUnit.MILLISECONDS); break; } return zkClient; }
Source:
<code>private double getWeightedLocality(int region, int entity) { <START> return cluster.getOrComputeWeightedLocality(region, entity, type, onlyOnSsd); <END> }</code><technical_language>a boolean for ssd, this a type? want favor non-ssd in another balancer impl</technical_language>

Target:
private double getWeightedLocality(int region, int entity) { return cluster.getOrComputeWeightedLocality(region, entity, type, includeStorageType); }
Source:
<code>public static SerializerAdapter initializeSerializerAdapter() { JacksonAdapter adapter = (JacksonAdapter) JacksonAdapter.createDefaultSerializerAdapter(); <START> ObjectMapper mapper = adapter.serializer(); <END> SerializationUtil.configureMapper(mapper); return adapter; }</code><technical_language>copy() serializer this mutate Azure Core serializer want. Another option creating a new instance of JacksonAdapter createDefaultSerializerAdapter (which creates returns global instance depending instantiated)</technical_language>

Target:
public static SerializerAdapter initializeSerializerAdapter() { JacksonAdapter adapter = new JacksonAdapter(); ObjectMapper mapper = adapter.serializer(); SerializationUtil.configureMapper(mapper); return adapter; }
Source:
<code>public void RTE_012_Photo(){ String articleName = PageContent.articleNamePrefix+base.getTimeStamp(); ArticlePageObject article = base.openArticleByName(wikiURL, articleName); SourceEditModePageObject source = article.openCurrectArticleSourceMode(); PhotoAddComponentObject photoAddPhoto = source.clickAddPhoto(); <START> PhotoOptionsComponentObject photoOptions = photoAddPhoto.addPhotoFromWiki("Image001.jpg"); <END> photoOptions.setCaption(PageContent.caption); photoOptions.clickAddPhoto(); String photoName = photoAddPhoto.getPhotoName(); source.checkSourceContent(String.format(PageContent.wikiTextPhoto.replace("%photoName%", photoName), PageContent.caption)); source.submitArticle(); }</code><technical_language>if deletes photo</technical_language>

Target:
public void RTE_012_Photo(){ String articleName = PageContent.articleNamePrefix+base.getTimeStamp(); ArticlePageObject article = base.openArticleByName(wikiURL, articleName); SourceEditModePageObject source = article.openCurrectArticleSourceMode(); PhotoAddComponentObject photoAddPhoto = source.clickAddPhoto(); PhotoOptionsComponentObject photoOptions = photoAddPhoto.addPhotoFromWiki(PageContent.ARTICLESOURCEMODEFILE); photoOptions.setCaption(PageContent.caption); photoOptions.clickAddPhoto(); String photoName = photoAddPhoto.getPhotoName(); source.checkSourceContent(String.format(PageContent.wikiTextPhoto.replace("%photoName%", photoName), PageContent.caption)); source.submitArticle(); }
Source:
<code>public ActionResult execute() { String idOfCourseToDelete = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); try { logic.moveCourseToRecycleBin(idOfCourseToDelete); if (isRedirectedToHomePage()) { return new JsonResult("The course " + idOfCourseToDelete + " has been deleted. You can restore it from the 'Courses' tab."); } else { return new JsonResult("The course " + idOfCourseToDelete + " has been deleted. You can restore it from the deleted courses table below."); } } catch (InvalidParametersException ipe) { return new JsonResult(ipe.getMessage(), HttpStatus.SC_BAD_REQUEST); } catch (EntityDoesNotExistException ednee) { <START> return new JsonResult(ednee.getMessage(), HttpStatus.SC_MULTI_STATUS); <END> } }</code><technical_language>SC_NOT_FOUND</technical_language>

Target:
public ActionResult execute() { String idOfCourseToDelete = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); try { logic.moveCourseToRecycleBin(idOfCourseToDelete); return new JsonResult("The course " + idOfCourseToDelete + " has been deleted. You can restore it from the Recycle Bin manually."); } catch (InvalidParametersException e) { return new JsonResult(e.getMessage(), HttpStatus.SC_BAD_REQUEST); } catch (EntityDoesNotExistException e) { return new JsonResult(e.getMessage(), HttpStatus.SC_INTERNAL_SERVER_ERROR); } }
Source:
<code>public int countChildren(String path) { if (!checkIfPathBelongsToZkRealm(path)) { throw new IllegalArgumentException( "The given path does not map to the ZK realm for this DedicatedZkClient! Path: " + path + " ZK realm sharding key: " + _zkRealmShardingKey); } <START> return countChildren(path); <END> }</code><technical_language>forget _innerSharedZkClient. stack overflow</technical_language>

Target:
public int countChildren(String path) { checkIfPathContainsShardingKey(path); return _innerSharedZkClient.countChildren(path); }
Source:
<code>public DeprecatedAgentProtocolMonitor() { <START> super(AgentProtocol.class.getName() + "-deprecated"); <END> }</code><technical_language>delete default ID</technical_language>

Target:
public DeprecatedAgentProtocolMonitor() { super(); }
Source:
<code>private void updateExpandedParent(@NonNull ExpandableWrapper<P, C> parentWrapper, int flatParentPosition, boolean expansionTriggeredByListItemClick) { <START> if (!parentWrapper.isExpanded()) { <END> parentWrapper.setExpanded(true); List<ExpandableWrapper<P, C>> wrappedChildList = parentWrapper.getWrappedChildList(); if (wrappedChildList != null) { int childCount = wrappedChildList.size(); for (int i = 0; i < childCount; i++) { mFlatItemList.add(flatParentPosition + i + 1, wrappedChildList.get(i)); } notifyItemRangeInserted(flatParentPosition + 1, childCount); } if (expansionTriggeredByListItemClick && mExpandCollapseListener != null) { mExpandCollapseListener.onParentExpanded(getNearestParentPosition(flatParentPosition)); } } }</code><technical_language>good for early returns</technical_language>

Target:
private void updateExpandedParent(@NonNull ExpandableWrapper<P, C> parentWrapper, int flatParentPosition, boolean expansionTriggeredByListItemClick) { if (parentWrapper.isExpanded()) { return; } parentWrapper.setExpanded(true); List<ExpandableWrapper<P, C>> wrappedChildList = parentWrapper.getWrappedChildList(); if (wrappedChildList != null) { int childCount = wrappedChildList.size(); for (int i = 0; i < childCount; i++) { mFlatItemList.add(flatParentPosition + i + 1, wrappedChildList.get(i)); } notifyItemRangeInserted(flatParentPosition + 1, childCount); } if (expansionTriggeredByListItemClick && mExpandCollapseListener != null) { mExpandCollapseListener.onParentExpanded(getNearestParentPosition(flatParentPosition)); } }
Source:
<code>public void test_presentValue_onStart() { SimpleRatesProvider prov = provider(START_DATE); CurrencyAmount computed = PRICER.presentValue(TERM_DEPOSIT, prov); <START> double expected = ((1d + RATE * TERM_DEPOSIT.expand().getYearFraction()) * dfEnd - dfStart) * NOTIONAL; <END> assertEquals(computed.getCurrency(), EUR); assertEquals(computed.getAmount(), expected, TOLERANCE * NOTIONAL); }</code><technical_language>START_DATE, discount factor for start date 1</technical_language>

Target:
public void test_presentValue_onStart() { SimpleRatesProvider prov = provider(START_DATE, 1.0d, DF_END); CurrencyAmount computed = PRICER.presentValue(TERM_DEPOSIT, prov); double expected = ((1d + RATE * TERM_DEPOSIT.expand().getYearFraction()) * DF_END - 1.0d) * NOTIONAL; assertEquals(computed.getCurrency(), EUR); assertEquals(computed.getAmount(), expected, TOLERANCE * NOTIONAL); }
Source:
<code>public void run() { logger.debug("Trying to create KieServerClient for {}", config); if (config.getClient() == null) { try { config.setClient(createKieServicesClient(config)); <START> executorService.shutdown(); <END> } catch (NoEndpointFoundException e) { logger.warn("Unable to connect to KieServer: {}. The client will try to reconnect in the background", config); } catch (Exception e) { if (e.getCause() != null && NoEndpointFoundException.class.isInstance(e.getCause())) { logger.warn("Unable to connect to KieServer: {}. The client will try to reconnect in the background", config); } else { logger.warn("Unable to create KieServer client: {}", config, e); } } } }</code><technical_language>Imagine 2 KIE Servers. of running do of client creation. fall async creation. KIE Server client creation succeeds forbids scheduling of next tasks for other KIE Servers. I cancel periodic task for KIE Server able connect to. hold tasks in a separate collection. Moreover, task is removed, shut executor service</technical_language>

Target:
public void run() { logger.debug("Trying to create KieServerClient for {}", kieConfig); if (kieConfig.getClient() == null) { try { kieConfig.setClient(createKieServicesClient(kieConfig)); } catch (NoEndpointFoundException e) { logger.warn("Unable to connect to KieServer: {}. The client will try to reconnect in the background", kieConfig); } catch (Exception e) { if (e.getCause() != null && NoEndpointFoundException.class.isInstance(e.getCause())) { logger.warn("Unable to connect to KieServer: {}. The client will try to reconnect in the background", kieConfig); } else { logger.warn("Unable to create KieServer client: {}", kieConfig, e); } } finally { if (kieConfig.getClient() == null) { logger.debug("KieServerClient for could not be created. Retrying...", kieConfig); retryConnection(kieConfig); } else { logger.debug("KieServerClient for created.", kieConfig); } } } }
Source:
<code>public void testBuildProcessStartedEventWithInitiatorAndUserAuthBypassEnabled() { processMetadata.put("initiator", "john"); ServicesAwareAuditEventBuilder builder = new ServicesAwareAuditEventBuilder(); builder.setIdentityProvider(identityProvider); enableSetInitiator(builder); ProcessStartedEvent pse = new ProcessStartedEventImpl(processInstance, kieRuntime); ProcessInstanceLog log = (ProcessInstanceLog) builder.buildEvent(pse); assertEquals("john", log.getIdentity()); <START> } <END></code><technical_language>4th scenario - bypass is true is initiator? identity null</technical_language>

Target:
public void testBuildProcessStartedEventWithInitiatorAndUserAuthBypassEnabled() { processMetadata.put("initiator", "john"); enableSetInitiator(builder); ProcessStartedEvent pse = new ProcessStartedEventImpl(processInstance, kieRuntime); ProcessInstanceLog log = (ProcessInstanceLog) builder.buildEvent(pse); assertEquals("john", log.getIdentity()); }
Source:
<code>public void testExpiration() { cache.put("k", "v0"); <START> CompletableFuture<?> expirationFuture = executorService.submit(() -> { <END> while (!terminated) { expirationManager.processExpiration(); checkDataContainer(); } }); CompletableFuture<?> updateFuture = executorService.submit(() -> { for (int i = 1; !terminated; ++i) { assertEquals("v" + (i - 1), cache.remove("k")); timeService.advance(1000 + ThreadLocalRandom.current().nextInt(1000)); assertEquals(null, cache.put("k", "v" + i)); timeService.advance(1000 + ThreadLocalRandom.current().nextInt(1000)); checkDataContainer(); } }); CompletableFuture<?> timeout = executorService.submit(() -> { LockSupport.parkNanos(TimeUnit.SECONDS.toNanos(30)); terminated = true; }); CompletableFuture.anyOf(expirationFuture, updateFuture, timeout).join(); }</code><technical_language>is wrong fork()</technical_language>

Target:
public void testExpiration() throws Exception { cache.put("k", "v0"); CompletableFuture<?> expirationFuture = CompletableFuture.runAsync(() -> { while (!terminated) { expirationManager.processExpiration(); checkDataContainer(); } }, executorService); CompletableFuture<?> updateFuture = CompletableFuture.runAsync(() -> { for (int i = 1; !terminated; ++i) { assertEquals("v" + (i - 1), cache.remove("k")); timeService.advance(1000 + ThreadLocalRandom.current().nextInt(1000)); assertEquals(null, cache.put("k", "v" + i)); timeService.advance(1000 + ThreadLocalRandom.current().nextInt(1000)); checkDataContainer(); } }, executorService); CompletableFuture.anyOf(expirationFuture, updateFuture).get(30, TimeUnit.SECONDS); terminated = true; }
Source:
<code>void resolveChanges() { Set<Object> selectedKeys = selectedSet.keySet(); List<Object> visibleKeys = new ArrayList<Object>(); for (T visible : dataDisplay.getVisibleItems()) { visibleKeys.add(getKey(visible)); } if (!visibleKeys.containsAll(selectedKeys)) { for (Map.Entry<Object, T> objectTEntry : selectedSet.entrySet()) { <START> if (!visibleKeys.contains(objectTEntry.getKey())) <END> selectionChanges.put(objectTEntry.getValue(), false); } } if (selectionChanges.isEmpty()) { return; } boolean changed = false; for (Map.Entry<T, Boolean> entry : selectionChanges.entrySet()) { T object = entry.getKey(); boolean selected = entry.getValue(); Object key = getKey(object); T oldValue = selectedSet.get(key); if (selected) { if (oldValue == null || !oldValue.equals(object)) { selectedSet.put(getKey(object), object); changed = true; } } else { if (oldValue != null) { selectedSet.remove(key); changed = true; } } } selectionChanges.clear(); if (changed) { SelectionChangeEvent.fire(this); } }</code><technical_language>Please add curly brackets</technical_language>

Target:
void resolveChanges() { Set<Object> selectedKeys = selectedSet.keySet(); List<Object> visibleKeys = new ArrayList<Object>(); for (T visible : dataDisplay.getVisibleItems()) { visibleKeys.add(getKey(visible)); } if (!visibleKeys.containsAll(selectedKeys)) { for (Map.Entry<Object, T> selectedEntry : selectedSet.entrySet()) { if (!visibleKeys.contains(selectedEntry.getKey())) { selectionChanges.put(selectedEntry.getValue(), false); } } } if (selectionChanges.isEmpty()) { return; } boolean changed = false; for (Map.Entry<T, Boolean> entry : selectionChanges.entrySet()) { T object = entry.getKey(); boolean selected = entry.getValue(); Object key = getKey(object); T oldValue = selectedSet.get(key); if (selected) { if (oldValue == null || !oldValue.equals(object)) { selectedSet.put(getKey(object), object); changed = true; } } else { if (oldValue != null) { selectedSet.remove(key); changed = true; } } } selectionChanges.clear(); if (changed) { SelectionChangeEvent.fire(this); } }
Source:
<code>public static ResponseBodySerializer getResponseBodySerializer(final String contentType) { ResponseBodySerializer serializer = RESPONSE_BODY_SERIALIZERS.get(contentType); if (null == serializer) { synchronized (ResponseBodySerializerFactory.class) { if (null == RESPONSE_BODY_SERIALIZERS.get(contentType)) { instantiateResponseBodySerializerFromFactories(contentType); } serializer = RESPONSE_BODY_SERIALIZERS.get(contentType); } } if (MISSING_SERIALIZER == serializer) { throw new ResponseBodySerializerNotFoundException(contentType); } <START> return serializer; <END> }</code><technical_language>result variable named result</technical_language>

Target:
public static ResponseBodySerializer getResponseBodySerializer(final String contentType) { ResponseBodySerializer result = RESPONSE_BODY_SERIALIZERS.get(contentType); if (null == result) { synchronized (ResponseBodySerializerFactory.class) { if (null == RESPONSE_BODY_SERIALIZERS.get(contentType)) { instantiateResponseBodySerializerFromFactories(contentType); } result = RESPONSE_BODY_SERIALIZERS.get(contentType); } } if (MISSING_SERIALIZER == result) { throw new ResponseBodySerializerNotFoundException(contentType); } return result; }
Source:
<code>public void write_string_resource_json_instance() throws InterruptedException { <START> Map<Integer, Object> map = new HashMap<>(); <END> map.put(0, "newValue"); String valueToWrite = "newValue"; WriteResponse response = helper.server.send(helper.getCurrentRegistration(), new WriteRequest(ContentFormat.JSON, TEST_OBJECT_ID, 0, STRING_RESOURCE_INSTANCE_ID, 0, valueToWrite, Type.STRING), 1000000); assertEquals(CHANGED, response.getCode()); assertNotNull(response.getCoapResponse()); assertThat(response.getCoapResponse(), is(instanceOf(Response.class))); ReadResponse readResponse = helper.server.send(helper.getCurrentRegistration(), new ReadRequest(ContentFormat.JSON, TEST_OBJECT_ID, 0, STRING_RESOURCE_INSTANCE_ID, 0), 1000000); LwM2mResourceInstance resource = (LwM2mResourceInstance) readResponse.getContent(); assertEquals(valueToWrite, resource.getValue()); }</code><technical_language>map is used</technical_language>

Target:
public void write_string_resource_json_instance() throws InterruptedException { assertStringResourceInstance(ContentFormat.JSON); }
Source:
<code>public void postProcessBeanFactory(final ConfigurableListableBeanFactory beanFactory) throws BeansException { <START> for (String beanName : beanFactory.getBeanDefinitionNames()) { <END> if (!beanName.equalsIgnoreCase(getPdxDiskStoreName())) { BeanDefinition beanDefinition = beanFactory.getBeanDefinition(beanName); if (isPersistentRegion(beanDefinition) || isDiskStore(beanDefinition)) { addPdxDiskStoreDependency(beanDefinition); } } } }</code><technical_language>getBeanNamesForType ? need do type checking</technical_language>

Target:
public void postProcessBeanFactory(final ConfigurableListableBeanFactory beanFactory) throws BeansException { postProcessPdxDiskStoreDependencies(beanFactory, AsyncEventQueue.class, DiskStore.class, Region.class); }
Source:
<code>public ShellLauncher() throws IOException { moduleDir = DirUtils.findModuleDir(); String kbaseYml = TextUtils.readFileText(new File(moduleDir, "kbase.yml")); @SuppressWarnings("unchecked") <START> Map<String,Object> config = (Map<String, Object>)new Yaml().load(kbaseYml); <END> moduleName = (String)config.get("module-name"); workDir = Paths.get(moduleDir.toPath().toString(), "test_local", "workdir").toString(); }</code><technical_language>Do new Yaml(new SafeConstructor())</technical_language>

Target:
public ShellLauncher() throws IOException { moduleInfo = new ModuleInfo(); }
Source:
<code>private static String cleanseEndtime(String jsonld) { return jsonld.replaceFirst( <START> "\"endTime\":\"\\d\\d\\d\\d-\\d\\d-\\d\\dT\\d\\d:\\d\\d:\\d\\d\"", <END> "\"endTime\":\"0001-01-01T00:00:00\""); }</code><technical_language>shorten this a bit quantifiers: "\"endTime\":\"\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\"",</technical_language>

Target:
private static String cleanseEndtime(String jsonld) { return jsonld.replaceFirst( "\"endTime\":\"\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\"", "\"endTime\":\"0001-01-01T00:00:00\""); }
Source:
<code>public final ActionResult execute(ActionExecutionContext actionExecutionContext) throws ActionExecutionException, InterruptedException { Actions.prefetchInputs(getInputs(), actionExecutionContext, this); try { actionExecutionContext .getActionInputPrefetcher() .prefetchFiles(getInputs(), actionExecutionContext.getMetadataProvider()); } catch (IOException e) { <START> throw new ActionExecutionException("Failed to fetch remote input file.", e, this, false); <END> } ActionResult actionResult; try { DeterministicWriter deterministicWriter; try { deterministicWriter = newDeterministicWriter(actionExecutionContext); } catch (IOException e) { throw new EnvironmentalExecException("failed to create file '" + getPrimaryOutput().prettyPrint() + "' due to I/O error: " + e.getMessage(), e); } actionResult = ActionResult.create( getStrategy(actionExecutionContext) .writeOutputToFile( this, actionExecutionContext, deterministicWriter, makeExecutable, isRemotable())); } catch (ExecException e) { throw e.toActionExecutionException( "Writing file for rule '" + Label.print(getOwner().getLabel()) + "'", actionExecutionContext.getVerboseFailures(), this); } afterWrite(actionExecutionContext); return actionResult; }</code><technical_language>Message in Actions.java failed (pre)fetch, failed fetch. Is difference intentional</technical_language>

Target:
public final ActionResult execute(ActionExecutionContext actionExecutionContext) throws ActionExecutionException, InterruptedException { Actions.prefetchInputs(getInputs(), actionExecutionContext, this); ActionResult actionResult; try { DeterministicWriter deterministicWriter; try { deterministicWriter = newDeterministicWriter(actionExecutionContext); } catch (IOException e) { throw new EnvironmentalExecException("failed to create file '" + getPrimaryOutput().prettyPrint() + "' due to I/O error: " + e.getMessage(), e); } actionResult = ActionResult.create( getStrategy(actionExecutionContext) .writeOutputToFile( this, actionExecutionContext, deterministicWriter, makeExecutable, isRemotable())); } catch (ExecException e) { throw e.toActionExecutionException( "Writing file for rule '" + Label.print(getOwner().getLabel()) + "'", actionExecutionContext.getVerboseFailures(), this); } afterWrite(actionExecutionContext); return actionResult; }
Source:
<code>protected ListenableFuture<Long> ping(long nonce) throws ProtocolException { final VersionMessage ver = vPeerVersionMessage; if (!ver.isPingPongSupported()) throw new ProtocolException("Peer version is too low for measurable pings: " + ver); <START> if (pendingPings.size() > 50) { <END> log.info("{}: Too many pending pings, disconnecting", this); close(); } PendingPing pendingPing = new PendingPing(nonce); pendingPings.add(pendingPing); sendMessage(new Ping(pendingPing.nonce)); return pendingPing.future; }</code><technical_language>fiixing cases. prefer in commits, for each</technical_language>

Target:
protected ListenableFuture<Long> ping(long nonce) throws ProtocolException { final VersionMessage ver = vPeerVersionMessage; if (!ver.isPingPongSupported()) throw new ProtocolException("Peer version is too low for measurable pings: " + ver); if (pendingPings.size() > PENDING_PINGS_LIMIT) { log.info("{}: Too many pending pings, disconnecting", this); close(); } PendingPing pendingPing = new PendingPing(nonce); pendingPings.add(pendingPing); sendMessage(new Ping(pendingPing.nonce)); return pendingPing.future; }
Source:
<code>public DataContext createDataContext(final JavaTypeFactory typeFactory) { class DruidDataContext implements DataContext { private final Map<String, Object> context = ImmutableMap.<String, Object>of( DataContext.Variable.UTC_TIMESTAMP.camelName, localNow.getMillis(), DataContext.Variable.CURRENT_TIMESTAMP.camelName, localNow.getMillis(), DataContext.Variable.LOCAL_TIMESTAMP.camelName, new Interval( new DateTime("1970-01-01T00:00:00.000", localNow.getZone()), localNow ).toDurationMillis(), DataContext.Variable.TIME_ZONE.camelName, localNow.getZone().toTimeZone().clone(), <START> CTX_AUTHENTICATION_RESULT, authenticationResult <END> ); @Override public SchemaPlus getRootSchema() { throw new UnsupportedOperationException(); } @Override public JavaTypeFactory getTypeFactory() { return typeFactory; } @Override public QueryProvider getQueryProvider() { throw new UnsupportedOperationException(); } @Override public Object get(final String name) { return context.get(name); } } return new DruidDataContext(); }</code><technical_language>This named DATA_CTX_AUTHENTICATION_RESULT a kind of context other CTX_ things. (The others query context)</technical_language>

Target:
public DataContext createDataContext(final JavaTypeFactory typeFactory) { class DruidDataContext implements DataContext { private final Map<String, Object> context = ImmutableMap.<String, Object>of( DataContext.Variable.UTC_TIMESTAMP.camelName, localNow.getMillis(), DataContext.Variable.CURRENT_TIMESTAMP.camelName, localNow.getMillis(), DataContext.Variable.LOCAL_TIMESTAMP.camelName, new Interval( new DateTime("1970-01-01T00:00:00.000", localNow.getZone()), localNow ).toDurationMillis(), DataContext.Variable.TIME_ZONE.camelName, localNow.getZone().toTimeZone().clone(), DATA_CTX_AUTHENTICATION_RESULT, authenticationResult ); @Override public SchemaPlus getRootSchema() { throw new UnsupportedOperationException(); } @Override public JavaTypeFactory getTypeFactory() { return typeFactory; } @Override public QueryProvider getQueryProvider() { throw new UnsupportedOperationException(); } @Override public Object get(final String name) { return context.get(name); } } return new DruidDataContext(); }
Source:
<code>private ParametricScalarImplementation( Signature signature, List<Optional<Class<?>>> argumentNativeContainerTypes, Map<String, Class<?>> specializedTypeParameters, List<ParametricScalarImplementationChoice> choices, Class<?> returnContainerType) { this.signature = requireNonNull(signature, "signature is null"); this.argumentNativeContainerTypes = ImmutableList.copyOf(requireNonNull(argumentNativeContainerTypes, "argumentNativeContainerTypes is null")); this.specializedTypeParameters = ImmutableMap.copyOf(requireNonNull(specializedTypeParameters, "specializedTypeParameters is null")); this.choices = requireNonNull(choices, "choices is null"); this.returnNativeContainerType = requireNonNull(returnContainerType, "return native container type is null"); for (int i = 1; i < choices.size(); i++) { checkArgument(Objects.equals(choices.get(i).getDependencies(), choices.get(0).getDependencies())); checkArgument(Objects.equals(choices.get(i).getConstructorDependencies(), choices.get(0).getConstructorDependencies())); <START> checkArgument(Objects.equals(choices.get(i).getConstructor(), choices.get(0).getConstructor())); <END> } }</code><technical_language>For 3, checkCondition(..., FUNCTION_IMPLEMENTATION_ERROR, "Some descriptive message");</technical_language>

Target:
private ParametricScalarImplementation( Signature signature, List<Optional<Class<?>>> argumentNativeContainerTypes, Map<String, Class<?>> specializedTypeParameters, List<ParametricScalarImplementationChoice> choices, Class<?> returnContainerType) { this.signature = requireNonNull(signature, "signature is null"); this.argumentNativeContainerTypes = ImmutableList.copyOf(requireNonNull(argumentNativeContainerTypes, "argumentNativeContainerTypes is null")); this.specializedTypeParameters = ImmutableMap.copyOf(requireNonNull(specializedTypeParameters, "specializedTypeParameters is null")); this.choices = requireNonNull(choices, "choices is null"); this.returnNativeContainerType = requireNonNull(returnContainerType, "return native container type is null"); for (int i = 1; i < choices.size(); i++) { checkCondition(Objects.equals(choices.get(i).getDependencies(), choices.get(0).getDependencies()), FUNCTION_IMPLEMENTATION_ERROR, "Implementations for the same function signature must have matching dependencies: %s", signature); checkCondition(Objects.equals(choices.get(i).getConstructorDependencies(), choices.get(0).getConstructorDependencies()), FUNCTION_IMPLEMENTATION_ERROR, "Implementations for the same function signature must have matching constructor dependencies: %s", signature); checkCondition(Objects.equals(choices.get(i).getConstructor(), choices.get(0).getConstructor()), FUNCTION_IMPLEMENTATION_ERROR, "Implementations for the same function signature must have matching constructors: %s", signature); } }
Source:
<code>public void showResizeFactorDialog(final Attachment attachment){ final CharSequence[] resizeOptions = { getString(R.string.account_settings_attachments_resize_factor_entry_original), getString(R.string.account_settings_attachments_resize_factor_entry_half), getString(R.string.account_settings_attachments_resize_factor_entry_one_fourth)}; int selectedChoice = -1; if(attachment.overrideDefault){ if(attachment.resizeFactor == 1.0f){ <START> selectedChoice = 0; <END> } else if (attachment.resizeFactor == 0.5f){ selectedChoice = 1; } else { selectedChoice = 2; } } AlertDialog.Builder builder = new AlertDialog.Builder(this) .setTitle(getString(R.string.account_settings_attachment_resize_factor_label)) .setSingleChoiceItems(resizeOptions, selectedChoice, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { switch(which) { case 0: attachment.updateResizeInfo(1.0f, true); attachmentPresenter.updateAttachmentsList(attachment); break; case 1: attachment.updateResizeInfo(0.5f, true); attachmentPresenter.updateAttachmentsList(attachment); break; case 2: attachment.updateResizeInfo(0.25f, true); attachmentPresenter.updateAttachmentsList(attachment); break; } dialog.dismiss(); } }); builder.create().show(); }</code><technical_language>constants</technical_language>

Target:
public void showResizeFactorDialog(final Attachment attachment){ final CharSequence[] resizeOptions = { getString(R.string.account_settings_attachments_resize_factor_entry_original), getString(R.string.account_settings_attachments_resize_factor_entry_half), getString(R.string.account_settings_attachments_resize_factor_entry_one_fourth)}; int selectedChoice = Account.RESIZE_FACTOR_NONE_SELECTED; if (attachment.overrideDefault) { if (attachment.resizeFactor == 1.0f) { selectedChoice = Account.RESIZE_FACTOR_ORIGINAL_SIZE_SELECTED; } else if (attachment.resizeFactor == 0.5f) { selectedChoice = Account.RESIZE_FACTOR_HALF_SIZE_SELECTED; } else { selectedChoice = Account.RESIZE_FACTOR_ONE_FOURTH_SIZE_SELECTED; } } AlertDialog.Builder builder = new AlertDialog.Builder(this) .setTitle(getString(R.string.account_settings_attachment_resize_factor_label)) .setSingleChoiceItems(resizeOptions, selectedChoice, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { Account.ResizeFactor factor = Account.ResizeFactor.values()[which]; switch(factor) { case FULL_SIZE: attachment.updateResizeInfo(1.0f, true); attachmentPresenter.updateAttachmentsList(attachment); break; case HALF_SIZE: attachment.updateResizeInfo(0.5f, true); attachmentPresenter.updateAttachmentsList(attachment); break; case QUARTER_SIZE: attachment.updateResizeInfo(0.25f, true); attachmentPresenter.updateAttachmentsList(attachment); break; } dialog.dismiss(); } }); builder.create().show(); }
Source:
<code><START> private Clusters mapCollection(List<VDSGroup> entities) { <END> ApplicationMode appMode = getCurrent().get(ApplicationMode.class); Clusters collection = new Clusters(); for (org.ovirt.engine.core.common.businessentities.VDSGroup entity : entities) { if (appMode == ApplicationMode.VirtOnly) { collection.getClusters().add(addLinks(map(entity), "glusterVolumes")); } else { collection.getClusters().add(addLinks(map(entity))); } } return collection; }</code><technical_language>prefer adding mapVirtOnlyCollection() calling</technical_language>

Target:
private Clusters mapCollection(List<VDSGroup> entities) { Clusters collection = new Clusters(); for (org.ovirt.engine.core.common.businessentities.VDSGroup entity : entities) { collection.getClusters().add(addLinks(map(entity))); } return collection; }
Source:
<code>public KieServerInstance addKieServerInstance(KieServerInfo kieServerInfo) throws KieServerControllerException { ServerTemplate serverTemplate = this.templateStorage.load(kieServerInfo.getServerId()); if (serverTemplate != null) { throw new KieServerControllerException("KieServerInstance is already registered with id: " + kieServerInfo.getServerId()); } <START> KieServerInstance kieServerInstance = new KieServerInstance(); <END> kieServerInstance.setIdentifier(kieServerInfo.getServerId()); kieServerInstance.setVersion(kieServerInfo.getVersion()); kieServerInstance.setName(kieServerInfo.getName()); kieServerInstance.setKieServerSetup(new KieServerSetup()); kieServerInstance.setStatus(KieServerStatus.UP); kieServerInstance.setManagedInstances(new HashSet<KieServerInstanceInfo>()); if (kieServerInfo.getLocation() != null && !kieServerInfo.getLocation().isEmpty()) { KieServerInstanceInfo instanceInfo = new KieServerInstanceInfo(kieServerInfo.getLocation(), KieServerStatus.UP, kieServerInfo.getCapabilities()); kieServerInstance.getManagedInstances().add(instanceInfo); } serverTemplate = new ServerTemplate(); serverTemplate.setId(kieServerInfo.getServerId()); serverTemplate.setName(kieServerInfo.getName()); serverTemplate.setCapabilities(kieServerInfo.getCapabilities()); if (kieServerInfo.getLocation() != null && !kieServerInfo.getLocation().isEmpty()) { serverTemplate.addServerInstance(ModelFactory.newServerInstanceKey(serverTemplate.getId(), kieServerInfo.getLocation())); } templateStorage.store(serverTemplate); return kieServerInstance; }</code><technical_language>I prefer set kieserverInstance properties in constructor</technical_language>

Target:
public KieServerInstance addKieServerInstance(KieServerInfo kieServerInfo) throws KieServerControllerException { ServerTemplate serverTemplate = this.templateStorage.load(kieServerInfo.getServerId()); if (serverTemplate != null) { throw new KieServerControllerException("KieServerInstance is already registered with id: " + kieServerInfo.getServerId()); } KieServerInstance kieServerInstance = new KieServerInstance(kieServerInfo.getServerId(), kieServerInfo.getName(), kieServerInfo.getVersion(), new HashSet<KieServerInstanceInfo>(), KieServerStatus.UP, new KieServerSetup()); if (kieServerInfo.getLocation() != null && !kieServerInfo.getLocation().isEmpty()) { KieServerInstanceInfo instanceInfo = new KieServerInstanceInfo(kieServerInfo.getLocation(), KieServerStatus.UP, kieServerInfo.getCapabilities()); kieServerInstance.getManagedInstances().add(instanceInfo); } serverTemplate = new ServerTemplate(kieServerInfo.getServerId(), kieServerInfo.getName(), kieServerInfo.getCapabilities(), new HashMap<Capability, ServerConfig>(), new ArrayList<ContainerSpec>()); if (kieServerInfo.getLocation() != null && !kieServerInfo.getLocation().isEmpty()) { serverTemplate.addServerInstance(ModelFactory.newServerInstanceKey(serverTemplate.getId(), kieServerInfo.getLocation())); } templateStorage.store(serverTemplate); return kieServerInstance; }
Source:
<code>public Boolean getBooleanProperty(final String key) throws ActiveMQPropertyConversionException { <START> return getOrCreateProperties().getBooleanProperty(key(key)); <END> }</code><technical_language>delegated as: getBooleanProperty(key(key))</technical_language>

Target:
public Boolean getBooleanProperty(final String key) throws ActiveMQPropertyConversionException { return getBooleanProperty(key(key)); }
Source:
<code><START> public GDBLearningStrategy withEnvironmentBuilder(LearningEnvironmentBuilder envBuilder) { <END> this.envBuilder = envBuilder; this.environment = envBuilder.buildForTrainer(); return this; }</code><technical_language>@artemmalykh, please a this problem</technical_language>

Target:
public GDBLearningStrategy withEnvironmentBuilder(LearningEnvironmentBuilder envBuilder) { this.envBuilder = envBuilder; this.trainerEnvironment = envBuilder.buildForTrainer(); return this; }
Source:
<code>CloseableTribbleIterator<T> iterator() throws IOException; @Override void close() throws IOException; List<String> getSequenceNames(); Object getHeader(); <START> default boolean hasIndex() { <END> return false; }</code><technical_language>I want separate out concepts of hasIndex isQueriable. In gatk a datasource index supports random access. I supportsRandomAccess clearer name. granular want though, potentially imagine a stream index supports fast skipping rewinding, easily either</technical_language>

Target:
CloseableTribbleIterator<T> iterator() throws IOException; @Override void close() throws IOException; List<String> getSequenceNames(); Object getHeader(); default boolean isQueryable() { return false; }
Source:
<code>public void run() { try { while (!shutdown) { synchronized (this) { long idleTime = getIdleTime(); wait(getSleepTime()); PoolingHttpClientConnectionManager poolConnMgr = (PoolingHttpClientConnectionManager) connMgr; <START> System.out.println("before closing expired and idl conn, stats is "+poolConnMgr.getTotalStats()); <END> connMgr.closeExpiredConnections(); connMgr.closeIdleConnections(idleTime, TimeUnit.MILLISECONDS); System.out.println("after closing expired and idl conn, stats is "+poolConnMgr.getTotalStats()); } } } catch (InterruptedException ex) { shutdown(); } }</code><technical_language>remove this testing</technical_language>

Target:
public void run() { try { while (!shutdown) { synchronized (this) { long idleTime = getIdleTime(); wait(getSleepTime()); PoolingHttpClientConnectionManager poolConnMgr = (PoolingHttpClientConnectionManager) connMgr; connMgr.closeExpiredConnections(); connMgr.closeIdleConnections(idleTime, TimeUnit.MILLISECONDS); } } } catch (InterruptedException ex) { shutdown(); } }
Source:
<code>public EscapePods(Aero originalRide, int nPods, boolean isEscapePod) { super(); setCrew(new Crew(CrewType.CREW)); setChassis(POD_EJECT_NAME); setModel(originalRide.getDisplayName()); StringBuffer newName = new StringBuffer(POD_EJECT_NAME); <START> newName.append(originalRide.getDisplayName()); <END> displayName = newName.toString(); initializeSI(nPods); if (isEscapePod) { setFuel(10); setOriginalWalkMP(4); } setMovementMode(EntityMovementMode.AERODYNE); for (int i = 0; i < 4; i++) { initializeArmor(nPods, i); } setOriginalRideId(originalRide.getId()); setOriginalRideExternalId(originalRide.getExternalIdAsString()); }</code><technical_language>Unnecessary stringbuffer</technical_language>

Target:
public EscapePods(Aero originalRide, int nPods, boolean isEscapePod) { super(); setCrew(new Crew(CrewType.CREW)); setChassis(POD_EJECT_NAME); setModel(originalRide.getDisplayName()); String newName = new String(POD_EJECT_NAME + originalRide.getDisplayName()); displayName = newName; initializeSI(nPods); if (isEscapePod) { setFuel(ESCAPE_POD_FUEL); setOriginalWalkMP(ESCAPE_POD_SAFE_THRUST); } setMovementMode(EntityMovementMode.AERODYNE); for (int i = 0; i < 4; i++) { initializeArmor(nPods, i); } setOriginalRideId(originalRide.getId()); setOriginalRideExternalId(originalRide.getExternalIdAsString()); }