auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private boolean isVisibleAndScrolledIntoView(View view) { if (view != null && view.getVisibility() == View.VISIBLE) { Rect scrollBounds = new Rect(); mScrollView.getHitRect(scrollBounds); return view.getLocalVisibleRect(scrollBounds); <START> } else { <END> return false; } }</code><technical_language>a small nitpick: need else here</technical_language>

Target:
private boolean isVisibleAndScrolledIntoView(View view) { if (view != null && view.getVisibility() == View.VISIBLE) { Rect scrollBounds = new Rect(); mScrollView.getHitRect(scrollBounds); return view.getLocalVisibleRect(scrollBounds); } return false; }
Source:
<code>public String getProbeString() { if (fAddress != null) { return fAddress; } else if (fSymbol != null && fOffset != null) { return new StringBuffer(fSymbol).append('+').append(fOffset).toString(); <START> } <END> return null; }</code><technical_language>question: want if symbol == offset == null return fSymbol+??? instead of null</technical_language>

Target:
public String getProbeString() { if (fAddress != null) { return fAddress; } else if (fSymbol != null) { StringBuffer buffer = new StringBuffer(fSymbol); if (fOffset != null) { buffer.append('+').append(fOffset); } return buffer.toString(); } return null; }
Source:
<code>public final Optional<HttpAction> redirect(final WebContext context) { <START> return Optional.empty(); <END> }</code><technical_language>code try move this method in IndirectClient</technical_language>

Target:
public final HttpAction redirect(final WebContext context) { throw new TechnicalException("direct clients do not support redirections"); }
Source:
<code>public void unregister() { <START> enforceNetworkStackPermission(); <END> if (DBG) log("Unregistering NetworkFactory"); if (mMessenger != null) { ConnectivityManager.from(mContext).unregisterNetworkFactory(mMessenger); mMessenger = null; } }</code><technical_language>new NETWORK_FACTORY permission Paul is building in aosp/1099096</technical_language>

Target:
public void unregister() { if (DBG) log("Unregistering NetworkFactory"); if (mMessenger != null) { ConnectivityManager.from(mContext).unregisterNetworkFactory(mMessenger); mMessenger = null; } }
Source:
<code><START> public double publishServoEvent(ServoControl servo, Integer eventType, double currentOutput) { <END> servo.publishServoEvent(eventType, currentOutput); return currentOutput; }</code><technical_language>bigger change, this method publish a new class called ServoEventData .. yet, call ServoData consistent EncoderData ... (and rename method publishServoData ) .. this establish a pattern for Controls publish ControlData</technical_language>

Target:
public double publishServoEvent(ServoControl servo, Integer eventType, double currentOutput) { servo.publishServoData(ServoStatus.SERVO_POSITION_UPDATE, currentOutput); return currentOutput; }
Source:
<code>private void initTargetDomains() { templateDisks= diskDao.getAllForVm(getParameters().getVmStaticData().getVmtGuid()); targetDomainsSize = new HashMap<>(); diskToProfileMap = new HashMap<>(); diskToStorageIds = new HashMap<>(); for (Disk disk: templateDisks) { DiskImage diskImage = (DiskImage)disk; diskToProfileMap.put(disk.getId(), diskImage.getDiskProfileIds()); diskToStorageIds.put(disk.getId(), diskImage.getStorageIds()); for (Guid storageId: diskImage.getStorageIds()) { <START> StorageDomain domain = storageDomainDao.get(storageId); <END> if (!targetDomainsSize.containsKey(domain.getId())) { targetDomainsSize.put(domain.getId(), domain.getAvailableDiskSizeInBytes()); } } } }</code><technical_language>this line moved 'if'</technical_language>

Target:
private void initTargetDomains() { templateDisks= diskDao.getAllForVm(getParameters().getVmStaticData().getVmtGuid()); targetDomainsSize = new HashMap<>(); diskToProfileMap = new HashMap<>(); diskToStorageIds = new HashMap<>(); for (Disk disk: templateDisks) { DiskImage diskImage = (DiskImage)disk; diskToProfileMap.put(disk.getId(), diskImage.getDiskProfileIds()); diskToStorageIds.put(disk.getId(), diskImage.getStorageIds()); for (Guid storageId: diskImage.getStorageIds()) { if (!targetDomainsSize.containsKey(storageId)) { StorageDomain domain = storageDomainDao.get(storageId); targetDomainsSize.put(domain.getId(), domain.getAvailableDiskSizeInBytes()); } } } }
Source:
<code><START> public void readyToForward() <END> { started = true; if(created.get() == 0) forward(); }</code><technical_language>This needs synchronised, threads updated of 'started'</technical_language>

Target:
public synchronized void readyToForward() { started = true; if(created.get() == 0) forward(); }
Source:
<code>public void testListRemote_Dumb_DetachedHEAD() throws Exception { Repository src = remoteRepository.getRepository(); RefUpdate u = src.updateRef(Constants.HEAD, true); RevCommit Q = remoteRepository.commit().message("Q").create(); u.setNewObjectId(Q); assertEquals(RefUpdate.Result.FORCED, u.forceUpdate()); Repository dst = createBareRepository(); Ref head; <START> try (Transport t = Transport.open(dst, dumbAuthNoneURI)) { try (FetchConnection c = t.openFetch()) { <END> head = c.getRef(Constants.HEAD); } } assertNotNull("has " + Constants.HEAD, head); assertEquals(Q, head.getObjectId()); }</code><technical_language>combined a single try-with-resource block</technical_language>

Target:
public void testListRemote_Dumb_DetachedHEAD() throws Exception { Repository src = remoteRepository.getRepository(); RefUpdate u = src.updateRef(Constants.HEAD, true); RevCommit Q = remoteRepository.commit().message("Q").create(); u.setNewObjectId(Q); assertEquals(RefUpdate.Result.FORCED, u.forceUpdate()); Repository dst = createBareRepository(); Ref head; try (Transport t = Transport.open(dst, dumbAuthNoneURI); FetchConnection c = t.openFetch()) { head = c.getRef(Constants.HEAD); } assertNotNull("has " + Constants.HEAD, head); assertEquals(Q, head.getObjectId()); }
Source:
<code>public void bitreserveClientWithoutTokenShouldSetTheTokenAndRestAdapter() throws Exception { BitreserveClient bitreserveClient = new BitreserveClient(); <START> Assert.assertNull(SessionManager.INSTANCE.getBearerToken()); <END> Assert.assertNotNull(bitreserveClient.getToken().getBitreserveRestAdapter()); }</code><technical_language>uppercase _INSTANCE_? Is a convention for this</technical_language>

