auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public ListBoxModel doFillProjectNameItems(@QueryParameter String collectionUrl, @QueryParameter String credentialsId) { StandardListBoxModel listBoxModel = new StandardListBoxModel(); listBoxModel.withEmptySelection(); if (StringUtils.isBlank(collectionUrl) || StringUtils.isBlank(credentialsId)) { return listBoxModel; } StandardUsernamePasswordCredentials credential = TeamCollectionConfiguration.findCredentialsById(credentialsId); if (credential == null) { return listBoxModel; } String username = credential.getUsername(); Secret password = credential.getPassword(); try { ReleaseManagementHttpClient releaseManagementHttpClient = new ReleaseManagementHttpClient( collectionUrl.toLowerCase(), username, password); List<Project> projects = releaseManagementHttpClient.GetProjectItems(); for (Project project : projects) { listBoxModel.add(project.getName()); } <START> } catch (ReleaseManagementException ignored) { <END> } return listBoxModel; }</code><technical_language>please log.. tough time debug.</technical_language>

Target:
public ListBoxModel doFillProjectNameItems(@QueryParameter String collectionUrl, @QueryParameter String credentialsId) { StandardListBoxModel listBoxModel = new StandardListBoxModel(); listBoxModel.withEmptySelection(); if (StringUtils.isBlank(collectionUrl) || StringUtils.isBlank(credentialsId)) { return listBoxModel; } StandardUsernamePasswordCredentials credential = TeamCollectionConfiguration.findCredentialsById(credentialsId); if (credential == null) { return listBoxModel; } String username = credential.getUsername(); Secret password = credential.getPassword(); try { ReleaseManagementHttpClient releaseManagementHttpClient = new ReleaseManagementHttpClient( collectionUrl.toLowerCase(), username, password); List<Project> projects = releaseManagementHttpClient.GetProjectItems(); for (Project project : projects) { listBoxModel.add(project.getName()); } } catch (ReleaseManagementException ex) { logger.log(Level.WARNING, String.format("Get team project for collection url: %s failed.", collectionUrl), ex); } return listBoxModel; }
Source:
<code>private long getUpdatedRate() { try { return unitsPerSecond.get(); } catch (Exception e) { log.error("Could not refresh the Qos rate. This can happen if the Qos Service is unreachable." <START> + " Extended periods of being unable to refresh will hinder QoS of all clients., ", e); <END> return returnPreviousOrDefaultRate(); } }</code><technical_language>static message template added</technical_language>

Target:
private long getUpdatedRate() { try { return unitsPerSecond.get(); } catch (Exception e) { log.error(RATE_UPDATE_ERROR_MESSAGE, e); return returnPreviousOrDefaultRate(); } }
Source:
<code>public boolean entityStateEqualTo(UserPortalItemModel other) { if (getEntity() instanceof VmPool && other.getEntity() instanceof VmPool) { return getEntity().equals(other.getEntity()); } else if (getEntity() instanceof VM && other.getEntity() instanceof VM) { VM thisVm = (VM) getEntity(); VM otherVm = (VM) other.getEntity(); boolean consoleUsersEqual = (thisVm.getConsoleCurentUserName() != null && thisVm.getConsoleCurentUserName().equals(otherVm.getConsoleCurentUserName())) || <START> (thisVm.getConsoleCurentUserName() == null && otherVm.getConsoleCurentUserName() == null); <END> return thisVm.getDynamicData().getStatus().equals(otherVm.getDynamicData().getStatus()) && consoleUsersEqual && thisVm.getStaticData().equals(otherVm.getStaticData()); } return false; }</code><technical_language>Consider Java 7's static Objects.equals() API code more readable</technical_language>

Target:
public boolean entityStateEqualTo(UserPortalItemModel other) { if (getEntity() instanceof VmPool && other.getEntity() instanceof VmPool) { return getEntity().equals(other.getEntity()); } else if (getEntity() instanceof VM && other.getEntity() instanceof VM) { VM thisVm = (VM) getEntity(); VM otherVm = (VM) other.getEntity(); boolean consoleUsersEqual = Objects.equals(thisVm.getConsoleCurentUserName(), otherVm.getConsoleCurentUserName()); return thisVm.getDynamicData().getStatus().equals(otherVm.getDynamicData().getStatus()) && consoleUsersEqual && thisVm.getStaticData().equals(otherVm.getStaticData()); } return false; }
Source:
<code>V call() throws StatusRuntimeException; } protected synchronized <V> V retryRPC(RpcCallable<V> rpc, Logger logger, String rpcName, String description, Object... args) throws AlluxioStatusException { String debugDesc = logger.isDebugEnabled() ? String.format(description, args) : null; long ts1 = System.currentTimeMillis(); logger.debug("Enter: {}({})", rpcName, debugDesc); try (Timer.Context ctx = MetricsSystem.timer(getQualifiedMetricName(rpcName)).time()) { V ret = retryRPCInternal(rpc, () -> { MetricsSystem.counter(getQualifiedRetryMetricName(rpcName)).inc(); return null; }); long ts2 = System.currentTimeMillis(); <START> logger.debug("Exit (OK): {}({}) in ms", rpcName, debugDesc, ts2 - ts1); <END> return ret; } catch (Exception e) { MetricsSystem.counter(getQualifiedFailureMetricName(rpcName)).inc(); long ts2 = System.currentTimeMillis(); logger.debug("Exit (ERROR): {}({}) in ms: {}", rpcName, debugDesc, ts2 - ts1, e.toString()); throw e; } }</code><technical_language>inline ts2</technical_language>

Target:
V call() throws StatusRuntimeException; } protected synchronized <V> V retryRPC(RpcCallable<V> rpc, Logger logger, String rpcName, String description, Object... args) throws AlluxioStatusException { String debugDesc = logger.isDebugEnabled() ? String.format(description, args) : null; long startMs = System.currentTimeMillis(); logger.debug("Enter: {}({})", rpcName, debugDesc); try (Timer.Context ctx = MetricsSystem.timer(getQualifiedMetricName(rpcName)).time()) { V ret = retryRPCInternal(rpc, () -> { MetricsSystem.counter(getQualifiedRetryMetricName(rpcName)).inc(); return null; }); logger.debug("Exit (OK): {}({}) in ms", rpcName, debugDesc, System.currentTimeMillis() - startMs); return ret; } catch (Exception e) { MetricsSystem.counter(getQualifiedFailureMetricName(rpcName)).inc(); logger.debug("Exit (ERROR): {}({}) in ms: {}", rpcName, debugDesc, System.currentTimeMillis() - startMs, e.toString()); throw e; } }
Source:
<code>public void process(final LGraph lGraph, final IElkProgressMonitor monitor) { monitor.begin("Partition preprocessing", 1); lGraph.getLayerlessNodes().stream() .filter(lNode -> lNode.hasProperty(LayeredOptions.PARTITIONING_PARTITION)) .flatMap(lNode -> Streams.stream(lNode.getOutgoingEdges())) .filter(lEdge -> mustBeReversed(lEdge)) .collect(Collectors.toList()) <START> <END> .stream() .forEach(lEdge -> reverse(lEdge, lGraph)); monitor.done(); }</code><technical_language>Empty line purpose</technical_language>

