auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>void executeSearch() { <START> Collection<Persona> results = Collections.EMPTY_LIST; <END> try { results = Persona.getPersonaByName(searchField.getText()); } catch (CentralRepoException ex) { Exceptions.printStackTrace(ex); } updateResultsTable(results); }</code><technical_language>this method private</technical_language>

Target:
private void executeSearch() { Collection<Persona> results = Collections.EMPTY_LIST; try { results = Persona.getPersonaByName(searchField.getText()); } catch (CentralRepoException ex) { Exceptions.printStackTrace(ex); } updateResultsTable(results); }
Source:
<code>protected ViewModel doGet(HttpServletRequest request, HttpServletResponse response) throws Exception { if (isJsonPreferred(request, response)) { <START> response.setStatus(405); <END> return new DefaultViewModel("stormpathJsonView", Collections.EMPTY_MAP); } return super.doGet(request, response); }</code><technical_language>HttpServletResponse.SC_METHOD_NOT_ALLOWED instead of hardcoding 405 please</technical_language>

Target:
protected ViewModel doGet(HttpServletRequest request, HttpServletResponse response) throws Exception { if (isJsonPreferred(request, response)) { response.setStatus(HttpServletResponse.SC_METHOD_NOT_ALLOWED); return new DefaultViewModel("stormpathJsonView", Collections.EMPTY_MAP); } return super.doGet(request, response); }
Source:
<code>public void handleSessionEstablishmentError(Throwable error) throws Exception { LOG.info("=================================================handleSessionEstablishmentError received for processor=" + processorId, error); <START> stop(); <END> }</code><technical_language>curious.. stopping debounceTimer(other resources) zkController here. new session establishment, zkController is registered. DebounceTimer(executorService), others reinstantiated right</technical_language>

Target:
public void handleSessionEstablishmentError(Throwable error) throws Exception { LOG.info("handleSessionEstablishmentError received for processor=" + processorId, error); stop(); }
Source:
<code>public static String abbreviate(final String str, final String abbrevMarker, int offset, final int maxWidth) { if (isEmpty(str) && isEmpty(abbrevMarker)) { return str; <START> } else if (isNotEmpty(str) && "".equals(abbrevMarker) && maxWidth>0) { <END> return str.substring(0, maxWidth); } else if (isEmpty(str) || isEmpty(abbrevMarker)) { return str; } final int abbrevMarkerLength = abbrevMarker.length(); final int minAbbrevWidth = abbrevMarkerLength + 1; final int minAbbrevWidthOffset = abbrevMarkerLength + abbrevMarkerLength + 1; if (maxWidth < minAbbrevWidth) { throw new IllegalArgumentException(String.format("Minimum abbreviation width is %d", minAbbrevWidth)); } if (str.length() <= maxWidth) { return str; } if (offset > str.length()) { offset = str.length(); } if (str.length() - offset < maxWidth - abbrevMarkerLength) { offset = str.length() - (maxWidth - abbrevMarkerLength); } if (offset <= abbrevMarkerLength+1) { return str.substring(0, maxWidth - abbrevMarkerLength) + abbrevMarker; } if (maxWidth < minAbbrevWidthOffset) { throw new IllegalArgumentException(String.format("Minimum abbreviation width with offset is %d", minAbbrevWidthOffset)); } if (offset + maxWidth - abbrevMarkerLength < str.length()) { return abbrevMarker + abbreviate(str.substring(offset), abbrevMarker, maxWidth - abbrevMarkerLength); } return abbrevMarker + str.substring(str.length() - (maxWidth - abbrevMarkerLength)); }</code><technical_language>magic strings, this class defines EMPTY for this purpose. missing spaces ></technical_language>

Target:
public static String abbreviate(final String str, final String abbrevMarker, int offset, final int maxWidth) { if (isEmpty(str) && isEmpty(abbrevMarker)) { return str; } else if (isNotEmpty(str) && EMPTY.equals(abbrevMarker) && maxWidth > 0) { return str.substring(0, maxWidth); } else if (isEmpty(str) || isEmpty(abbrevMarker)) { return str; } final int abbrevMarkerLength = abbrevMarker.length(); final int minAbbrevWidth = abbrevMarkerLength + 1; final int minAbbrevWidthOffset = abbrevMarkerLength + abbrevMarkerLength + 1; if (maxWidth < minAbbrevWidth) { throw new IllegalArgumentException(String.format("Minimum abbreviation width is %d", minAbbrevWidth)); } if (str.length() <= maxWidth) { return str; } if (offset > str.length()) { offset = str.length(); } if (str.length() - offset < maxWidth - abbrevMarkerLength) { offset = str.length() - (maxWidth - abbrevMarkerLength); } if (offset <= abbrevMarkerLength+1) { return str.substring(0, maxWidth - abbrevMarkerLength) + abbrevMarker; } if (maxWidth < minAbbrevWidthOffset) { throw new IllegalArgumentException(String.format("Minimum abbreviation width with offset is %d", minAbbrevWidthOffset)); } if (offset + maxWidth - abbrevMarkerLength < str.length()) { return abbrevMarker + abbreviate(str.substring(offset), abbrevMarker, maxWidth - abbrevMarkerLength); } return abbrevMarker + str.substring(str.length() - (maxWidth - abbrevMarkerLength)); }
Source:
<code>private void createPresenterView() { RenderedTemplate renderedTemplate = null; <START> if (presenterConfigModel.getNestedPresenter()) { <END> renderedTemplate = createdNestedPresenterTemplates.getView(); } else if (presenterConfigModel.getPresenterWidget()) { renderedTemplate = createdPresenterWidgetTemplates.getView(); } else if (presenterConfigModel.getPopupPresenter()) { renderedTemplate = createdPopupPresenterTemplates.getView(); } PsiClass createdPsiClass = createPsiClass(createdPresenterPackage, renderedTemplate); createdPsiClass.navigate(true); }</code><technical_language>extract</technical_language>

