auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public synchronized void registerPropertyDeprecation(PropertyDeprecationDescriptor descriptor) { Map<String, Map<String, String>> properties = removedProperties; if (descriptor.isDeprecated()) { properties = deprecatedProperties; <START> } <END> properties.computeIfAbsent(descriptor.getSchema(), key -> new HashMap<>()).put(descriptor.getName(), descriptor.getFallback()); log.info("Registered property deprecation: " + descriptor); }</code><technical_language>Map<String, Map<String, String>> properties = descriptor.isDeprecated() ? deprecatedProperties : removedProperties</technical_language>

Target:
public synchronized void registerPropertyDeprecation(PropertyDeprecationDescriptor descriptor) { Map<String, Map<String, String>> properties = descriptor.isDeprecated() ? deprecatedProperties : removedProperties; properties.computeIfAbsent(descriptor.getSchema(), key -> new HashMap<>()).put(descriptor.getName(), descriptor.getFallback()); log.info("Registered property deprecation: " + descriptor); }
Source:
<code>public void onInfoWindowClick(Marker marker) { mCustomInfoWindowAdapter.cancelUpdates(); ObaTripStatus status = mMarkerData.getStatusFromMarker(marker); if (mController != null && mController.getFocusedStopId() != null) { TripDetailsActivity.start(mActivity, status.getActiveTripId(), <START> mController.getFocusedStopId(), "vehicle"); <END> } else { TripDetailsActivity.start(mActivity, status.getActiveTripId(), null, "vehicle"); } }</code><technical_language>"vehicle" string moved a constant SCROLL_MODE_VEHICLE in TripDetailsListFragment</technical_language>

Target:
public void onInfoWindowClick(Marker marker) { mCustomInfoWindowAdapter.cancelUpdates(); ObaTripStatus status = mMarkerData.getStatusFromMarker(marker); if (mController != null && mController.getFocusedStopId() != null) { TripDetailsActivity.start(mActivity, status.getActiveTripId(), mController.getFocusedStopId(), TripDetailsListFragment.SCROLL_MODE_VEHICLE); } else { TripDetailsActivity.start(mActivity, status.getActiveTripId(), TripDetailsListFragment.SCROLL_MODE_VEHICLE); } }
Source:
<code>private ScrollPane createAllMilestonesScrollPane() { VBox milestonesBox = new VBox(); milestonesBox.setPrefWidth(398); milestonesBox.setStyle("-fx-background-color: white;"); originalMilestones.forEach(milestone -> milestonesBox.getChildren().add( setMouseClickForNode(milestone.getDetailedMilestoneNode(), milestone.getTitle())) ); ScrollPane milestonesScrollPane = new ScrollPane(); <START> milestonesScrollPane.setMaxHeight(160); <END> milestonesScrollPane.setContent(milestonesBox); return milestonesScrollPane; }</code><technical_language>Actually, this Search results's i.e. set height * no. of milestones</technical_language>

Target:
private ScrollPane createAllMilestonesScrollPane() { VBox milestonesBox = new VBox(); milestonesBox.setStyle("-fx-background-color: white;"); originalMilestones.forEach(milestone -> milestonesBox.getChildren().add( setMouseClickForNode(milestone.getDetailedMilestoneNode(), milestone.getTitle())) ); ScrollPane milestonesScrollPane = new ScrollPane(); milestonesScrollPane.setMaxHeight(MILESTONES_SCROLLPANE_MAX_HEIGHT); milestonesScrollPane.setContent(milestonesBox); return milestonesScrollPane; }
Source:
<code>public void doBuild(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { <START> ManualCondition manualCondition=(ManualCondition) getProcess().getPromotionCondition(ManualCondition.class.getName()); <END> if(!getTarget().hasPermission(Promotion.PROMOTE)) { if (!manualCondition.getUsersAsSet().isEmpty() && !manualCondition.isInUsersList() && !manualCondition.isInGroupList()) return; } JSONObject formData = req.getSubmittedForm(); List<ParameterValue> paramValues=null; if (formData!=null){ paramValues = new ArrayList<ParameterValue>(); if (manualCondition!=null){ List<ParameterDefinition> parameterDefinitions=manualCondition.getParameterDefinitions(); if (parameterDefinitions != null && !parameterDefinitions.isEmpty()) { JSONArray a = JSONArray.fromObject(formData.get("parameter")); for (Object o : a) { JSONObject jo = (JSONObject) o; String name = jo.getString("name"); ParameterDefinition d = manualCondition.getParameterDefinition(name); if (d==null) throw new IllegalArgumentException("No such parameter definition: " + name); paramValues.add(d.createValue(req, jo)); } } } } if (paramValues==null){ paramValues = new ArrayList<ParameterValue>(); } Future<Promotion> f = getProcess().scheduleBuild2(getTarget(), new UserCause(), paramValues); if (f==null) LOGGER.warning("Failing to schedule the promotion of "+getTarget()); rsp.forwardToPreviousPage(req); }</code><technical_language>I suppose null checks missing</technical_language>

Target:
public void doBuild(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { ManualCondition manualCondition = (ManualCondition) getProcess().getPromotionCondition(ManualCondition.class.getName()); if(!getTarget().hasPermission(Promotion.PROMOTE)) { if (manualCondition == null || (!manualCondition.getUsersAsSet().isEmpty() && !manualCondition.isInUsersList() && !manualCondition.isInGroupList())) return; } JSONObject formData = req.getSubmittedForm(); List<ParameterValue> paramValues=null; if (formData!=null){ paramValues = new ArrayList<ParameterValue>(); if (manualCondition!=null){ List<ParameterDefinition> parameterDefinitions=manualCondition.getParameterDefinitions(); if (parameterDefinitions != null && !parameterDefinitions.isEmpty()) { JSONArray a = JSONArray.fromObject(formData.get("parameter")); for (Object o : a) { JSONObject jo = (JSONObject) o; String name = jo.getString("name"); ParameterDefinition d = manualCondition.getParameterDefinition(name); if (d==null) throw new IllegalArgumentException("No such parameter definition: " + name); paramValues.add(d.createValue(req, jo)); } } } } if (paramValues==null){ paramValues = new ArrayList<ParameterValue>(); } Future<Promotion> f = getProcess().scheduleBuild2(getTarget(), new UserCause(), paramValues); if (f==null) LOGGER.warning("Failing to schedule the promotion of "+getTarget()); rsp.forwardToPreviousPage(req); }
Source:
<code>public int available() throws IOException { final FSDataInputStream inLocal = in; synchronized (inLocal) { <START> int avail = in.available(); <END> if (pos + avail > end) { avail = (int) (end - pos); } return avail; } }</code><technical_language>input stream change. this computed offset of read passed in</technical_language>

Target:
public int available() throws IOException { return (int) (end - pos); }
Source:
<code>public DynamoDBLeaseCoordinator initialLeaseTableReadCapacity(long readCapacity) { <START> throw new UnsupportedOperationException("Please set read capacity using the constructor"); <END> }</code><technical_language>This is a breaking change. setting available. mark deprecated though</technical_language>

Target:
public DynamoDBLeaseCoordinator initialLeaseTableReadCapacity(long readCapacity) { if (readCapacity <= 0) { throw new IllegalArgumentException("readCapacity should be >= 1"); } initialLeaseTableReadCapacity = readCapacity; return this; }
Source:
<code>public void logAuditMessage(final Guid clusterId, final GlusterVolumeEntity volume, final VDS server, final AuditLogType logType, final Map<String, String> customValues) { AuditLogableBase logable = new AuditLogableBase(); logable.setAuditLogType(logType); logable.setVds(server); logable.setGlusterVolume(volume); logable.setVdsGroupId(clusterId == null ? Guid.Empty : clusterId); if (customValues != null) { for (String key : customValues.keySet()) { logable.addCustomValue(key, customValues.get(key)); } } <START> AuditLogDirector.log(logable); <END> }</code><technical_language>HI, log method accepts (logable,logType) ? LdapBrokerUtils.logEventForUser</technical_language>

Target:
public void logAuditMessage(final Guid clusterId, final GlusterVolumeEntity volume, final VDS server, final AuditLogType logType, final Map<String, String> customValues) { AuditLogableBase logable = new AuditLogableBase(); logable.setVds(server); logable.setGlusterVolume(volume); logable.setVdsGroupId(clusterId == null ? Guid.Empty : clusterId); if (customValues != null) { for (String key : customValues.keySet()) { logable.addCustomValue(key, customValues.get(key)); } } AuditLogDirector.log(logable, logType); }
Source:
<code>protected boolean canDoAction() { boolean canDo = true; if (getVm() == null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_EXIST); } if (getVm().getStatus() != VMStatus.Up) { canDo = failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_VM_STATUS_ILLEGAL, LocalizedVmStatus.from(getVm().getStatus())); } <START> return canDo; <END> }</code><technical_language>please remove canDo variable, return in #39 in a similar #36</technical_language>

