auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void testIV3AnalyticsProviderInDE(String wikiName, String path) { networkTrafficInterceptor.startIntercepting(); String testedPage = urlBuilder.getUrlForPath(wikiName, path); AdsBaseObject adsBaseObject = new AdsBaseObject(driver, testedPage); JavascriptActions jsActions = new JavascriptActions(driver); <START> jsActions.waitForJavaScriptTruthy("typeof(iom) == 'object'"); <END> assertTrackingPixels(adsBaseObject, URL_TRACKING_SCRIPT); }</code><technical_language>I knew do typeof(...) a misleading typeof is a function, operand, adding () a function. triple =</technical_language>

Target:
public void testIV3AnalyticsProviderInDE(String wikiName, String path) { networkTrafficInterceptor.startIntercepting(); String testedPage = urlBuilder.getUrlForPath(wikiName, path); AdsBaseObject adsBaseObject = new AdsBaseObject(driver, testedPage); JavascriptActions jsActions = new JavascriptActions(driver); jsActions.waitForJavaScriptTruthy("typeof iom === 'object'"); assertTrackingPixels(adsBaseObject, URL_TRACKING_SCRIPT); }
Source:
<code>public CounterChartViewer(Composite parent, String title, String xLabel, String yLabel) { super(parent, title, xLabel, yLabel); Chart chart = getSwtChart(); chart.getTitle().setVisible(true); getSwtChart().getAxisSet().getXAxes()[0].getTitle().setVisible(true); chart.getLegend().setPosition(SWT.RIGHT); chart.getLegend().setVisible(true); Color backgroundColor = new Color(Display.getDefault(), 250, 250, 250); chart.setBackground(backgroundColor); <START> backgroundColor.dispose(); <END> }</code><technical_language>surprised this works, I expect dispose color longer need it, ie. viewer's control is disposed, adding a dispose listener chart. chart's default background color anyways? a system color instead (doesn't need disposed)</technical_language>

Target:
public CounterChartViewer(Composite parent, String title, String xLabel, String yLabel) { super(parent, title, xLabel, yLabel); Chart chart = getSwtChart(); chart.getTitle().setVisible(true); getSwtChart().getAxisSet().getXAxes()[0].getTitle().setVisible(true); chart.getLegend().setPosition(SWT.RIGHT); chart.getLegend().setVisible(true); chart.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WIDGET_LIGHT_SHADOW)); }
Source:
<code>public static long copy(final DataHandle<Location> in, final DataHandle<Location> out, final long length, final Task task, final int bufferSize) throws IOException { <START> long inputlength; <END> try { inputlength = in.length(); } catch (final IOException exc) { inputlength = 0; } if (task != null) { if (length > 0) task.setProgressMaximum(length); else if (inputlength > 0) task.setProgressMaximum(inputlength); } final byte[] buffer = new byte[bufferSize]; long totalRead = 0; while (true) { if (task != null && task.isCanceled()) break; final int r; if (length > 0 && totalRead + bufferSize > length) { int remaining = (int) (length - totalRead); r = in.read(buffer, 0, remaining); } else { r = in.read(buffer); } if (r <= 0) break; if (task != null && task.isCanceled()) break; out.write(buffer, 0, r); totalRead += r; if (task != null) task.setProgressValue(task .getProgressValue() + r); } return totalRead; }</code><technical_language>achieve final this variable if structure this section a more carefully</technical_language>

Target:
public static long copy(final DataHandle<Location> in, final DataHandle<Location> out, final long length, final Task task, final int bufferSize) throws IOException { final long inputlength; { long i = 0; try { i = in.length(); } catch (final IOException exc) { i = 0; } inputlength = i; } if (task != null) { if (length > 0) task.setProgressMaximum(length); else if (inputlength > 0) task.setProgressMaximum(inputlength); } final byte[] buffer = new byte[bufferSize]; long totalRead = 0; while (true) { if (task != null && task.isCanceled()) break; final int r; if (length > 0 && totalRead + bufferSize > length) { int remaining = (int) (length - totalRead); r = in.read(buffer, 0, remaining); } else { r = in.read(buffer); } if (r <= 0) break; if (task != null && task.isCanceled()) break; out.write(buffer, 0, r); totalRead += r; if (task != null) { task.setProgressValue(task.getProgressValue() + r); } } return totalRead; }
Source:
<code>static ReplicaView replicaInfo(Node node, long logOffset, long timeSinceLastCaughtUpMs) { <START> return new ReplicaView() { <END> @Override public Node endpoint() { return node; } @Override public long logEndOffset() { return logOffset; } @Override public long timeSinceLastCaughtUpMs() { return timeSinceLastCaughtUpMs; } }; }</code><technical_language>DefaultReplicaView. Similarly below</technical_language>

Target:
static ReplicaView replicaInfo(Node node, long logOffset, long timeSinceLastCaughtUpMs) { return new ReplicaView.DefaultReplicaView(node, logOffset, timeSinceLastCaughtUpMs); }
Source:
<code>public static List<Variable> getRunTimeVariables( Collection<Variable> variables) { List<Variable> runtimeVariables = <START> ReportalUtil.getVariablesByRegex(variables, "(?!(^" <END> + Reportal.REPORTAL_CONFIG_PREFIX + ")).+"); return runtimeVariables; }</code><technical_language>I .*Reportal.REPORTAL_CONFIG_PREFIX.+ prefix match good enough, "renaming" variable name I matter for match result</technical_language>

Target:
public static List<Variable> getRunTimeVariables( Collection<Variable> variables) { List<Variable> runtimeVariables = ReportalUtil.getVariablesByRegex(variables, Reportal.REPORTAL_CONFIG_PREFIX_NEGATION_REGEX); return runtimeVariables; }
Source:
<code>public void doTestRawQueryNXDomain(Executor executor) throws InterruptedException { final String msg = "RawQuery " + TEST_NX_DOMAIN; for (Network network : getTestableNetworks()) { final NetworkCapabilities nc = (network != null) ? mCM.getNetworkCapabilities(network) : mCM.getNetworkCapabilities(mCM.getActiveNetwork()); assertNotNull("Couldn't determine NetworkCapabilities for " + network, nc); <START> if (!nc.hasTransport(TRANSPORT_WIFI)) continue; <END> final VerifyCancelCallback callback = new VerifyCancelCallback(msg); mDns.rawQuery(network, TEST_NX_DOMAIN, CLASS_IN, TYPE_AAAA, FLAG_NO_CACHE_LOOKUP, executor, null, callback); assertTrue(msg + " but no answer after " + TIMEOUT_MS + "ms.", callback.waitForAnswer()); callback.assertNXDomain(); } }</code><technical_language>this "if (nc.hasTransport(TRANSPORT_CELLULAR)) continue;"</technical_language>