Target:
private void createPresenterView() { RenderedTemplate renderedTemplate = null; if (presenterConfigModel.getNestedPresenter()) { renderedTemplate = createdNestedPresenterTemplates.getView(); } else if (presenterConfigModel.getPresenterWidget()) { renderedTemplate = createdPresenterWidgetTemplates.getView(); } else if (presenterConfigModel.getPopupPresenter()) { renderedTemplate = createdPopupPresenterTemplates.getView(); } PsiClass createdPsiClass = createPsiClass(createdPresenterPackage, renderedTemplate); navigateToClass(createdPsiClass); }
Source:
<code>private void startDownloading(Uri downloadUri, String downloadName) { File file = new File(Environment.getExternalStorageDirectory()+"/"+Environment.DIRECTORY_DOWNLOADS+"/"+downloadName); <START> if(file.exists()); <END> file.delete(); DownloadManager.Request downloadRequest = new DownloadManager.Request(downloadUri) .setDestinationInExternalFilesDir(context, Environment.DIRECTORY_DOWNLOADS, downloadName) .setVisibleInDownloadsUi(false) .setNotificationVisibility(DownloadManager.Request.VISIBILITY_HIDDEN); this.downloadId = getDownloadManager(context).enqueue(downloadRequest); }</code><technical_language>This is empty if statement. is difference if condition is true false, line this called whatsoever. Note ; put end of if statement</technical_language>

Target:
private void startDownloading(Uri downloadUri, String downloadName) { File file = new File(context.getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS)+"/"+downloadName); if(file.exists()) file.delete(); DownloadManager.Request downloadRequest = new DownloadManager.Request(downloadUri) .setDestinationInExternalFilesDir(context, Environment.DIRECTORY_DOWNLOADS, downloadName) .setVisibleInDownloadsUi(false) .setNotificationVisibility(DownloadManager.Request.VISIBILITY_HIDDEN); this.downloadId = getDownloadManager(context).enqueue(downloadRequest); }
Source:
<code>public void testIterationStateReaperOnClosedConnections() throws InterruptedException { IterationManager iterationManager = server().getIterationManager(); for (int i = 0; i < 10; i++) { hotRodClient.iteratorStart(null, null, null, 10, false); <START> } <END> hotRodClient.stop().await(); assertEquals(0, iterationManager.activeIterations()); }</code><technical_language>Thinking verify 10 active iterations stopping client. reaper timeout below</technical_language>

Target:
public void testIterationStateReaperOnClosedConnections() throws InterruptedException { IterationManager iterationManager = server().getIterationManager(); for (int i = 0; i < 10; i++) { hotRodClient.iteratorStart(null, null, null, 10, false); } assertEquals(10, iterationManager.activeIterations()); hotRodClient.stop().await(); assertEquals(0, iterationManager.activeIterations()); }
Source:
<code><START> default Map<Long, LearnedAndAcceptedValue> getConsolidatedLocalAndRemoteRecord( <END> NamespaceAndUseCase namespaceAndUseCase) { if (!history().containsKey(namespaceAndUseCase)) { return ImmutableMap.of(); } LearnerAndAcceptorRecords records = history().get(namespaceAndUseCase); long minSeq = records.getMinSequence(); long maxSeq = records.getMaxSequence(); return LongStream.rangeClosed(minSeq, maxSeq).boxed().collect( Collectors.toMap(Function.identity(), seq -> getLearnedAndAcceptedValues(records, seq))); }</code><technical_language>If this model, worth some kind of caching. wondering if a derived lazy Map<NamespaceAndUseCase, Map<Long, LearnedAndAcceptedValue> is a good idea,</technical_language>

Target:
default ConsolidatedLearnerAndAcceptorRecord getConsolidatedLocalAndRemoteRecord( NamespaceAndUseCase namespaceAndUseCase) { if (!history().containsKey(namespaceAndUseCase)) { return ImmutableConsolidatedLearnerAndAcceptorRecord.of(ImmutableMap.of()); } LearnerAndAcceptorRecords records = history().get(namespaceAndUseCase); long minSeq = records.getMinSequence(); long maxSeq = records.getMaxSequence(); return ImmutableConsolidatedLearnerAndAcceptorRecord.of( consolidateRecordsForSequenceRange(records, minSeq, maxSeq)); }
Source:
<code>public Iterator<String> getResponseHeaders(String name) throws IOException { <START> Map<String, List<String>> mapHeader = connection.getHeaderFields(); <END> List<String> listHeaderValues = mapHeader.get(name); if(null == listHeaderValues) { return Collections.<String>emptyList().iterator(); } else { return listHeaderValues.iterator(); } }</code><technical_language>This part of patch fine merged, small correction mentioned below</technical_language>

Target:
public Iterator<String> getResponseHeaders(String name) throws IOException { Map<String, List<String>> mapHeader = connection.getHeaderFields(); List<String> listHeaderValues = mapHeader.get(name); if (listHeaderValues == null) { return Collections.<String>emptyList().iterator(); } else { return listHeaderValues.iterator(); } }
Source:
<code>public void deliver(WebContext ctx, String objectId, String fileExtension) { try { engine.deliver(ctx, name, <START> <END> objectId, fileExtension, status -> handleHttpError(ctx, objectId, fileExtension, null, status)); } catch (IOException e) { throw Exceptions.handle() .error(e) .to(StorageUtils.LOG) .withSystemErrorMessage( "Storage Layer 1: An error occurred when delivering %s (%s) for %s: %s (%s)", objectId, name, ctx.getRequestedURI()) .handle(); } }</code><technical_language>Formatting</technical_language>

Target:
public void deliver(WebContext ctx, String objectId, String fileExtension) { try { engine.deliver(ctx, name, objectId, fileExtension, status -> handleHttpError(ctx, objectId, fileExtension, null, status)); } catch (IOException e) { throw Exceptions.handle() .error(e) .to(StorageUtils.LOG) .withSystemErrorMessage("Layer 1: An error occurred when delivering %s (%s) for %s: %s (%s)", objectId, name, ctx.getRequestedURI()) .handle(); } }
Source:
<code>public HttpResponse doDoUninstall() throws IOException { Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER); archive.delete(); <START> Jenkins.getActiveInstance().getPluginManager().resolveDependantPlugins(); <END> return HttpResponses.redirectViaContextPath("/pluginManager/installed"); }</code><technical_language>getActiveInstance() difference, Jenkins.getInstance() before. I assign Jenkins a variable</technical_language>