Target:
protected boolean canDoAction() { boolean canDo = true; if (!FeatureSupported.vmSlaPolicy(getVdsGroup().getcompatibility_version())) { addCanDoActionMessage(VdcBllMessages.VM_SLA_POLICY_NOT_SUPPORTED); return false; } if (getVm() == null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_EXIST); } if (getVm() == null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_EXIST); } if (getVm().getStatus() != VMStatus.Up) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_VM_STATUS_ILLEGAL, LocalizedVmStatus.from(getVm().getStatus())); } return canDo; }
Source:
<code>public void testKDCLocator() { KDCLocator locator = new KDCLocator(); String[] recordsList = { "0 100 88 example.com.", "0 100 88 comp1.example.com", "1 100 88 comp1.example.com." }; DnsSRVResult result = locator.getKdc(recordsList, "example.com"); int numOfEntries = result.getNumOfValidAddresses(); <START> Assert.assertEquals(3, numOfEntries); <END> }</code><technical_language>omit Assert class notation</technical_language>

Target:
public void testKDCLocator() { KDCLocator locator = new KDCLocator(); String[] recordsList = { "0 100 88 example.com.", "0 100 88 comp1.example.com", "1 100 88 comp1.example.com." }; DnsSRVResult result = locator.getKdc(recordsList, "example.com"); int numOfEntries = result.getNumOfValidAddresses(); assertEquals(3, numOfEntries); }
Source:
<code>public void test() { final Resource resource = KieServices.Factory.get().getResources().newReaderResource(new StringReader(DRL)); resource.setTargetPath(TestConstants.DRL_TEST_TARGET_PATH); final KieBuilder kbuilder = KieBaseUtil.getKieBuilderFromResources(true, resource); final KieBase kbase = KieBaseUtil.getDefaultKieBaseFromKieBuilder(kbuilder); KieSession ksession = kbase.newKieSession(); ksession.insert(new Person()); ksession.insert(new Cheese("eidam")); ((DefaultAgenda) ksession.getAgenda()).activateRuleFlowGroup("group1"); <START> Assertions.assertThat(1).isEqualTo(ksession.fireAllRules()); <END> ksession.dispose(); }</code><technical_language>expected actual reversed here</technical_language>

Target:
public void test() { final Resource resource = KieServices.Factory.get().getResources().newReaderResource(new StringReader(DRL)); resource.setTargetPath(TestConstants.DRL_TEST_TARGET_PATH); final KieBuilder kbuilder = KieBaseUtil.getKieBuilderFromResources(true, resource); final KieBase kbase = KieBaseUtil.getDefaultKieBaseFromKieBuilder(kbuilder); final KieSession ksession = kbase.newKieSession(); ksession.insert(new Person()); ksession.insert(new Cheese("eidam")); ((DefaultAgenda) ksession.getAgenda()).activateRuleFlowGroup("group1"); Assertions.assertThat(ksession.fireAllRules()).isEqualTo(1); ksession.dispose(); }
Source:
<code>private void registerSitesPerHostToZK(int sitesperhost) { try { ZKUtil.addIfMissing(m_messenger.getZK(), VoltZK.sitesPerHost, CreateMode.PERSISTENT, new byte[0]); } catch (Exception e) { VoltDB.crashLocalVoltDB("Unable to create " + VoltZK.sitesPerHost + " node to Zookeeper, dying", false, e); } String path = ZKUtil.joinZKPath(VoltZK.sitesPerHost, "host_" + m_messenger.getHostId()); <START> try { <END> ByteBuffer b = ByteBuffer.allocate(4); b.putInt(sitesperhost); m_messenger.getZK().create(path, b.array(), Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); } catch (KeeperException.NodeExistsException e) { hostLog.info("Zookeeper node " + path + "already exists"); } catch (Exception e) { VoltDB.crashLocalVoltDB("Unable to write sitePerHost to ZK, dying", false, e); } }</code><technical_language>host id instead of "host_"+ host id path splitting is needed late on</technical_language>