Target:
public void doTestRawQueryNXDomain(Executor executor) throws InterruptedException { final String msg = "RawQuery " + TEST_NX_DOMAIN; for (Network network : getTestableNetworks()) { final NetworkCapabilities nc = (network != null) ? mCM.getNetworkCapabilities(network) : mCM.getNetworkCapabilities(mCM.getActiveNetwork()); assertNotNull("Couldn't determine NetworkCapabilities for " + network, nc); if (nc.hasTransport(TRANSPORT_CELLULAR)) continue; final VerifyCancelCallback callback = new VerifyCancelCallback(msg); mDns.rawQuery(network, TEST_NX_DOMAIN, CLASS_IN, TYPE_AAAA, FLAG_NO_CACHE_LOOKUP, executor, null, callback); assertTrue(msg + " but no answer after " + TIMEOUT_MS + "ms.", callback.waitForAnswer()); callback.assertNXDomain(); } }
Source:
<code>public Set<SearchFilterItem> setActiveFilterParams(Model model, HttpServletRequest request) { Map<String, String[]> parameterMap = request.getParameterMap(); model.addAttribute("parameterMap", parameterMap); Map<String, String[]> filtersOnlyMap = parameterMap.entrySet().stream() .filter(entry -> Stream.of(SingletonSearchFilterType.values()).map (SingletonSearchFilterType::getParameterName).collect(Collectors.toList()).contains(entry <START> .getKey()) || ("filterJournals").equals(entry.getKey())) <END> .collect(Collectors.toMap(entry -> entry.getKey(), entry -> entry.getValue())); Set<SearchFilterItem> activeFilterItems = new LinkedHashSet<>(); filtersOnlyMap.forEach((filterName, filterValues) -> buildActiveFilterItems(activeFilterItems, parameterMap, filterName, filterValues)); return activeFilterItems; }</code><technical_language>clarify this a lot if extract Stream.of(SingletonSearchFilterType.values()).map(SingletonSearchFilterType::getParameterName).collect(Collectors.toList()) a static constant. speed contains if constant a Set instead of a List</technical_language>

Target:
public Set<SearchFilterItem> setActiveFilterParams(Model model, HttpServletRequest request) { Map<String, String[]> parameterMap = request.getParameterMap(); model.addAttribute("parameterMap", parameterMap); Map<String, String[]> filtersOnlyMap = parameterMap.entrySet().stream() .filter(entry -> FILTER_PARAMETER_NAMES.contains(entry.getKey()) || ("filterJournals").equals(entry.getKey())) .collect(Collectors.toMap(entry -> entry.getKey(), entry -> entry.getValue())); Set<SearchFilterItem> activeFilterItems = new LinkedHashSet<>(); filtersOnlyMap.forEach((filterName, filterValues) -> buildActiveFilterItems(activeFilterItems, parameterMap, filterName, filterValues)); return activeFilterItems; }
Source:
<code>public void testSaveAndRetrieveCustomToken() { List<String> allowedClasses = new ArrayList<String>(); allowedClasses.add("java.util."); allowedClasses.add("org.springframework.security."); allowedClasses.add("org.company.oauth2.CustomOAuth2AccessToken"); allowedClasses.add("org.company.oauth2.CustomOAuth2Authentication"); WhitelistedSerializationStrategy newStrategy = new WhitelistedSerializationStrategy(allowedClasses); SerializationStrategy oldStrategy = SerializationUtils.getSerializationStrategy(); try { SerializationUtils.setSerializationStrategy(newStrategy); <START> OAuth2AccessToken accessToken = new DefaultOAuth2AccessToken("FOO"); <END> Authentication authentication = new UsernamePasswordAuthenticationToken("marissa", "koala"); AuthorizationCodeResourceDetails resource = new AuthorizationCodeResourceDetails(); resource.setClientId("client"); resource.setScope(Arrays.asList("foo", "bar")); tokenStore.saveAccessToken(resource, authentication, accessToken); OAuth2AccessToken result = tokenStore.getAccessToken(resource, authentication); } finally { SerializationUtils.setSerializationStrategy(oldStrategy); } }</code><technical_language>this new CustomOAuth2AccessToken("FOO")</technical_language>

Target:
public void testSaveAndRetrieveCustomToken() { OAuth2AccessToken accessToken = new CustomOAuth2AccessToken("FOO"); Authentication authentication = new UsernamePasswordAuthenticationToken("marissa", "koala"); AuthorizationCodeResourceDetails resource = new AuthorizationCodeResourceDetails(); resource.setClientId("client"); resource.setScope(Arrays.asList("foo", "bar")); tokenStore.saveAccessToken(resource, authentication, accessToken); OAuth2AccessToken result = tokenStore.getAccessToken(resource, authentication); assertNotNull(result); assertEquals(accessToken, result); }
Source:
<code><START> public void applyXSettingsToQuery(SolrQuery query, XSettings xSettings) { <END> XField xField = xSettings.getField(); String fieldName = xFieldNameMapper.mapXField(xField); XRange xRange = xSettings.getRange(); XRangeConverter xRangeConverter = xRangeConverterManager.getXRangeConverter(xRange.getClass()); String startParam = xRangeConverter.convertStart(xRange); String endParam = xRangeConverter.convertEnd(xRange); String gapParam = xRangeConverter.convertGap(xRange); rangeFacetToQueryApplier.applyRangeFacet(query, fieldName, startParam, endParam, gapParam); }</code><technical_language>if xSettings is null</technical_language>

Target:
public void applyXSettingsToQuery(SolrQuery query, XSettings xSettings) { Preconditions.checkNotNull(query); Preconditions.checkNotNull(xSettings); XField xField = xSettings.getField(); String fieldName = xFieldNameMapper.mapXField(xField); XRange xRange = xSettings.getRange(); XRangeConverter xRangeConverter = xRangeConverterManager.getXRangeConverter(xRange.getClass()); String startParam = xRangeConverter.convertStart(xRange); String endParam = xRangeConverter.convertEnd(xRange); String gapParam = xRangeConverter.convertGap(xRange); rangeFacetToQueryApplier.applyRangeFacet(query, fieldName, startParam, endParam, gapParam); }
Source:
<code>public synchronized LinkedHashMap<ComponentName, RegistrationInfoImpl> getResolvedMap() { <START> return new LinkedHashMap<ComponentName,RegistrationInfoImpl>(resolved); <END> }</code><technical_language>Method return a Map, Collections.unmodifiableMap</technical_language>