Target:
public HttpResponse doDoUninstall() throws IOException { Jenkins jenkins = Jenkins.getActiveInstance(); jenkins.checkPermission(Jenkins.ADMINISTER); archive.delete(); jenkins.getPluginManager().resolveDependantPlugins(); return HttpResponses.redirectViaContextPath("/pluginManager/installed"); }
Source:
<code>public void testReportForDutyWithEnvironmentEdge() throws Exception { cluster.getConfiguration().setInt(HConstants.MASTER_PORT, HBaseTestingUtility.randomFreePort()); cluster.getConfiguration().setInt("hbase.procedure.remote.dispatcher.delay.msec", 0); cluster.getConfiguration().setInt("hbase.regionserver.rpc.retry.interval", 0); boolean tablesOnMaster = LoadBalancer.isTablesOnMaster(testUtil.getConfiguration()); cluster.getConfiguration().setInt(ServerManager.WAIT_ON_REGIONSERVERS_MINTOSTART, tablesOnMaster ? 2 : 1); cluster.getConfiguration().setInt(ServerManager.WAIT_ON_REGIONSERVERS_MAXTOSTART, tablesOnMaster ? 2 : 1); EnvironmentEdge previousEdge = EnvironmentEdgeManager.getDelegate(); ManualEnvironmentEdge edge = new ManualEnvironmentEdge(); EnvironmentEdgeManager.injectEdge(edge); master = cluster.addMaster(); rs = cluster.addRegionServer(); LOG.debug("Starting master: " + master.getMaster().getServerName()); master.start(); rs.start(); waitForClusterOnline(master); <START> EnvironmentEdgeManager.injectEdge(previousEdge); <END> }</code><technical_language>This reset is done other tests get manual edge right</technical_language>

Target:
public void testReportForDutyWithEnvironmentEdge() throws Exception { cluster.getConfiguration().setInt(HConstants.MASTER_PORT, HBaseTestingUtility.randomFreePort()); cluster.getConfiguration().setInt("hbase.procedure.remote.dispatcher.delay.msec", 0); cluster.getConfiguration().setInt("hbase.regionserver.rpc.retry.interval", 0); boolean tablesOnMaster = LoadBalancer.isTablesOnMaster(testUtil.getConfiguration()); cluster.getConfiguration().setInt(ServerManager.WAIT_ON_REGIONSERVERS_MINTOSTART, tablesOnMaster ? 2 : 1); cluster.getConfiguration().setInt(ServerManager.WAIT_ON_REGIONSERVERS_MAXTOSTART, tablesOnMaster ? 2 : 1); ManualEnvironmentEdge edge = new ManualEnvironmentEdge(); EnvironmentEdgeManager.injectEdge(edge); master = cluster.addMaster(); rs = cluster.addRegionServer(); LOG.debug("Starting master: " + master.getMaster().getServerName()); master.start(); rs.start(); waitForClusterOnline(master); }
Source:
<code>public Boolean call() throws InterruptedException{ CallContext callContext = bulkExecCallerImpl.getCallContexts().poll(); if(callContext!=null) <START> bulkExecCallerImpl.processOutput(callContext); <END> if(getPhase() == WorkPhase.COMPLETED && bulkExecCallerImpl.getCallContexts().isEmpty()) { getCallerThreadPoolExecutor().shutdown(); } else if(callContext != null) { bulkExecCallerImpl.getCallContexts().put(callContext); submitTask(this); } return true; }</code><technical_language>work to: - assign a continueCalling variable false if callContext is empty else return processOutput() - if continueCalling is true, submitTask(this) - else if callContexts (aka callContextQueue) isEmpty, shutdown way, callable is similar while loop in relying processOutput() decision continue</technical_language>

Target:
public Boolean call() throws InterruptedException{ CallContext callContext = bulkExecCallerImpl.getCallContextQueue().poll(); continueCalling = (callContext == null)? false:bulkExecCallerImpl.processOutput(callContext); if(continueCalling) { bulkExecCallerImpl.getCallContextQueue().put(callContext); submitTask(this); } else if(getPhase() == WorkPhase.COMPLETED && bulkExecCallerImpl.getCallContextQueue().isEmpty()) { getCallerThreadPoolExecutor().shutdown(); } return true; }
Source:
<code>public SpecificSegmentsQuerySegmentWalker add( final DataSegment descriptor, final QueryableIndex index ) { final Segment segment = new QueryableIndexSegment(index, descriptor.getId()); <START> timelines.putIfAbsent(descriptor.getDataSource(), new VersionedIntervalTimeline<>(Ordering.natural())); <END> final VersionedIntervalTimeline<String, Segment> timeline = timelines.get(descriptor.getDataSource()); timeline.add(descriptor.getInterval(), descriptor.getVersion(), descriptor.getShardSpec().createChunk(segment)); segments.add(descriptor); closeables.add(index); return this; }</code><technical_language>Another good candidate for computeIfAbsent</technical_language>

Target:
public SpecificSegmentsQuerySegmentWalker add( final DataSegment descriptor, final QueryableIndex index ) { final Segment segment = new QueryableIndexSegment(index, descriptor.getId()); timelines.computeIfAbsent(descriptor.getDataSource(), datasource -> new VersionedIntervalTimeline<>(Ordering.natural())); final VersionedIntervalTimeline<String, Segment> timeline = timelines.get(descriptor.getDataSource()); timeline.add(descriptor.getInterval(), descriptor.getVersion(), descriptor.getShardSpec().createChunk(segment)); segments.add(descriptor); closeables.add(index); return this; }
Source:
<code>protected void doNonBlockingAction(final VdcActionType task, final VdcActionParametersBase params) { setCorrelationId(params); setJobOrStepId(params); VdcActionParametersBase sp = sessionize(params); DbUser currentUser = getCurrent().getUser(); VdcActionParametersBase logout = currentUser != null ? sessionize(new VdcActionParametersBase()) : null; try { backend.runAction(VdcActionType.RunAsyncAction, sessionize(new RunAsyncActionParameters(task, sp))); } finally { if (currentUser != null) { <START> backend.logoff(logout); <END> } } }</code><technical_language>logoff needed this code executed tread pool, is executed in HTTP request thread now, unexpectedly close session. Remove it</technical_language>

Target:
protected void doNonBlockingAction(final VdcActionType task, final VdcActionParametersBase params) { setCorrelationId(params); setJobOrStepId(params); backend.runAction(VdcActionType.RunAsyncAction, sessionize(new RunAsyncActionParameters(task, sessionize(params)))); }
Source:
<code>public void serve() throws TException { Subscription sub = conn.subscribe(subject, queue, newRequestHandler()); LOGGER.info("Frugal server running..."); try { shutdown.take(); } catch (InterruptedException ignored) { } LOGGER.info("Frugal server stopping..."); try { sub.unsubscribe(); <START> } catch (IOException ignored) { <END> } }</code><technical_language>want log error here</technical_language>