Target:
private void registerSitesPerHostToZK(int sitesperhost) { try { ZKUtil.addIfMissing(m_messenger.getZK(), VoltZK.sitesPerHost, CreateMode.PERSISTENT, new byte[0]); } catch (Exception e) { VoltDB.crashLocalVoltDB("Unable to create " + VoltZK.sitesPerHost + " node to Zookeeper, dying", false, e); } String path = ZKUtil.joinZKPath(VoltZK.sitesPerHost, String.valueOf(m_messenger.getHostId())); try { ByteBuffer b = ByteBuffer.allocate(4); b.putInt(sitesperhost); m_messenger.getZK().create(path, b.array(), Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); } catch (KeeperException.NodeExistsException e) { hostLog.info("Zookeeper node " + path + "already exists"); } catch (Exception e) { VoltDB.crashLocalVoltDB("Unable to write sitePerHost to ZK, dying", false, e); } }
Source:
<code>protected void executeCommand() { if (getVmTemplate() != null) { UpdateVmTemplate(); <START> if (getVmTemplate().getstorage_pool_id() != null <END> && !VmTemplateHandler.BlankVmTemplateId.equals(getVmTemplate().getId())) { UpdateTemplateInSpm( getVmTemplate().getstorage_pool_id().getValue(), new java.util.ArrayList<VmTemplate>(java.util.Arrays .asList(new VmTemplate[] { getVmTemplate() }))); } setSucceeded(true); } }</code><technical_language>want freeLock() operation? change status of template DB lock? Global transaction</technical_language>

Target:
protected void executeCommand() { if (getVmTemplate() != null) { getVmStaticDAO().incrementDbGeneration(getVmTemplate().getId()); VmHandler.LockVm(getVm().getDynamicData(), getCompensationContext()); freeLock(); UpdateVmTemplate(); setSucceeded(true); } }
Source:
<code>protected void shutdown() { if (requestResponseHandlers.size() > 0) { logger.info("Shutting down RequestResponseHandlerController"); Iterator<AsyncRequestResponseHandler> asyncRequestHandlerIterator = requestResponseHandlers.iterator(); while (asyncRequestHandlerIterator.hasNext()) { AsyncRequestResponseHandler requestHandler = asyncRequestHandlerIterator.next(); <START> requestHandler.shutdown(); <END> asyncRequestHandlerIterator.remove(); } logger.info("RequestResponseHandlerController shutdown complete"); } }</code><technical_language>If of handlers fails shutdown for some reason, dont proceed rest right? Is this expected</technical_language>

Target:
protected void shutdown() { if (asyncRequestResponseHandlers.size() > 0) { logger.info("Shutting down RequestResponseHandlerController"); Iterator<AsyncRequestResponseHandler> asyncRequestHandlerIterator = asyncRequestResponseHandlers.iterator(); while (asyncRequestHandlerIterator.hasNext()) { AsyncRequestResponseHandler requestHandler = asyncRequestHandlerIterator.next(); requestHandler.shutdown(); asyncRequestHandlerIterator.remove(); } logger.info("RequestResponseHandlerController shutdown complete"); } }
Source:
<code>private long beginFateOperation() throws ThriftSecurityException, TException { while (true) { MasterClientService.Iface client = null; try { <START> client = MasterClient.getConnectionWithRetry(context, 0); <END> return client.beginFateOperation(Tracer.traceInfo(), context.rpcCreds()); } catch (TTransportException tte) { log.debug("Failed to call beginFateOperation(), retrying ... ", tte); sleepUninterruptibly(100, TimeUnit.MILLISECONDS); } catch (ThriftNotActiveServiceException e) { log.debug("Contacted a Master which is no longer active, retrying"); sleepUninterruptibly(100, TimeUnit.MILLISECONDS); } finally { MasterClient.close(client); } } }</code><technical_language>a method getConnectionWithRetry(ctx) count default 0/infinite retires. of calls do need pass zero</technical_language>

Target:
private long beginFateOperation() throws ThriftSecurityException, TException { while (true) { MasterClientService.Iface client = null; try { client = MasterClient.getConnection(context, true); if (client == null) throw new TTransportException("Could not get connection"); return client.beginFateOperation(Tracer.traceInfo(), context.rpcCreds()); } catch (TTransportException tte) { log.debug("Failed to call beginFateOperation(), retrying ... ", tte); sleepUninterruptibly(100, TimeUnit.MILLISECONDS); } catch (ThriftNotActiveServiceException e) { log.debug("Contacted a Master which is no longer active, retrying"); sleepUninterruptibly(100, TimeUnit.MILLISECONDS); } finally { MasterClient.close(client); } } }
Source:
<code>private String getMethodCallback(JMethod method) { <START> if (isVoidMethod(method)) { <END> return "org.fusesource.restygwt.client.MethodCallback<java.lang.Void> callback"; } else if (method.getReturnType().isPrimitive() != null) { JPrimitiveType primitiveType = method.getReturnType().isPrimitive(); return "org.fusesource.restygwt.client.MethodCallback<" + primitiveType.getQualifiedBoxedSourceName() + "> callback"; } return "org.fusesource.restygwt.client.MethodCallback<" + method.getReturnType().getParameterizedQualifiedSourceName() + "> callback"; }</code><technical_language>Correct if wrong, I block "if (isVoidMethod(method)) {" is needed anymore</technical_language>

Target:
private String getMethodCallback(JMethod method) { if (method.getReturnType().isPrimitive() != null) { JPrimitiveType primitiveType = method.getReturnType().isPrimitive(); return "org.fusesource.restygwt.client.MethodCallback<" + primitiveType.getQualifiedBoxedSourceName() + "> callback"; } return "org.fusesource.restygwt.client.MethodCallback<" + method.getReturnType().getParameterizedQualifiedSourceName() + "> callback"; }
Source:
<code>PagedFlux<BlobItem> listBlobsFlatWithOptionalTimeout(ListBlobsOptions options, String continuationToken, Duration timeout) { Function<String, Mono<PagedResponse<BlobItem>>> func = marker -> listBlobsFlatSegment(marker, options, timeout) .map(response -> { List<BlobItem> value = response.getValue().getSegment() == null <START> ? new ArrayList<>(0) <END> : response.getValue().getSegment().getBlobItems().stream() .map(BlobItem::new) .collect(Collectors.toList()); return new PagedResponseBase<>( response.getRequest(), response.getStatusCode(), response.getHeaders(), value, response.getValue().getNextMarker(), response.getDeserializedHeaders()); }); return new PagedFlux<>(() -> func.apply(continuationToken), func); }</code><technical_language>Collections.emptyList() (and other similar places)</technical_language>