Target:
public void bitreserveClientWithoutTokenShouldSetTheTokenAndRestAdapter() throws Exception { BitreserveClient.initialize(new MockSharedPreferencesContext()); BitreserveClient bitreserveClient = new BitreserveClient(); Assert.assertNull(SessionManager.INSTANCE.getBearerToken()); Assert.assertNotNull(bitreserveClient.getToken().getBitreserveRestAdapter()); }
Source:
<code><START> public AddProblemFactChangeCommand() { <END> super(); }</code><technical_language>type of this field ProblemFactChange instead of Object</technical_language>

Target:
public AddProblemFactChangeCommand() { }
Source:
<code>public <R extends HttpRequest> R bindToRequest(R request, Object input) { Builder<?> builder = request.toBuilder(); Payload payload = Payload.class.cast(input); if (payload.getContentMetadata().getContentType() == null) <START> payload.getContentMetadata().setContentType(MediaType.APPLICATION_OCTET_STREAM); <END> Long contentLength = payload.getContentMetadata().getContentLength(); if (contentLength != null && contentLength >= 0) { checkArgument(contentLength <= 5l * 1024 * 1024 * 1024, "maximum size for put object is 5GB, %s", contentLength); } else { builder.replaceHeader(TRANSFER_ENCODING, "chunked").build(); } byte[] md5 = payload.getContentMetadata().getContentMD5(); if (md5 != null) { builder.replaceHeader(ETAG, base16().lowerCase().encode(md5)); } Date expires = payload.getContentMetadata().getExpires(); if (expires != null) { builder.replaceHeader(OBJECT_DELETE_AT, String.valueOf( MILLISECONDS.toSeconds(expires.getTime()))) .build(); } return (R) builder.payload(payload).build(); }</code><technical_language>Add {...} if</technical_language>

Target:
public <R extends HttpRequest> R bindToRequest(R request, Object input) { Builder<?> builder = request.toBuilder(); Payload payload = Payload.class.cast(input); if (payload.getContentMetadata().getContentType() == null) { payload.getContentMetadata().setContentType(MediaType.APPLICATION_OCTET_STREAM); } Long contentLength = payload.getContentMetadata().getContentLength(); if (contentLength != null && contentLength >= 0) { checkArgument(contentLength <= 5l * 1024 * 1024 * 1024, "maximum size for put object is 5GB, %s", contentLength); } else { builder.replaceHeader(TRANSFER_ENCODING, "chunked").build(); } byte[] md5 = payload.getContentMetadata().getContentMD5(); if (md5 != null) { builder.replaceHeader(ETAG, base16().lowerCase().encode(md5)); } Date expires = payload.getContentMetadata().getExpires(); if (expires != null) { builder.replaceHeader(OBJECT_DELETE_AT, String.valueOf( MILLISECONDS.toSeconds(expires.getTime()))) .build(); } return (R) builder.payload(payload).build(); }
Source:
<code>public boolean test(final Object receiver, final String property, final Object[] args, final Object expectedValue) { if (expectedValue instanceof Boolean) { if (IS_WRAPTEXT_ENABLED.equals(property)) { boolean wrapTextFlag = Platform.getPreferencesService().getBoolean(Activator.PLUGIN_ID, WrapTextPreferencePage.ENABLE_WRAP_TEXT, true, null); return <START> expectedValue.equals(wrapTextFlag == true); <END> } else if (IS_AUTO_RESIZE_CELL_HEIGHT_ENABLED.equals(property)) { boolean autoResizeCellHeightFlag = Platform.getPreferencesService().getBoolean(Activator.PLUGIN_ID, WrapTextPreferencePage.ENABLE_AUTO_RESIZE_CELL_HEIGHT, true, null); return expectedValue.equals(autoResizeCellHeightFlag == true); } } return false; }</code><technical_language>'wrapTextFlag' is needed</technical_language>

Target:
public boolean test(final Object receiver, final String property, final Object[] args, final Object expectedValue) { if (expectedValue instanceof Boolean) { if (IS_WRAPTEXT_ENABLED.equals(property)) { boolean wrapTextFlag = Platform.getPreferencesService().getBoolean(Activator.PLUGIN_ID, WrapTextPreferencePage.ENABLE_WRAP_TEXT, true, null); return expectedValue.equals(wrapTextFlag); } else if (IS_AUTO_RESIZE_CELL_HEIGHT_ENABLED.equals(property)) { boolean autoResizeCellHeightFlag = Platform.getPreferencesService().getBoolean(Activator.PLUGIN_ID, WrapTextPreferencePage.ENABLE_AUTO_RESIZE_CELL_HEIGHT, true, null); return expectedValue.equals(autoResizeCellHeightFlag); } } return false; }
Source:
<code>public void onDraw(Canvas canvas) { <START> if (currentImage.get() != null) { <END> currentImage.get().onDraw(canvas); } }</code><technical_language>replaced currentImage.isPresent()</technical_language>

Target:
public void onDraw(Canvas canvas) { if (images.get(index) != null) { images.get(index).onDraw(canvas); } }
Source:
<code>public static void main(String[] args) { Map<String, Object> conf = ConfigUtils.readStormConfig(); try { Supervisor supervisor = new Supervisor(conf, null, new MesosSupervisor()); <START> supervisor.launch(); <END> } catch (Exception e) { String msg = String.format("main: Exception: %s", e.getMessage()); LOG.error(msg); e.printStackTrace(); } }</code><technical_language>another potential issue I noticed. code is invoked launchDaemon() method, launch() method: * <LINK_0> please try supervisor.launchDaemon() instead of supervisor.launch()</technical_language>

Target:
public static void main(String[] args) { Map<String, Object> conf = ConfigUtils.readStormConfig(); try { Supervisor supervisor = new Supervisor(conf, null, new MesosSupervisor()); Method m = Supervisor.class.getDeclaredMethod("launchDaemon"); m.setAccessible(true); m.invoke(supervisor); } catch (Exception e) { String msg = String.format("main: Exception: %s", e.getMessage()); LOG.error(msg); e.printStackTrace(); } }
Source:
<code>private Function<CircuitBreakerEvent, String> getCircuitBreakerEventStringFunction() { <START> ObjectMapper jsonMapper = new ObjectMapper(); <END> return cbEvent -> { try { return jsonMapper.writeValueAsString( CircuitBreakerEventDTOFactory.createCircuitBreakerEventDTO(cbEvent) ); } catch (JsonProcessingException e) { } return ""; }; }</code><technical_language>moved class member variable</technical_language>