Target:
public synchronized void serve() throws TException { Subscription sub = conn.subscribe(subject, queue, newRequestHandler()); LOGGER.info("Frugal server running..."); try { shutdown.take(); } catch (InterruptedException ignored) { } LOGGER.info("Frugal server stopping..."); try { sub.unsubscribe(); } catch (IOException e) { LOGGER.warning("Frugal server failed to unsubscribe: " + e.getMessage()); } }
Source:
<code>public Collection<Locator> getLocators(long shard) throws IOException { <START> Timer.Context ctx = Instrumentation.getReadTimerContext(CassandraModel.CF_METRICS_LOCATOR.getName()); <END> try { RowQuery<Long, Locator> query = AstyanaxIO.getKeyspace() .prepareQuery(CassandraModel.CF_METRICS_LOCATOR) .getKey(shard); return query.execute().getResult().getColumnNames(); } catch (NotFoundException e) { Instrumentation.markNotFound(CassandraModel.CF_METRICS_LOCATOR_NAME); return Collections.emptySet(); } catch (ConnectionException ex) { Instrumentation.markReadError(ex); LOG.error("Connection exception during getLocators(" + Long.toString(shard) + " )", ex); throw new IOException("Error reading locators", ex); } finally { ctx.stop(); } }</code><technical_language>CassandraModel.CF_METRICS_LOCATOR_NAME</technical_language>

Target:
public Collection<Locator> getLocators(long shard) throws IOException { Timer.Context ctx = Instrumentation.getReadTimerContext(CassandraModel.CF_METRICS_LOCATOR_NAME); try { RowQuery<Long, Locator> query = AstyanaxIO.getKeyspace() .prepareQuery(CassandraModel.CF_METRICS_LOCATOR) .getKey(shard); return query.execute().getResult().getColumnNames(); } catch (NotFoundException e) { Instrumentation.markNotFound(CassandraModel.CF_METRICS_LOCATOR_NAME); return Collections.emptySet(); } catch (ConnectionException ex) { Instrumentation.markReadError(ex); LOG.error("Connection exception during getLocators(" + Long.toString(shard) + " )", ex); throw new IOException("Error reading locators", ex); } finally { ctx.stop(); } }
Source:
<code>private void handleExceptions() { <START> if(!globalExceptions.isEmpty()){ <END> ArrayList<MutationException> mutationExceptions = null; synchronized (globalExceptions) { mutationExceptions = new ArrayList<>(globalExceptions); globalExceptions.clear(); } List<Throwable> problems = new ArrayList<>(mutationExceptions.size()); ArrayList<String> hostnames = new ArrayList<>(mutationExceptions.size()); List<Row> failedMutations = new ArrayList<>(mutationExceptions.size()); for (MutationException mutationException : mutationExceptions) { problems.add(mutationException.throwable); failedMutations.add(mutationException.mutation); hostnames.add(null); } try { RetriesExhaustedWithDetailsException exception = new RetriesExhaustedWithDetailsException( problems, failedMutations, hostnames); exceptionListener.onException(exception, this); } catch (RetriesExhaustedWithDetailsException e) { for (Throwable throwable : e.getCauses()) { throwable.printStackTrace(); } LOG.error("ExceptionListener threw exception", e); } } }</code><technical_language>This check need synchronized too, depending underlying implementation</technical_language>

Target:
private void handleExceptions() throws RetriesExhaustedWithDetailsException { if (!hasExceptions.get()) { ArrayList<MutationException> mutationExceptions = null; synchronized (globalExceptions) { mutationExceptions = new ArrayList<>(globalExceptions); globalExceptions.clear(); } if (mutationExceptions.isEmpty()) { return; } List<Throwable> problems = new ArrayList<>(mutationExceptions.size()); ArrayList<String> hostnames = new ArrayList<>(mutationExceptions.size()); List<Row> failedMutations = new ArrayList<>(mutationExceptions.size()); for (MutationException mutationException : mutationExceptions) { problems.add(mutationException.throwable); failedMutations.add(mutationException.mutation); hostnames.add(host.toString()); } RetriesExhaustedWithDetailsException exception = new RetriesExhaustedWithDetailsException( problems, failedMutations, hostnames); exceptionListener.onException(exception, this); } }
Source:
<code>protected void executeCommand() { Guid vmId = getParameters().getVmId(); List<VmNumaNode> vmNumaNodes = getParameters().getVmNumaNodeList(); Guid vdsId = getDedicatedHost(); List<VdsNumaNode> vdsNumaNodes = new ArrayList<>(); if (vdsId != null) { vdsNumaNodes = getVdsNumaNodeDao().getAllVdsNumaNodeByVdsId(vdsId); } List<VdsNumaNode> nodes = new ArrayList<>(); for (VmNumaNode vmNumaNode : vmNumaNodes) { vmNumaNode.setId(Guid.newGuid()); for (Pair<Guid, Pair<Boolean, Integer>> pair : vmNumaNode.getVdsNumaNodeList()) { <START> int index = pair.getSecond().getSecond(); <END> if (pair.getSecond().getFirst()) { for (VdsNumaNode vdsNumaNode : vdsNumaNodes) { if (vdsNumaNode.getIndex() == index) { pair.setFirst(vdsNumaNode.getId()); break; } } } } nodes.add(vmNumaNode); } getVmNumaNodeDao().massSaveNumaNode(nodes, null, vmId); setActionReturnValue(nodes.get(0).getId()); setSucceeded(true); }</code><technical_language>NPE</technical_language>