Target:
PagedFlux<BlobItem> listBlobsFlatWithOptionalTimeout(ListBlobsOptions options, String continuationToken, Duration timeout) { Function<String, Mono<PagedResponse<BlobItem>>> func = marker -> listBlobsFlatSegment(marker, options, timeout) .map(response -> { List<BlobItem> value = response.getValue().getSegment() == null ? Collections.emptyList() : response.getValue().getSegment().getBlobItems().stream() .map(BlobItem::new) .collect(Collectors.toList()); return new PagedResponseBase<>( response.getRequest(), response.getStatusCode(), response.getHeaders(), value, response.getValue().getNextMarker(), response.getDeserializedHeaders()); }); return new PagedFlux<>(() -> func.apply(continuationToken), func); }
Source:
<code>public void doesNotLogIfLoggingNotAllowedEvenIfOperationsAreSlow() { <START> makeOperationsTakeSpecifiedDuration(LONG_DURATION); <END> profilingTimelockService.getFreshTimestamp(); verify(delegate).getFreshTimestamp(); verifyLoggerNeverInvoked(); }</code><technical_language>nit: explicitly add disallowLogging</technical_language>

Target:
public void doesNotLogIfLoggingNotAllowedEvenIfOperationsAreSlow() { accumulateLogsWithCall(LONG_DURATION, profilingTimelockService::getFreshTimestamp); verify(delegate).getFreshTimestamp(); verifyLoggerNeverInvoked(); }
Source:
<code>public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.homeAsUp: return true; case R.id.menu_page_other_languages: startLangLinksActivity(); return true; case R.id.menu_page_share: sharePageLink(); return true; case R.id.menu_page_add_to_list: addToReadingList(AddToReadingListDialog.InvokeSource.PAGE_OVERFLOW_MENU); return true; case R.id.menu_page_remove_from_list: <START> ReadingList.DAO.anyListContainsTitleAsync(ReadingListDaoProxy.key(getTitle()), <END> new CallbackTask.DefaultCallback<ReadingListPage>() { @Override public void success(@Nullable ReadingListPage page) { new RemoveFromReadingListsDialog(page).deleteOrShowDialog(getContext(), new RemoveFromReadingListsDialog.Callback() { @Override public void onDeleted(@NonNull ReadingListPage page) { if (callback() != null) { callback().onPageRemoveFromReadingLists(getTitle()); } } }); } }); return true; case R.id.menu_page_find_in_page: showFindInPage(); return true; case R.id.menu_page_content_issues: showContentIssues(); return true; case R.id.menu_page_similar_titles: showSimilarTitles(); return true; case R.id.menu_page_font_and_theme: showThemeChooser(); return true; case R.id.menu_page_show_tabs: tabsProvider.enterTabMode(false); return true; case R.id.menu_page_search: if (callback() != null) { callback().onPageSearchRequested(); } return true; default: return super.onOptionsItemSelected(item); } }</code><technical_language>If this menu option, page in a list time updateBookmarkAndMenuOptionsFromDao called. case necessary call anyListContainsTitleAsync here; show RemoveFromReadingListsDialog immediately? If is get app in a state this menu item is showing article longer appearing in list, cleaner invalidate options menu necessary reading list DB interactions in order prevent happening. Side note: put of this logic a private helper method is done for other cases</technical_language>

Target:
public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.homeAsUp: return true; case R.id.menu_page_other_languages: startLangLinksActivity(); return true; case R.id.menu_page_share: sharePageLink(); return true; case R.id.menu_page_add_to_list: addToReadingList(AddToReadingListDialog.InvokeSource.PAGE_OVERFLOW_MENU); return true; case R.id.menu_page_remove_from_list: new RemoveFromReadingListsDialog(model.getReadingListPage()).deleteOrShowDialog(getContext(), new RemoveFromReadingListsDialog.Callback() { @Override public void onDeleted(@NonNull ReadingListPage page) { if (callback() != null) { callback().onPageRemoveFromReadingLists(getTitle()); } } }); return true; case R.id.menu_page_find_in_page: showFindInPage(); return true; case R.id.menu_page_content_issues: showContentIssues(); return true; case R.id.menu_page_similar_titles: showSimilarTitles(); return true; case R.id.menu_page_font_and_theme: showThemeChooser(); return true; case R.id.menu_page_show_tabs: tabsProvider.enterTabMode(false); return true; case R.id.menu_page_search: if (callback() != null) { callback().onPageSearchRequested(); } return true; default: return super.onOptionsItemSelected(item); } }
Source:
<code><START> protected byte[] getOutput(FilePath workspace) throws IOException, InterruptedException { <END> try (InputStream is = getOutputFile(workspace).read()) { return IOUtils.toByteArray(is); } }</code><technical_language>introduce a new method optional Launcher in implementations</technical_language>

Target:
protected byte[] getOutput(FilePath workspace) throws IOException, InterruptedException { return getOutputFile(workspace).act(new MasterToSlaveFileCallable<byte[]>() { @Override public byte[] invoke(File f, VirtualChannel channel) throws IOException, InterruptedException { byte[] buf = FileUtils.readFileToByteArray(f); ByteBuffer transcoded = maybeTranscode(buf, charset); if (transcoded == null) { return buf; } else { byte[] buf2 = new byte[transcoded.remaining()]; transcoded.get(buf2); return buf2; } } }); }
Source:
<code>public void testCreateCxfRsClientFactoryBeanProgrammatically() { CxfRsEndpoint endpoint = resolveMandatoryEndpoint("cxfrs://bean://" + BEAN_SERVICE_ENDPOINT_NAME, CxfRsEndpoint.class); <START> SpringJAXRSClientFactoryBean cfb = (SpringJAXRSClientFactoryBean)endpoint.createJAXRSClientFactoryBean(); <END> assertEquals("Got the wrong address", BEAN_SERVICE_ADDRESS, cfb.getAddress()); assertNotNull("Service class must not be null", cfb.getServiceClass()); assertEquals("Got the wrong ServiceClass", CustomerService.class, cfb.getServiceClass()); assertEquals("Got the wrong username", BEAN_SERVICE_USERNAME, cfb.getUsername()); assertEquals("Got the wrong password", BEAN_SERVICE_PASSWORD, cfb.getPassword()); }</code><technical_language>need check instance of cfb is set before</technical_language>