Target:
private Function<CircuitBreakerEvent, String> getCircuitBreakerEventStringFunction() { return cbEvent -> { try { return jsonMapper.writeValueAsString( CircuitBreakerEventDTOFactory.createCircuitBreakerEventDTO(cbEvent) ); } catch (JsonProcessingException e) { } return ""; }; }
Source:
<code>protected <R extends HttpRequest> R createRequest(R fromRequest, String payload) { fromRequest.setPayload(payload); <START> fromRequest.getPayload().getContentMetadata().setContentType(MediaType.TEXT_XML); <END> return fromRequest; }</code><technical_language>good set content length here, if known</technical_language>

Target:
protected <R extends HttpRequest> R createRequest(R fromRequest, String payload) { MutableContentMetadata metadata = new BaseMutableContentMetadata(); metadata.setContentType(MediaType.TEXT_XML); metadata.setContentLength(Long.valueOf(payload.getBytes().length)); fromRequest.setPayload(payload); fromRequest.getPayload().setContentMetadata(metadata); return fromRequest; }
Source:
<code><START> public static OMElement convertToDocument(File file) throws DataSourceException { <END> try { OMElement documentElement = new StAXOMBuilder(new FileInputStream(file)).getDocumentElement(); return documentElement; } catch (Exception e) { throw new DataSourceException("Error in creating an XML document from file: " + e.getMessage(), e); } }</code><technical_language>API change, this major impact</technical_language>

Target:
public static Document convertToDocument(File file) throws DataSourceException { try { DocumentBuilder db = dbf.newDocumentBuilder(); return db.parse(file); } catch (Exception e) { throw new DataSourceException("Error in creating an XML document from file: " + e.getMessage(), e); } }
Source:
<code>protected boolean pastThreshold() { <START> return ((supplier.get().compareTo(threshold) >= 0) ^ invert); <END> }</code><technical_language>Do bitwise operators for logical operations. I recommend !=</technical_language>

Target:
protected boolean pastThreshold() { return ((supplier.get().compareTo(threshold) >= 0) != invert); }
Source:
<code><START> public Move<InvestmentSolution> next() { <END> long transferMillis = RandomUtils.nextLong(workingRandom, InvestmentNumericUtil.MAXIMUM_QUANTITY_MILLIS) + 1L; Map.Entry<Long, AssetClassAllocation> lowerEntry = quantityMillisIncrementToAllocationMap.lowerEntry(transferMillis); Map.Entry<Long, AssetClassAllocation> ceilingEntry = quantityMillisIncrementToAllocationMap .ceilingEntry(transferMillis); transferMillis -= (lowerEntry == null ? 0L : lowerEntry.getKey()); AssetClassAllocation fromAllocation = ceilingEntry.getValue(); AssetClassAllocation toAllocation = allocationList.get(workingRandom.nextInt(allocationList.size() - 1)); if (toAllocation == fromAllocation) { toAllocation = allocationList.get(allocationList.size() - 1); } return new InvestmentQuantityTransferMove(fromAllocation, toAllocation, transferMillis); }</code><technical_language>I this return InvestmentQuantityTransferMove instead of Move<InvestmentSolution></technical_language>

Target:
public InvestmentQuantityTransferMove next() { long transferMillis = RandomUtils.nextLong(workingRandom, InvestmentNumericUtil.MAXIMUM_QUANTITY_MILLIS) + 1L; Map.Entry<Long, AssetClassAllocation> lowerEntry = quantityMillisIncrementToAllocationMap.lowerEntry(transferMillis); Map.Entry<Long, AssetClassAllocation> ceilingEntry = quantityMillisIncrementToAllocationMap .ceilingEntry(transferMillis); transferMillis -= (lowerEntry == null ? 0L : lowerEntry.getKey()); AssetClassAllocation fromAllocation = ceilingEntry.getValue(); AssetClassAllocation toAllocation = allocationList.get(workingRandom.nextInt(allocationList.size() - 1)); if (toAllocation == fromAllocation) { toAllocation = allocationList.get(allocationList.size() - 1); } return new InvestmentQuantityTransferMove(fromAllocation, toAllocation, transferMillis); }
Source:
<code>private boolean updateFloppyListFromVDSM(Guid repoStoragePoolId, Guid repoStorageDomainId) { boolean refreshFloppySucceeded = false; if (repoStorageDomainId != null) { try { VDSReturnValue returnValue = Backend .getInstance() .getResourceManager() .RunVdsCommand(VDSCommandType.GetFloppyList, new IrsBaseVDSCommandParameters(repoStoragePoolId)); @SuppressWarnings("unchecked") <START> Map<String, Map<String, String>> isoDomainFloppyList = <END> (Map<String, Map<String, String>>) returnValue.getReturnValue(); if (returnValue.getSucceeded() && isoDomainFloppyList != null) { refreshFloppySucceeded = refreshIsoFileListMetaData(repoStorageDomainId, repoStorageDom, isoDomainFloppyList, ImageFileType.Floppy); } log.debugFormat("The refresh process from VDSM, for Floppy files succeeded."); } catch (Exception e) { refreshFloppySucceeded = false; log.warnFormat("The refresh process from VDSM, for Floppy files failed."); log.error(e); } } return refreshFloppySucceeded; }</code><technical_language>Rename floppyStats</technical_language>

Target:
private boolean updateFloppyListFromVDSM(Guid repoStoragePoolId, Guid repoStorageDomainId) { boolean refreshFloppySucceeded = false; if (repoStorageDomainId != null) { try { VDSReturnValue returnValue = Backend .getInstance() .getResourceManager() .RunVdsCommand(VDSCommandType.GetFloppyList, new IrsBaseVDSCommandParameters(repoStoragePoolId)); @SuppressWarnings("unchecked") Map<String, Map<String, String>> fileStats = (Map<String, Map<String, String>>) returnValue.getReturnValue(); if (returnValue.getSucceeded() && fileStats != null) { refreshFloppySucceeded = refreshIsoFileListMetaData(repoStorageDomainId, repoStorageDom, fileStats, ImageFileType.Floppy); } log.debugFormat("The refresh process from VDSM, for Floppy files succeeded."); } catch (Exception e) { refreshFloppySucceeded = false; log.warnFormat("The refresh process from VDSM, for Floppy files failed."); log.error(e); } } return refreshFloppySucceeded; }
Source:
<code>public final ReviewCategoryStrategy reviewCategoryStrategy() { String s = reviewCategeoryStrategyRaw(); return s != null ? ReviewCategoryStrategy.valueOf(s) : <START> null; <END> }</code><technical_language>this return ReviewCategoryStrategy.NONE? do ReviewCategoryStrategy.NONE if null means too</technical_language>