Target:
protected void executeCommand() { Guid vmId = getParameters().getVmId(); List<VmNumaNode> vmNumaNodes = getParameters().getVmNumaNodeList(); Guid vdsId = getDedicatedHost(); List<VdsNumaNode> vdsNumaNodes = new ArrayList<>(); if (vdsId != null) { vdsNumaNodes = getVdsNumaNodeDao().getAllVdsNumaNodeByVdsId(vdsId); } List<VdsNumaNode> nodes = new ArrayList<>(); for (VmNumaNode vmNumaNode : vmNumaNodes) { vmNumaNode.setId(Guid.newGuid()); for (Pair<Guid, Pair<Boolean, Integer>> pair : vmNumaNode.getVdsNumaNodeList()) { if (pair.getSecond() != null && pair.getSecond().getSecond() != null) { int index = pair.getSecond().getSecond(); if (pair.getSecond().getFirst()) { for (VdsNumaNode vdsNumaNode : vdsNumaNodes) { if (vdsNumaNode.getIndex() == index) { pair.setFirst(vdsNumaNode.getId()); break; } } } } } nodes.add(vmNumaNode); } getVmNumaNodeDao().massSaveNumaNode(nodes, null, vmId); setActionReturnValue(nodes.get(0).getId()); setSucceeded(true); }
Source:
<code>public FormValidation doCheckWebSocket(@QueryParameter boolean webSocket, @QueryParameter String tunnel) { if (webSocket) { if (!WebSockets.isSupported()) { return FormValidation.error("WebSocket support is not enabled in this Jenkins installation"); } <START> if (Util.fixEmptyAndTrim(tunnel) != null) { <END> return FormValidation.error("Tunneling is not currently supported in WebSocket mode"); } } else { if (Jenkins.get().getTcpSlaveAgentListener() == null) { return FormValidation.error("Either WebSocket mode is selected, or the TCP port for inbound agents must be enabled"); } } return FormValidation.ok(); }</code><technical_language>want get tunneling for this</technical_language>

Target:
public FormValidation doCheckWebSocket(@QueryParameter boolean webSocket, @QueryParameter String tunnel) { if (webSocket) { if (!WebSockets.isSupported()) { return FormValidation.error("WebSocket support is not enabled in this Jenkins installation"); } if (Util.fixEmptyAndTrim(tunnel) != null) { return FormValidation.error("Tunneling is not supported in WebSocket mode"); } } else { if (Jenkins.get().getTcpSlaveAgentListener() == null) { return FormValidation.error("Either WebSocket mode is selected, or the TCP port for inbound agents must be enabled"); } } return FormValidation.ok(); }
Source:
<code>public void tradePerformed(Order o, double matchPrice) throws StockMarketExpection { ordersPlaced.remove(o); if(o.getClass() == BuyOrder.class){ this.cashInHand = this.cashInHand - matchPrice*o.getSize(); this.position.add(o); } else{ this.cashInHand = this.cashInHand + matchPrice*o.getSize(); for(Order <START> O: position){ <END> if(O.getStockSymbol().equals(o.getStockSymbol())){ if(o.getSize() < O.getSize()){ O.setSize(O.getSize() - o.getSize()); } else{ this.position.remove(O); } break; } } } }</code><technical_language>rename this this is order in this trader's position. easier understand a quick glance</technical_language>

Target:
public void tradePerformed(Order o, double matchPrice) throws StockMarketExpection { ordersPlaced.remove(o); if(o.getClass() == BuyOrder.class){ this.cashInHand = this.cashInHand - matchPrice*o.getSize(); this.position.add(o); } else{ this.cashInHand = this.cashInHand + matchPrice*o.getSize(); for(Order traderPosition: position){ if(traderPosition.getStockSymbol().equals(o.getStockSymbol())){ if(o.getSize() < traderPosition.getSize()){ traderPosition.setSize(traderPosition.getSize() - o.getSize()); } else{ this.position.remove(traderPosition); } break; } } } }
Source:
<code>public void initialize() { configurator .newConfiguration() .methodName(WS_AGENT_TRACK_CONNECTION_SUBSCRIBE) .noParams() .noResult() .withConsumer(endpointIds::add); <START> <END> configurator .newConfiguration() .methodName(WS_AGENT_TRACK_CONNECTION_UNSUBSCRIBE) .noParams() .noResult() .withConsumer(endpointIds::remove); }</code><technical_language>elaborate happen if browser closed forcefully? unsubscribed ever? set grow? sendRequest method work if entries endpointIds browsers gone</technical_language>

Target:
public void initialize() { configurator .newConfiguration() .methodName(WS_AGENT_TRACK_CONNECTION_SUBSCRIBE) .noParams() .noResult() .withConsumer(endpointIds::add); configurator .newConfiguration() .methodName(WS_AGENT_TRACK_CONNECTION_UNSUBSCRIBE) .noParams() .noResult() .withConsumer(endpointIds::remove); keepingInTouchFuture = heartBeatScheduler.scheduleAtFixedRate( this::sendRequest, 0, WS_AGENT_TRACK_CONNECTION_PERIOD_MILLISECONDS, MILLISECONDS); }
Source:
<code>private void refreshDetails() { if (details!=null && list!=null && !list.getTable().isDisposed()) { if (documents==null) { documents = new DocumentFetcher(); } IStructuredSelection sel = (IStructuredSelection) list.getSelection(); if (sel==null || sel.isEmpty()) { details.setText(""); } else { int numLines = computeLines(); if (numLines > 0) { LineItem item = (LineItem) sel.getFirstElement(); IDocument document = documents.getDocument(item.getFile()); if (document!=null) { try { int line = item.getLineNumber()-1; int start = document.getLineOffset(Math.max(line-(numLines-1)/2, 0)); int end = document.getLength(); try { IRegion lineInfo = <START> document.getLineInformation(line+(numLines-1)/2 + 1); <END> end = lineInfo.getOffset() + lineInfo.getLength(); } catch (BadLocationException e) { } StyledString styledString = highlightMatches(document.get(start, end-start)); details.setText(styledString.getString()); details.setStyleRanges(styledString.getStyleRanges()); return; } catch (BadLocationException e) { } } } } details.setText(""); } }</code><technical_language>line + numLines/2 current code read line for numLines odd. E.g. numLines == 1, this leads reading 2 lines of text current code</technical_language>

Target:
private void refreshDetails() { if (details!=null && list!=null && !list.getTable().isDisposed()) { if (documents==null) { documents = new DocumentFetcher(); } IStructuredSelection sel = (IStructuredSelection) list.getSelection(); if (sel==null || sel.isEmpty()) { details.setText(""); } else { int numLines = computeLines(); if (numLines > 0) { LineItem item = (LineItem) sel.getFirstElement(); IDocument document = documents.getDocument(item.getFile()); if (document!=null) { try { int line = item.getLineNumber()-1; int start = document.getLineOffset(Math.max(line-(numLines-1)/2, 0)); int end = document.getLength(); try { IRegion lineInfo = document.getLineInformation(line + numLines/2); end = lineInfo.getOffset() + lineInfo.getLength(); } catch (BadLocationException e) { } StyledString styledString = highlightMatches(document.get(start, end-start)); details.setText(styledString.getString()); details.setStyleRanges(styledString.getStyleRanges()); return; } catch (BadLocationException e) { } } } } details.setText(""); } }
Source:
<code>public void setExpanded(boolean mIsExpanded) { this.mIsExpanded = mIsExpanded; if (mIsExpanded && mClickableView != null) { <START> mClickableView.setRotation(ROTATED_POSITION); <END> } else if (mClickableView != null) { mClickableView.setRotation(INITIAL_POSITION); } }</code><technical_language>setRotation() requires API 11, min is 7. Guard of this newer API</technical_language>