Target:
public synchronized Map<ComponentName, RegistrationInfoImpl> getResolvedMap() { return Collections.unmodifiableMap(resolved); }
Source:
<code>private static void handleHundredKmWithPreviousType( String mgrsPart, MgrsPartType previousType, StringBuilder mgrsBuilder) { LOGGER.trace("Found a 100KM which occurs after a {}", mgrsPart, previousType); switch (previousType) { case ZONE: <START> LOGGER.trace("Saving this part"); <END> mgrsBuilder.append(mgrsPart); break; case HUNDRED_KM: case NUMERIC: case NONE: LOGGER.trace("Ignoring this part, since 100KM is only valid after a ZONE"); break; } }</code><technical_language>log mgrs part</technical_language>

Target:
private static void handleHundredKmWithPreviousType( String mgrsPart, MgrsPartType previousType, StringBuilder mgrsBuilder) { LOGGER.trace("Found a 100KM which occurs after a {}", mgrsPart, previousType); switch (previousType) { case ZONE: LOGGER.trace("Saving this part [{}]", mgrsPart); mgrsBuilder.append(mgrsPart); break; case HUNDRED_KM: case NUMERIC: case NONE: LOGGER.trace("Ignoring this part [{}], since 100KM is only valid after a ZONE", mgrsPart); } }
Source:
<code><START> public static String encodeWebSocketKey(String key) throws NoSuchAlgorithmException, NullPointerException, IOException { <END> String toEncode = key + WEB_SOCKET_GUID; return Base64.getEncoder().encodeToString(encoder.getHashSHA1(toEncode.getBytes())); }</code><technical_language>Remove throws? thrown, for catch exception (SHA1 is of default algorithms JVM needs implement)</technical_language>

Target:
public static String encodeWebSocketKey(String key) { String toEncode = key + WEB_SOCKET_GUID; try { return Base64.getEncoder().encodeToString(encoder.getHashSHA1(toEncode.getBytes())); } catch (NoSuchAlgorithmException e) { return null; } }
Source:
<code>public void checkConstructorWithThrowable() { Throwable testThrowable = new RuntimeException("yo"); StorIOException storIOException = new StorIOException(testThrowable); <START> assertThat(storIOException.getCause()).isEqualTo(testThrowable); <END> }</code><technical_language>isSameAs() instead of isEqualsTo()</technical_language>

Target:
public void checkConstructorWithThrowable() { Throwable testThrowable = new RuntimeException("yo"); StorIOException storIOException = new StorIOException(testThrowable); assertThat(storIOException.getCause()).isSameAs(testThrowable); }
Source:
<code>public void validate(FailureCollector collector) { if (!containsMacro("sheetValue") && sheet.equalsIgnoreCase(SHEET_NO) && !StringUtils.isNumeric(sheetValue)) { collector.addFailure( String.format("Invalid sheet number: '%s'.", sheetValue), "The value should be greater than or equal to zero.") .withConfigProperty(SHEET_VALUE); } if (!(Strings.isNullOrEmpty(tableExpiryPeriod)) && (Strings.isNullOrEmpty(memoryTableName))) { collector.addFailure( "Value for Table Expiry Period is valid only when file tracking table is specified.", null) .withConfigProperty(TABLE_EXPIRY_PERIOD); } if (!Strings.isNullOrEmpty(rowsLimit) && !StringUtils.isNumeric(rowsLimit)) { collector.addFailure(String.format("Invalid row limit: '%s'.", rowsLimit), "Numeric value expected.") .withConfigProperty(ROWS_LIMIT); } <START> collector.getOrThrowException(); <END> }</code><technical_language>here, caller decide call it. In case of configurePipeline(), more validated</technical_language>

Target:
public void validate(FailureCollector collector) { if (!containsMacro("sheetValue") && sheet.equalsIgnoreCase(SHEET_NO) && !StringUtils.isNumeric(sheetValue)) { collector.addFailure( String.format("Invalid sheet number: '%s'.", sheetValue), "The value should be greater than or equal to zero.") .withConfigProperty(SHEET_VALUE); } if (!(Strings.isNullOrEmpty(tableExpiryPeriod)) && (Strings.isNullOrEmpty(memoryTableName))) { collector.addFailure( "Value for Table Expiry Period is valid only when file tracking table is specified.", null) .withConfigProperty(TABLE_EXPIRY_PERIOD); } if (!Strings.isNullOrEmpty(rowsLimit) && !StringUtils.isNumeric(rowsLimit)) { collector.addFailure(String.format("Invalid row limit: '%s'.", rowsLimit), "Numeric value expected.") .withConfigProperty(ROWS_LIMIT); } if (Strings.isNullOrEmpty(columnList) && Strings.isNullOrEmpty(outputSchema)) { collector.addFailure( "'Field Name Schema Type Mapping' and 'Columns To Be Extracted' cannot both be empty.", null) .withConfigProperty(OUTPUT_SCHEMA).withConfigProperty(COLUMN_LIST); } }
Source:
<code>public static StreamingPlanSection extractStreamingSections(SubPlan subPlan) { <START> List<SubPlan> childrenRoots = new ArrayList<>(); <END> StreamingSubPlan streamingSection = extractStreamingSection(subPlan, childrenRoots); return new StreamingPlanSection( streamingSection, childrenRoots.stream() .map(SqlQueryScheduler::extractStreamingSections) .collect(toImmutableList())); }</code><technical_language>nit: call materializedExchangeChildren</technical_language>

Target:
public static StreamingPlanSection extractStreamingSections(SubPlan subPlan) { ImmutableList.Builder<SubPlan> materializedExchangeChildren = ImmutableList.builder(); StreamingSubPlan streamingSection = extractStreamingSection(subPlan, materializedExchangeChildren); return new StreamingPlanSection( streamingSection, materializedExchangeChildren.build().stream() .map(SqlQueryScheduler::extractStreamingSections) .collect(toImmutableList())); }
Source:
<code><START> public void testDisableHtmlEscaping() { <END> String testStr = "==="; String json = DHE_GSON.toJson(testStr); assertEquals(testStr.length() + 2, json.length()); assertEquals(testStr, json.substring(1, 1 + testStr.length())); }</code><technical_language>@WenFeiYi provide another unit test example posted Jira? i.e {"call":"Multi(org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos$MultiRequest)","multi.gets":0,"starttimems":"1604389131993","responsesize":"64","method":"Multi","param":"region\u003d test,,1604389129684.8812226d0f8942b24892c79e3c393b26., for 10 action(s) 1st row key\u003d11","processingtimems":20,"client":"172.16.136.23:61264","queuetimems":0,"multi.servicecalls":0,"class":"MiniHBaseClusterRegionServer","multi.mutations":10} assert \u003d is replaced = entire string message</technical_language>