Target:
public void process(final LGraph lGraph, final IElkProgressMonitor monitor) { monitor.begin("Partition preprocessing", 1); List<LEdge> edgesToBeReversed = lGraph.getLayerlessNodes().stream() .filter(lNode -> lNode.hasProperty(LayeredOptions.PARTITIONING_PARTITION)) .flatMap(lNode -> Streams.stream(lNode.getOutgoingEdges())) .filter(lEdge -> mustBeReversed(lEdge)) .collect(Collectors.toList()); edgesToBeReversed.stream() .forEach(lEdge -> reverse(lEdge, lGraph)); monitor.done(); }
Source:
<code>private LabelProvider getWorkbenchLabelProvider() { <START> if(workbenchLabelProvider == null) { <END> workbenchLabelProvider = new WorkbenchLabelProvider(); } return workbenchLabelProvider; }</code><technical_language>curly brackets removed</technical_language>

Target:
private LabelProvider getWorkbenchLabelProvider() { if (workbenchLabelProvider == null) workbenchLabelProvider = new WorkbenchLabelProvider(); return workbenchLabelProvider; }
Source:
<code>public void testTrimStringMap() { Map<String, String> nullMap = null; Assert.assertNull( StringUtil.trimStringMap( nullMap ) ); Map<String, String> stringMap = new HashMap<>(); stringMap.put( " spaces ", " spacesval " ); stringMap.put( "\t tabs \t", "\t tabsval \t" ); stringMap.put( "\n newline \n", "\n newlineval \n" ); stringMap.put( "empty", "" ); <START> stringMap.put( "null", null ); <END> stringMap = StringUtil.trimStringMap( stringMap ); Assert.assertEquals( stringMap.get( "spaces" ), "spacesval" ); Assert.assertEquals( stringMap.get( "tabs" ), "tabsval" ); Assert.assertEquals( stringMap.get( "newline" ), "newlineval" ); Assert.assertEquals( stringMap.get( "empty" ), "" ); Assert.assertEquals( stringMap.get( "null" ), "" ); }</code><technical_language>I add entry key is null</technical_language>

Target:
public void testTrimStringMap() { Map<String, String> nullMap = null; Assert.assertNull( StringUtil.trimStringMap( nullMap ) ); Map<String, String> stringMap = new HashMap<>(); stringMap.put( " spaces ", " spacesval " ); stringMap.put( "\t tabs \t", "\t tabsval \t" ); stringMap.put( "\n newline \n", "\n newlineval \n" ); stringMap.put( "empty", "" ); stringMap.put( "null", null ); stringMap.put( null, null ); stringMap = StringUtil.trimStringMap( stringMap ); Assert.assertEquals( stringMap.get( "spaces" ), "spacesval" ); Assert.assertEquals( stringMap.get( "tabs" ), "tabsval" ); Assert.assertEquals( stringMap.get( "newline" ), "newlineval" ); Assert.assertEquals( stringMap.get( "empty" ), "" ); Assert.assertEquals( stringMap.get( "null" ), "" ); Assert.assertEquals( stringMap.get( "" ), "" ); }
Source:
<code>private String adjustDebuggerPath(String path) { <START> MIBreakpoints breakpoints = getServicesTracker().getService(MIBreakpoints.class); <END> return (breakpoints != null) ? breakpoints.adjustDebuggerPath(path) : path; }</code><technical_language>I for MIBreakpoints, is generic. for IBreakpoints, check is instanceof IMIBreakpointPathAdjuster. Or, breakpoints service register name IMIBreakpointPathAdjuster, ask for service. I is more brittle a solution, easy forget register a new bp service version name</technical_language>

Target:
private String adjustDebuggerPath(String path) { IBreakpoints breakpoints = getServicesTracker().getService(IBreakpoints.class); return (breakpoints instanceof MIBreakpoints) ? ((MIBreakpoints)breakpoints).adjustDebuggerPath(path) : path; }
Source:
<code>public String docs() { <START> return "boolean {function} Returns true if the function is known to CommandHelper."; <END> }</code><technical_language>Implementation.getServerType().getBranding(), CommandHelper</technical_language>