Target:
public void setExpanded(boolean mIsExpanded) { this.mIsExpanded = mIsExpanded; if (mIsExpanded && mClickableView != null && isHoneycomb()) { mClickableView.setRotation(ROTATED_POSITION); } else if (mClickableView != null && isHoneycomb()) { mClickableView.setRotation(INITIAL_POSITION); } }
Source:
<code>private void throwError(HttpServletResponse resp, int statusCode, String message) throws IOException { String requestId; <START> if (Config.isDevServer()) { <END> requestId = "dummyrequestid"; } else { requestId = String.valueOf(ApiProxy.getCurrentEnvironment().getAttributes() .get("com.google.appengine.runtime.request_log_id")); } JsonResult result = new JsonResult(message, statusCode); result.setRequestId(requestId); result.send(resp); }</code><technical_language>want put logic get reqeuestId in a utility method</technical_language>

Target:
private void throwError(HttpServletResponse resp, int statusCode, String message) throws IOException { JsonResult result = new JsonResult(message, statusCode); result.setRequestId(Config.getRequestId()); result.send(resp); }
Source:
<code>protected void handleSingleSelection(IStructuredSelection selection) { try { disposeDetail(); final Composite compositeToRenderOn = new Composite(detailPanel, SWT.NONE); GridLayoutFactory.fillDefaults().numColumns(1).equalWidth(false).applyTo(compositeToRenderOn); GridDataFactory.fillDefaults().grab(true, true).align(SWT.FILL, SWT.FILL).applyTo(compositeToRenderOn); final EObject object = (EObject) selection.getFirstElement(); final VView detailView = getView(); final ViewModelContext childContext = getViewModelContext().getChildContext(object, getVElement(), <START> detailView); <END> ecpView = ECPSWTViewRenderer.INSTANCE.render(compositeToRenderOn, childContext); border.layout(true, true); final Point point = detailPanel.computeSize(SWT.DEFAULT, SWT.DEFAULT); scrolledComposite.setMinHeight(point.y); } catch (final ECPRendererException ex) { Activator.log(ex); } }</code><technical_language>happened debug flag dependent logic</technical_language>

Target:
protected void handleSingleSelection(IStructuredSelection selection) { disposeDetail(); final Composite compositeToRenderOn = new Composite(detailPanel, SWT.NONE); GridLayoutFactory.fillDefaults().numColumns(1).equalWidth(false).applyTo(compositeToRenderOn); GridDataFactory.fillDefaults().grab(true, true).align(SWT.FILL, SWT.FILL).applyTo(compositeToRenderOn); final EObject object = (EObject) selection.getFirstElement(); final VView detailView = getView(); if (detailView == null) { if (isDebug()) { final Label label = new Label(compositeToRenderOn, SWT.NONE); label.setBackground(compositeToRenderOn.getDisplay().getSystemColor(SWT.COLOR_RED)); label.setText("No Detail View found."); } } else { final ViewModelContext childContext = getViewModelContext().getChildContext(object, getVElement(), detailView); try { ecpView = ECPSWTViewRenderer.INSTANCE.render(compositeToRenderOn, childContext); } catch (final ECPRendererException ex) { Activator.log(ex); } } border.layout(true, true); final Point point = detailPanel.computeSize(SWT.DEFAULT, SWT.DEFAULT); scrolledComposite.setMinHeight(point.y); }
Source:
<code>protected boolean isStalemate() { <START> return (battleState.getMaxBattleRounds() > 0 <END> && battleState.getMaxBattleRounds() <= battleState.getBattleRound()) || (getPower(BattleState.Side.OFFENSE) == 0 && getPower(BattleState.Side.DEFENSE) == 0); }</code><technical_language>I a data clump code-smell getMaxBattleRounds & getBattleRounds(). Extract object is refactoring pattern fix that, in this case a BattleRound object. for example this code be: return battleState.getBattleRound().hasMoreRounds() || (getPower ...) WDYT</technical_language>

Target:
protected boolean isStalemate() { return battleState.getBattleRoundState().isLastRound() || (getPower(BattleState.Side.OFFENSE) == 0 && getPower(BattleState.Side.DEFENSE) == 0); }
Source:
<code>protected Boolean doInBackground(Void... params) { boolean isError = false; for (Map.Entry<Uri, String> entry : files.entrySet()) { InputStream inputStream = null; FileOutputStream outputStream = null; String outPath = folder.path + entry.getValue(); try { if ((new File(outPath)).isFile()) { ignored++; continue; } inputStream = getContentResolver().openInputStream(entry.getKey()); outputStream = new FileOutputStream(outPath); byte[] buffer = new byte[4096]; int count; while ((count = inputStream.read(buffer)) > 0) { outputStream.write(buffer, 0, count); <START> } <END> copied++; } catch (FileNotFoundException e) { Log.e(TAG, String.format("Can't find input file \"%s\" to copy", entry.getKey()), e); isError = true; } catch (IOException e) { Log.e(TAG, String.format("IO exception during file \"%s\" sharing", entry.getKey()), e); isError = true; } finally { try { if (inputStream != null) inputStream.close(); if (outputStream != null) outputStream.close(); } catch (Exception e) { Log.w(TAG, "Exception on input/output stream close", e); } } } return isError; }</code><technical_language>able replace this Files.asByteSink(outFile).writeFrom(inputStream);</technical_language>