Target:
public final ReviewCategoryStrategy reviewCategoryStrategy() { String s = reviewCategeoryStrategyRaw(); return s != null ? ReviewCategoryStrategy.valueOf(s) : ReviewCategoryStrategy.NONE; }
Source:
<code>public void testGetRangeOfTimestampsReturnsAllRows() { keyValueService.put(TEST_TABLE, ImmutableMap.of( Cell.create(row0, column0), value0_t0, Cell.create(row1, column0), value0_t0, Cell.create(row2, column0), value0_t0), TEST_TIMESTAMP); RangeRequest range = RangeRequest.all().withBatchHint(1); List<RowResult<Set<Long>>> results = ImmutableList.copyOf( keyValueService.getRangeOfTimestamps(TEST_TABLE, range, TEST_TIMESTAMP + 1)); assertEquals(3, results.size()); assertTrue(Arrays.equals(row0, results.get(0).getRowName())); assertTrue(Arrays.equals(row1, results.get(1).getRowName())); <START> assertTrue(Arrays.equals(row2, results.get(2).getRowName())); <END> }</code><technical_language>For these, prefer assertArrayEquals(expected, actual) instead. get a more helpful assertion failure message if breaks here</technical_language>

Target:
public void testGetRangeOfTimestampsReturnsAllRows() { keyValueService.put(TEST_TABLE, ImmutableMap.of( Cell.create(row0, column0), value0_t0, Cell.create(row1, column0), value0_t0, Cell.create(row2, column0), value0_t0), TEST_TIMESTAMP); RangeRequest range = RangeRequest.all().withBatchHint(1); List<RowResult<Set<Long>>> results = ImmutableList.copyOf( keyValueService.getRangeOfTimestamps(TEST_TABLE, range, TEST_TIMESTAMP + 1)); assertEquals(3, results.size()); assertArrayEquals(row0, results.get(0).getRowName()); assertArrayEquals(row1, results.get(1).getRowName()); assertArrayEquals(row2, results.get(2).getRowName()); }
Source:
<code>private synchronized long getRtt() { <START> long rtt = mediaStream.getMediaStreamStats().getRttMs(); <END> return (rtt > 0 && rtt < 1000) ? rtt : 1000; }</code><technical_language>add some logging catch suspicious RTTs : rtt =< 0 || rtt >= 1000</technical_language>

Target:
private synchronized long getRtt() { long rtt = mediaStream.getMediaStreamStats().getRttMs(); if (rtt < 0 || rtt > 1000) { logger.warn("RTT not calculated, or has a suspiciously high value (" + rtt + "). Using the default of 100ms."); rtt = 100; } return rtt; }
Source:
<code>public static IFile findReferenceFile(ERepositoryObjectType type, Item item, String fileExtension) { IFolder folder = RepositoryResourceUtil.getFolder(type); String path = item.getState().getPath(); if (path != null && path.length() > 0) { folder = folder.getFolder(path); } Property property = item.getProperty(); String fileName = ResourceFilenameHelper.getExpectedFileName(property.getLabel(), property.getVersion()) + DOT + (fileExtension != null ? fileExtension : ""); if(type == IServerObjectRepositoryType.TYPE_WORKFLOW && exAdapter != null && fileExtension != null && fileExtension.equals("conf")) { <START> fileName = exAdapter.getWorkflowConfigFilename(item); <END> } IFile file = folder.getFile(fileName); return file; }</code><technical_language>"exAdapter.getWorkflowConfigFilename(item);" return null value, invoking "folder.getFile(fileName)" check first</technical_language>

Target:
public static IFile findReferenceFile(ERepositoryObjectType type, Item item, String fileExtension) { IFolder folder = RepositoryResourceUtil.getFolder(type); String path = item.getState().getPath(); if (path != null && path.length() > 0) { folder = folder.getFolder(path); } Property property = item.getProperty(); String fileName = ResourceFilenameHelper.getExpectedFileName(property.getLabel(), property.getVersion()) + DOT + (fileExtension != null ? fileExtension : ""); if(type == IServerObjectRepositoryType.TYPE_WORKFLOW && exAdapter != null && fileExtension != null && fileExtension.equals("conf")) { fileName = exAdapter.getWorkflowConfigFilename(item); } IFile file = fileName != null?folder.getFile(fileName):null; return file; }
Source:
<code>public void stopBlockingForTask(int id) { super.stopBlockingForTask(id); if (id == ProcessAndSendTask.SEND_PHASE_ID_NO_DIALOG || id == ProcessAndSendTask.PROCESSING_PHASE_ID_NO_DIALOG) { triggerSyncIconRefresh(TRIGGER_END_SEND_FORMS); <START> } else if (id == DataPullTask.DATA_PULL_TASK_ID) { <END> triggerSyncIconRefresh(TRIGGER_END_DATA_PULL); } }</code><technical_language>if else clauses result in behavior</technical_language>

Target:
public void stopBlockingForTask(int id) { super.stopBlockingForTask(id); if (id == ProcessAndSendTask.SEND_PHASE_ID_NO_DIALOG || id == ProcessAndSendTask.PROCESSING_PHASE_ID_NO_DIALOG || id == DataPullTask.DATA_PULL_TASK_ID) { triggerSyncIconRefresh(SyncIconTrigger.NO_ANIMATION); } }
Source:
<code>public ProxyControl() { setPort(DEFAULT_PORT); setExcludeList(new HashSet<>()); setIncludeList(new HashSet<>()); setCaptureHttpHeaders(true); iNumberingStartValue = HTTP_SAMPLER_NUMBERING_START_VALUE_DEFAULT; sNumberingFormat = JMeterUtils.getPropDefault("proxy.number.value_format", HTTP_SAMPLER_NUMBERING_INTEGER_FORMAT_DEFAULT); setHttpSamplerNumberingIntegerFormat(sNumberingFormat); sNumberingMode = JMeterUtils.getPropDefault("proxy.number.mode", HTTP_SAMPLER_NUMBERING_MODE_DEFAULT); if (HttpSamplerNumberingMode.PREFIX.getStringMode().equals(sNumberingMode)) { setHttpSampleNumberingMode(HttpSamplerNumberingMode.PREFIX.getIntValue()); } <START> if (HttpSamplerNumberingMode.SUFFIX.getStringMode().equals(sNumberingMode)) { <END> setHttpSampleNumberingMode(HttpSamplerNumberingMode.SUFFIX.getIntValue()); } boolean bWihtNumber = JMeterUtils.getPropDefault("proxy.number.requests", true); if (!bWihtNumber) { setHttpSampleNumberingMode(HttpSamplerNumberingMode.NO_NUMBER.getIntValue()); } }</code><technical_language>else if</technical_language>