Target:
public void testDisableHtmlEscaping() { assertEquals("\"\\u003d\\u003d\\u003d\"", GSON.toJson("===")); assertEquals("\"===\"", DHE_GSON.toJson("===")); }
Source:
<code>protected void executeVdsBrokerCommand() { UpdateGlusterGeoRepKeysVDSParameters parameters = getParameters(); status = getBroker().glusterGeoRepKeysUpdate(parameters.getRemoteUserName(), <START> new ArrayList<>(parameters.getGeoRepPubKeys())); <END> proceedProxyReturnValue(); }</code><technical_language>create new List here? getGeoRepPubKeys returns a list already</technical_language>

Target:
protected void executeVdsBrokerCommand() { UpdateGlusterGeoRepKeysVDSParameters parameters = getParameters(); status = getBroker().glusterGeoRepKeysUpdate(parameters.getGeoRepPubKeys(), parameters.getRemoteUserName()); proceedProxyReturnValue(); }
Source:
<code>public void actionDialogOK() { fCollectAction.setCollectString(fCollectString.getText()); fCollectAction.setCharPtrAsStrings(fTreatCharPtrAsStrings.getSelection()); <START> Integer limit = getCharPtrAsStringLimit(fTreatCharPtrAsStringsLimit.getText()); <END> fCollectAction.setCharPtrAsStringsLimit(limit); }</code><technical_language>Throwing exception 'getCharPtrAsStringLimit' instead of processing 'NumbeFormatException' allow limit value</technical_language>

Target:
public void actionDialogOK() { fCollectAction.setCollectString(fCollectString.getText()); fCollectAction.setCharPtrAsStrings(fTreatCharPtrAsStrings.getSelection()); try { Integer limit = getCharPtrAsStringLimit(fTreatCharPtrAsStringsLimit.getText()); fCollectAction.setCharPtrAsStringsLimit(limit); } catch (IllegalCollectStringLimitException e) { } }
Source:
<code>public OutputWriter createOutputWriter() { <START> if (file.exists() && overwriteFile==false){ <END> throw new IllegalStateException("The file already exists. Please configure the job to overwrite the existing file."); } List<String> headers = new ArrayList<String>(); for (int i = 0; i < columns.length; i++) { String columnName = columns[i].getName(); headers.add(columnName); if (columnToBeSortedOn != null) { if (columnName.equals(columnToBeSortedOn.getName())) { indexOfColumnToBeSortedOn = i; } } } if (columnToBeSortedOn != null) { if (indexOfColumnToBeSortedOn == -1) { this.isColumnToBeSortedOnPresentInInput = false; indexOfColumnToBeSortedOn = columns.length; headers.add(columnToBeSortedOn.getName()); InputColumn<?>[] newColumns = new InputColumn<?>[columns.length + 1]; for (int i = 0; i < columns.length; i++) { newColumns[i] = columns[i]; } newColumns[columns.length] = columnToBeSortedOn; columns = newColumns; } } if (_targetFile == null) { try { initTempFile(); } catch (Exception e) { throw new RuntimeException(e); } } return CsvOutputWriterFactory.getWriter(_targetFile.getPath(), headers.toArray(new String[0]), separatorChar, quoteChar, escapeChar, includeHeader, columns); }</code><technical_language>This condition moved a Validate method insted of createOutputWriter() method (which is invoked initiatlize time, validation time is more frequent/early)</technical_language>

Target:
public OutputWriter createOutputWriter() { List<String> headers = new ArrayList<String>(); for (int i = 0; i < columns.length; i++) { String columnName = columns[i].getName(); headers.add(columnName); if (columnToBeSortedOn != null) { if (columnName.equals(columnToBeSortedOn.getName())) { indexOfColumnToBeSortedOn = i; } } } if (columnToBeSortedOn != null) { if (indexOfColumnToBeSortedOn == -1) { this.isColumnToBeSortedOnPresentInInput = false; indexOfColumnToBeSortedOn = columns.length; headers.add(columnToBeSortedOn.getName()); InputColumn<?>[] newColumns = new InputColumn<?>[columns.length + 1]; for (int i = 0; i < columns.length; i++) { newColumns[i] = columns[i]; } newColumns[columns.length] = columnToBeSortedOn; columns = newColumns; } } if (_targetFile == null) { try { initTempFile(); } catch (Exception e) { throw new RuntimeException(e); } } return CsvOutputWriterFactory.getWriter(_targetFile.getPath(), headers.toArray(new String[0]), separatorChar, quoteChar, escapeChar, includeHeader, columns); }
Source:
<code>public void filePage003_diffPage() { HistoryPagePageObject historyPage = new HistoryPagePageObject(driver); <START> historyPage.openHistoryPage(Global.DOMAIN + URLsContent.wikiDir + URLsContent.fileNS + URLsContent.fileName); <END> historyPage.goToDiffPageFromHistoryPage(); DiffPagePageObject diffPage = new DiffPagePageObject(driver); diffPage.verifyDiffTablePresent(); }</code><technical_language>1. openHistoryPage() method named openFileHistoryPage() 2. method if parameter consist variable e.g. historyPage.openHistoryPage(URLsContent.fileName);</technical_language>