Target:
protected Boolean doInBackground(Void... params) { boolean isError = false; for (Map.Entry<Uri, String> entry : mFiles.entrySet()) { InputStream inputStream = null; String outPath = mFolder.path + entry.getValue(); try { File outFile = new File(outPath); if (outFile.isFile()) { mIgnored++; continue; } inputStream = getContentResolver().openInputStream(entry.getKey()); Files.asByteSink(outFile).writeFrom(inputStream); mCopied++; } catch (FileNotFoundException e) { Log.e(TAG, String.format("Can't find input file \"%s\" to copy", entry.getKey()), e); isError = true; } catch (IOException e) { Log.e(TAG, String.format("IO exception during file \"%s\" sharing", entry.getKey()), e); isError = true; } finally { try { if (inputStream != null) inputStream.close(); } catch (IOException e) { Log.w(TAG, "Exception on input/output stream close", e); } } } return isError; }
Source:
<code>public TransactionToken stage(AccessToken creds, String env) throws TException { checkAccess(creds, null); Transaction existing = transactions.get(creds); <START> if(existing != null) { <END> existing.abort(); } Transaction transaction = getEngine(env).startTransaction(); transactions.put(creds, transaction); return new TransactionToken(); }</code><technical_language>add this log message</technical_language>

Target:
public TransactionToken stage(AccessToken creds, String env) throws TException { checkAccess(creds, null); Transaction existing = transactions.get(creds); if(existing != null) { existing.abort(); } Transaction transaction = getEngine(env).startTransaction(); transactions.put(creds, transaction); Logger.info("Started Transaction {}", transaction); return new TransactionToken(); }
Source:
<code>private void waitForNotTransportState(String state) { if (stateMap.get("TransportState") != null) { long start = System.currentTimeMillis(); while (stateMap.get("TransportState").equals(state)) { try { Thread.sleep(50); <START> if (System.currentTimeMillis() - start > (this.notificationTimeout.longValue() * 1000)) { <END> break; } } catch (InterruptedException e) { logger.error("InterruptedException during playing a notification sound"); } } } }</code><technical_language>adding unneeded braces</technical_language>

Target:
private void waitForNotTransportState(String state) { if (stateMap.get("TransportState") != null) { long start = System.currentTimeMillis(); while (stateMap.get("TransportState").equals(state)) { try { Thread.sleep(50); if (System.currentTimeMillis() - start > this.notificationTimeout.longValue() * 1000) { break; } } catch (InterruptedException e) { logger.error("InterruptedException during playing a notification sound"); } } } }
Source:
<code>public CourseStudent create(Course course, Student student, CourseEnrolmentType courseEnrolmentType, CourseParticipationType participationType, Date enrolmentDate, Boolean lodging, CourseOptionality optionality, BillingDetails billingDetails, String organization, String additionalInfo, Room room, BigDecimal lodgingFee, Currency lodgingFeeCurrency, Boolean archived) throws DuplicateCourseStudentException { <START> CourseStudent courseStudent2 = findByCourseAndStudent(course, student); <END> if (courseStudent2 != null) throw new DuplicateCourseStudentException(); CourseStudent courseStudent = new CourseStudent(); courseStudent.setCourse(course); courseStudent.setArchived(archived); courseStudent.setBillingDetails(billingDetails); courseStudent.setCourseEnrolmentType(courseEnrolmentType); courseStudent.setEnrolmentTime(enrolmentDate); courseStudent.setParticipationType(participationType); courseStudent.setLodging(lodging); courseStudent.setOptionality(optionality); courseStudent.setStudent(student); courseStudent.setRoom(room); courseStudent.setLodgingFee(lodgingFee); courseStudent.setLodgingFeeCurrency(lodgingFeeCurrency); courseStudent.setOrganization(organization); courseStudent.setAdditionalInfo(additionalInfo); persist(courseStudent); courseStudentCreatedEvent.fire(new CourseStudentCreatedEvent(courseStudent.getId(), courseStudent.getCourse().getId(), courseStudent.getStudent().getId())); return courseStudent; }</code><technical_language>This fail single result exception</technical_language>

Target:
public CourseStudent create(Course course, Student student, CourseEnrolmentType courseEnrolmentType, CourseParticipationType participationType, Date enrolmentDate, Boolean lodging, CourseOptionality optionality, BillingDetails billingDetails, String organization, String additionalInfo, Room room, BigDecimal lodgingFee, Currency lodgingFeeCurrency, Boolean archived) throws DuplicateCourseStudentException { List<CourseStudent> courseStudents = listByCourseAndStudent(course, student); if (!courseStudents.isEmpty()) throw new DuplicateCourseStudentException(); CourseStudent courseStudent = new CourseStudent(); courseStudent.setCourse(course); courseStudent.setArchived(archived); courseStudent.setBillingDetails(billingDetails); courseStudent.setCourseEnrolmentType(courseEnrolmentType); courseStudent.setEnrolmentTime(enrolmentDate); courseStudent.setParticipationType(participationType); courseStudent.setLodging(lodging); courseStudent.setOptionality(optionality); courseStudent.setStudent(student); courseStudent.setRoom(room); courseStudent.setLodgingFee(lodgingFee); courseStudent.setLodgingFeeCurrency(lodgingFeeCurrency); courseStudent.setOrganization(organization); courseStudent.setAdditionalInfo(additionalInfo); persist(courseStudent); courseStudentCreatedEvent.fire(new CourseStudentCreatedEvent(courseStudent.getId(), courseStudent.getCourse().getId(), courseStudent.getStudent().getId())); return courseStudent; }
Source:
<code>public void newLimitedEntryActionSetColumn() { final LimitedEntryActionSetFieldCol52 column = new LimitedEntryActionSetFieldCol52(); final ActionSetFieldPopup popup = new ActionSetFieldPopup( model, oracle, presenter, new ActionColumnCommand() { public void execute( final ActionCol52 column ) { presenter.appendColumn( column ); } }, column, true, !access.isEditable() ); popup.show(); <START> } <END></code><technical_language>methods for line...perhaps reuse code instead</technical_language>

Target:
public void newLimitedEntryActionSetColumn() { final LimitedEntryActionSetFieldCol52 column = new LimitedEntryActionSetFieldCol52(); doNewActionSetColumn( column ); }
Source:
<code>public static void waitForTasksToComplete(final IProject project) { try { final Job waitJob = new Job("Waiting for other tasks...") { @Override protected IStatus run(IProgressMonitor monitor) { return Status.OK_STATUS; } }; waitJob.setRule(project.getWorkspace().getRuleFactory().buildRule()); waitJob.schedule(); <START> waitJob.join(); <END> } catch (InterruptedException e) { e.printStackTrace(); fail("Failed to wait for other jobs to complete: " + e.getMessage()); } }</code><technical_language>set a timeout something</technical_language>

