auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private List<Repository> getRepositories() { List<Repository> reposList = new LinkedList<Repository>(); Iterator<RepositoryTreeNode> it = ((IStructuredSelection) repositoryTableViewer.getSelection()).iterator(); <START> while (it.hasNext()) { <END> reposList.add(it.next().getRepository()); } return reposList; }</code><technical_language>style nit: braces single line blocks</technical_language>

Target:
private List<Repository> getRepositories() { List<Repository> reposList = new LinkedList<Repository>(); Iterator<RepositoryTreeNode> it = ((IStructuredSelection) repositoryTableViewer.getSelection()).iterator(); while (it.hasNext()) reposList.add(it.next().getRepository()); return reposList; }
Source:
<code>public E take() throws InterruptedException { ThroughputElement<E> e = this.underlyingQueue.take(); <START> this.elementsRemoved.incrementAndGet(); <END> Long queueTime = e.getWaited(); this.totalQueueTime.addAndGet(queueTime); boolean unlocked = false; try { this.maxQueueTimeLock.readLock().lock(); if (this.maxQueuedTime < queueTime) { this.maxQueueTimeLock.readLock().unlock(); unlocked = true; try { this.maxQueueTimeLock.writeLock().lock(); this.maxQueuedTime = queueTime; } finally { this.maxQueueTimeLock.writeLock().unlock(); } } } finally { if(!unlocked) this.maxQueueTimeLock.readLock().unlock(); } return e.getElement(); }</code><technical_language>This logic poll. this abstracted a single method</technical_language>

Target:
public E take() throws InterruptedException { ThroughputElement<E> e = this.underlyingQueue.take(); internalRemoveElement(e); return e.getElement(); }
Source:
<code>public void testService() throws Exception { <START> final CloseableHttpClient client = create().build(); <END> final String baseUrl = "http://localhost:" + System.getProperty("fcrepo.port") + "/fcrepo/rest"; final CamelContext ctx = getOsgiService(CamelContext.class, "(camel.context.name=FcrepoService)", 10000); assertNotNull(ctx); final MockEndpoint resultEndpoint = (MockEndpoint) ctx.getEndpoint("mock:result"); final String url1 = post(baseUrl).replace(baseUrl, ""); final String url2 = post(baseUrl).replace(baseUrl, ""); final ProducerTemplate template = ctx.createProducerTemplate(); final Map<String, Object> headers = new HashMap<>(); headers.put(FCREPO_BASE_URL, baseUrl); headers.put(FCREPO_IDENTIFIER, url1); template.sendBodyAndHeaders(ctx.getEndpoint("direct:start"), null, headers); headers.put(FCREPO_IDENTIFIER, url2); template.sendBodyAndHeaders(ctx.getEndpoint("direct:start"), null, headers); resultEndpoint.expectedMinimumMessageCount(2); assertIsSatisfied(resultEndpoint); }</code><technical_language>This client appears used</technical_language>

Target:
public void testService() throws Exception { final String baseUrl = "http://localhost:" + System.getProperty("fcrepo.port") + "/fcrepo/rest"; final CamelContext ctx = getOsgiService(CamelContext.class, "(camel.context.name=FcrepoService)", 10000); assertNotNull(ctx); final MockEndpoint resultEndpoint = (MockEndpoint) ctx.getEndpoint("mock:result"); final String url1 = post(baseUrl).replace(baseUrl, ""); final String url2 = post(baseUrl).replace(baseUrl, ""); final ProducerTemplate template = ctx.createProducerTemplate(); final Map<String, Object> headers = new HashMap<>(); headers.put(FCREPO_BASE_URL, baseUrl); headers.put(FCREPO_IDENTIFIER, url1); template.sendBodyAndHeaders(ctx.getEndpoint("direct:start"), null, headers); headers.put(FCREPO_IDENTIFIER, url2); template.sendBodyAndHeaders(ctx.getEndpoint("direct:start"), null, headers); resultEndpoint.expectedMinimumMessageCount(2); assertIsSatisfied(resultEndpoint); }
Source:
<code>public Proxy getProxy() { <START> if (this.proxy == null) { <END> return Proxy.NO_PROXY; } else { return this.proxy; } }</code><technical_language>Default member variable Proxy.NOPROXY. mutate translate a in a getter, breaks expectations caller have. This breaks relationship get set. options.getProxy(null); if (options.getProxy() != null) System.out.println("Whut?!");</technical_language>

Target:
public Proxy getProxy() { return this.proxy; }
Source:
<code>public Map<String, ApiClusterTemplateService> getAdditionalServices(CmTemplateProcessor cmTemplateProcessor, TemplatePreparationObject source) { if (isConfigurationNeeded(cmTemplateProcessor, source)) { ApiClusterTemplateService coreSettings = createTemplate(); Set<HostgroupView> hostgroupViews = source.getHostgroupViews(); return hostgroupViews.stream() <START> .filter(hg -> hg.getName().toLowerCase().equals("master") || hg.getName().toLowerCase().equals("main")) <END> .collect(Collectors.toMap(HostgroupView::getName, v -> coreSettings)); } return Map.of(); }</code><technical_language>Hmm.. this.. run a search-all code for string "master". this break arbitrarily</technical_language>

Target:
public Map<String, ApiClusterTemplateService> getAdditionalServices(CmTemplateProcessor cmTemplateProcessor, TemplatePreparationObject source) { if (isConfigurationNeeded(cmTemplateProcessor, source)) { ApiClusterTemplateService coreSettings = createTemplate(); Set<HostgroupView> hostgroupViews = source.getHostgroupViews(); return hostgroupViews.stream() .filter(hg -> hg.getName().toLowerCase().equals("master")) .collect(Collectors.toMap(HostgroupView::getName, v -> coreSettings)); } return Map.of(); }
Source:
<code>public void testUseNonExistingCatalog() throws Exception { TestingExecutor executor = new TestingExecutorBuilder() .setExecuteSqlConsumer((ignored1, ignored2) -> { throw new SqlExecutionException("mocked exception"); }) .build(); InputStream inputStream = new ByteArrayInputStream("use catalog cat;\n".getBytes()); SessionContext sessionContext = new SessionContext("test-session", new Environment()); String sessionId = executor.openSession(sessionContext); try (Terminal terminal = new DumbTerminal(inputStream, new MockOutputStream()); <START> CliClient client = new CliClient(terminal, sessionId, executor, File.createTempFile("history", "tmp").toPath())) { <END> client.open(); assertThat(executor.getNumExecuteSqlCalls(), is(1)); } }</code><technical_language>nit: fix indention below, a typical copy paste mistake. create a method reduce duplicate code (e.g. for tmp file)</technical_language>