Target:
public void filePage003_diffPage() { HistoryPagePageObject historyPage = new HistoryPagePageObject(driver); historyPage.openFileHistoryPage(URLsContent.filePage + URLsContent.fileName001); historyPage.goToDiffPageFromHistoryPage(); DiffPagePageObject diffPage = new DiffPagePageObject(driver); diffPage.verifyDiffTablePresent(); }
Source:
<code>public String[] getDnsServers() { WinDef.ULONGByReference bufferSize = new WinDef.ULONGByReference(); int ret = IPHlpAPI.INSTANCE.GetNetworkParams(null, bufferSize); if (ret != IPHlpAPI.ERROR_BUFFER_OVERFLOW) { LOG.error("Failed to get network parameters buffer size. Error code: {}", ret); return new String[0]; } FIXED_INFO buffer = new FIXED_INFO(new Memory(bufferSize.getValue().longValue())); ret = IPHlpAPI.INSTANCE.GetNetworkParams(buffer, bufferSize); if (ret != 0) { LOG.error("Failed to get network parameters. Error code: {}", ret); return new String[0]; } List<String> list = new ArrayList<>(); IPHlpAPI.IP_ADDR_STRING dns = buffer.DnsServerList; while(dns != null) { String addr = new String(dns.IpAddress.String); int nullPos = addr.indexOf(0); if(nullPos != -1) { addr = addr.substring(0, nullPos); } list.add(addr); dns = dns.Next; } <START> return list.toArray(new String[0]); <END> }</code><technical_language>This return list.toArray(new String[list.size()]); avoid creating/discarding empty String array</technical_language>

Target:
public String[] getDnsServers() { WinDef.ULONGByReference bufferSize = new WinDef.ULONGByReference(); int ret = IPHlpAPI.INSTANCE.GetNetworkParams(null, bufferSize); if (ret != IPHlpAPI.ERROR_BUFFER_OVERFLOW) { LOG.error("Failed to get network parameters buffer size. Error code: {}", ret); return new String[0]; } FIXED_INFO buffer = new FIXED_INFO(new Memory(bufferSize.getValue().longValue())); ret = IPHlpAPI.INSTANCE.GetNetworkParams(buffer, bufferSize); if (ret != 0) { LOG.error("Failed to get network parameters. Error code: {}", ret); return new String[0]; } List<String> list = new ArrayList<>(); IPHlpAPI.IP_ADDR_STRING dns = buffer.DnsServerList; while (dns != null) { String addr = new String(dns.IpAddress.String); int nullPos = addr.indexOf(0); if (nullPos != -1) { addr = addr.substring(0, nullPos); } list.add(addr); dns = dns.Next; } return list.toArray(new String[list.size()]); }
Source:
<code>protected StorageDomain addParents(StorageDomain model) { Guid storageDomainId = Guid.createGuidFromString(model.getId()); List<Guid> dataCenterIds = StorageDomainHelper.getAttachedDataCenters(this, storageDomainId); if (!CollectionUtils.isEmpty(dataCenterIds)) { <START> DataCenters dataCenters = new DataCenters(); <END> for (Guid dataCenterId : dataCenterIds) { DataCenter dataCenter = new DataCenter(); dataCenter.setId(dataCenterId.toString()); dataCenters.getDataCenters().add(dataCenter); } model.setDataCenters(dataCenters); } return model; }</code><technical_language>extracted helper? this logic repeat itself.</technical_language>

Target:
protected StorageDomain addParents(StorageDomain model) { StorageDomainHelper.addAttachedDataCenterReferences(this, model); return model; }
Source:
<code>public void selectAllFiles() { logger.info("selectAllFiles called"); List<FileMetadata> allFiles = new ArrayList<>(); <START> for (FileMetadata fm : workingVersion.getFileMetadatas()) { <END> allFiles.add(fm); } selectedFiles = allFiles; }</code><technical_language>selectedFiles = workingVersion.getFileMetadatas();</technical_language>

Target:
public void selectAllFiles() { logger.fine("selectAllFiles called"); selectedFiles = workingVersion.getFileMetadatas(); }
Source:
<code>public void tearDown() throws IOException, InterruptedException { try (AutoMlClient client = AutoMlClient.create()) { <START> while (!client.getOperationsClient().getOperation(operationFullName).getDone()) { Thread.sleep(1000); } <END> client.getOperationsClient().deleteOperation(operationFullName); } System.setOut(null); }</code><technical_language>this a counter of some kind limit 3-5m? finish, in case</technical_language>

Target:
public void tearDown() throws IOException, InterruptedException { try (AutoMlClient client = AutoMlClient.create()) { client.getOperationsClient().cancelOperation(operationFullName); client.getOperationsClient().awaitTermination(5, TimeUnit.SECONDS); } System.setOut(null); }
Source:
<code><START> default Subscription onChange(Consumer<T> consumer) { <END> PropertyListener<T> listener = new PropertyListener<T>() { @Override public void onChange(T value) { consumer.accept(value); } }; addListener(listener); return () -> removeListener(listener); }</code><technical_language>nit: semantically 'Subscription' a obvious result 'onChange' method; 'subscribe' work method name here? is terminology in RexJava</technical_language>

Target:
default Subscription onChange(Consumer<T> consumer) { return subscribe(consumer); }
Source:
<code>public static long getCFInstanceIndex() { long cfInstanceIndex = -1L; try { cfInstanceIndex = Long.parseLong(System.getenv("CF_INSTANCE_INDEX")); } catch(Exception e) { <START> return cfInstanceIndex; <END> } return cfInstanceIndex; }</code><technical_language>Please specific in catching exceptions, generic catch-all Exception for instance a multi-catch block. wrong -1 is returned, is if is caused CF_INSTANCE_INDEX environment variable present, if is present parseable a Long. Also, return statement in catch-block is redundant end of method. I suggest log exception CommunityCommons log node INFO level, if catch one</technical_language>

Target:
public static long getCFInstanceIndex() { long cfInstanceIndex = -1L; try { cfInstanceIndex = Long.parseLong(System.getenv("CF_INSTANCE_INDEX")); } catch(SecurityException securityException) { LOG.info("GetCFInstanceIndex: Could not access environment variable CF_INSTANCE_INDEX, permission denied. Value of -1 is returned."); } catch(NumberFormatException numberFormatException) { LOG.info("GetCFInstanceIndex: Could not parse value of environment variable CF_INSTANCE_INDEX as Long. Value of -1 is returned."); } catch(NullPointerException nullPointerException) { LOG.info("GetCFInstanceIndex: Could not find value for environment variable CF_INSTANCE_INDEX. This could indicate a local deployment is running. Value of -1 is returned."); } return cfInstanceIndex; }
Source:
<code>protected void onHandleIntent(@Nullable Intent intent) { Log.d(TAG, "Starting File upload service"); resources = getResources(); if (intent != null) { Operation operation = (Operation) intent.getExtras().getSerializable(resources. getString(R.string.intent_extra_operation_object)); try { uploadFile(operation); } catch (AndroidAgentException e) { <START> Log.d(TAG, e.getLocalizedMessage()); <END> } } this.stopSelf(); }</code><technical_language>log errors debug. Please error log instead</technical_language>