Target:
public ProxyControl() { setPort(DEFAULT_PORT); setExcludeList(new HashSet<>()); setIncludeList(new HashSet<>()); setCaptureHttpHeaders(true); iNumberingStartValue = HTTP_SAMPLER_NUMBERING_START_VALUE_DEFAULT; sNumberingFormat = JMeterUtils.getPropDefault("proxy.number.value_format", HTTP_SAMPLER_NUMBERING_INTEGER_FORMAT_DEFAULT); setHttpSamplerNumberingIntegerFormat(sNumberingFormat); sNumberingMode = JMeterUtils.getPropDefault("proxy.number.mode", HTTP_SAMPLER_NUMBERING_MODE_DEFAULT); if (HttpSamplerNumberingMode.PREFIX.getStringMode().equals(sNumberingMode)) { setHttpSampleNumberingMode(HttpSamplerNumberingMode.PREFIX.getIntValue()); } else if (HttpSamplerNumberingMode.SUFFIX.getStringMode().equals(sNumberingMode)) { setHttpSampleNumberingMode(HttpSamplerNumberingMode.SUFFIX.getIntValue()); } boolean bWihtNumber = JMeterUtils.getPropDefault("proxy.number.requests", true); if (!bWihtNumber) { setHttpSampleNumberingMode(HttpSamplerNumberingMode.NO_NUMBER.getIntValue()); } }
Source:
<code>public void waitForAttribute() throws Exception { iface.go("file://"+ System.getProperty("user.dir")+"/resources/html/test/blinking.html"); WebDriverElement text = iface.getWebDriverElement(new Hook(Strategy.ID, "p1")); text.click(); Assert.assertTrue(iface.getPause().waitForAttribute(new Hook(Strategy.ID, "p1"), "class", "hidden", true, 10) != null); Assert.assertTrue(iface.getPause().waitForAttribute(new Hook(Strategy.ID, "p1"), "class", "hidden", false, 10) != null); Assert.assertTrue(iface.getPause().waitForAttribute(new Hook(Strategy.ID, "p1"), "class", "normal", false, 10) != null); <START> Assert.assertTrue(iface.getPause().waitForAttribute(new Hook(Strategy.ID, "p1"), "class", "normal", false, 10) != null); <END> }</code><technical_language>lines in a row identical -- is this intentional, passing true</technical_language>

Target:
public void waitForAttribute() throws Exception { iface.go("file://"+ System.getProperty("user.dir")+"/resources/html/test/blinking.html"); WebDriverElement text = iface.getWebDriverElement(new Hook(Strategy.ID, "p1")); text.click(); Assert.assertTrue(iface.getPause().waitForAttribute(new Hook(Strategy.ID, "p1"), "class", "hidden", true, 10) != null); Assert.assertTrue(iface.getPause().waitForAttribute(new Hook(Strategy.ID, "p1"), "class", "hidden", false, 10) != null); Assert.assertTrue(iface.getPause().waitForAttribute(new Hook(Strategy.ID, "p1"), "class", "normal", false, 10) != null); Assert.assertTrue(iface.getPause().waitForAttribute(new Hook(Strategy.ID, "p1"), "class", "normal", true, 10) != null); }
Source:
<code>private final void initializeTemplate(MrrtReportTemplate template, Document doc) throws ParseException { final Elements metaTags = doc.getElementsByTag("meta"); template.setPath(doc.baseUri()); template.setCharset(metaTags.attr("charset")); for (Element metaTag : metaTags) { final String name = metaTag.attr("name"); final String content = metaTag.attr("content"); switch (name) { case DCTERMS_TITLE: template.setDcTermsTitle(content); break; case DCTERMS_DESCRIPTION: template.setDcTermsDescription(content); break; case DCTERMS_IDENTIFIER: template.setDcTermsIdentifier(content); break; case DCTERMS_TYPE: template.setDcTermsType(content); break; case DCTERMS_LANGUAGE: template.setDcTermsLanguage(content); break; case DCTERMS_PUBLISHER: template.setDcTermsPublisher(content); break; case DCTERMS_RIGHTS: template.setDcTermsRights(content); break; case DCTERMS_LICENSE: template.setDcTermsLicense(content); break; case DCTERMS_DATE: <START> template.setDcTermsDate(new SimpleDateFormat(MrrtReportTemplateConstants.DATE_FORMAT).parse(content)); <END> break; case DCTERMS_CREATOR: template.setDcTermsCreator(content); break; default: log.debug("Unhandled meta tag " + name); } } }</code><technical_language>extract new SimpleDateFormat(MrrtReportTemplateConstants.DATE_FORMAT).parse(content) a private method easier read. For example parseDcTermsDate(String content)</technical_language>

Target:
private final void initializeTemplate(MrrtReportTemplate template, Document doc) throws ParseException { final Elements metaTags = doc.getElementsByTag("meta"); template.setPath(doc.baseUri()); template.setCharset(metaTags.attr("charset")); for (Element metaTag : metaTags) { final String name = metaTag.attr("name"); final String content = metaTag.attr("content"); switch (name) { case DCTERMS_TITLE: template.setDcTermsTitle(content); break; case DCTERMS_DESCRIPTION: template.setDcTermsDescription(content); break; case DCTERMS_IDENTIFIER: template.setDcTermsIdentifier(content); break; case DCTERMS_TYPE: template.setDcTermsType(content); break; case DCTERMS_LANGUAGE: template.setDcTermsLanguage(content); break; case DCTERMS_PUBLISHER: template.setDcTermsPublisher(content); break; case DCTERMS_RIGHTS: template.setDcTermsRights(content); break; case DCTERMS_LICENSE: template.setDcTermsLicense(content); break; case DCTERMS_DATE: parseDcTermsDate(template, content); break; case DCTERMS_CREATOR: template.setDcTermsCreator(content); break; default: log.debug("Unhandled meta tag " + name); } } }
Source:
<code>public boolean equals(final Object o) { if (this == o) { return true; } else if (o == null || getClass() != o.getClass()) { return false; } final RankedClient other = (RankedClient) o; <START> return clientId == other.clientId() && rank == other.rank(); <END> }</code><technical_language>I understand warning this, clientId .equals instead of ==</technical_language>