Target:
public void testUseNonExistingCatalog() throws Exception { TestingExecutor executor = new TestingExecutorBuilder() .setExecuteSqlConsumer((ignored1, ignored2) -> { throw new SqlExecutionException("mocked exception"); }) .build(); InputStream inputStream = new ByteArrayInputStream("use catalog cat;\n".getBytes()); SessionContext sessionContext = new SessionContext("test-session", new Environment()); String sessionId = executor.openSession(sessionContext); try (Terminal terminal = new DumbTerminal(inputStream, new MockOutputStream()); CliClient client = new CliClient(terminal, sessionId, executor, historyTempFile())) { client.open(); assertThat(executor.getNumExecuteSqlCalls(), is(1)); } }
Source:
<code><START> public void createTraceFile() throws Throwable { <END> startRemoteSession(); setTracepoints(); MIBreakpointDMContext bptDMC = setBreakpointAtEndLine(); startTracing(); MIStoppedEvent stoppedEvent = SyncUtil.resumeUntilStopped(); Assert.assertTrue(stoppedEvent instanceof MIBreakpointHitEvent && ((MIBreakpointHitEvent)stoppedEvent).getNumber() == bptDMC.getReference()); stopTracing(); saveTraceData(); shutdownRemoteSession(); }</code><technical_language>remove trace file created a previous test? this test create it</technical_language>

Target:
public void createTraceFile() throws Throwable { deleteOldTraceFile(); startRemoteSession(); setTracepoints(); MIBreakpointDMContext bptDMC = setBreakpointAtEndLine(); startTracing(); MIStoppedEvent stoppedEvent = SyncUtil.resumeUntilStopped(); assertTrue(stoppedEvent instanceof MIBreakpointHitEvent && ((MIBreakpointHitEvent)stoppedEvent).getNumber() == bptDMC.getReference()); stopTracing(); saveTraceData(); }
Source:
<code>private static void addParseTransforms(GeneralCommandLine commandLine, JpsModule module) throws ProjectBuildException { JpsErlangModuleExtension extension = JpsErlangModuleExtension.getExtension(module); <START> LinkedHashSet<String> parseTransforms = extension != null ? extension.getParseTransforms() : null; <END> if (parseTransforms == null || parseTransforms.isEmpty()) return; for (String ptModule : parseTransforms) { commandLine.addParameter("+{parse_transform, " + ptModule + "}"); } }</code><technical_language>java Collection<String> parseTransforms = extension != null ? extension.getParseTransforms() : Collections.<String>emptySet(); if (parseTransforms.isEmpty()) return;</technical_language>

Target:
private static void addParseTransforms(GeneralCommandLine commandLine, JpsModule module) throws ProjectBuildException { JpsErlangModuleExtension extension = JpsErlangModuleExtension.getExtension(module); List<String> parseTransforms = extension != null ? extension.getParseTransforms() : Collections.<String>emptyList(); if (parseTransforms.isEmpty()) return; for (String ptModule : parseTransforms) { commandLine.addParameter("+{parse_transform, " + ptModule + "}"); } }
Source:
<code><START> public void testOpenRemoteXBeeAlreadyOpen() throws XBeeException { <END> Mockito.when(connectionInterface.isOpen()).thenReturn(true); remoteXBeeDevice.open(); assertTrue(remoteXBeeDevice.isOpen()); remoteXBeeDevice.close(); assertFalse(remoteXBeeDevice.isOpen()); }</code><technical_language>description of test is wrong wanted do different... mental</technical_language>

Target:
public void testOpenRemoteXBeeAlreadyOpen() { Mockito.when(connectionInterface.isOpen()).thenReturn(true); try { remoteXBeeDevice.open(); fail("Device shouldn't have connected"); } catch (Exception e) { assertEquals(InterfaceAlreadyOpenException.class, e.getClass()); } assertTrue(remoteXBeeDevice.isOpen()); remoteXBeeDevice.close(); assertFalse(remoteXBeeDevice.isOpen()); }
Source:
<code>public static JSONObject objectToObject(org.json.JSONObject obj){ <START> assert(obj instanceof JSONObject); <END> return (JSONObject) obj; }</code><technical_language>I assert assert is useful</technical_language>

Target:
public static JSONObject objectToObject(org.json.JSONObject obj){ Assert.that(obj == null || (obj instanceof JSONObject), "Object "+ obj+" should have been an instance of our JSONObject."); return (JSONObject) obj; }
Source:
<code>public void execute(LifeCycleHookBinding.Operation operation, AsyncQuery query, RequestScope requestScope, Optional<ChangeSpec> changes) { if (query.getStatus() == QueryStatus.QUEUED && query.getResult() == null) { asyncExecutorService.executeQuery(query, requestScope.getUser(), requestScope.getApiVersion()); <START> query.prePersist(); <END> } }</code><technical_language>I feel this belong in this hook</technical_language>

Target:
public void execute(LifeCycleHookBinding.Operation operation, AsyncQuery query, RequestScope requestScope, Optional<ChangeSpec> changes) { if (query.getStatus() == QueryStatus.QUEUED && query.getResult() == null) { asyncExecutorService.executeQuery(query, requestScope.getUser(), requestScope.getApiVersion()); } }
Source:
<code>private String getMetacardId(String resultId, QueryResponse response) { <START> if (!StringUtils.isBlank(mappedMetacardIdField)) { <END> Optional<SolrDocument> document = getResponseDocument(resultId, response); if (document.isPresent()) { Object val = document.get().getFirstValue(mappedMetacardIdField); if (val != null) { return val.toString(); } } } return resultId; }</code><technical_language>a StringUtils.isNotBlank</technical_language>

Target:
private String getMetacardId(String resultId, QueryResponse response) { if (StringUtils.isNotBlank(mappedMetacardIdField)) { Optional<SolrDocument> document = getResponseDocument(resultId, response); if (document.isPresent()) { Object val = document.get().getFirstValue(mappedMetacardIdField); if (val != null) { return val.toString(); } } } return resultId; }
Source:
<code>@Test public void test() { <START> for (IClass iClass:cha) { <END> for (IField field:iClass.getAllFields()) { TypeSignature sig = ((FieldImpl) field) .getGenericSignature(); if (sig == null) { continue; } if (sig.isClassTypeSignature()) { ((ClassTypeSignature)sig).getTypeArguments(); } } } }</code><technical_language>iterating entire class hierarchy, resolve classes expose issue? Also, confirm this test fails patch is fixed afterward</technical_language>