Target:
public void testCreateCxfRsClientFactoryBeanProgrammatically() { CxfRsEndpoint endpoint = resolveMandatoryEndpoint("cxfrs://bean://" + BEAN_SERVICE_ENDPOINT_NAME, CxfRsEndpoint.class); SpringJAXRSClientFactoryBean cfb = (SpringJAXRSClientFactoryBean)endpoint.createJAXRSClientFactoryBean(); assertNotSame("Got the same object but must be different", super.applicationContext.getBean(BEAN_SERVICE_ENDPOINT_NAME), cfb); assertEquals("Got the wrong address", BEAN_SERVICE_ADDRESS, cfb.getAddress()); assertNotNull("Service class must not be null", cfb.getServiceClass()); assertEquals("Got the wrong ServiceClass", CustomerService.class, cfb.getServiceClass()); assertEquals("Got the wrong username", BEAN_SERVICE_USERNAME, cfb.getUsername()); assertEquals("Got the wrong password", BEAN_SERVICE_PASSWORD, cfb.getPassword()); }
Source:
<code>public void testServiceScripts() throws Exception { String[] b = new String[] { "Agent", "LeapMotion", "OpenNi", "Runtime", "SlamBad", "_TemplateService", "Cli", "WebGui", "JMonkeyEngine", "ImageDisplay", "GoogleAssistant", "PickToLight", "PythonProxy", "Sprinkler", "_TemplateProxy", "SwingGui" }; Set<String> blacklist = new HashSet<String>(Arrays.asList(b)); pythonScripts = getPyRobotLabServiceScripts(); log.info("testing scripts", pythonScripts.size()); for (String name : pythonScripts.keySet()) { <START> name = "AudioFile"; <END> log.info("testing script {}", name); releaseServices(); Python python = (Python) Runtime.start("python", "Python"); try { log.error("testing ######## ########", name); python.execAndWait(pythonScripts.get(name)); } catch (Exception e) { log.error("testing threw", name, e); } } }</code><technical_language>Um... this is wrong... overriding forcing "AudioFile" tested here</technical_language>

Target:
public void testServiceScripts() throws Exception { String[] b = new String[] { "Agent", "LeapMotion", "OpenNi", "Runtime", "SlamBad", "_TemplateService", "Cli", "WebGui", "JMonkeyEngine", "ImageDisplay", "GoogleAssistant", "PickToLight", "PythonProxy", "Sprinkler", "_TemplateProxy", "SwingGui" }; Set<String> blacklist = new HashSet<String>(Arrays.asList(b)); pythonScripts = getPyRobotLabServiceScripts(); log.info("testing scripts", pythonScripts.size()); for (String name : pythonScripts.keySet()) { log.info("testing script {}", name); releaseServices(); Python python = (Python) Runtime.start("python", "Python"); try { log.error("testing ######## ########", name); python.execAndWait(pythonScripts.get(name)); } catch (Exception e) { log.error("testing threw", name, e); } } }
Source:
<code>private long skipVarintsInBuffer(long items) throws IOException { <START> if (items == 0) { <END> return 0; } if (available() == 0) { advance(); if (available() == 0) { throw new OrcCorruptionException(orcDataSourceId, "Unexpected end of stream"); } } long skipped = 0; while (items - skipped > SIZE_OF_LONG && available() > MAX_VARINT_LENGTH) { long value = ByteArrays.getLong(buffer, position); position += SIZE_OF_LONG; long mask = (value & VARINT_MASK) ^ VARINT_MASK; skipped += Long.bitCount(mask); } while (skipped < items && available() > 0) { if ((buffer[position++] & 0x80) == 0) { skipped++; } } return skipped; }</code><technical_language>this check is false; remove</technical_language>

Target:
private long skipVarintsInBuffer(long items) throws IOException { if (available() == 0) { advance(); if (available() == 0) { throw new OrcCorruptionException(orcDataSourceId, "Unexpected end of stream"); } } long skipped = 0; while (items - skipped > SIZE_OF_LONG && available() > MAX_VARINT_LENGTH) { long value = ByteArrays.getLong(buffer, position); position += SIZE_OF_LONG; long mask = (value & VARINT_MASK) ^ VARINT_MASK; skipped += Long.bitCount(mask); } while (skipped < items && available() > 0) { if ((buffer[position++] & 0x80) == 0) { skipped++; } } return skipped; }
Source:
<code>public synchronized void validate() throws TimeoutException { if (!selfDelivered) { throw new TimeoutException("Timeout waiting for member " + localAddress); } else if (!keysAwaitingValidation.isEmpty()) { <START> throw new TimeoutException("Timeout waiting for the validation of " + keysAwaitingValidation); <END> } }</code><technical_language>"Timeout waiting for validation of keys: " sounds a me</technical_language>

Target:
public synchronized void validate() throws TimeoutException { if (!selfDelivered) { throw new TimeoutException("Timeout waiting for member " + localAddress); } else if (!keysAwaitingValidation.isEmpty()) { throw new TimeoutException("Timeout waiting for the validation of keys: " + keysAwaitingValidation); } }
Source:
<code><START> public DatabasesImpl() { <END> this(new DatabaseConnection("database1")); }</code><technical_language>I this do want though, new DatabaseConnection("database1") try load db's properties yaml. need connection lazily instantiated</technical_language>

Target:
public DatabasesImpl() { }
Source:
<code>public void download() throws Exception { LanguageDownloader downloader = LanguageFactory.getLanguageDownloader(getClient(), <START> connectivity,mSettingsRepository.getSettings()); <END> downloader.start(); }</code><technical_language>Settings is LanguageDownloader</technical_language>

Target:
public void download() throws Exception { LanguageDownloader downloader = LanguageFactory.getLanguageDownloader(getClient(), connectivity); downloader.start(); }
Source:
<code>public void exitNonReserved(SqlBaseParser.NonReservedContext context) { if (!(context.getChild(0) instanceof TerminalNode)) { int rule = ((ParserRuleContext) context.getChild(0)).getRuleIndex(); throw new AssertionError("nonReserved can only contain tokens. Found nested rule: " + ruleNames.get(rule)); } context.getParent().removeLastChild(); Token token = (Token) context.getChild(0).getPayload(); <START> warningConsumer.accept(new ParsingWarning("nonReserved word used", null, token.getLine(), token.getCharPositionInLine())); <END> context.getParent().addChild(new CommonToken( new Pair<>(token.getTokenSource(), token.getInputStream()), SqlBaseLexer.IDENTIFIER, token.getChannel(), token.getStartIndex(), token.getStopIndex())); }</code><technical_language>do put visitNonReserved? overwhelm PostProcessor</technical_language>