Target:
public static void waitForTasksToComplete(final IProject project) { try { final TimeLimitedJob waitJob = new TimeLimitedJob(); waitJob.setRule(project.getWorkspace().getRuleFactory().buildRule()); waitJob.scheduleWithTimeout(10*60); waitJob.join(); } catch (InterruptedException e) { e.printStackTrace(); fail("Failed to wait for other jobs to complete: " + e.getMessage()); } }
Source:
<code>public IStatus validate(IProject project, String path) { if( fileExists(path)) { return Status.OK_STATUS; } <START> return new Status(IStatus.ERROR, "Text","File not found: " + path); <END> }</code><technical_language>PLUGIN_ID</technical_language>

Target:
public IStatus validate(IProject project, String path) { if( fileExists(path)) { return Status.OK_STATUS; } return new Status(IStatus.ERROR, Activator.PLUGIN_ID ,Messages.CustomTrace_FileNotFound + ": " + path); }
Source:
<code>private static Map<Integer, Collection<JsonArrayEntry>> groupJsonEntryByInstanceId( Collection<JsonArrayEntry> jsonEntries, LwM2mPath baseName) throws InvalidValueException { Map<Integer, Collection<JsonArrayEntry>> result = new HashMap<>(); for (JsonArrayEntry e : jsonEntries) { LwM2mPath nodePath = baseName.append(e.getName()); if (!nodePath.isResourceInstance() && !nodePath.isResource()) { throw new InvalidValueException( "Invalid path for resource, it should be a resource or a resource instance path", nodePath); } Collection<JsonArrayEntry> jsonArray = result.get(nodePath.getObjectInstanceId()); if (jsonArray == null) { <START> jsonArray = new ArrayList<JsonArrayEntry>(); <END> result.put(nodePath.getObjectInstanceId(), jsonArray); } jsonArray.add(e); } return result; }</code><technical_language><></technical_language>

Target:
private static Map<Integer, Collection<JsonArrayEntry>> groupJsonEntryByInstanceId( Collection<JsonArrayEntry> jsonEntries, LwM2mPath baseName) throws InvalidValueException { Map<Integer, Collection<JsonArrayEntry>> result = new HashMap<>(); for (JsonArrayEntry e : jsonEntries) { LwM2mPath nodePath = baseName.append(e.getName()); if (!nodePath.isResourceInstance() && !nodePath.isResource()) { throw new InvalidValueException( "Invalid path for resource, it should be a resource or a resource instance path", nodePath); } Collection<JsonArrayEntry> jsonArray = result.get(nodePath.getObjectInstanceId()); if (jsonArray == null) { jsonArray = new ArrayList<>(); result.put(nodePath.getObjectInstanceId(), jsonArray); } jsonArray.add(e); } return result; }
Source:
<code>public void testFirstDataMapper() { final StudentDataMapper mapper = new StudentDataMapperImpl(); Student student = new Student(1, "Adam", 'A'); mapper.insert(student); assertEquals(student.getStudentId(), mapper.find(student.getStudentId()).get().getStudentId()); student = new Student(student.getStudentId(), "AdamUpdated", 'A'); mapper.update(student); <START> assertEquals("AdamUpdated", mapper.find(student.getStudentId()).get().getName()); <END> mapper.delete(student); assertFalse(mapper.find(student.getStudentId()).isPresent()); }</code><technical_language>student.getName() instead of AdamUpdated</technical_language>

Target:
public void testFirstDataMapper() { final StudentDataMapper mapper = new StudentDataMapperImpl(); int studentId = 1; Student student = new Student(studentId, "Adam", 'A'); mapper.insert(student); assertEquals(studentId, mapper.find(student.getStudentId()).get().getStudentId()); String updatedName = "AdamUpdated"; student = new Student(student.getStudentId(), updatedName, 'A'); mapper.update(student); assertEquals(updatedName, mapper.find(student.getStudentId()).get().getName()); mapper.delete(student); assertFalse(mapper.find(student.getStudentId()).isPresent()); }
Source:
<code>protected static TrustManagerFactory buildTrustManagerFactory( <START> File certChainFile, TrustManagerFactory trustManagerFactory, String keyType) <END> throws NoSuchAlgorithmException, CertificateException, KeyStoreException, IOException { X509Certificate[] x509Certs = toX509Certificates(certChainFile); return buildTrustManagerFactory(x509Certs, trustManagerFactory, keyType); }</code><technical_language>need method signature this method is protected changing signature is a API breaking change</technical_language>

Target:
static TrustManagerFactory buildTrustManagerFactory( File certChainFile, TrustManagerFactory trustManagerFactory, String keyType) throws NoSuchAlgorithmException, CertificateException, KeyStoreException, IOException { X509Certificate[] x509Certs = toX509Certificates(certChainFile); return buildTrustManagerFactory(x509Certs, trustManagerFactory, keyType); }
Source:
<code>public synchronized void addLocation(URI location, TaskId remoteSourceTaskId) { requireNonNull(location, "location is null"); if (closed.get()) { return; } if (allClients.containsKey(location)) { return; } checkState(!noMoreLocations, "No more locations already set"); HttpPageBufferClient client = new HttpPageBufferClient( httpClient, maxResponseSize, maxErrorDuration, acknowledgePages, location, new ExchangeClientCallback(), scheduler, pageBufferClientCallbackExecutor); allClients.put(location, client); <START> checkState(taskIdToURI.put(remoteSourceTaskId, location) == null, "Duplicate remoteSourceTaskId: " + remoteSourceTaskId); <END> queuedClients.add(client); scheduleRequestIfNecessary(); }</code><technical_language>Potentially a race, remote location is removed is added. return addLocation client is cancelled</technical_language>

Target:
public synchronized void addLocation(URI location, TaskId remoteSourceTaskId) { requireNonNull(location, "location is null"); if (closed.get()) { return; } if (allClients.containsKey(location)) { return; } if (removedRemoteSourceTaskIds.contains(remoteSourceTaskId)) { return; } checkState(!noMoreLocations, "No more locations already set"); HttpPageBufferClient client = new HttpPageBufferClient( httpClient, maxResponseSize, maxErrorDuration, acknowledgePages, location, new ExchangeClientCallback(), scheduler, pageBufferClientCallbackExecutor); allClients.put(location, client); checkState(taskIdToLocationMap.put(remoteSourceTaskId, location) == null, "Duplicate remoteSourceTaskId: " + remoteSourceTaskId); queuedClients.add(client); scheduleRequestIfNecessary(); }