Target:
public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final RankedClient<?> that = (RankedClient<?>) o; return rank == that.rank && Objects.equals(clientId, that.clientId); }
Source:
<code>public void ratioTest() throws Exception { String[] statNames = {"Cache:HitRatio", "Clustered:HitRatio", "Cache:MissRatio", "Clustered:MissRatio"}; sendManagementCallToCollectStats(statNames); <START> Thread.sleep(3000); <END> Cache<String, String> cache = cacheManager.getCache("dedicated-cache-1", String.class, String.class); cache.put("one", "val1"); cache.put("two", "val2"); cache.get("one"); cache.get("two"); cache.get("three"); cache.get("four"); Double[] ratios = new Double[statNames.length]; do { List<ContextualStatistics> stats = waitForNextStats() .stream() .filter(statistics -> "dedicated-cache-1".equals(statistics.getContext().get("cacheName"))) .collect(Collectors.toList()); for (ContextualStatistics stat : stats) { for (int i = 0; i < statNames.length; i++) { String statName = statNames[i]; Sample<Double>[] samples = stat.getStatistic(RatioHistory.class, statName).getValue(); ratios[i] = samples.length > 0 ? samples[samples.length - 1].getValue() : 0d; } } } while (!Thread.currentThread().isInterrupted() && !Arrays.equals(ratios, new Double[]{.5d, .5d, .5d, .5d})); assertThat(ratios, is(array(equalTo(.5d), equalTo(.5d), equalTo(.5d), equalTo(.5d)))); }</code><technical_language>do need 3s? 1.1s enough</technical_language>

Target:
public void ratioTest() throws Exception { String[] statNames = {"Cache:HitRatio", "Clustered:HitRatio", "Cache:MissRatio", "Clustered:MissRatio"}; sendManagementCallToCollectStats(statNames); Thread.sleep(25000); Cache<String, String> cache = cacheManager.getCache("dedicated-cache-1", String.class, String.class); cache.put("one", "val1"); cache.put("two", "val2"); cache.get("one"); cache.get("two"); cache.get("three"); cache.get("four"); Double[] ratios = new Double[statNames.length]; do { List<ContextualStatistics> stats = waitForNextStats() .stream() .filter(statistics -> "dedicated-cache-1".equals(statistics.getContext().get("cacheName"))) .collect(Collectors.toList()); for (ContextualStatistics stat : stats) { for (int i = 0; i < statNames.length; i++) { String statName = statNames[i]; Sample<Double>[] samples = stat.getStatistic(RatioHistory.class, statName).getValue(); ratios[i] = samples.length > 0 ? samples[samples.length - 1].getValue() : 0d; } } } while (!Thread.currentThread().isInterrupted() && !Arrays.equals(ratios, new Double[]{.5d, .5d, .5d, .5d})); assertThat(ratios, is(array(equalTo(.5d), equalTo(.5d), equalTo(.5d), equalTo(.5d)))); }
Source:
<code>public InputStream getStream() throws IOException { try { URI uri = new URI(encodeUriParts(getSourcePath())); if (channel == null || channel.isClosed()) { channel = getSessionForHost(uri).openChannel("sftp"); channel.connect(); } ChannelSftp sftpChannel = (ChannelSftp) channel; currentStream = sftpChannel.get(decodeUriParts(uri.getRawPath())); return currentStream; } catch (URISyntaxException ex) { throw new IOException("Bad URI format", ex); <START> } catch (JSchException ex) { <END> throw new IOException("Error with connection", ex); } catch (SftpException ex) { throw new IOException("Error retrieving file", ex); } }</code><technical_language>log this properly too, I think. Errors in this class bubble inspected easily</technical_language>

Target:
public InputStream getStream() throws IOException { try { URI uri = new URI(encodeUriParts(getSourcePath())); if (channel == null || channel.isClosed()) { channel = getSessionForHost(uri).openChannel("sftp"); channel.connect(); } ChannelSftp sftpChannel = (ChannelSftp) channel; currentStream = sftpChannel.get(decodeUriParts(uri.getRawPath())); return currentStream; } catch (URISyntaxException ex) { String msg = String.format("Bad URI format for %s", getSourcePath()); LOG.error(msg,ex); throw new IOException(msg,ex); } catch (JSchException ex) { LOG.error("Error with connection",ex); throw new IOException("Error with connection", ex); } catch (SftpException ex) { LOG.error("Error while retrieving file",ex); throw new IOException("Error retrieving file", ex); } }
Source:
<code>public void emit(Event event) { if (event instanceof ServiceMetricEvent) { ServiceMetricEvent metricEvent = (ServiceMetricEvent) event; try { eventsQueue.put(metricEvent); } catch (InterruptedException exception) { <START> log.error(exception.toString()); <END> Thread.currentThread().interrupt(); } } }</code><technical_language>this swallow stacktrace. suggestion log.error(exception, "Failed add metricEvent events queue.");</technical_language>

Target:
public void emit(Event event) { if (event instanceof ServiceMetricEvent) { ServiceMetricEvent metricEvent = (ServiceMetricEvent) event; try { eventsQueue.put(metricEvent); } catch (InterruptedException exception) { log.error(exception, "Failed to add metricEvent to events queue."); Thread.currentThread().interrupt(); } } }
Source:
<code><START> private static Map<String, String> retrieveComponentProperties(String componentId, Map<String, String> componentProperties) { <END> String prefix = getComponentPrefix(componentId); return componentProperties.entrySet() .stream().filter(e -> e.getKey().startsWith(prefix)) .collect(toMap(e -> removeComponentPrefix(componentId, e.getKey()), Map.Entry::getValue)); }</code><technical_language>I get reason static methods (and below)</technical_language>

Target:
private Map<String, String> retrieveComponentProperties(String componentId, Map<String, String> componentProperties) { String prefix = getComponentPrefix(componentId); return componentProperties.entrySet() .stream().filter(e -> e.getKey().startsWith(prefix)) .collect(toMap(e -> removeComponentPrefix(componentId, e.getKey()), Map.Entry::getValue)); }
Source:
<code>public static String linkify(String url, boolean newTab) { if (isHttpUri(url)) { try { URL old = new URL(url); URI constructed = new URI(old.getProtocol(), old.getUserInfo(), old.getHost(), old.getPort(), old.getPath(), old.getQuery(), old.getRef()); return String.format("<a href=\"%s\"%s title=\"Link to %s\">%s</a>", constructed.toString(), newTab ? " target=\"_blank\"" : "", <START> Util.encode(url), <END> Util.htmlize(url) ); } catch (MalformedURLException | URISyntaxException ex) { return url; } } return url; }</code><technical_language>while it, encode() Appandable htmlize() appends converted char</technical_language>