Target:
public void exitNonReserved(SqlBaseParser.NonReservedContext context) { if (!(context.getChild(0) instanceof TerminalNode)) { int rule = ((ParserRuleContext) context.getChild(0)).getRuleIndex(); throw new AssertionError("nonReserved can only contain tokens. Found nested rule: " + ruleNames.get(rule)); } context.getParent().removeLastChild(); Token token = (Token) context.getChild(0).getPayload(); if (token.getText().equalsIgnoreCase("CURRENT_ROLE")) { warningConsumer.accept(new ParsingWarning(format("Reserved word used: %s", token.getText()), token.getLine(), token.getCharPositionInLine())); } context.getParent().addChild(new CommonToken( new Pair<>(token.getTokenSource(), token.getInputStream()), SqlBaseLexer.IDENTIFIER, token.getChannel(), token.getStartIndex(), token.getStopIndex())); }
Source:
<code>public static Comparable value(SqlNode node) { if (node instanceof SqlLiteral) { SqlLiteral literal = (SqlLiteral) node; switch (literal.getTypeName().getFamily()) { case CHARACTER: return (NlsString) literal.value; case NUMERIC: return (BigDecimal) literal.value; case INTERVAL_YEAR_MONTH: case INTERVAL_DAY_TIME: final SqlIntervalLiteral.IntervalValue val = (SqlIntervalLiteral.IntervalValue) literal.value; <START> return val.getSign(); <END> } } if (SqlUtil.isLiteralChain(node)) { assert node instanceof SqlCall; final SqlLiteral literal = SqlLiteralChainOperator.concatenateOperands((SqlCall) node); assert SqlTypeUtil.inCharFamily(literal.getTypeName()); return (NlsString) literal.value; } if (node instanceof SqlIntervalQualifier) { SqlIntervalQualifier qualifier = (SqlIntervalQualifier) node; return qualifier.timeUnitRange; } switch (node.getKind()) { case CAST: assert node instanceof SqlCall; return value(((SqlCall) node).operand(0)); case MINUS_PREFIX: assert node instanceof SqlCall; Comparable o = value(((SqlCall) node).operand(0)); if (o instanceof BigDecimal) { BigDecimal bigDecimal = (BigDecimal) o; return bigDecimal.negate(); } default: throw Util.newInternal("invalid literal: " + node); } }</code><technical_language>is that? I getSign is</technical_language>