Target:
protected void onHandleIntent(@Nullable Intent intent) { if (Constants.DEBUG_MODE_ENABLED) { Log.d(TAG, "Starting File upload service"); } resources = getResources(); if (intent != null) { Operation operation = (Operation) intent.getExtras().getSerializable(resources. getString(R.string.intent_extra_operation_object)); try { uploadFile(operation); } catch (AndroidAgentException e) { Log.e(TAG, e.getLocalizedMessage()); } } this.stopSelf(); }
Source:
<code><START> public long getDb_generation() { <END> return db_generation; }</code><technical_language>java conventions</technical_language>

Target:
public Long getDb_generation() { return db_generation; }
Source:
<code>public Response putMultipart(final MultipartAttachmentWriter mpw) { Map<String, Object> options = new HashMap<String, Object>(); options.put("new_edits", "false"); URI uri = this.uriHelper.documentUri(mpw.getId(), options); HashMap<String, String> headers = new HashMap<String, String>(); String contentType = "multipart/related;boundary=" + mpw.getBoundary(); HttpConnection connection = Http.PUT(contentType, uri); connection.setInput(mpw, mpw.getContentLength()); try { InputStream is = connection.executeToInputStream(); <START> return jsonHelper.fromJson(new InputStreamReader(is), Response.class); <END> } catch (IOException ioe) { return null; } }</code><technical_language>useful a method HttpConnection, responseAsClass(Response.class)</technical_language>

Target:
public Response putMultipart(final MultipartAttachmentWriter mpw) { Map<String, Object> options = new HashMap<String, Object>(); options.put("new_edits", "false"); URI uri = this.uriHelper.documentUri(mpw.getId(), options); String contentType = "multipart/related;boundary=" + mpw.getBoundary(); HttpConnection connection = Http.PUT(uri, contentType); connection.setRequestBody(mpw, mpw.getContentLength()); return executeToJsonObject(connection, Response.class); }
Source:
<code>public void testEncounter_latestEncounterIsAlwaysShown() { inUserLoginGoToDemoPatientChart(); for (int i = 0; i < 6; i++) { openEncounterForm(); String temp = Integer.toString(i + 35); String respiratoryRate = Integer.toString(i + 80); String bpSystolic = Integer.toString(i + 80); <START> String bpDiastolic = Integer.toString(5 + 100); <END> answerTextQuestion("Temperature", temp); answerTextQuestion("Respiratory rate", respiratoryRate); answerTextQuestion("Blood pressure, systolic", bpSystolic); answerTextQuestion("Blood pressure, diastolic", bpDiastolic); saveForm(); waitForProgressFragment(); try{ Thread.sleep(20000); } catch (InterruptedException e){} checkObservationValueEquals("[test] Temperature (°C)", temp); checkObservationValueEquals("[test] Respiratory rate (bpm)", respiratoryRate); checkObservationValueEquals("[test] Blood pressure, systolic", bpSystolic); checkObservationValueEquals("[test] Blood pressure, diastolic", bpDiastolic); } }</code><technical_language>bpDiastolic is for interaction. "i" instead of "5"</technical_language>

Target:
public void testEncounter_latestEncounterIsAlwaysShown() { inUserLoginGoToDemoPatientChart(); for (int i = 0; i < 6; i++) { openEncounterForm(); String temp = Integer.toString(i + 35) + ".7"; String respiratoryRate = Integer.toString(i + 80); String bpSystolic = Integer.toString(i + 80); String bpDiastolic = Integer.toString(i + 100); answerTextQuestion("Temperature", temp); answerTextQuestion("Respiratory rate", respiratoryRate); answerTextQuestion("Blood pressure, systolic", bpSystolic); answerTextQuestion("Blood pressure, diastolic", bpDiastolic); saveForm(); waitForProgressFragment(); try{ Thread.sleep(30000); } catch (InterruptedException e){} checkObservationValueEquals("[test] Temperature (°C)", temp); checkObservationValueEquals("[test] Respiratory rate (bpm)", respiratoryRate); checkObservationValueEquals("[test] Blood pressure, systolic", bpSystolic); checkObservationValueEquals("[test] Blood pressure, diastolic", bpDiastolic); } }
Source:
<code>public void testIOConsoleAvailable() throws Exception { IOConsole console = new IOConsole("", null); try (InputStream consoleInput = console.getInputStream()) { consoleInput.available(); consoleInput.available(); <START> } catch (IOException ioe) { <END> TestCase.assertEquals("Input Stream is closed", ioe.getMessage()); } console = new IOConsole("", null); try (InputStream consoleInput = console.getInputStream()) { consoleInput.available(); new Thread(() -> { try { Thread.sleep(100); consoleInput.close(); } catch (Exception e) { } }).start(); assertEquals("read() did not signaled EOF.", -1, consoleInput.read()); } console = new IOConsole("", null); try (InputStream consoleInput = console.getInputStream()) { consoleInput.close(); boolean second = false; try { consoleInput.available(); second = true; consoleInput.available(); } catch (IOException ioe) { assertFalse("Second available() after close() thrown exception. Either both or non should fail.", second); } } }</code><technical_language>please remove catch. is hit. if wrong is fine throw further</technical_language>

Target:
public void testIOConsoleAvailable() throws Exception { IOConsole console = new IOConsole("", null); try (InputStream consoleInput = console.getInputStream()) { consoleInput.available(); consoleInput.available(); } console = new IOConsole("", null); try (InputStream consoleInput = console.getInputStream()) { consoleInput.available(); new Thread(() -> { try { Thread.sleep(100); consoleInput.close(); } catch (Exception e) { } }).start(); assertEquals("read() did not signaled EOF.", -1, consoleInput.read()); } console = new IOConsole("", null); try (InputStream consoleInput = console.getInputStream()) { consoleInput.close(); consoleInput.available(); consoleInput.available(); } }
Source:
<code>public DeniedAccess(Map<URI, Collection<String>> conflicts) { <START> assert !conflicts.isEmpty() : "the conflict map should not be empty"; <END> this.conflicts = conflicts; }</code><technical_language>assertions</technical_language>