Target:
public static String linkify(String url, boolean newTab) { if (isHttpUri(url)) { try { return String.format("<a href=\"%s\"%s title=\"Link to %s\">%s</a>", Util.encodeURL(url), newTab ? " target=\"_blank\"" : "", Util.encode(url), Util.htmlize(url) ); } catch (MalformedURLException | URISyntaxException ex) { return url; } } return url; }
Source:
<code>private void addServlet(HelixRestNamespace namespace, ServletType servletType) { String resourceConfigMapKey = String.format("%s_%s", servletType.name(), namespace.getName()); if (_resourceConfigMap.containsKey(resourceConfigMapKey)) { throw new IllegalArgumentException( String.format("Duplicated namespace name \"%s\"", namespace.getName())); } ResourceConfig config = getResourceConfig(namespace, servletType); _resourceConfigMap.put(resourceConfigMapKey, config); String path = servletType.getServletPath(namespace); LOG.info("Initializing Servlet on path: " + path); <START> System.out.println("Initializing Servlet on path: " + path); <END> _servletContextHandler.addServlet(new ServletHolder(new ServletContainer(config)), path); }</code><technical_language>Remove this</technical_language>

Target:
private void addServlet(HelixRestNamespace namespace, ServletType servletType) { String resourceConfigMapKey = String.format("%s_%s", servletType.name(), namespace.getName()); if (_resourceConfigMap.containsKey(resourceConfigMapKey)) { throw new IllegalArgumentException( String.format("Duplicated namespace name \"%s\"", namespace.getName())); } ResourceConfig config = getResourceConfig(namespace, servletType); _resourceConfigMap.put(resourceConfigMapKey, config); String path = servletType.getServletPath(namespace); LOG.info("Initializing Servlet on path: " + path); _servletContextHandler.addServlet(new ServletHolder(new ServletContainer(config)), path); }
Source:
<code>public AggregateSnapshotter(EventStore eventStore, List<AggregateFactory<?>> aggregateFactories, ParameterResolverFactory parameterResolverFactory) { this(eventStore, aggregateFactories, parameterResolverFactory, <START> new ClasspathHandlerDefinition(Thread.currentThread().getContextClassLoader())); <END> }</code><technical_language>Instead of context class loader, class loader of aggregate factory provided</technical_language>

Target:
public AggregateSnapshotter(EventStore eventStore, List<AggregateFactory<?>> aggregateFactories, ParameterResolverFactory parameterResolverFactory) { this(eventStore, aggregateFactories, parameterResolverFactory, ClasspathHandlerDefinition.forClassLoader( aggregateFactories.isEmpty() ? Thread.currentThread().getContextClassLoader() : aggregateFactories.get(0).getClass().getClassLoader()), null); }
Source:
<code>public GetDataSystemIdentifierDto(final int id, final String systemType, final List<MeasurementDto> measurements, final List<ProfileDto> profiles) { super(id, systemType); <START> this.measurements = measurements; <END> this.profiles = profiles; }</code><technical_language>implementation of getMeasurements() list is exposed unmodifiable list. code invoking constructor a modifiable reference measurements. Creating a new list measurement values provided prevent this</technical_language>

Target:
public GetDataSystemIdentifierDto(final int id, final String systemType, final List<MeasurementDto> measurements, final List<ProfileDto> profiles) { super(id, systemType); this.measurements = new ArrayList<>(measurements); this.profiles = new ArrayList<>(profiles); }
Source:
<code>public PostAggregator toPostAggregator( PlannerContext plannerContext, RowSignature rowSignature, RexNode rexNode, PostAggregatorVisitor postAggregatorVisitor ) { final List<RexNode> operands = ((RexCall) rexNode).getOperands(); final List<PostAggregator> inputPostAggs = new ArrayList<>(); Integer size = null; int operandCounter = 0; for (RexNode operand : operands) { final PostAggregator convertedPostAgg = OperatorConversions.toPostAggregator( plannerContext, rowSignature, operand, postAggregatorVisitor ); if (convertedPostAgg == null) { if (operandCounter == 0) { try { <START> size = RexLiteral.intValue(operand); <END> } catch (RuntimeException re) { return null; } } else { return null; } } else { inputPostAggs.add(convertedPostAgg); operandCounter++; } } return new SketchSetPostAggregator( postAggregatorVisitor.getOutputNamePrefix() + postAggregatorVisitor.getAndIncrementCounter(), getSetOperationName(), size, inputPostAggs ); }</code><technical_language>for literal check exception handling</technical_language>