Target:
public static Comparable value(SqlNode node) { if (node instanceof SqlLiteral) { SqlLiteral literal = (SqlLiteral) node; switch (literal.getTypeName().getFamily()) { case CHARACTER: return (NlsString) literal.value; case NUMERIC: return (BigDecimal) literal.value; case INTERVAL_YEAR_MONTH: final SqlIntervalLiteral.IntervalValue valMonth = (SqlIntervalLiteral.IntervalValue) literal.value; return valMonth.getSign() * SqlParserUtil.intervalToMonths(valMonth); case INTERVAL_DAY_TIME: final SqlIntervalLiteral.IntervalValue valTime = (SqlIntervalLiteral.IntervalValue) literal.value; return valTime.getSign() * SqlParserUtil.intervalToMillis(valTime); } } if (SqlUtil.isLiteralChain(node)) { assert node instanceof SqlCall; final SqlLiteral literal = SqlLiteralChainOperator.concatenateOperands((SqlCall) node); assert SqlTypeUtil.inCharFamily(literal.getTypeName()); return (NlsString) literal.value; } if (node instanceof SqlIntervalQualifier) { SqlIntervalQualifier qualifier = (SqlIntervalQualifier) node; return qualifier.timeUnitRange; } switch (node.getKind()) { case CAST: assert node instanceof SqlCall; return value(((SqlCall) node).operand(0)); case MINUS_PREFIX: assert node instanceof SqlCall; Comparable o = value(((SqlCall) node).operand(0)); if (o instanceof BigDecimal) { BigDecimal bigDecimal = (BigDecimal) o; return bigDecimal.negate(); } default: throw Util.newInternal("invalid literal: " + node); } }
Source:
<code>public static @NonNull List<CompletableFuture<LanguageServer>> getInitializedLanguageServers(@NonNull IFile file, @Nullable Predicate<ServerCapabilities> request) throws IOException { Collection<LanguageServerWrapper> wrappers = getLSWrappers(file, request); <START> return wrappers.stream().map(wrapper -> { <END> return wrapper.getInitializedServer().thenApply((server) -> { try { wrapper.connect(file, null); } catch (IOException e) { LanguageServerPlugin.logError(e); } return server; }); }).collect(Collectors.toList()); }</code><technical_language>get rid of {</technical_language>

Target:
public static @NonNull List<CompletableFuture<LanguageServer>> getInitializedLanguageServers(@NonNull IFile file, @Nullable Predicate<ServerCapabilities> request) throws IOException { Collection<LanguageServerWrapper> wrappers = getLSWrappers(file, request); return wrappers.stream().map(wrapper -> wrapper.getInitializedServer().thenApply((server) -> { try { wrapper.connect(file, null); } catch (IOException e) { LanguageServerPlugin.logError(e); } return server; })).collect(Collectors.toList()); }
Source:
<code><START> public void testPreAndPostLaunchCommands() throws IOException { <END> File tempPreLaunchFile = new File(tempDataDir, "prelaunch.txt"); File tempPostLaunchFile = new File(tempDataDir, "postlaunch.txt"); localhost.setConfig(BrooklynConfigKeys.ONBOX_BASE_DIR, tempDataDir.getAbsolutePath()); app.createAndManageChild(EntitySpec.create(MyService.class) .configure(SoftwareProcess.PRE_LAUNCH_COMMAND, String.format("echo foo > %s", tempPreLaunchFile.getAbsoluteFile())) .configure(SoftwareProcess.POST_LAUNCH_COMMAND, String.format("echo bar > %s", tempPostLaunchFile.getAbsoluteFile()))); app.start(ImmutableList.of(localhost)); List<String> prelaunch = Files.readLines(tempPreLaunchFile, Charsets.UTF_8); List<String> postlaunch = Files.readLines(tempPostLaunchFile, Charsets.UTF_8); assertEquals(prelaunch.size(), 1); assertEquals(postlaunch.size(), 1); assertEquals(postlaunch.get(0), "bar"); assertEquals(prelaunch.get(0), "foo"); tempPreLaunchFile.delete(); tempPostLaunchFile.delete(); }</code><technical_language>This do for now, assert executed right time. a VanillaSoftwareProcess a LAUNCH_COMMAND of echo inLaunch >> "+tempFile.getAbsoluteFile(). pre launch echo inPreLaunch >> "+tempFile.getAbsoluteFile() etc. assertion file contained lines (in order) of inPreLaunch, inLaunch, inPostLaunch. Note a big fan of boring names "inPreLaunch" "foo" easy for code + results is happening. tests "myPassword" - if this ends in wrong place, easy happened</technical_language>

Target:
public void testPreAndPostLaunchCommands() throws IOException { File tempFile = new File(tempDataDir, "tempFile.txt"); localhost.setConfig(BrooklynConfigKeys.ONBOX_BASE_DIR, tempDataDir.getAbsolutePath()); app.createAndManageChild(EntitySpec.create(VanillaSoftwareProcess.class) .configure(VanillaSoftwareProcess.CHECK_RUNNING_COMMAND, "") .configure(SoftwareProcess.PRE_LAUNCH_COMMAND, String.format("echo inPreLaunch >> %s", tempFile.getAbsoluteFile())) .configure(VanillaSoftwareProcess.LAUNCH_COMMAND, String.format("echo inLaunch >> %s", tempFile.getAbsoluteFile())) .configure(SoftwareProcess.POST_LAUNCH_COMMAND, String.format("echo inPostLaunch >> %s", tempFile.getAbsoluteFile()))); app.start(ImmutableList.of(localhost)); List<String> output = Files.readLines(tempFile, Charsets.UTF_8); assertEquals(output.size(), 3); assertEquals(output.get(0), "inPreLaunch"); assertEquals(output.get(1), "inLaunch"); assertEquals(output.get(2), "inPostLaunch"); tempFile.delete(); }
Source:
<code>public void setup() throws IOException { Configuration config = new Configuration(false); config.set(BigtableOptionsFactory.PROJECT_ID_KEY, "project"); config.set(BigtableOptionsFactory.INSTANCE_ID_KEY, "instance"); BigtableHBaseSettings settings = BigtableHBaseSettings.create(config); TableName tableName = TableName.valueOf(TEST_TABLE); HBaseRequestAdapter hbaseAdapter = new HBaseRequestAdapter(settings, tableName); when(mockConnection.getConfiguration()).thenReturn(config); when(mockConnection.getSession()).thenReturn(mockSession); when(mockSession.getDataClientWrapper()).thenReturn(mockBigtableDataClient); when(mockBigtableDataClient.readFlatRows(isA(Query.class))).thenReturn(mockResultScanner); table = new AbstractBigtableTable(mockConnection, hbaseAdapter) {}; <START> } <END></code><technical_language>values ported over? config.set(BIGTABLE_ADMIN_HOST_KEY, "localhost")</technical_language>

Target:
public void setup() throws IOException { Configuration config = new Configuration(false); config.set(BigtableOptionsFactory.PROJECT_ID_KEY, "project"); config.set(BigtableOptionsFactory.INSTANCE_ID_KEY, "instance"); config.set(BigtableOptionsFactory.BIGTABLE_ADMIN_HOST_KEY, "localhost"); config.set(BigtableOptionsFactory.BIGTABLE_HOST_KEY, "localhost"); config.set(BigtableOptionsFactory.BIGTABLE_PORT_KEY, "0"); config.set(BigtableOptionsFactory.ENABLE_GRPC_RETRIES_KEY, "false"); config.set(BigtableOptionsFactory.BIGTABLE_NULL_CREDENTIAL_ENABLE_KEY, "true"); config.set(BigtableOptionsFactory.CUSTOM_USER_AGENT_KEY, "testAgent"); BigtableHBaseSettings settings = BigtableHBaseSettings.create(config); TableName tableName = TableName.valueOf(TEST_TABLE); HBaseRequestAdapter hbaseAdapter = new HBaseRequestAdapter(settings, tableName); when(mockConnection.getConfiguration()).thenReturn(config); when(mockConnection.getSession()).thenReturn(mockSession); when(mockSession.getDataClientWrapper()).thenReturn(mockBigtableDataClient); when(mockBigtableDataClient.readFlatRows(isA(Query.class))).thenReturn(mockResultScanner); table = new AbstractBigtableTable(mockConnection, hbaseAdapter) {}; }
Source:
<code>public CacheGroupMetricsImpl(CacheGroupContext ctx) { this.ctx = ctx; CacheConfiguration cacheCfg = ctx.config(); DataStorageConfiguration dsCfg = ctx.shared().kernalContext().config().getDataStorageConfiguration(); <START> boolean persistentEnabled = CU.isPersistentCache(cacheCfg, dsCfg) && !ctx.shared().kernalContext().clientNode(); <END> MetricRegistry mreg = ctx.shared().kernalContext().metric().registry(metricGroupName()); mreg.register("Caches", this::getCaches, List.class, null); storageSize = mreg.register("StorageSize", () -> persistentEnabled ? database().forGroupPageStores(ctx, PageStore::size) : 0, "Storage space allocated for group, in bytes."); sparseStorageSize = mreg.register("SparseStorageSize", () -> persistentEnabled ? database().forGroupPageStores(ctx, PageStore::getSparseSize) : 0, "Storage space allocated for group adjusted for possible sparsity, in bytes."); idxBuildCntPartitionsLeft = mreg.longMetric("IndexBuildCountPartitionsLeft", "Number of partitions need processed for finished indexes create or rebuilding."); initLocalPartitionsNumber = mreg.longMetric("InitializedLocalPartitionsNumber", "Number of local partitions initialized on current node."); DataRegion region = ctx.dataRegion(); if (region != null) { DataRegionMetricsImpl dataRegionMetrics = ctx.dataRegion().memoryMetrics(); grpPageAllocationTracker = dataRegionMetrics.getOrAllocateGroupPageAllocationTracker(ctx.cacheOrGroupName()); } else grpPageAllocationTracker = new LongAdderMetric("NO_OP", null); }</code><technical_language>nip :) sense swap arguments of && operator</technical_language>