Target:
public DeniedAccess(Map<URI, Collection<String>> conflicts) { if (conflicts.isEmpty()) { throw new IllegalArgumentException("the conflict map should not be empty"); } this.conflicts = conflicts; }
Source:
<code>private Object executeQuery(Object entity, String queryString, Map<String, Object> params, MappingPolicy mappingPolicy) { final TypeInformation<?> typeInformation = property.getTypeInformation(); final TypeInformation<?> actualType = typeInformation.getActualType(); final Class<?> targetType = actualType.getType(); final Result<Map<String, Object>> result = queryEngine.query(queryString, params).with(mappingPolicy); if (actualType.isMap()) { return result; } if (typeInformation.isCollectionLike()) { <START> return CollectionLikeQueryResultExtractionUtil.extractCollectionLikeResult(result, targetType, typeInformation.getType()); <END> } return result.to(targetType).singleOrNull(); }</code><technical_language>QueryResultBuilder</technical_language>

Target:
private Object executeQuery(Object entity, String queryString, Map<String, Object> params, MappingPolicy mappingPolicy) { final TypeInformation<?> typeInformation = property.getTypeInformation(); final TypeInformation<?> actualType = typeInformation.getActualType(); final Class<?> targetType = actualType.getType(); final Result<Map<String, Object>> result = queryEngine.query(queryString, params).with(mappingPolicy); if (actualType.isMap()) { return result; } return (typeInformation.isCollectionLike()) ? result.to(targetType).asCollection((Class<? extends Iterable>)typeInformation.getType()) : result.to(targetType).singleOrNull(); }
Source:
<code>Comparator<TimeAndDims> dimsComparator() { <START> return new TimeAndDimsComp(); <END> }</code><technical_language>TimeAndDimsComp a singleton, a static final INSTANCE in</technical_language>

Target:
protected final Comparator<TimeAndDims> dimsComparator() { return new TimeAndDimsComp(dimValues); }
Source:
<code>private boolean checkFourLetterWord(final SelectionKey k, final int len) throws IOException { String cmd = FourLetterCommands.getCmdMapView().get(len); <START> if (cmd == null || !FourLetterCommands.getWhiteListedCmdView().contains(cmd)) { <END> return false; } LOG.info("Processing " + cmd + " command from " + sock.socket().getRemoteSocketAddress()); packetReceived(); if (k != null) { try { k.cancel(); } catch(Exception e) { LOG.error("Error cancelling command selection key ", e); } } final PrintWriter pwriter = new PrintWriter( new BufferedWriter(new SendBufferWriter())); if (len == FourLetterCommands.setTraceMaskCmd) { incomingBuffer = ByteBuffer.allocate(8); int rc = sock.read(incomingBuffer); if (rc < 0) { throw new IOException("Read error"); } incomingBuffer.flip(); long traceMask = incomingBuffer.getLong(); ZooTrace.setTextTraceLevel(traceMask); SetTraceMaskCommand setMask = new SetTraceMaskCommand(pwriter, this, traceMask); setMask.start(); return true; } else { CommandExecutor commandExecutor = new CommandExecutor(); return commandExecutor.execute(this, pwriter, len, zkServer, factory); } }</code><technical_language>if request is for 4lw command, processed in only. If false is returned here, request proceed normal request. This is major issue in current patch</technical_language>

Target:
private boolean checkFourLetterWord(final SelectionKey k, final int len) throws IOException { if (!FourLetterCommands.isKnown(len)) { return false; } String cmd = FourLetterCommands.getCommandString(len); packetReceived(); if (k != null) { try { k.cancel(); } catch(Exception e) { LOG.error("Error cancelling command selection key ", e); } } final PrintWriter pwriter = new PrintWriter( new BufferedWriter(new SendBufferWriter())); if (!FourLetterCommands.isEnabled(cmd)) { LOG.debug("Command is not executed because it is not in the whitelist.", cmd); NopCommand nopCmd = new NopCommand(pwriter, this, cmd + " is not executed because it is not in the whitelist."); nopCmd.start(); return true; } LOG.info("Processing " + cmd + " command from " + sock.socket().getRemoteSocketAddress()); if (len == FourLetterCommands.setTraceMaskCmd) { incomingBuffer = ByteBuffer.allocate(8); int rc = sock.read(incomingBuffer); if (rc < 0) { throw new IOException("Read error"); } incomingBuffer.flip(); long traceMask = incomingBuffer.getLong(); ZooTrace.setTextTraceLevel(traceMask); SetTraceMaskCommand setMask = new SetTraceMaskCommand(pwriter, this, traceMask); setMask.start(); return true; } else { CommandExecutor commandExecutor = new CommandExecutor(); return commandExecutor.execute(this, pwriter, len, zkServer, factory); } }
Source:
<code>public int getSupportedFeatureSet() { int featureSet = 0; try { final MutableInt feat = new MutableInt(0); synchronized (sLock) { if (mIWifiStaIface != null) { mIWifiStaIface.getCapabilities((status, capabilities) -> { if (status.code != WifiStatusCode.SUCCESS) return; feat.value = wifiFeatureMaskFromStaCapabilities(capabilities); }); } } featureSet = feat.value; } catch (RemoteException e) { handleRemoteException(e); return 0; } Set<Integer> supportedIfaceTypes = mHalDeviceManager.getSupportedIfaceTypes(); if (supportedIfaceTypes.contains(IfaceType.AP)) { featureSet |= WifiManager.WIFI_FEATURE_MOBILE_HOTSPOT; } if (supportedIfaceTypes.contains(IfaceType.P2P)) { featureSet |= WifiManager.WIFI_FEATURE_P2P; } if (supportedIfaceTypes.contains(IfaceType.NAN)) { featureSet |= WifiManager.WIFI_FEATURE_AWARE; } <START> <END> return featureSet; }</code><technical_language>if (supportedIfaceTypes.contains(IfaceType.STA)) { featureSet |= WifiManager.WIFI_FEATURE_INFRA; }</technical_language>