Target:
@Test public void test() { TypeArgument.make("<Lorg/apache/hadoop/io/Text;[B>"); TypeArgument.make("<[TP_OUT;>"); }
Source:
<code>public boolean equals(Object obj) { if(obj == this) return true; if(obj instanceof EquipmentType) { if(((EquipmentType) obj).getId().equals("ANY")) return true; if(((EquipmentType) obj).getId().equals(getId())) <START> return true; <END> } return false; }</code><technical_language>put spaces if tokens. Additionally, checking for null. if statements braces</technical_language>

Target:
public boolean equals(Object obj) { if (obj == this) { return true; } if (obj == null) { return false; } if (obj instanceof EquipmentType) { if (((EquipmentType) obj).getId().equals("ANY")) { return true; } if (((EquipmentType) obj).getId().equals(getId())) { return true; } } return false; }
Source:
<code>public void onKeyPress(KeyPressEvent event) { if (event.getSource() == newTopic <START> && event.getCharCode() == KeyCodes.KEY_ENTER) { <END> doTopicEdit(); } }</code><technical_language>Due a bug in GWT this work in Firfox [1]. work browsers be: event.getNativeEvent().getKeyCode() == KeyCodes.KEY_ENTER [1] <LINK_0></technical_language>

Target:
public void onKeyPress(KeyPressEvent event) { if (event.getSource() == newTopic && event.getNativeEvent().getKeyCode() == KeyCodes.KEY_ENTER) { doTopicEdit(); } }
Source:
<code>public boolean isMothballing() { if (!isTech()) { return false; } for (UUID unitId : techUnitIds) { Unit u = campaign.getUnit(unitId); <START> if (u != null && u.isMothballing()) { <END> return true; } } return false; }</code><technical_language>suggestion if ((u != null) && u.isMothballing()) {</technical_language>

Target:
public boolean isMothballing() { if (!isTech()) { return false; } for (UUID unitId : techUnitIds) { Unit u = campaign.getUnit(unitId); if ((u != null) && u.isMothballing()) { return true; } } return false; }
Source:
<code>public ContainerHeartbeatClient(String coordinatorUrl, String executionEnvContainerId) { this.heartbeatEndpoint = <START> String.format("%s%s?%s=%s", coordinatorUrl, CoordinationConstants.CLUSTERBASED_CONTAINER_HEARTBEAT_SERVELET, <END> CoordinationConstants.CLUSTERBASED_EXECUTION_ENVIRONMENT_CONTAINER_ID, executionEnvContainerId); }</code><technical_language>I suggest extracting format a constant hardcoding some of format constants instead of other way. e.g. CONTAINER_HEART_BEAT_SERVLET_FORMAT = "%s" + "/containerHeartbeat"; CONTAINER_EXECUTION_ID_PARAM_FORMAT = "executionContainerId=" + "%s"; CONTAINER_HEART_BEAT_ENDPOINT_FORMAT = CONTAINER_HEART_BEAT_SERVLET_FORMAT + CONTAINER_EXECUTION_ID_PARAM_FORMAT some flavor of above, reuse format unit tests & other places in code. IMO, constants forces users figure out repetitive code e.g. "%s%s?%s=%s" readability hit well</technical_language>

Target:
public ContainerHeartbeatClient(String coordinatorUrl, String executionEnvContainerId) { this.heartbeatEndpoint = String.format(CoordinationConstants.YARN_CONTAINER_HEARTBEAT_ENDPOINT_FORMAT, coordinatorUrl, executionEnvContainerId); }
Source:
<code>public static int getFormatLength(String format) throws IllegalArgumentException { byte[] b = format.getBytes(Bytes.UTF8_CHARSET); int repeat = 0; char last = (char)b[0]; int length = b.length; for(int i=0; i<b.length+1; i++) { if (i != b.length && (char) b[i] == last) { repeat++; continue; } int r = repeat; char l = last; repeat = 1; if( i != b.length) last = (char) b[i]; if ((l == 'y' || l == 'u') && (r == 4 || r == 2)) continue; else if (r == 2 && "MmdHhs".indexOf(l) != -1 ) continue; else if (r == 3 && (l == 'e' || l == 'E')) continue; else if (l == 'S') continue; else if (r == 1) { if (l == 'a') { length++; continue; } if(" ,.-/:".indexOf(l) != -1) continue; } <START> throw new IllegalArgumentException("not supported format \"" + format + "\": '" + l + "' can't be repeated " + r + " times"); } <END> return length; }</code><technical_language>I elevate a standard SQL exception error code. DB2 throws error [SQLState 22007](<LINK_0> if attempts e.g. following: INSERT t1 (c1) VALUES (TIMESTAMP_FORMAT('1999-12-31 23:59:59', 'YYYY-MM-sadsdDD HH24:MI:SXXXS')) SQL20447N Format string "YYYY-MM-sadsdDD HH24:MI:SXXXS" is valid for "SYSIBM.TIMESTAMP_FORMAT" function. SQLSTATE=22007 I suggest here</technical_language>

Target:
public static int getFormatLength(String format) throws IllegalArgumentException { byte[] b = format.getBytes(Bytes.UTF8_CHARSET); int repeat = 0; char last = (char)b[0]; int length = b.length; for(int i=0; i<b.length+1; i++) { if (i != b.length && (char) b[i] == last) { repeat++; continue; } int r = repeat; char l = last; repeat = 1; if( i != b.length) last = (char) b[i]; if ((l == 'y' || l == 'u') && (r == 4 || r == 2)) continue; else if (r == 2 && "MmdHhs".indexOf(l) != -1 ) continue; else if (r == 3 && (l == 'e' || l == 'E')) continue; else if (l == 'S' && r <= 9) continue; else if (r == 1 && l == 'a') { length++; continue; } else if(" ,.-/:".indexOf(l) != -1) continue; throw new IllegalArgumentException("not supported format \"" + format + "\": '" + l + "' can't be repeated " + r + " times"); } return length; }
Source:
<code>public String getCloseArgString() { <START> return closeArg; <END> }</code><technical_language>this</technical_language>

Target:
public String getCloseArgString() { return this.closeArg; }
Source:
<code>protected List<HostMetaData> getAllInstanceHostMetaDataForLinkedServices(final Map<Long, Account> accounts, final Set<Long> linkedServicesIds) { MultiRecordMapper<HostMetaData> mapper = new MultiRecordMapper<HostMetaData>() { @Override protected HostMetaData map(List<Object> input) { Host host = (Host) input.get(0); IpAddress hostIp = (IpAddress) input.get(1); HostMetaData data = new HostMetaData(hostIp.getAddress(), host, accounts.get(host.getAccountId())); return data; } }; <START> HostTable host = mapper.add(HOST, HOST.STATE); <END> IpAddressTable hostIpAddress = mapper.add(IP_ADDRESS); InstanceHostMapTable instanceHostMap = mapper.add(INSTANCE_HOST_MAP, INSTANCE_HOST_MAP.INSTANCE_ID, INSTANCE_HOST_MAP.HOST_ID); ServiceExposeMapTable exposeMap = mapper.add(SERVICE_EXPOSE_MAP, SERVICE_EXPOSE_MAP.INSTANCE_ID, SERVICE_EXPOSE_MAP.SERVICE_ID); return create() .select(mapper.fields()) .from(hostIpAddress) .join(HOST_IP_ADDRESS_MAP) .on(HOST_IP_ADDRESS_MAP.IP_ADDRESS_ID.eq(hostIpAddress.ID)) .join(host) .on(host.ID.eq(HOST_IP_ADDRESS_MAP.HOST_ID)) .join(instanceHostMap) .on(instanceHostMap.HOST_ID.eq(host.ID)) .join(exposeMap) .on(exposeMap.INSTANCE_ID.eq(instanceHostMap.INSTANCE_ID)) .where(host.REMOVED.isNull()) .and(exposeMap.REMOVED.isNull()) .and(instanceHostMap.REMOVED.isNull()) .and(host.STATE.notIn(CommonStatesConstants.REMOVING, CommonStatesConstants.REMOVED)) .and(hostIpAddress.REMOVED.isNull()) .and(exposeMap.SERVICE_ID.in(linkedServicesIds)) .fetch().map(mapper); }</code><technical_language>understanding is add(HOST) add fields host, including state. Is case</technical_language>

Target:
protected List<HostMetaData> getAllInstanceHostMetaDataForLinkedServices(final Map<Long, Account> accounts, final Set<Long> linkedServicesIds) { MultiRecordMapper<HostMetaData> mapper = new MultiRecordMapper<HostMetaData>() { @Override protected HostMetaData map(List<Object> input) { Host host = (Host) input.get(0); IpAddress hostIp = (IpAddress) input.get(1); HostMetaData data = new HostMetaData(hostIp.getAddress(), host, accounts.get(host.getAccountId())); return data; } }; HostTable host = mapper.add(HOST); IpAddressTable hostIpAddress = mapper.add(IP_ADDRESS); InstanceHostMapTable instanceHostMap = mapper.add(INSTANCE_HOST_MAP, INSTANCE_HOST_MAP.INSTANCE_ID, INSTANCE_HOST_MAP.HOST_ID); ServiceExposeMapTable exposeMap = mapper.add(SERVICE_EXPOSE_MAP, SERVICE_EXPOSE_MAP.INSTANCE_ID, SERVICE_EXPOSE_MAP.SERVICE_ID); return create() .select(mapper.fields()) .from(hostIpAddress) .join(HOST_IP_ADDRESS_MAP) .on(HOST_IP_ADDRESS_MAP.IP_ADDRESS_ID.eq(hostIpAddress.ID)) .join(host) .on(host.ID.eq(HOST_IP_ADDRESS_MAP.HOST_ID)) .join(instanceHostMap) .on(instanceHostMap.HOST_ID.eq(host.ID)) .join(exposeMap) .on(exposeMap.INSTANCE_ID.eq(instanceHostMap.INSTANCE_ID)) .where(host.REMOVED.isNull()) .and(exposeMap.REMOVED.isNull()) .and(instanceHostMap.REMOVED.isNull()) .and(host.STATE.notIn(CommonStatesConstants.REMOVING, CommonStatesConstants.REMOVED)) .and(hostIpAddress.REMOVED.isNull()) .and(exposeMap.SERVICE_ID.in(linkedServicesIds)) .fetch().map(mapper); }
Source:
<code>public List<List<String>> getColumns(List<String> columns) { <START> ArrayList<List<String>> dataColumns = new ArrayList<List<String>>(); <END> for (String column : columns) { int index = columnNames.indexOf(column); List<String> dataColumn = getColumn(index); dataColumns.add(dataColumn); } return dataColumns; }</code><technical_language>Local variable declared List instead of ArrayList. Is this worth caching</technical_language>

Target:
public List<List<String>> getColumns(List<String> columns) { List<List<String>> dataColumns = new ArrayList<List<String>>(); for (String column : columns) { int index = columnNames.indexOf(column); List<String> dataColumn = getColumn(index); dataColumns.add(dataColumn); } return dataColumns; }
Source:
<code>private Optional<List<Map<String, String>>> readPartitionFromCatalogAndPrune( FlinkContext context, Catalog catalog, ObjectIdentifier tableIdentifier, List<String> allFieldNames, Seq<RexNode> partitionPredicate, Function<List<Map<String, String>>, List<Map<String, String>>> pruner) throws TableNotExistException, TableNotPartitionedException{ RexNodeToExpressionConverter converter = new RexNodeToExpressionConverter( allFieldNames.toArray(new String[0]), context.getFunctionCatalog(), context.getCatalogManager(), TimeZone.getTimeZone(context.getTableConfig().getLocalTimeZone())); ArrayList<Expression> partitionFilters = new ArrayList<>(); Option<ResolvedExpression> subExpr; for (RexNode node: JavaConversions.seqAsJavaList(partitionPredicate)) { subExpr = node.accept(converter); <START> if (!subExpr.isEmpty()) { <END> partitionFilters.add(subExpr.get()); } } ObjectPath tablePath = tableIdentifier.toObjectPath(); if (partitionFilters.size() > 0) { try { List<Map<String, String>> remainingPartitions = catalog.listPartitionsByFilter(tablePath, partitionFilters) .stream() .map(CatalogPartitionSpec::getPartitionSpec) .collect(Collectors.toList()); return Optional.of(remainingPartitions); } catch (UnsupportedOperationException e) { return readPartitionFromCatalogWithoutFilterAndPrune(catalog, tablePath, pruner); } } else { return readPartitionFromCatalogWithoutFilterAndPrune(catalog, tablePath, pruner); } }</code><technical_language>if subExpr is empty</technical_language>

Target:
private Optional<List<Map<String, String>>> readPartitionFromCatalogAndPrune( FlinkContext context, Catalog catalog, ObjectIdentifier tableIdentifier, List<String> allFieldNames, Seq<RexNode> partitionPredicate, Function<List<Map<String, String>>, List<Map<String, String>>> pruner) throws TableNotExistException, TableNotPartitionedException { ObjectPath tablePath = tableIdentifier.toObjectPath(); RexNodeToExpressionConverter converter = new RexNodeToExpressionConverter( allFieldNames.toArray(new String[0]), context.getFunctionCatalog(), context.getCatalogManager(), TimeZone.getTimeZone(context.getTableConfig().getLocalTimeZone())); ArrayList<Expression> partitionFilters = new ArrayList<>(); Option<ResolvedExpression> subExpr; for (RexNode node: JavaConversions.seqAsJavaList(partitionPredicate)) { subExpr = node.accept(converter); if (!subExpr.isEmpty()) { partitionFilters.add(subExpr.get()); } else { return readPartitionFromCatalogWithoutFilterAndPrune(catalog, tablePath, pruner); } } try { List<Map<String, String>> remainingPartitions = catalog.listPartitionsByFilter(tablePath, partitionFilters) .stream() .map(CatalogPartitionSpec::getPartitionSpec) .collect(Collectors.toList()); return Optional.of(remainingPartitions); } catch (UnsupportedOperationException e) { return readPartitionFromCatalogWithoutFilterAndPrune(catalog, tablePath, pruner); } }
Source:
<code>public PartitionHandler partitionHandler(TaskLauncher taskLauncher, JobExplorer jobExplorer) throws Exception { <START> <END> MavenProperties mavenProperties = new MavenProperties(); mavenProperties.setRemoteRepositories(new HashMap<>(Collections.singletonMap("springRepo", new MavenProperties.RemoteRepository(repository)))); MavenResource resource = MavenResource.parse("io.spring.cloud:partitioned-batch-job:1.0.1.BUILD-SNAPSHOT", mavenProperties); DeployerPartitionHandler partitionHandler = new DeployerPartitionHandler(taskLauncher, jobExplorer, resource, "workerStep"); Map<String, String> environmentProperties = new HashMap<>(); environmentProperties.put("spring.profiles.active", "worker"); partitionHandler.setEnvironmentProperties(environmentProperties); partitionHandler.setMaxWorkers(2); return partitionHandler; }</code><technical_language>if delegatingResourceLoader here, need control maven properties (since applied MavenResourceLoader delegatingResourceLoader _and_ get benefit of able load more Maven, e.g. file: http: URLs</technical_language>

Target:
public PartitionHandler partitionHandler(TaskLauncher taskLauncher, JobExplorer jobExplorer) throws Exception { Resource resource = delegatingResourceLoader.getResource("maven://io.spring.cloud:partitioned-batch-job:1.0.0.BUILD-SNAPSHOT"); DeployerPartitionHandler partitionHandler = new DeployerPartitionHandler(taskLauncher, jobExplorer, resource, "workerStep"); Map<String, String> environmentProperties = new HashMap<>(); environmentProperties.put("spring.profiles.active", "worker"); partitionHandler.setEnvironmentProperties(environmentProperties); partitionHandler.setMaxWorkers(2); return partitionHandler; }
Source:
<code>private String getRequiredStorageUuid(String hostUuid, String psUuid){ if(psUuid == null){ return getMostFreeLocalStorageUuid(hostUuid); }else if(!Q.New(PrimaryStorageVO.class) .eq(PrimaryStorageVO_.type, LocalStorageConstants.LOCAL_STORAGE_TYPE) .eq(PrimaryStorageVO_.uuid, psUuid).isExists()){ <START> throw new OperationFailureException(argerr(String.format("the type of primary storage[uuid:%s] cheesed is not local storage, " + <END> "check if the resource can be created on other storage when cluster has attached local primary storage",psUuid))); }else if(Q.New(LocalStorageHostRefVO.class) .eq(LocalStorageHostRefVO_.primaryStorageUuid, psUuid) .eq(LocalStorageHostRefVO_.hostUuid, hostUuid).isExists()){ return psUuid; }else { return getMostFreeLocalStorageUuid(hostUuid); } }</code><technical_language>cheesed..</technical_language>

Target:
private String getRequiredStorageUuid(String hostUuid, String psUuid){ if(psUuid == null){ return getMostFreeLocalStorageUuid(hostUuid); }else if(Q.New(LocalStorageHostRefVO.class) .eq(LocalStorageHostRefVO_.hostUuid, hostUuid) .eq(LocalStorageHostRefVO_.primaryStorageUuid, psUuid) .isExists()){ return psUuid; }else if(!Q.New(PrimaryStorageVO.class) .eq(PrimaryStorageVO_.uuid, psUuid) .eq(PrimaryStorageVO_.type, LocalStorageConstants.LOCAL_STORAGE_TYPE) .isExists()){ throw new OperationFailureException(argerr("the type of primary storage[uuid:%s] chosen is not local storage, " + "check if the resource can be created on other storage when cluster has attached local primary storage", psUuid)); }else { return getMostFreeLocalStorageUuid(hostUuid); } }
Source:
<code>private void handleResponse(BranchCommitResponse response, IProgressMonitor monitor, Branch sourceBranch, Branch destinationBranch) throws OseeCoreException { TransactionRecord newTransaction = response.getTransaction(); AccessPolicy accessPolicy = ServiceUtil.getAccessPolicy(); accessPolicy.removePermissions(sourceBranch); if (sourceBranch.getAssociatedArtifactId() > 0) { TransactionManager.cacheCommittedArtifactTransaction(BranchManager.getAssociatedArtifact(sourceBranch), newTransaction); } BranchManager.getCache().reloadCache(); if (skipChecksAndEvents) { return; } Collection<Change> changes = new ArrayList<Change>(); IOperation operation = ChangeManager.comparedToPreviousTx(newTransaction, changes); doSubWork(operation, monitor, 1.0); handleArtifactEvents(newTransaction, changes); <START> <END> OseeEventManager.kickBranchEvent(getClass(), new BranchEvent(BranchEventType.Committed, sourceBranch.getGuid(), destinationBranch.getGuid())); }</code><technical_language>send this event. change flag skipChecksAndLocalEvents</technical_language>

Target:
private void handleResponse(BranchCommitResponse response, IProgressMonitor monitor, Branch sourceBranch, Branch destinationBranch) throws OseeCoreException { TransactionRecord newTransaction = response.getTransaction(); AccessPolicy accessPolicy = ServiceUtil.getAccessPolicy(); accessPolicy.removePermissions(sourceBranch); if (sourceBranch.getAssociatedArtifactId() > 0) { TransactionManager.cacheCommittedArtifactTransaction(BranchManager.getAssociatedArtifact(sourceBranch), newTransaction); } BranchManager.getCache().reloadCache(); if (!skipChecksAndEvents) { Collection<Change> changes = new ArrayList<Change>(); IOperation operation = ChangeManager.comparedToPreviousTx(newTransaction, changes); doSubWork(operation, monitor, 1.0); handleArtifactEvents(newTransaction, changes); OseeEventManager.kickBranchEvent(getClass(), new BranchEvent(BranchEventType.Committed, sourceBranch.getGuid(), destinationBranch.getGuid())); } }
Source:
<code>public void execute() throws MojoExecutionException { if (!outputDirectory.exists()) { outputDirectory.mkdirs(); } List<String> list = new ArrayList<>(); for (File jsonFile : cucumberFiles(cucumberOutput)) { list.add(jsonFile.getAbsolutePath()); } if (list.isEmpty()) { getLog().warn(cucumberOutput.getAbsolutePath() + " does not exist."); return; } try { Configuration configuration = new Configuration(outputDirectory, projectName); configuration.setBuildNumber(buildNumber); configuration.setParallelTesting(parallelTesting); <START> if (classifications != null) { <END> for (Map.Entry<String, String> entry : classifications.entrySet()) { configuration.addClassifications(StringUtils.capitalise(entry.getKey()), entry.getValue()); } } ReportBuilder reportBuilder = new ReportBuilder(list, configuration); getLog().info("About to generate Cucumber report."); Reportable report = reportBuilder.generateReports(); if (checkBuildResult) { if (report == null) { throw new MojoExecutionException("BUILD FAILED - Check Report For Details"); } } } catch (Exception e) { throw new MojoExecutionException("Error Found:", e); } }</code><technical_language>Validate null if is empty</technical_language>

Target:
public void execute() throws MojoExecutionException { if (!outputDirectory.exists()) { outputDirectory.mkdirs(); } List<String> list = new ArrayList<>(); for (File jsonFile : cucumberFiles(cucumberOutput)) { list.add(jsonFile.getAbsolutePath()); } if (list.isEmpty()) { getLog().warn(cucumberOutput.getAbsolutePath() + " does not exist."); return; } try { Configuration configuration = new Configuration(outputDirectory, projectName); configuration.setBuildNumber(buildNumber); configuration.setParallelTesting(parallelTesting); if (!MapUtils.isEmpty(classifications)) { for (Map.Entry<String, String> entry : classifications.entrySet()) { configuration.addClassifications(StringUtils.capitalise(entry.getKey()), entry.getValue()); } } ReportBuilder reportBuilder = new ReportBuilder(list, configuration); getLog().info("About to generate Cucumber report."); Reportable report = reportBuilder.generateReports(); if (checkBuildResult && report == null) { throw new MojoExecutionException("BUILD FAILED - Check Report For Details"); } } catch (Exception e) { throw new MojoExecutionException("Error Found:", e); } }
Source:
<code>public InstructorFeedbackResultsNoResponsePanel getNoResponsePanel() { <START> return new InstructorFeedbackResultsNoResponsePanel( <END> bundle.responseStatus.getStudentsWhoDidNotRespondToAnyQuestion(), bundle.responseStatus.emailNameTable, bundle.responseStatus.emailTeamNameTable); }</code><technical_language>this if passed in responseStatus</technical_language>

Target:
public InstructorFeedbackResultsNoResponsePanel getNoResponsePanel() { return new InstructorFeedbackResultsNoResponsePanel(bundle.responseStatus); }
Source:
<code>private static boolean prefixExists(Subfield subfieldPath, Collection<Subfield> subfieldPaths) { return subfieldPaths.stream() <START> .filter(path -> path.isPrefix(subfieldPath)) <END> .findAny() .isPresent(); }</code><technical_language>nit: IntelliJ this this replaced anyMatch: java return subfieldPaths.stream() .anyMatch(path -> path.isPrefix(subfieldPath));</technical_language>

Target:
private static boolean prefixExists(Subfield subfieldPath, Collection<Subfield> subfieldPaths) { return subfieldPaths.stream().anyMatch(path -> path.isPrefix(subfieldPath)); }
Source:
<code>public void exceptionIfBoutNotFound() throws IOException { Messages messages = null; try { final String name = "testunread"; final Aliases aliases = new DyBase().user(new URN("urn:test:75066")).aliases(); final Alias alias = aliases.add(name); final Inbox inbox = alias.inbox(); final Bout bout = inbox.bout(inbox.start()); bout.messages().post(" 4 leading spaces retained "); final Friends friends = bout.friends(); friends.kick(name); <START> messages = bout.messages(); <END> } catch (IOException | URISyntaxException e) { fail(e.getMessage()); } messages.unread(); fail("Exception is not received"); }</code><technical_language>@2686747 this final Messages messages, I need null in place above</technical_language>

Target:
public void exceptionIfBoutNotFound() throws Exception { try (final DyBase base = new DyBase()) { final String name = "testunread"; final Aliases aliases = base.user( new URN("urn:test:75066") ).aliases(); final Alias alias = aliases.add(name); final Inbox inbox = alias.inbox(); final Bout bout = inbox.bout(inbox.start()); bout.messages().post(" 4 leading spaces retained "); final Friends friends = bout.friends(); friends.kick(name); final Messages messages = bout.messages(); this.thrown.expect(HttpException.class); this.thrown.expectMessage(String.valueOf(bout.number())); messages.unread(); } }
Source:
<code>public SystemViewLocal(GridKernalContext ctx, SystemView<R> sysView) { super(sqlName(sysView.name()), sysView.description(), ctx, indexes(sysView), columns(sysView)); this.sysView = sysView; <START> attributeNames = new String[sysView.walker().count()]; <END> sysView.walker().visitAll(new AttributeVisitor() { @Override public <T> void accept(int idx, String name, Class<T> clazz, boolean filtering) { attributeNames[idx] = name; } }); }</code><technical_language>initialize attributeNames if (sysView instanceof FiltrableSystemView) == true</technical_language>

Target:
public SystemViewLocal(GridKernalContext ctx, SystemView<R> sysView) { this(ctx, sysView, null); }
Source:
<code>public void send(String source, OutgoingMessageEnvelope envelope) { String msg = String.format("OutputStream:%s Key:%s Value:%s", envelope.getSystemStream(), envelope.getKey(), <START> envelope.getMessage() != null ? new String((byte[]) envelope.getMessage()) : null); <END> LOG.info(msg); System.out.println(String.format("Message %d :", messageCounter.incrementAndGet())); if (envelope.getKey() != null) { System.out.println(String.format("Key:%s Value:%s", envelope.getKey(), getFormattedValue(envelope))); } else { System.out.println(getFormattedValue(envelope)); } }</code><technical_language>this non-null check message done other places in this class. For instance, in getFormattedValue implementation(line number: 100)</technical_language>

Target:
public void send(String source, OutgoingMessageEnvelope envelope) { String msg = String.format("OutputStream:%s Key:%s Value:%s", envelope.getSystemStream(), envelope.getKey(), new String((byte[]) envelope.getMessage())); LOG.info(msg); System.out.println(String.format("Message %d :", messageCounter.incrementAndGet())); if (envelope.getKey() != null) { System.out.println(String.format("Key:%s Value:%s", envelope.getKey(), getFormattedValue(envelope))); } else { System.out.println(getFormattedValue(envelope)); } }
Source:
<code>public void testCreateInvalidConfigAEADWithAuthAndCrypt() throws Exception { IpSecConfig ipSecConfig = buildIpSecConfig(); IpSecAlgorithm authenticatedEncryptionAlgo = new IpSecAlgorithm(IpSecAlgorithm.AUTH_CRYPT_AES_GCM, CRYPT_KEY, 128); try { ipSecConfig.setAuthenticatedEncryption( IpSecTransform.DIRECTION_OUT, authenticatedEncryptionAlgo); fail( "IpSecService should have thrown an error on crypt/auth being" + " enabled with authenticated encryption for outbound"); } catch (IllegalArgumentException <START> e) { <END> } try { ipSecConfig.setAuthenticatedEncryption( IpSecTransform.DIRECTION_IN, authenticatedEncryptionAlgo); fail( "IpSecService should have thrown an error on crypt/auth being" + " enabled with authenticated encryption for inbound"); } catch (IllegalArgumentException e) { } }</code><technical_language>expected</technical_language>

Target:
public void testCreateInvalidConfigAEADWithAuthAndCrypt() throws Exception { IpSecConfig ipSecConfig = buildIpSecConfig(); IpSecAlgorithm authenticatedEncryptionAlgo = new IpSecAlgorithm(IpSecAlgorithm.AUTH_CRYPT_AES_GCM, CRYPT_KEY, 128); try { ipSecConfig.setAuthenticatedEncryption( IpSecTransform.DIRECTION_OUT, authenticatedEncryptionAlgo); fail( "IpSecService should have thrown an error on crypt/auth being" + " enabled with authenticated encryption for outbound"); } catch (IllegalArgumentException expected) { } try { ipSecConfig.setAuthenticatedEncryption( IpSecTransform.DIRECTION_IN, authenticatedEncryptionAlgo); fail( "IpSecService should have thrown an error on crypt/auth being" + " enabled with authenticated encryption for inbound"); } catch (IllegalArgumentException expected) { } }
Source:
<code>public void killAll(Map<String, String> modelEnvVars) throws InterruptedException { for( OSProcess p : this) { if(p.getPid()<10) continue; LOGGER.finest("Considering to kill "+p.getPid()); boolean matched; try { matched = p.hasMatchingEnvVars(modelEnvVars); } catch (WinpException e) { LOGGER.log(FINEST," Failed to check environment variable match",e); continue; } if (matched) { if (getVeto(p) == null) <START> p.killRecursively(); <END> } else LOGGER.finest("Environment variable didn't match"); } }</code><technical_language>IMO logging is missing here</technical_language>

Target:
public void killAll(Map<String, String> modelEnvVars) throws InterruptedException { for( OSProcess p : this) { if(p.getPid()<10) continue; LOGGER.finest("Considering to kill "+p.getPid()); boolean matched; try { matched = p.hasMatchingEnvVars(modelEnvVars); } catch (WinpException e) { LOGGER.log(FINEST," Failed to check environment variable match",e); continue; } if(matched) p.killRecursively(); else LOGGER.finest("Environment variable didn't match"); } }
Source:
<code>public void simplePhenotypeSearch() throws AvroRemoteException { SearchGenotypePhenotypeRequest request = SearchGenotypePhenotypeRequest.newBuilder().build(); request.setPhenotype("GIST"); SearchGenotypePhenotypeResponse response = client.genotypePhenotype.searchGenotypePhenotype(request); <START> assertThat(response).isNotNull(); <END> assertThat(response.getAssociations()).isNotNull() ; assertThat(response.getAssociations().get(0)).isNotNull() ; }</code><technical_language>above, this null. If null, Client.searchGenotypePhenotype method, server endpoint, behaving in a manner other Client methods server endpoints</technical_language>

Target:
public void simplePhenotypeSearch() throws AvroRemoteException { SearchGenotypePhenotypeRequest request = SearchGenotypePhenotypeRequest.newBuilder().build(); request.setPhenotype(TestData.PHENOTYPE_NAME); SearchGenotypePhenotypeResponse response = client.genotypePhenotype.searchGenotypePhenotype(request); assertThat(response.getAssociations()).isNotNull() ; assertThat(response.getAssociations()).isNotEmpty() ; }
Source:
<code>public ParallelTransferOptions(Integer blockSize, Integer maxConcurrency, ProgressReceiver progressReceiver, Integer maxSingleUploadSize) { this.blockSize = blockSize; this.maxConcurrency = maxConcurrency; if (maxConcurrency != null) { <START> StorageImplUtils.assertInBounds("numBuffers", maxConcurrency, 1, Integer.MAX_VALUE); <END> } this.progressReceiver = progressReceiver; this.maxSingleUploadSize = maxSingleUploadSize; }</code><technical_language>this change maxConcurrency</technical_language>

Target:
public ParallelTransferOptions(Integer blockSize, Integer maxConcurrency, ProgressReceiver progressReceiver, Integer maxSingleUploadSize) { this.blockSize = blockSize; this.maxConcurrency = maxConcurrency; if (maxConcurrency != null) { StorageImplUtils.assertInBounds("maxConcurrency", maxConcurrency, 1, Integer.MAX_VALUE); } this.progressReceiver = progressReceiver; this.maxSingleUploadSize = maxSingleUploadSize; }
Source:
<code>private boolean multiMatchRune(int r) { int length = Math.min(runes.length, RUNES_LINER_SEARCH_SIZE); for (int j = 0; j < length; j += 2) { if (r < runes[j]) { return false; } if (r <= runes[j + 1]) { return true; } } <START> for (int lo = 0, hi = (runes.length - RUNES_LINER_SEARCH_SIZE) / 2; lo < hi; ) { <END> int m = lo + (hi - lo) / 2; int c = runes[2 * m + RUNES_LINER_SEARCH_SIZE]; if (c <= r) { if (r <= runes[2 * m + 1 + RUNES_LINER_SEARCH_SIZE]) { return true; } lo = m + 1; } else { hi = m; } } return false; }</code><technical_language>worth fuss subtract portion initially scanned. a logarithmic algorithm this is common case. fast enough search complete array. find evidence contrary</technical_language>

Target:
private boolean multiMatchRune(int r) { int length = Math.min(runes.length, 10); for (int j = 0; j < length; j += 2) { if (r < runes[j]) { return false; } if (r <= runes[j + 1]) { return true; } } for (int lo = 0, hi = runes.length / 2; lo < hi; ) { int m = lo + (hi - lo) / 2; int c = runes[2 * m]; if (c <= r) { if (r <= runes[2 * m + 1]) { return true; } lo = m + 1; } else { hi = m; } } return false; }
Source:
<code>private void loosen(ObjectDirectoryInserter inserter, ObjectReader reader, PackFile pack, HashSet<ObjectId> existing) throws IOException { for (PackIndex.MutableEntry entry : pack) { <START> final <END> ObjectId oid = entry.toObjectId(); if (!existing.contains(oid)) { existing.add(oid); try { ObjectLoader loader = reader.open(oid); inserter.insert(loader.getType(), loader.getSize(), loader.openStream(), true); } catch (MissingObjectException e) { throw new IOException(e); } } } }</code><technical_language>nit: newer jgit code avoid 'final' for locals needed</technical_language>

Target:
private void loosen(ObjectDirectoryInserter inserter, ObjectReader reader, PackFile pack, HashSet<ObjectId> existing) throws IOException { for (PackIndex.MutableEntry entry : pack) { ObjectId oid = entry.toObjectId(); if (existing.contains(oid)) { continue; } existing.add(oid); ObjectLoader loader = reader.open(oid); inserter.insert(loader.getType(), loader.getSize(), loader.openStream(), true ); } }
Source:
<code><START> private boolean applicableFile(File file, DepositBinConfiguration config) { <END> if (!config.hasFileFilters()) return true; if (config.getFilePattern() != null && !config.getFilePattern().matcher(file.getName()).matches()) return false; return config.getMaxSize() == null || config.getMaxSize() == 0 || file.length() <= config.getMaxSize(); }</code><technical_language>want log a warning files _not_ applicable, some kind of junk uploaded</technical_language>

Target:
private boolean applicableFile(File file, DepositBinConfiguration config) { if (!config.hasFileFilters()) return true; boolean answer = config.getFilePattern() == null || config.getFilePattern().matcher(file.getName()).matches(); answer = answer && (config.getMaxBytesPerFilee() == null || config.getMaxBytesPerFilee() == 0 || file.length() <= config .getMaxBytesPerFilee()); if (answer) return true; log.warn("Non-applicable file found in bin {}", file.getAbsolutePath(), config.getName()); return false; }
Source:
<code>private Boolean listElementStarts(List<String> aList, String charSeq) { for (String match : aList) { <START> if (match.startsWith(match)){ <END> return Boolean.TRUE; } } return Boolean.FALSE; }</code><technical_language>Is this line (match.startsWith(match)) correct? checking charSeq</technical_language>

Target:
private Boolean listElementStarts(List<String> aList, String charSeq) { for (String match : aList) { if (match.startsWith(charSeq)){ return Boolean.TRUE; } } return Boolean.FALSE; }
Source:
<code>private static int countExternalReferences(PDOMBinding binding) throws Exception { IPDOMIterator<PDOMName> extRefs = binding.getExternalReferences(); assertNotNull(extRefs); int count = 0; <START> for( ; extRefs.hasNext(); ++count) <END> extRefs.next(); return count; }</code><technical_language>incrementing count is main purpose of this loop, rewrite loop as: for (; extRefs.hasNext(); extRefs.next()) { ++count; }</technical_language>

Target:
private static int countExternalReferences(PDOMBinding binding) throws Exception { IPDOMIterator<PDOMName> extRefs = binding.getExternalReferences(); assertNotNull(extRefs); int count = 0; for( ; extRefs.hasNext(); extRefs.next()) ++count; return count; }
Source:
<code>private RspListFuture processCalls(ReplicableCommand command, boolean broadcast, long timeout, RspFilter filter, List<Address> dests, ResponseMode mode, DeliverOrder deliverOrder) throws Exception { if (trace) log.tracef("Replication task sending %s to addresses %s with response mode %s", command, dests, mode); boolean rsvp = isRsvpCommand(command); Buffer buf = marshallCall(command); RequestOptions opts = constructRequestOptions(mode, rsvp, deliverOrder, timeout); Collection<Address> realDest = dests; if (deliverOrder == DeliverOrder.TOTAL) { opts.anycasting(true).useAnycastAddresses(true); } else if (broadcast || FORCE_MCAST) { opts.anycasting(false); realDest = null; } else { opts.anycasting(true).setUseAnycastAddresses(false); } opts.rspFilter(filter); GroupRequest<Response> request = cast(realDest, buf, opts, false); if (mode == ResponseMode.GET_NONE) return null; RspListFuture retval = new RspListFuture(request); <START> if (request == null) { <END> if (broadcast) { retval.complete(EMPTY_RESPONSES_LIST); } else { Map<Address, Rsp<Response>> rsps = new HashMap<>(dests.size()); for (Address dest : dests) { Rsp<Response> rsp = new Rsp<>(); rsp.setSuspected(); rsps.put(dest, rsp); } retval.complete(new RspList<>(rsps)); } } if (timeout > 0 && !retval.isDone()) { ScheduledFuture<?> timeoutFuture = timeoutExecutor.schedule(retval, timeout, TimeUnit.MILLISECONDS); retval.setTimeoutFuture(timeoutFuture); } return retval; }</code><technical_language>I request null. if is, RspListFuture constructor throw a NPE</technical_language>

Target:
private CompletableFuture<Responses> processCalls(ReplicableCommand command, boolean broadcast, long timeout, RspFilter filter, List<Address> dests, ResponseMode mode, DeliverOrder deliverOrder) throws Exception { if (trace) log.tracef("Replication task sending %s to addresses %s with response mode %s", command, dests, mode); boolean rsvp = isRsvpCommand(command); Buffer buf = marshallCall(command); RequestOptions opts = constructRequestOptions(mode, rsvp, deliverOrder, timeout); Collection<Address> realDest = dests; if (deliverOrder == DeliverOrder.TOTAL) { opts.anycasting(true).useAnycastAddresses(true); } else if (broadcast || FORCE_MCAST) { opts.anycasting(false); realDest = null; } else { opts.anycasting(true).setUseAnycastAddresses(false); } opts.rspFilter(filter); GroupRequest<Response> request = cast(realDest, buf, opts, false); if (mode == ResponseMode.GET_NONE) return null; RspListFuture retval = new RspListFuture(request); if (timeout > 0 && !retval.isDone()) { ScheduledFuture<?> timeoutFuture = timeoutExecutor.schedule(retval, timeout, TimeUnit.MILLISECONDS); retval.setTimeoutFuture(timeoutFuture); } return retval; }