Target:
public String docs() { return "boolean {name} Returns true if the function is known to " + Implementation.GetServerType().getBranding() + "."; }
Source:
<code>public void detectSingleTextLanguage() { DetectedLanguage primaryLanguage = new DetectedLanguage().setName("English").setIso6391Name("en").setScore(1.0); <START> List<DetectedLanguage> expectedLanguageList = new ArrayList<>(Arrays.asList(primaryLanguage)); <END> StepVerifier.create(client.detectLanguage("This is a test English Text")) .assertNext(response -> validateDetectedLanguages(expectedLanguageList, response.getDetectedLanguages())) .verifyComplete(); }</code><technical_language>new ArrayList<>(Arrays.asList( Arrays.asList(. do a Ctrl F replace all</technical_language>

Target:
public void detectSingleTextLanguage() { DetectedLanguage primaryLanguage = new DetectedLanguage("English", "en", 1.0); List<DetectedLanguage> expectedLanguageList = Arrays.asList(primaryLanguage); StepVerifier.create(client.detectLanguage("This is a test English Text")) .assertNext(response -> validateDetectedLanguages(expectedLanguageList, response.getDetectedLanguages())) .verifyComplete(); }
Source:
<code>public CertificationWriter(final String fileName) throws IOException { OUT = new OutputStreamWriter(new FileOutputStream(fileName + EXT), "UTF-8"); LOG.info("NEW FILE: {}", fileName); <START> writeHeader(); <END> }</code><technical_language>considered a bad practice add state changing behavior a constructor</technical_language>

Target:
public CertificationWriter(final String fileName) throws IOException { OUT = new OutputStreamWriter(new FileOutputStream(fileName + EXT), "UTF-8"); LOG.info("NEW FILE: {}", fileName); }
Source:
<code>public void testGenerateUserCourseRegisterEmail() throws IOException { ______TS("student course register email"); CourseAttributes course = new CourseAttributes("idOfTypicalCourse1", "Course Name", "UTC"); AccountAttributes user = new AccountAttributes(); user.email = "user@email.tmt"; user.name = "User Name"; user.googleId = "user.googleid"; EmailWrapper email = new EmailGenerator().generateUserCourseRegisterEmail(user, course); String subject = String.format(EmailType.USER_COURSE_REGISTER.getSubject(), course.getName(), course.getId()); <START> verifyEmail(email, user.email, subject, "/userCourseRegiserEmail.html"); <END> }</code><technical_language>Missed this: a typo in filename</technical_language>

Target:
public void testGenerateUserCourseRegisterEmail() throws IOException { ______TS("student course register email"); CourseAttributes course = new CourseAttributes("idOfTypicalCourse1", "Course Name", "UTC"); AccountAttributes user = new AccountAttributes(); user.email = "user@email.tmt"; user.name = "User Name"; user.googleId = "user.googleid"; user.isInstructor = false; EmailWrapper email = new EmailGenerator().generateUserCourseRegisterEmail(user, course); String subject = String.format(EmailType.USER_COURSE_REGISTER.getSubject(), course.getName(), course.getId()); verifyEmail(email, user.email, subject, "/studentCourseRegisterEmail.html"); ______TS("instructor course register email"); user.isInstructor = true; email = new EmailGenerator().generateUserCourseRegisterEmail(user, course); subject = String.format(EmailType.USER_COURSE_REGISTER.getSubject(), course.getName(), course.getId()); verifyEmail(email, user.email, subject, "/instructorCourseRegisterEmail.html"); }
Source:
<code>public void processResponse(JsonRpcResponse response) { JsonNode id = response.getId(); if (NullNode.class.isInstance(id) || id == null) { this.tracker.processIssue(response); return; } JsonRpcCall call = this.tracker.removeCall(response.getId()); if (call == null) { this.log.error("Not able to update response for {}", response.getId()); return; } call.addResponse(response); if (call.getCallback() != null && call.getExecutor() != null) { if (response.getError() != null) { Map<String, Object> map = mapValues(response.getError()); String message = (String) map.get("message"); call.getExecutor().submit(() -> <START> call.getCallback().onFailure(new Exception(message))); <END> } else { call.getExecutor().submit(() -> call.getCallback().onResponse(new JsonResponseUtil().populate(response))); } } }</code><technical_language>I pass message code code exception method in callback for *VDSCommands</technical_language>

Target:
public void processResponse(JsonRpcResponse response) { JsonNode id = response.getId(); if (NullNode.class.isInstance(id) || id == null) { this.tracker.processIssue(response); return; } JsonRpcCall call = this.tracker.removeCall(response.getId()); if (call == null) { this.log.error("Not able to update response for {}", response.getId()); return; } call.addResponse(response); if (call.getCallback() != null && executorService != null) { if (response.getError() != null) { executorService.submit(() -> call.getCallback().onFailure(mapValues(response.getError()))); } else { executorService.submit(() -> call.getCallback().onResponse(new JsonResponseUtil().populate(response))); } } }
Source:
<code>public final void prepareRun(BatchSinkContext context) { OutputFormatProvider outputFormatProvider = createOutputFormatProvider(context); Map<String, String> outputConfig = new HashMap<>(outputFormatProvider.getOutputFormatConfiguration()); <START> if (config.fileSystemProperties != null) { <END> Map<String, String> properties = GSON.fromJson(config.fileSystemProperties, MAP_STRING_STRING_TYPE); outputConfig.putAll(properties); } context.addOutput(Output.of(config.referenceName, new SinkOutputFormatProvider( outputFormatProvider.getOutputFormatClassName(), outputConfig))); }</code><technical_language>this is a bit odd. subclass creates OutputFormatProvider, parent takes config map, adds some config settings, creates another OutputFormatProvider. this, pass config map createOutputFormatProvider call, OutputFormatProvider returns directly</technical_language>

Target:
public final void prepareRun(BatchSinkContext context) { OutputFormatProvider outputFormatProvider = createOutputFormatProvider(context, config.fileSystemProperties); context.addOutput(Output.of(config.referenceName, outputFormatProvider)); }
Source:
<code>String getFormattedNote() { StringBuilder formattedNote = new StringBuilder(constants.empty()); for (int i = 0; i < notes.size(); i++) { String note = notes.get(i); formattedNote.append(constants.lineBreak()); formattedNote.append(constants.htmlTab()); <START> formattedNote.append(note); <END> } return formattedNote.toString(); }</code><technical_language>Consider this in a single line: formattedNote.append(constants.lineBreak().append(constants.htmlTab().append(note);</technical_language>

Target:
String getFormattedNote() { StringBuilder formattedNote = new StringBuilder(constants.empty()); for (int i = 0; i < notes.size(); i++) { String note = notes.get(i); formattedNote.append(constants.lineBreak()).append(constants.htmlTab()).append(note); } return formattedNote.toString(); }
Source:
<code><START> DistributedLockService getCmsDlockService() { <END> if (cmsDlockService == null) { cmsDlockService = DLockService.getOrCreateService(CMS_DLOCK_SERVICE_NAME, cache.getInternalDistributedSystem()); } return cmsDlockService; }</code><technical_language>This method synchronized cmsDlockService is lazy initialized</technical_language>

Target:
synchronized DistributedLockService getCmsDlockService() { if (cmsDlockService == null) { cmsDlockService = DLockService.getOrCreateService(CMS_DLOCK_SERVICE_NAME, cache.getInternalDistributedSystem()); } return cmsDlockService; }
Source:
<code>public Long create(Sample sample) throws IOException { loadChildEntities(sample); authorizationManager.throwIfNotWritable(sample); setChangeDetails(sample); if (isDetailedSample(sample)) { if (!isIdentitySample(sample)) { DetailedSample detailed = (DetailedSample) sample; if (detailed.getParent() == null) { <START> throw new IllegalArgumentException("Detailed sample is missing parent identifier"); <END> } if (detailed.getParent().getId() != SampleImpl.UNSAVED_ID) { detailed.setParent((DetailedSample) get(detailed.getParent().getId())); } else { try { setIdentity(detailed); if (!isIdentitySample(detailed.getParent())) { detailed.setParent(findOrCreateParent(detailed)); } detailed.inheritPermissions(detailed.getParent()); } catch (MisoNamingException e) { throw new IOException(e.getMessage(), e); } } validateHierarchy(detailed); } else { sample.inheritPermissions(sample.getProject()); if (isUniqueExternalNameWithinProjectRequired() && isExternalNameDuplicatedInProject(sample)) { throw new IllegalArgumentException("Sample with external name '" + ((SampleIdentity) sample).getExternalName() + "' already exists in project " + sample.getProject().getShortName()); } } } else { sample.inheritPermissions(sample.getProject()); } sample.setName(generateTemporaryName()); if (isStringEmptyOrNull(sample.getAlias()) && namingScheme.hasSampleAliasGenerator()) { sample.setAlias(generateTemporaryName()); } return save(sample, true).getId(); }</code><technical_language>![CRITICAL](<LINK_0> 'Severity: CRITICAL') Define a constant instead of duplicating this literal "Detailed sample is missing parent identifier" 3 times. [![rule](<LINK_1>](<LINK_2></technical_language>

Target:
public Long create(Sample sample) throws IOException { loadChildEntities(sample); authorizationManager.throwIfNotWritable(sample); setChangeDetails(sample); if (isDetailedSample(sample)) { DetailedSample detailed = (DetailedSample) sample; if (!isIdentitySample(sample)) { if (detailed.getParent() == null) { throw new IllegalArgumentException("Detailed sample is missing parent identifier"); } if (detailed.getParent().getId() != SampleImpl.UNSAVED_ID) { detailed.setParent((DetailedSample) get(detailed.getParent().getId())); } else { try { setIdentity(detailed); if (!isIdentitySample(detailed.getParent())) { detailed.setParent(findOrCreateParent(detailed)); } } catch (MisoNamingException e) { throw new IOException(e.getMessage(), e); } } validateHierarchy(detailed); } else { if (isUniqueExternalNameWithinProjectRequired() && isExternalNameDuplicatedInProject(sample)) { throw new IllegalArgumentException("Sample with external name '" + ((SampleIdentity) sample).getExternalName() + "' already exists in project " + sample.getProject().getShortName()); } } detailed.inheritPermissions(detailed.getParent() == null ? detailed.getProject() : detailed.getParent()); } else { sample.inheritPermissions(sample.getProject()); } sample.setName(generateTemporaryName()); if (isStringEmptyOrNull(sample.getAlias()) && namingScheme.hasSampleAliasGenerator()) { sample.setAlias(generateTemporaryName()); } return save(sample, true).getId(); }
Source:
<code>public List<ISuite> runSuitesLocally() { if (m_suites.isEmpty()) { error("No test suite found. Nothing to run"); usage(); return Collections.emptyList(); } SuiteRunnerMap suiteRunnerMap = new SuiteRunnerMap(); if (m_suites.get(0).getVerbose() >= 2) { Version.displayBanner(); } for (XmlSuite xmlSuite : m_suites) { createSuiteRunners(suiteRunnerMap, xmlSuite); } if (m_suiteThreadPoolSize == 1 && !m_randomizeSuites) { for (XmlSuite xmlSuite : m_suites) { runSuitesSequentially( xmlSuite, suiteRunnerMap, getVerbose(xmlSuite), getDefaultSuiteName()); } return Lists.newArrayList(suiteRunnerMap.values()); } <START> IDynamicGraph<ISuite> suiteGraph = new org.testng.internal.DynamicGraph<>(); <END> for (XmlSuite xmlSuite : m_suites) { populateSuiteGraph(suiteGraph, suiteRunnerMap, xmlSuite); } IThreadWorkerFactory<ISuite> factory = new SuiteWorkerFactory( suiteRunnerMap, 0 , getDefaultSuiteName()); ITestNGThreadPoolExecutor pooledExecutor = this.getExecutorFactory().newSuiteExecutor( "suites", suiteGraph, factory, m_suiteThreadPoolSize, m_suiteThreadPoolSize, Integer.MAX_VALUE, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(), null); Utils.log("TestNG", 2, "Starting executor for all suites"); pooledExecutor.run(); try { pooledExecutor.awaitTermination(Long.MAX_VALUE, TimeUnit.MILLISECONDS); pooledExecutor.shutdownNow(); } catch (InterruptedException handled) { Thread.currentThread().interrupt(); error("Error waiting for concurrent executors to finish " + handled.getMessage()); } return Lists.newArrayList(suiteRunnerMap.values()); }</code><technical_language>Import</technical_language>

Target:
public List<ISuite> runSuitesLocally() { if (m_suites.isEmpty()) { error("No test suite found. Nothing to run"); usage(); return Collections.emptyList(); } SuiteRunnerMap suiteRunnerMap = new SuiteRunnerMap(); if (m_suites.get(0).getVerbose() >= 2) { Version.displayBanner(); } for (XmlSuite xmlSuite : m_suites) { createSuiteRunners(suiteRunnerMap, xmlSuite); } if (m_suiteThreadPoolSize == 1 && !m_randomizeSuites) { for (XmlSuite xmlSuite : m_suites) { runSuitesSequentially( xmlSuite, suiteRunnerMap, getVerbose(xmlSuite), getDefaultSuiteName()); } return Lists.newArrayList(suiteRunnerMap.values()); } IDynamicGraph<ISuite> suiteGraph = new DynamicGraph<>(); for (XmlSuite xmlSuite : m_suites) { populateSuiteGraph(suiteGraph, suiteRunnerMap, xmlSuite); } IThreadWorkerFactory<ISuite> factory = new SuiteWorkerFactory( suiteRunnerMap, 0 , getDefaultSuiteName()); ITestNGThreadPoolExecutor pooledExecutor = this.getExecutorFactory().newSuiteExecutor( "suites", suiteGraph, factory, m_suiteThreadPoolSize, m_suiteThreadPoolSize, Integer.MAX_VALUE, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(), null); Utils.log("TestNG", 2, "Starting executor for all suites"); pooledExecutor.run(); try { pooledExecutor.awaitTermination(Long.MAX_VALUE, TimeUnit.MILLISECONDS); pooledExecutor.shutdownNow(); } catch (InterruptedException handled) { Thread.currentThread().interrupt(); error("Error waiting for concurrent executors to finish " + handled.getMessage()); } return Lists.newArrayList(suiteRunnerMap.values()); }
Source:
<code>private void shouldGetStoreLevelTagMap(final String builtInMetricsVersion) { final String taskName = "test-task"; final String storeType = "remote-window"; final String storeName = "window-keeper"; final StreamsMetricsImpl streamsMetrics = new StreamsMetricsImpl(metrics, THREAD_NAME, builtInMetricsVersion); final Map<String, String> tagMap = streamsMetrics.storeLevelTagMap(taskName, storeType, storeName); assertThat(tagMap.size(), equalTo(3)); assertThat( <START> tagMap.get(builtInMetricsVersion.equals(StreamsConfig.METRICS_LATEST) ? StreamsMetricsImpl.THREAD_ID_TAG : StreamsMetricsImpl.THREAD_ID_TAG_0100_TO_23), <END> equalTo(THREAD_NAME)); assertThat(tagMap.get(StreamsMetricsImpl.TASK_ID_TAG), equalTo(taskName)); assertThat(tagMap.get(storeType + "-" + StreamsMetricsImpl.STORE_ID_TAG), equalTo(storeName)); }</code><technical_language>get of this expression line above. IMHO easier assertThat is doing</technical_language>

Target:
private void shouldGetStoreLevelTagMap(final String builtInMetricsVersion) { final String taskName = "test-task"; final String storeType = "remote-window"; final String storeName = "window-keeper"; final StreamsMetricsImpl streamsMetrics = new StreamsMetricsImpl(metrics, THREAD_ID, builtInMetricsVersion); final Map<String, String> tagMap = streamsMetrics.storeLevelTagMap(THREAD_ID, taskName, storeType, storeName); assertThat(tagMap.size(), equalTo(3)); final boolean isMetricsLatest = builtInMetricsVersion.equals(StreamsConfig.METRICS_LATEST); assertThat( tagMap.get(isMetricsLatest ? StreamsMetricsImpl.THREAD_ID_TAG : StreamsMetricsImpl.THREAD_ID_TAG_0100_TO_23), equalTo(THREAD_ID)); assertThat(tagMap.get(StreamsMetricsImpl.TASK_ID_TAG), equalTo(taskName)); assertThat(tagMap.get(storeType + "-" + StreamsMetricsImpl.STORE_ID_TAG), equalTo(storeName)); }
Source:
<code>public static void setUp() { ITmfTrace trace = new TmfXmlKernelTraceStub(); IPath filePath = Activator.getAbsoluteFilePath(KERNEL_MEMORY_USAGE_FILE); IStatus status = trace.validate(null, filePath.toOSString()); if (!status.isOK()) { fail(status.getException().getMessage()); } try { trace.initTrace(null, filePath.toOSString(), TmfEvent.class); } catch (TmfTraceException e) { fail(e.getMessage()); } deleteSuppFiles(trace); ((TmfTrace) trace).traceOpened(new <START> TmfTraceOpenedSignal(null, trace, <END> null)); fModule = TmfTraceUtils.getAnalysisModuleOfClass(trace, KernelMemoryAnalysisModule.class, KernelMemoryAnalysisModule.ID); assertNotNull(fModule); fTrace = trace; }</code><technical_language>is reason of this change ? I revert "this" instead of null</technical_language>

Target:
public void setUp() { ITmfTrace trace = new TmfXmlKernelTraceStub(); IPath filePath = Activator.getAbsoluteFilePath(KERNEL_MEMORY_USAGE_FILE); IStatus status = trace.validate(null, filePath.toOSString()); if (!status.isOK()) { fail(status.getException().getMessage()); } try { trace.initTrace(null, filePath.toOSString(), TmfEvent.class); } catch (TmfTraceException e) { fail(e.getMessage()); } deleteSuppFiles(trace); ((TmfTrace) trace).traceOpened(new TmfTraceOpenedSignal(this, trace, null)); fModule = TmfTraceUtils.getAnalysisModuleOfClass(trace, KernelMemoryAnalysisModule.class, KernelMemoryAnalysisModule.ID); assertNotNull(fModule); fTrace = trace; }
Source:
<code>public int indexOf(Slice pattern, int offset) { if (pattern.length() == 0) { return min(offset, size); } if (size == 0 || offset >= size) { return -1; } if (pattern.length() < SIZE_OF_INT || size < SIZE_OF_LONG) { return indexOfBruteForce(pattern, offset); } <START> int head = pattern.getIntUnchecked(0); <END> int firstByteMask = head & 0xff; firstByteMask |= firstByteMask << 8; firstByteMask |= firstByteMask << 16; int lastValidIndex = size - pattern.length(); int index = offset; while (index <= lastValidIndex) { int value = getIntUnchecked(index); int valueXor = value ^ firstByteMask; int hasZeroBytes = (valueXor - 0x01010101) & ~valueXor & 0x80808080; if (hasZeroBytes == 0) { index += SIZE_OF_INT; continue; } if (value == head && equalsUnchecked(index, pattern, 0, pattern.length())) { return index; } index++; } return -1; }</code><technical_language>I suppose this decision is backed benchmarks</technical_language>

Target:
public int indexOf(Slice pattern, int offset) { if (size == 0 || offset >= size) { return -1; } if (pattern.length() == 0) { return offset; } if (pattern.length() < SIZE_OF_INT || size < SIZE_OF_LONG) { return indexOfBruteForce(pattern, offset); } int head = pattern.getIntUnchecked(0); int firstByteMask = head & 0xff; firstByteMask |= firstByteMask << 8; firstByteMask |= firstByteMask << 16; int lastValidIndex = size - pattern.length(); int index = offset; while (index <= lastValidIndex) { int value = getIntUnchecked(index); int valueXor = value ^ firstByteMask; int hasZeroBytes = (valueXor - 0x01010101) & ~valueXor & 0x80808080; if (hasZeroBytes == 0) { index += SIZE_OF_INT; continue; } if (value == head && equalsUnchecked(index, pattern, 0, pattern.length())) { return index; } index++; } return -1; }
Source:
<code>public ITmfEvent parseEvent(ITmfContext context) { @Nullable ITmfLocation location = context.getLocation(); if (location instanceof TmfLongLocation) { TmfLongLocation tmfLongLocation = (TmfLongLocation) location; Long locationInfo = tmfLongLocation.getLocationInfo(); if (location.equals(NULL_LOCATION)) { locationInfo = 0L; } if (locationInfo != null) { try { if (!locationInfo.equals(fFileInput.getFilePointer())) { fFileInput.seek(locationInfo); } String nextJson = readNextEventString(() -> (char) fFileInput.read()); while (nextJson != null) { TraceEventField field = TraceEventField.parseJson(nextJson); if (field == null) { return null; } if (field.getPhase() != 'M') { return new TraceEventEvent(this, context.getRank(), field); } Map<@NonNull String, @NonNull Object> args = field.getArgs(); if (args != null) { <START> args.entrySet().forEach(entry -> fProperties.put(entry.getKey(), String.valueOf(entry.getValue()))); <END> } nextJson = readNextEventString(() -> (char) fFileInput.read()); } } catch (IOException e) { Activator.getInstance().logError("Error parsing event", e); } } } return null; }</code><technical_language>good all, in chromeos_system_trace.json trace, properties tid, global, property for key, while thread properties</technical_language>

Target:
public ITmfEvent parseEvent(ITmfContext context) { @Nullable ITmfLocation location = context.getLocation(); if (location instanceof TmfLongLocation) { TmfLongLocation tmfLongLocation = (TmfLongLocation) location; Long locationInfo = tmfLongLocation.getLocationInfo(); if (location.equals(NULL_LOCATION)) { locationInfo = 0L; } if (locationInfo != null) { try { if (!locationInfo.equals(fFileInput.getFilePointer())) { fFileInput.seek(locationInfo); } String nextJson = readNextEventString(() -> (char) fFileInput.read()); while (nextJson != null) { TraceEventField field = TraceEventField.parseJson(nextJson); if (field == null) { return null; } if (field.getPhase() != 'M') { return new TraceEventEvent(this, context.getRank(), field); } parseMetadata(field); nextJson = readNextEventString(() -> (char) fFileInput.read()); } } catch (IOException e) { Activator.getInstance().logError("Error parsing event", e); } } } return null; }
Source:
<code><START> public static String getAlternativePath(String path, boolean removeExtension) { <END> return FOOTPRINTS_DATA_DIR != null ? getAlternativeFile(path, removeExtension).getAbsolutePath() : null; }</code><technical_language>Public? this method is else</technical_language>

Target:
private static String getAlternativePath(String path, boolean removeExtension) { return FOOTPRINTS_DATA_DIR != null ? getAlternativeFile(path, removeExtension).getAbsolutePath() : null; }
Source:
<code>public int getPreviousStep(int step) { <START> if(this.getCurrentStepObject().canFinish()) return -1; <END> if (myCurrentStep == projectCreatedStep.getStepId()) { return -1; } return super.getPreviousStep(step); }</code><technical_language>I curly braces missing formatting is wrong in subsequent if (one step indented)</technical_language>

Target:
public int getPreviousStep(int step) { if (this.getCurrentStepObject().canFinish()) { return -1; } if (myCurrentStep == projectCreatedStep.getStepId()) { return -1; } return super.getPreviousStep(step); }
Source:
<code>public void testJobSubmissionUnderSameJobId() throws Exception { final TestingJobManagerRunnerFactory jobManagerRunnerFactory = startDispatcherAndSubmitJob(1); runningJobsRegistry.setJobRunning(jobId); final TestingJobManagerRunner testingJobManagerRunner = jobManagerRunnerFactory.takeCreatedJobManagerRunner(); <START> testingJobManagerRunner.completeResultFutureExceptionally(new JobNotFinishedException(jobId)); testingJobManagerRunner.getCloseAsyncCalledFuture().get(); <END> final CompletableFuture<Acknowledge> submissionFuture = dispatcherGateway.submitJob(jobGraph, timeout); try { submissionFuture.get(10L, TimeUnit.MILLISECONDS); fail("The job submission future should not complete until the previous JobManager " + "termination future has been completed."); } catch (TimeoutException ignored) { } finally { testingJobManagerRunner.completeTerminationFuture(); } assertThat(submissionFuture.get(), equalTo(Acknowledge.get())); }</code><technical_language>I agree relying fact testing main thread enqueue handleAsync payload submitJob is a safe assumption. Hence, fix fine. I understand is wrong here</technical_language>

Target:
public void testJobSubmissionUnderSameJobId() throws Exception { final TestingJobManagerRunnerFactory jobManagerRunnerFactory = startDispatcherAndSubmitJob(1); runningJobsRegistry.setJobRunning(jobId); final TestingJobManagerRunner testingJobManagerRunner = jobManagerRunnerFactory.takeCreatedJobManagerRunner(); testingJobManagerRunner.completeResultFutureExceptionally(new JobNotFinishedException(jobId)); testingJobManagerRunner.getCloseAsyncCalledLatch().await(); final CompletableFuture<Acknowledge> submissionFuture = dispatcherGateway.submitJob(jobGraph, timeout); try { submissionFuture.get(10L, TimeUnit.MILLISECONDS); fail("The job submission future should not complete until the previous JobManager " + "termination future has been completed."); } catch (TimeoutException ignored) { } finally { testingJobManagerRunner.completeTerminationFuture(); } assertThat(submissionFuture.get(), equalTo(Acknowledge.get())); }
Source:
<code>public final static <A, B> AbstractBiJoiner<A, B> merge(BiJoiner<A, B>... joiners) { List<SingleBiJoiner<A, B>> joinerList = new ArrayList<>(joiners.length); for (BiJoiner<A, B> joiner : joiners) { if (joiner instanceof NoneBiJoiner) { } else if (joiner instanceof SingleBiJoiner) { joinerList.add((SingleBiJoiner<A, B>) joiner); } else if (joiner instanceof CompositeBiJoiner) { joinerList.addAll(((CompositeBiJoiner<A, B>) joiner).getJoinerList()); } else { throw new IllegalArgumentException("The joiner class (" + joiner.getClass() + ") is not supported."); } } <START> if (joinerList.size() == 0) { <END> return new NoneBiJoiner<>(); } else if (joinerList.size() == 1) { return joinerList.get(0); } return new CompositeBiJoiner<>(joinerList); }</code><technical_language>isEmpty() here. Alternatively, cache size() reuse in condition below</technical_language>

Target:
public final static <A, B> AbstractBiJoiner<A, B> merge(BiJoiner<A, B>... joiners) { List<SingleBiJoiner<A, B>> joinerList = new ArrayList<>(joiners.length); for (BiJoiner<A, B> joiner : joiners) { if (joiner instanceof NoneBiJoiner) { } else if (joiner instanceof SingleBiJoiner) { joinerList.add((SingleBiJoiner<A, B>) joiner); } else if (joiner instanceof CompositeBiJoiner) { joinerList.addAll(((CompositeBiJoiner<A, B>) joiner).getJoinerList()); } else { throw new IllegalArgumentException("The joiner class (" + joiner.getClass() + ") is not supported."); } } if (joinerList.isEmpty()) { return new NoneBiJoiner<>(); } else if (joinerList.size() == 1) { return joinerList.get(0); } return new CompositeBiJoiner<>(joinerList); }
Source:
<code>public ImportVmParameters() { <START> setSourceDomainId(Guid.Empty); <END> setDestDomainId(Guid.Empty); }</code><technical_language>setters</technical_language>

Target:
public ImportVmParameters() { sourceDomainId = Guid.Empty; destDomainId = Guid.Empty; }
Source:
<code>private static VerifiableProperties buildFrontendVProps(File trustStoreFile) throws IOException, GeneralSecurityException { Properties properties = new Properties(); properties.put("rest.server.blob.storage.service.factory", "com.github.ambry.frontend.AmbryBlobStorageServiceFactory"); properties.put("rest.server.router.factory", "com.github.ambry.router.InMemoryRouterFactory"); properties.put("rest.server.account.service.factory", "com.github.ambry.account.InMemAccountServiceFactory"); properties.put("netty.server.port", Integer.toString(PLAINTEXT_SERVER_PORT)); properties.put("netty.server.ssl.port", Integer.toString(SSL_SERVER_PORT)); properties.put("netty.server.enable.ssl", "true"); properties.put("netty.server.request.buffer.watermark", "1"); properties.put("netty.multipart.post.max.size.bytes", Long.toString(MAX_MULTIPART_POST_SIZE_BYTES)); TestSSLUtils.addSSLProperties(properties, "", SSLFactory.Mode.SERVER, trustStoreFile, "frontend"); properties.put("kms.default.container.key", TestUtils.getRandomKey(32)); <START> properties.setProperty("clustermap.cluster.name", "CLuster-Name"); <END> properties.setProperty("clustermap.datacenter.name", "Datacenter-Name"); properties.setProperty("clustermap.host.name", "localhost"); return new VerifiableProperties(properties); }</code><technical_language>Cluster-Name</technical_language>

Target:
private static VerifiableProperties buildFrontendVProps(File trustStoreFile) throws IOException, GeneralSecurityException { Properties properties = new Properties(); properties.put("rest.server.blob.storage.service.factory", "com.github.ambry.frontend.AmbryBlobStorageServiceFactory"); properties.put("rest.server.router.factory", "com.github.ambry.router.InMemoryRouterFactory"); properties.put("rest.server.account.service.factory", "com.github.ambry.account.InMemAccountServiceFactory"); properties.put("netty.server.port", Integer.toString(PLAINTEXT_SERVER_PORT)); properties.put("netty.server.ssl.port", Integer.toString(SSL_SERVER_PORT)); properties.put("netty.server.enable.ssl", "true"); properties.put("netty.server.request.buffer.watermark", "1"); properties.put("netty.multipart.post.max.size.bytes", Long.toString(MAX_MULTIPART_POST_SIZE_BYTES)); CommonTestUtils.populateRequiredRouterProps(properties); TestSSLUtils.addSSLProperties(properties, "", SSLFactory.Mode.SERVER, trustStoreFile, "frontend"); properties.put("kms.default.container.key", TestUtils.getRandomKey(32)); properties.setProperty("clustermap.cluster.name", "Cluster-Name"); properties.setProperty("clustermap.datacenter.name", DATA_CENTER_NAME); properties.setProperty("clustermap.host.name", HOST_NAME); return new VerifiableProperties(properties); }
Source:
<code>private boolean isNicHealthy(NetworkInterface networkInterface) { try { return networkInterface.isUp(); } catch (SocketException e) { <START> log.warn("Unable to get network interface '{}' status, pronouncing it unhealthy. Due to {}", <END> networkInterface.getDisplayName(), e.getMessage()); log.debug("Exception", e); return false; } }</code><technical_language>Please remove "Due to" string message: log.warn("Unable get network interface '{}' status, pronouncing unhealthy: {}", networkInterface.getDisplayName(), e.getMessage());</technical_language>

Target:
private boolean isNicHealthy(NetworkInterface networkInterface) { try { return networkInterface.isUp(); } catch (SocketException e) { log.warn("Unable to get network interface '{}' status, pronouncing it unhealthy: {}", networkInterface.getDisplayName(), e.getMessage()); log.debug("Exception", e); return false; } }
Source:
<code>protected Serializable performSave( Object entity, Serializable id, EntityPersister persister, boolean useIdentityColumn, Object anything, EventSource source, boolean requiresImmediateIdAccess) { if ( LOG.isTraceEnabled() ) { LOG.tracev( "Saving {0}", MessageHelper.infoString( persister, id, source.getFactory() ) ); } final EntityKey key; if ( !useIdentityColumn ) { key = source.generateEntityKey( id, persister ); Object old = source.getPersistenceContext().getEntity( key ); if ( old != null ) { if ( source.getPersistenceContext().getEntry( old ).getStatus() == Status.DELETED ) { source.forceFlush( source.getPersistenceContext().getEntry( old ) ); } else { throw new NonUniqueObjectException( id, persister.getEntityName() ); } } if ( ! DelayedPostInsertIdentifier.class.isInstance( id ) ) { persister.setIdentifier( entity, id, source ); <START> } <END> } else { key = null; } if ( invokeSaveLifecycle( entity, persister, source ) ) { return id; } return performSaveOrReplicate( entity, key, persister, useIdentityColumn, anything, source, requiresImmediateIdAccess ); }</code><technical_language>is in if ( !useIdentityColumn ) block. Is for useIdentityColumn false DelayedPostInsertIdentifier.class.isInstance( id ) is true? If so, sounds a bug</technical_language>

Target:
protected Serializable performSave( Object entity, Serializable id, EntityPersister persister, boolean useIdentityColumn, Object anything, EventSource source, boolean requiresImmediateIdAccess) { if ( LOG.isTraceEnabled() ) { LOG.tracev( "Saving {0}", MessageHelper.infoString( persister, id, source.getFactory() ) ); } final EntityKey key; if ( !useIdentityColumn ) { key = source.generateEntityKey( id, persister ); Object old = source.getPersistenceContext().getEntity( key ); if ( old != null ) { if ( source.getPersistenceContext().getEntry( old ).getStatus() == Status.DELETED ) { source.forceFlush( source.getPersistenceContext().getEntry( old ) ); } else { throw new NonUniqueObjectException( id, persister.getEntityName() ); } } persister.setIdentifier( entity, id, source ); } else { key = null; } if ( invokeSaveLifecycle( entity, persister, source ) ) { return id; } return performSaveOrReplicate( entity, key, persister, useIdentityColumn, anything, source, requiresImmediateIdAccess ); }
Source:
<code>public void start() { CONFIG_FILE.addCallback(new Runnable() { @Override public void run() { loadDrivers(); } }); <START> loadDrivers(); <END> }</code><technical_language>loadDrivers throw exception if fails. start this fail start of rancher server. reload (addCallback) exception caught ignored</technical_language>

Target:
public void start() { CONFIG_FILE.addCallback(new Runnable() { @Override public void run() { loadDrivers(); } }); try { loadDrivers(); } catch (Exception e) { log.error("Failed to load drivers.", e); } }
Source:
<code>private void generateNumberLinks() { <START> BootstrapGwtNumberedPager.INSTANCE.styles().ensureInjected(); <END> htmlPanel.clear(); if (getPageCount() > 1) { if (mFirstPage != null) { htmlPanel.add(mFirstPage); htmlPanel.add(firstBar); } htmlPanel.add(mPrevPage); for (int i = 1; i <= getPageCount(); i++) { LIElement li = Document.get().createLIElement(); Anchor anchor = new Anchor(); final int page = i; anchor.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { NumberedPager thePager = NumberedPager.this; thePager.setPageStart((page - 1) * thePager.getPageSize()); } }); anchor.getElement().appendChild(Document.get().createTextNode(Integer.toString(i))); if (this.getPage() == i - 1) { anchor.setStyleName(BootstrapGwtNumberedPager.INSTANCE.styles().selected()); anchor.setEnabled(false); } anchor.addStyleName(BootstrapGwtNumberedPager.INSTANCE.styles().spaceApart()); li.appendChild(anchor.getElement()); htmlPanel.add(anchor); } htmlPanel.add(mNextPage); if (mLastPage != null) { htmlPanel.add(lastBar); htmlPanel.add(mLastPage); } } }</code><technical_language>move ensure injected consturctor</technical_language>

Target:
private void generateNumberLinks() { htmlPanel.clear(); if (getPageCount() > 1) { if (mFirstPage != null) { htmlPanel.add(mFirstPage); htmlPanel.add(firstBar); } htmlPanel.add(mPrevPage); for (int i = 1; i <= getPageCount(); i++) { LIElement li = Document.get().createLIElement(); Anchor anchor = new Anchor(); final int page = i; anchor.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { NumberedPager thePager = NumberedPager.this; thePager.setPageStart((page - 1) * thePager.getPageSize()); } }); anchor.getElement().setInnerHTML(Integer.toString(i)); if (this.getPage() == i - 1) { anchor.setStyleName(BootstrapGwtNumberedPager.INSTANCE.styles().selected()); anchor.setEnabled(false); } anchor.addStyleName(BootstrapGwtNumberedPager.INSTANCE.styles().spaceApart()); li.appendChild(anchor.getElement()); htmlPanel.add(anchor); } htmlPanel.add(mNextPage); if (mLastPage != null) { htmlPanel.add(lastBar); htmlPanel.add(mLastPage); } } }
Source:
<code><START> public int generateNewViewId() { <END> for (;;) { final int result = sNextGeneratedId.get(); int newValue = result + 1; if (newValue > 0x00FFFFFF) newValue = 1; if (sNextGeneratedId.compareAndSet(result, newValue)) { return result; } } }</code><technical_language>please check formatting here? code differently indented rest of class</technical_language>

Target:
public int generateNewViewId() { while (true) { final int result = lastGeneratedId.get(); int newValue = result + 1; if (newValue > 0x00FFFFFF) newValue = 1; if (lastGeneratedId.compareAndSet(result, newValue)) { return result; } } }
Source:
<code>public void cumulativeResultsToDataShouldWriteToTheCorrectStreamNotCauseCorruption() { int numPuts = 10; <START> int port = server1.invoke(() -> { return createServerAndRegion(); }); <END> server2.invoke(() -> { createServerAndRegion(); }); String hostname = server1.getHost().getHostName(); client.invoke(() -> { ClientCacheFactory ccf = new ClientCacheFactory(); ccf.addPoolServer(hostname, port); clientCacheRule.createClientCache(ccf); ClientCache clientCache = clientCacheRule.getClientCache(); Region region = clientCache.createClientRegionFactory(ClientRegionShortcut.PROXY).create(regionName); IntStream.range(0, numPuts).forEach(id -> region.put("key-" + id, new TestObject(id))); ArrayList results = (ArrayList) FunctionService.onRegion(region) .execute(new QueryWithoutTurningIntoListFunction(regionName, "select distinct r.id, r.name from /" + regionName + " r, /" + regionName + " t where t.id = r.id order by r.id")) .getResult(); SelectResults rs = (SelectResults) results.get(0); assertEquals(numPuts, rs.size()); }); }</code><technical_language>replaced int port = server1.invoke(this::createServerAndRegion);</technical_language>

Target:
public void cumulativeResultsToDataShouldWriteToTheCorrectStreamNotCauseCorruption() { int numPuts = 10; int port = server1.invoke(this::createServerAndRegion); server2.invoke((SerializableRunnableIF) this::createServerAndRegion); String hostname = server1.getHost().getHostName(); client.invoke(() -> { ClientCacheFactory ccf = new ClientCacheFactory(); ccf.addPoolServer(hostname, port); clientCacheRule.createClientCache(ccf); ClientCache clientCache = clientCacheRule.getClientCache(); Region region = clientCache.createClientRegionFactory(ClientRegionShortcut.PROXY).create(regionName); IntStream.range(0, numPuts).forEach(id -> region.put("key-" + id, new TestObject(id))); ArrayList results = (ArrayList) FunctionService.onRegion(region) .execute(new QueryWithoutTurningIntoListFunction(regionName, "select distinct r.id, r.name from /" + regionName + " r, /" + regionName + " t where t.id = r.id")) .getResult(); SelectResults rs = (SelectResults) results.get(0); assertThat(rs).size().isEqualTo(numPuts); }); }