Target:
public CacheGroupMetricsImpl(CacheGroupContext ctx) { this.ctx = ctx; CacheConfiguration cacheCfg = ctx.config(); DataStorageConfiguration dsCfg = ctx.shared().kernalContext().config().getDataStorageConfiguration(); boolean persistentEnabled = !ctx.shared().kernalContext().clientNode() && CU.isPersistentCache(cacheCfg, dsCfg); MetricRegistry mreg = ctx.shared().kernalContext().metric().registry(metricGroupName()); mreg.register("Caches", this::getCaches, List.class, null); storageSize = mreg.register("StorageSize", () -> persistentEnabled ? database().forGroupPageStores(ctx, PageStore::size) : 0, "Storage space allocated for group, in bytes."); sparseStorageSize = mreg.register("SparseStorageSize", () -> persistentEnabled ? database().forGroupPageStores(ctx, PageStore::getSparseSize) : 0, "Storage space allocated for group adjusted for possible sparsity, in bytes."); idxBuildCntPartitionsLeft = mreg.longMetric("IndexBuildCountPartitionsLeft", "Number of partitions need processed for finished indexes create or rebuilding."); initLocalPartitionsNumber = mreg.longMetric("InitializedLocalPartitionsNumber", "Number of local partitions initialized on current node."); DataRegion region = ctx.dataRegion(); if (region != null) { DataRegionMetricsImpl dataRegionMetrics = ctx.dataRegion().memoryMetrics(); grpPageAllocationTracker = dataRegionMetrics.getOrAllocateGroupPageAllocationTracker(ctx.cacheOrGroupName()); } else grpPageAllocationTracker = new LongAdderMetric("NO_OP", null); }
Source:
<code>public ResponseEntity<?> trialsMatchingGet( @ApiParam(value = "", required = true) @RequestParam(value = "", required = true) String oncoTreeCode, @ApiParam(value = "", required = false) @RequestParam(value = "", required = false) String treatment) throws IOException, ParseException { HttpStatus status = HttpStatus.OK; AWSCredentials credentials = new BasicAWSCredentials(s3AccessKey, s3SecretKey); AmazonS3 s3client = AmazonS3ClientBuilder.standard() <START> .withCredentials(new AWSStaticCredentialsProvider(credentials)).withRegion(Regions.US_EAST_1).build(); <END> S3Object s3object = s3client.getObject("oncokb", "drug-matching/result.json"); S3ObjectInputStream inputStream = s3object.getObjectContent(); JSONParser jsonParser = new JSONParser(); JSONObject jsonObject = (JSONObject) jsonParser.parse(new InputStreamReader(inputStream, "UTF-8")); Tumor tumor = new Tumor(); if (jsonObject.containsKey(oncoTreeCode)){ tumor = getTumor(jsonObject, oncoTreeCode); if (treatment == null) { return new ResponseEntity<Tumor>(tumor, status); } Trial[] trial = getTrialByTumorTreatment(tumor.getTrials(), treatment); return new ResponseEntity<Trial[]>(trial, status); } return new ResponseEntity<Trial[]>(new Trial[0], status); }</code><technical_language>put region in properties file well</technical_language>

Target:
public ResponseEntity<List<Trial>> trialsMatchingGet( @ApiParam(value = "", required = true) @RequestParam(value = "", required = true) String oncoTreeCode, @ApiParam(value = "", required = false) @RequestParam(value = "", required = false) String treatment) throws IOException, ParseException { HttpStatus status = HttpStatus.OK; AWSCredentials credentials = new BasicAWSCredentials(s3AccessKey, s3SecretKey); AmazonS3 s3client = AmazonS3ClientBuilder.standard() .withCredentials(new AWSStaticCredentialsProvider(credentials)).withRegion(s3Region).build(); S3Object s3object = s3client.getObject("oncokb", "drug-matching/result.json"); S3ObjectInputStream inputStream = s3object.getObjectContent(); JSONParser jsonParser = new JSONParser(); JSONObject jsonObject = (JSONObject) jsonParser.parse(new InputStreamReader(inputStream, "UTF-8")); Tumor tumor = new Tumor(); if (jsonObject.containsKey(oncoTreeCode)){ tumor = getTumor(jsonObject, oncoTreeCode); if (treatment == null) { return new ResponseEntity<List<Trial>>(tumor.getTrials(), status); } List<Trial> trial = getTrialByTreatment(tumor.getTrials(), treatment); return new ResponseEntity<List<Trial>>(trial, status); } return new ResponseEntity<List<Trial>>(new ArrayList<>(), status); }
Source:
<code>private void initEditMessageAction(ChangeInfo info, String revision) { RevisionInfo revisionInfo = info.revision(revision); NativeMap<ActionInfo> actions = revisionInfo.actions(); if ((actions != null && actions.containsKey("message")) || revisionInfo.is_edit()) { editMessage.setVisible(true); editMessageAction = new EditMessageAction( info.legacy_id(), <START> info.revision(revision).commit().message(), <END> style, editMessage, reply); keysAction.add(new KeyCommand(0, 'e', Util.C.keyEditMessage()) { @Override public void onKeyPress(KeyPressEvent event) { editMessageAction.onEdit(); } }); } }</code><technical_language>revisionInfo reused too</technical_language>

Target:
private void initEditMessageAction(ChangeInfo info, String revision) { RevisionInfo revisionInfo = info.revision(revision); NativeMap<ActionInfo> actions = revisionInfo.actions(); if ((actions != null && actions.containsKey("message")) || revisionInfo.is_edit()) { editMessage.setVisible(true); editMessageAction = new EditMessageAction( info.legacy_id(), revisionInfo.commit().message(), style, editMessage, reply); keysAction.add(new KeyCommand(0, 'e', Util.C.keyEditMessage()) { @Override public void onKeyPress(KeyPressEvent event) { editMessageAction.onEdit(); } }); } }
Source:
<code>public static String fromJson(JsonReader jsonReader) { <START> return jsonReader.getStringOrDefault("default_job_timeout", null); <END> }</code><technical_language>line set default_job_timeout null if user in request body. IMO, Server throw error if default_job_timeout field is in request body. jsonReader.getString instead</technical_language>

Target:
public static String fromJson(JsonReader jsonReader) { return jsonReader.getString("default_job_timeout"); }