Target:
public int getSupportedFeatureSet() { int featureSet = 0; try { final MutableInt feat = new MutableInt(0); synchronized (sLock) { if (mIWifiStaIface != null) { mIWifiStaIface.getCapabilities((status, capabilities) -> { if (status.code != WifiStatusCode.SUCCESS) return; feat.value = wifiFeatureMaskFromStaCapabilities(capabilities); }); } } featureSet = feat.value; } catch (RemoteException e) { handleRemoteException(e); return 0; } Set<Integer> supportedIfaceTypes = mHalDeviceManager.getSupportedIfaceTypes(); if (supportedIfaceTypes.contains(IfaceType.STA)) { featureSet |= WifiManager.WIFI_FEATURE_INFRA; } if (supportedIfaceTypes.contains(IfaceType.AP)) { featureSet |= WifiManager.WIFI_FEATURE_MOBILE_HOTSPOT; } if (supportedIfaceTypes.contains(IfaceType.P2P)) { featureSet |= WifiManager.WIFI_FEATURE_P2P; } if (supportedIfaceTypes.contains(IfaceType.NAN)) { featureSet |= WifiManager.WIFI_FEATURE_AWARE; } return featureSet; }
Source:
<code>private static CommonCourtJudgment createCcJudgmentWithRandomData(String prefix, int numericPrefix){ CommonCourtJudgment ccJudgment = new CommonCourtJudgment(); TestInMemoryObjectFactoryHelper.fillJudgmentWithRandomData(ccJudgment, prefix, numericPrefix); ccJudgment.getSourceInfo().setSourceCode(SourceCode.COMMON_COURT); ccJudgment.getSourceInfo().setSourceJudgmentId(prefix+RandomStringUtils.randomAlphabetic(20)); <START> ccJudgment.getSourceInfo().setSourceJudgmentUrl("<LINK_0>" + RandomStringUtils.randomAlphabetic(20)); <END> CcJudgmentKeyword firstKeyword = new CcJudgmentKeyword(RandomStringUtils.randomAlphanumeric(18)); CcJudgmentKeyword secondKeyword = new CcJudgmentKeyword(RandomStringUtils.randomAlphanumeric(19)); ccJudgment.addKeyword(firstKeyword); ccJudgment.addKeyword(secondKeyword); return ccJudgment; }</code><technical_language>moving 2 lines fillJudgmentWithRandomData</technical_language>

Target:
private static CommonCourtJudgment createCcJudgmentWithRandomData(String prefix, int numericPrefix){ CommonCourtJudgment ccJudgment = new CommonCourtJudgment(); TestInMemoryObjectFactoryHelper.fillJudgmentWithRandomData(ccJudgment, prefix, numericPrefix); ccJudgment.getSourceInfo().setSourceCode(SourceCode.COMMON_COURT); CcJudgmentKeyword firstKeyword = new CcJudgmentKeyword(RandomStringUtils.randomAlphanumeric(18)); CcJudgmentKeyword secondKeyword = new CcJudgmentKeyword(RandomStringUtils.randomAlphanumeric(19)); ccJudgment.addKeyword(firstKeyword); ccJudgment.addKeyword(secondKeyword); return ccJudgment; }
Source:
<code>protected void configure() { bind(DataSource.class).toProvider(org.eclipse.che.core.db.JndiDataSourceProvider.class); bind(org.eclipse.che.api.system.server.SystemServicePermissionsFilter.class); install(new SystemPermissionsJpaModule()); install(new org.eclipse.che.api.permission.server.PermissionsModule()); install(new org.eclipse.che.api.workspace.server.WorkspaceApiPermissionsModule()); bind(UserProfileServicePermissionsFilter.class); bind(UserServicePermissionsFilter.class); bind(FactoryPermissionsFilter.class); bind(ActivityPermissionsFilter.class); <START> bindConstant().annotatedWith(Names.named("system.super_privileged_mode")).to(false); <END> Multibinder.newSetBinder(binder(), AccountPermissionsChecker.class) .addBinding() .to(PersonalAccountPermissionsChecker.class); }</code><technical_language>defined in property file admin able override this property external configuration</technical_language>

Target:
protected void configure() { bind(DataSource.class).toProvider(org.eclipse.che.core.db.JndiDataSourceProvider.class); bind(org.eclipse.che.api.system.server.SystemServicePermissionsFilter.class); install(new org.eclipse.che.api.permission.server.jpa.SystemPermissionsJpaModule()); install(new org.eclipse.che.api.permission.server.PermissionsModule()); install(new org.eclipse.che.api.workspace.server.WorkspaceApiPermissionsModule()); bind(org.eclipse.che.api.user.server.permissions.UserProfileServicePermissionsFilter.class); bind(org.eclipse.che.api.user.server.permissions.UserServicePermissionsFilter.class); bind(org.eclipse.che.api.factory.server.permissions.FactoryPermissionsFilter.class); bind(org.eclipse.che.plugin.activity.ActivityPermissionsFilter.class); Multibinder.newSetBinder(binder(), AccountPermissionsChecker.class) .addBinding() .to(org.eclipse.che.account.permission.PersonalAccountPermissionsChecker.class); }
Source:
<code>public static OctoInstallation[] getOctopusToolInstallations() { Jenkins jenkins = Jenkins.getInstanceOrNull(); if (jenkins == null) { <START> throw new NullPointerException("Jenkins instance not found"); <END> } OctoInstallation.DescriptorImpl descriptor = (OctoInstallation.DescriptorImpl) jenkins.getDescriptor(OctoInstallation.class); return descriptor.getInstallations(); }</code><technical_language>Consider adding a custom exception standardize messages</technical_language>

Target:
public static OctoInstallation[] getOctopusToolInstallations() { Jenkins jenkins = JenkinsHelpers.getJenkins(); OctoInstallation.DescriptorImpl descriptor = (OctoInstallation.DescriptorImpl) jenkins.getDescriptor(OctoInstallation.class); return descriptor.getInstallations(); }
Source:
<code><START> public String getProviderType() { <END> return osUser.getProviderType(); }</code><technical_language>return Credentials.IdentityProvider enum instead of underlying String</technical_language>

Target:
public Credentials.IdentityProvider getProviderType() { return Credentials.IdentityProvider.fromId(osUser.getProviderType()); }
Source:
<code>@Test void testEmptyValuesWithCollation() throws Exception { final RelBuilder builder = RelBuilder.create(config().build()); final RelNode root = builder .scan("DEPT") .filter(builder.literal(false)) .sort( builder.field("DNAME"), builder.field("DEPTNO")) .build(); try (PreparedStatement preparedStatement = RelRunners.run(root)) { final String s = CalciteAssert.toString(preparedStatement.executeQuery()); final String result = ""; <START> assertThat(s, is(result)); <END> } }</code><technical_language>compare plan</technical_language>

Target:
@Test void testEmptyValuesWithCollation() throws Exception { final RelBuilder builder = RelBuilder.create(config().build()); final RelNode root = builder .scan("DEPT").empty() .sort( builder.field("DNAME"), builder.field("DEPTNO")) .build(); try (PreparedStatement preparedStatement = RelRunners.run(root)) { final String result = CalciteAssert.toString(preparedStatement.executeQuery()); final String expectedResult = ""; assertThat(result, is(expectedResult)); } }