Target:
public PostAggregator toPostAggregator( PlannerContext plannerContext, RowSignature rowSignature, RexNode rexNode, PostAggregatorVisitor postAggregatorVisitor ) { final List<RexNode> operands = ((RexCall) rexNode).getOperands(); final List<PostAggregator> inputPostAggs = new ArrayList<>(); Integer size = null; int operandCounter = 0; for (RexNode operand : operands) { final PostAggregator convertedPostAgg = OperatorConversions.toPostAggregator( plannerContext, rowSignature, operand, postAggregatorVisitor ); if (convertedPostAgg == null) { if (operandCounter == 0) { try { if (!operand.isA(SqlKind.LITERAL)) { return null; } size = RexLiteral.intValue(operand); } catch (ClassCastException cce) { return null; } } else { return null; } } else { inputPostAggs.add(convertedPostAgg); operandCounter++; } } return new SketchSetPostAggregator( postAggregatorVisitor.getOutputNamePrefix() + postAggregatorVisitor.getAndIncrementCounter(), getSetOperationName(), size, inputPostAggs ); }
Source:
<code>protected Object[][] retrieveStatsRows(boolean interval) { Iterator<Object> i = getStatsRowKeyIterator(interval); ArrayList<Object[]> rows = new ArrayList<Object[]>(); while (i.hasNext()) { Object rowKey = i.next(); Object rowValues[] = new Object[columns.size()]; updateStatsRow(rowKey, rowValues); rows.add(rowValues); } <START> return rows.toArray(new Object[0][]); <END> }</code><technical_language>This more efficient rows.toArray(new Object[rows.size()][] list allocate a new array populate</technical_language>

Target:
protected Object[][] retrieveStatsRows(boolean interval) { Iterator<Object> i = getStatsRowKeyIterator(interval); ArrayList<Object[]> rows = new ArrayList<Object[]>(); while (i.hasNext()) { Object rowKey = i.next(); Object rowValues[] = new Object[columns.size()]; updateStatsRow(rowKey, rowValues); rows.add(rowValues); } return rows.toArray(new Object[rows.size()][]); }
Source:
<code>public static ServerRequest groupUpdateVisibilityRequest(Id sender, Id groupId, Group.GroupVisibility newVisibility) { Objects.requireNonNull(sender); Objects.requireNonNull(groupId); Objects.requireNonNull(newVisibility); RequestBuilder builder = new RequestBuilder(ServiceRequest.RequestKind <START> .GROUPUPDATEVISIBILITY, sender); <END> builder.addField(Fields.GID, groupId); builder.addField(Fields.VISIBILITY, newVisibility); return builder.request(); }</code><technical_language>replace GROUPUPDATEVISIBILITY GROUP_UPDATE_VISIBILITY, other request kinds</technical_language>

Target:
public static ServerRequest groupUpdateVisibilityRequest(Id sender, Id groupId, Group.GroupVisibility newVisibility) { Objects.requireNonNull(sender); Objects.requireNonNull(groupId); Objects.requireNonNull(newVisibility); RequestBuilder builder = new RequestBuilder(ServiceRequest.RequestKind .GROUP_UPDATE_VISIBILITY, sender); builder.addField(Fields.GID, groupId); builder.addField(Fields.VISIBILITY, newVisibility); return builder.request(); }
Source:
<code>private URL buildURL(URL serverUrl, String path, Map<String, Object> queryParameters, XWikiContext context) { try { URIBuilder uriBuilder = new URIBuilder(serverUrl.toURI()).setPath(path); for (Map.Entry<String, Object> queryParameter : queryParameters.entrySet()) { String key = queryParameter.getKey(); Object paramValue = queryParameter.getValue(); if (paramValue instanceof String) { uriBuilder.addParameter(key, (String) paramValue); <START> } else if (paramValue instanceof String[]) { <END> for (String paramValueElement : (String[]) paramValue) { uriBuilder.addParameter(key, paramValueElement); } } else if (paramValue instanceof Collection) { for (Object paramValueElement : (Collection) paramValue) { uriBuilder.addParameter(key, paramValueElement.toString()); } } else { uriBuilder.addParameter(key, paramValue.toString()); } } return normalizeURL(uriBuilder.build().toURL(), context); } catch (MalformedURLException | URISyntaxException e) { return null; } }</code><technical_language>I supported array good enough String[]</technical_language>

Target:
private URL buildURL(URL serverUrl, String path, Map<String, Object> queryParameters, XWikiContext context) { try { URL resultUrl = new URL(serverUrl, path); if (!queryParameters.isEmpty()) { StringBuilder stringBuilder = new StringBuilder(resultUrl.toExternalForm()); stringBuilder.append('?'); int parametersSize = queryParameters.size(); int currentIndex = 0; for (Map.Entry<String, Object> queryParameter : queryParameters.entrySet()) { String key = queryParameter.getKey(); Object paramValue = queryParameter.getValue(); appendQueryParameter(key, paramValue, stringBuilder); if (currentIndex < parametersSize - 1) { stringBuilder.append("&"); } currentIndex++; } resultUrl = new URL(stringBuilder.toString()); } return normalizeURL(resultUrl, context); } catch (MalformedURLException|UnsupportedEncodingException e) { return null; } }
Source:
<code>public void testSanitiseReplicationFactorPassesForTheKeyspace() { clientPool.run(client -> { try { CassandraVerifier.currentRfOnKeyspaceMatchesDesiredRf(client, CassandraContainer.KVS_CONFIG, false); } catch (TException e) { <START> fail(); <END> } return false; }); }</code><technical_language>a failure message (and below) - enough test is failing test code</technical_language>

Target:
public void testSanitiseReplicationFactorPassesForTheKeyspace() { clientPool.run(client -> { try { CassandraVerifier.currentRfOnKeyspaceMatchesDesiredRf(client, CassandraContainer.KVS_CONFIG, false); } catch (TException e) { fail("currentRf On Keyspace does not Match DesiredRf"); } return false; }); }
Source:
<code>public void writeTo(StreamOutput out) throws IOException { out.writeBoolean(enabled); out.writeOptionalString(terms); <START> if (out.getVersion().onOrAfter(Version.V_7_9_0)) { <END> out.writeBoolean(annotationsEnabled); } }</code><technical_language>above, delete this line</technical_language>

Target:
public void writeTo(StreamOutput out) throws IOException { out.writeBoolean(enabled); out.writeOptionalString(terms); out.writeBoolean(annotationsEnabled); }
Source:
<code>public <T> CompletionStage<T> invokeCommand(Address target, ReplicableCommand command, ResponseCollector<T> collector, DeliverOrder deliverOrder, long timeout, TimeUnit unit) { if (target.equals(address) && deliverOrder != DeliverOrder.TOTAL) { return CompletableFuture.completedFuture(collector.finish()); } long requestId = requests.newRequestId(); logRequest(requestId, command, target); SingleTargetRequest<T> request = new SingleTargetRequest<>(collector, requestId, requests, target); addRequest(request); <START> boolean checkView = request.onNewView(clusterView.getMembersSet()); <END> sendCommand(target, command, requestId, deliverOrder, isRsvpCommand(command), true, checkView); if (timeout > 0) { request.setTimeout(timeoutExecutor, timeout, unit); } return request; }</code><technical_language>For single target requests, able bypass invoking sendCommand? if (!request.onNewView(clusterView.getMembersSet()) { sendCommand(...); }</technical_language>

Target:
public <T> CompletionStage<T> invokeCommand(Address target, ReplicableCommand command, ResponseCollector<T> collector, DeliverOrder deliverOrder, long timeout, TimeUnit unit) { if (target.equals(address) && deliverOrder != DeliverOrder.TOTAL) { return CompletableFuture.completedFuture(collector.finish()); } long requestId = requests.newRequestId(); logRequest(requestId, command, target); SingleTargetRequest<T> request = new SingleTargetRequest<>(collector, requestId, requests, target); addRequest(request); boolean invalidTarget = request.onNewView(clusterView.getMembersSet()); if (!invalidTarget) { sendCommand(target, command, requestId, deliverOrder, isRsvpCommand(command), true, false); } if (timeout > 0) { request.setTimeout(timeoutExecutor, timeout, unit); } return request; }