auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void testRemoveEnclosingSquareBrackets() { <START> String list = Arrays.asList(new String[]{"test1", "test2"}).toString(); <END> String nullString = null; assertEquals("test1, test2", StringHelper.removeEnclosingSquareBrackets(list)); assertEquals("test1,test2", StringHelper.removeEnclosingSquareBrackets(" [test1,test2] ")); assertEquals("test", StringHelper.removeEnclosingSquareBrackets("test")); assertEquals("", StringHelper.removeEnclosingSquareBrackets("")); assertEquals(null, nullString); }</code><technical_language>Is this conversion necessary? SUT involve array all</technical_language>

Target:
public void testRemoveEnclosingSquareBrackets() { assertEquals("test1, test2", StringHelper.removeEnclosingSquareBrackets("[test1, test2]")); assertEquals("[ \"test\" ]", StringHelper.removeEnclosingSquareBrackets("[[ \"test\" ]]")); assertEquals("test1, [], ] test2", StringHelper.removeEnclosingSquareBrackets("[test1, [], ] test2]")); assertEquals("test", StringHelper.removeEnclosingSquareBrackets("test")); assertEquals(" test ", StringHelper.removeEnclosingSquareBrackets(" test ")); assertEquals("[test", StringHelper.removeEnclosingSquareBrackets("[test")); assertEquals("(test]", StringHelper.removeEnclosingSquareBrackets("(test]")); assertEquals("", StringHelper.removeEnclosingSquareBrackets("")); assertEquals(null, StringHelper.removeEnclosingSquareBrackets(null)); }
Source:
<code>private void populateLanguageValues() { languageBox.getItems().clear(); for (Locale locale : Languages.SUPPORTED_LOCALES) { String item = locale.toLanguageTag() + " : " + BundleUtils.getLabel(locale, Languages.SETTINGS_LABEL_KEYS.get(locale)); <START> if (!locale.equals(Languages.getCurrentLocale())) { <END> item += " (" + BundleUtils.getLabel(Languages.SETTINGS_LABEL_KEYS.get(locale)) + ")"; } Collator coll = Collator.getInstance(locale); languageBox.getItems().add(item); languageBox.getItems().sort(coll); if (Languages.getCurrentLocale().equals(locale)) { languageBox.getSelectionModel().select(item); } } }</code><technical_language>Some indentation issues - try autoformatting file first</technical_language>

Target:
private void populateLanguageValues() { languageBox.getItems().clear(); for (Locale locale : Languages.SUPPORTED_LOCALES) { String item = locale.toLanguageTag() + " : " + BundleUtils.getLabel(locale, Languages.SETTINGS_LABEL_KEYS.get(locale)); <<<<<<< HEAD ======= >>>>>>> 5be3b0d0413202bc5c6b99e8bdc33a78b19c94fb if (!locale.equals(Languages.getCurrentLocale())) { item += " (" + BundleUtils.getLabel(Languages.SETTINGS_LABEL_KEYS.get(locale)) + ")"; } languageBox.getItems().add(item); if (Languages.getCurrentLocale().equals(locale)) { languageBox.getSelectionModel().select(item); } } Collator coll = Collator.getInstance(); languageBox.getItems().sort(coll); }
Source:
<code>public boolean isValid(AuthDTO dto, ConstraintValidatorContext context) { Optional<AuthEntry> auth = catalog.findByInfo(dto.info); if (!auth.isPresent()) { context.buildConstraintViolationWithTemplate(dto.type + " type is not valid for " + dto.info + " Auth Info!").addConstraintViolation(); return false; } <START> return true; <END> }</code><technical_language>hmm, verify type</technical_language>

Target:
public boolean isValid(AuthDTO dto, ConstraintValidatorContext context) { Optional<AuthEntry> auth = catalog.findByInfo(dto.info); if (!auth.isPresent()) { context.buildConstraintViolationWithTemplate(dto.info + " is invalid Auth Info!").addConstraintViolation(); return false; } if (!auth.get().containsType(dto.type)) { context.buildConstraintViolationWithTemplate(dto.type + " type is not valid for " + dto.info + " Auth Info!").addConstraintViolation(); return false; } return true; }
Source:
<code>protected String buildErrorEmailSubject() { <START> return "Error occurred during Corporate Billed Corporate Paid batch upload process"; <END> }</code><technical_language>existing PCard error email service this service hard-coded literals for email subjects bodies. moved parameters config properties instead, a constant</technical_language>

Target:
protected String buildErrorEmailSubject() { return configurationService.getPropertyValueAsString(CuFPKeyConstants.ERROR_CBCP_BATCH_UPLOAD_EMAIL_SUBJECT); }
Source:
<code>public boolean isSnapshotAllowed() { if (containsKey(SrampConstants.SRAMP_SNAPSHOT_ALLOWED)) { String value = getConfigProperty(SrampConstants.SRAMP_SNAPSHOT_ALLOWED, "false"); <START> if (StringUtils.isNotBlank(value) && value.equals("true")) { END> return true; } else { return false; } } else { if (isSnapshot()) { return true; } else { return false; } } }</code><technical_language>return StringUtils.isNotBlank(value) && value.equals("true");</technical_language>

Target:
public boolean isSnapshotAllowed() { if (containsKey(SrampConstants.SRAMP_SNAPSHOT_ALLOWED)) { String value = getConfigProperty(SrampConstants.SRAMP_SNAPSHOT_ALLOWED, "false"); return StringUtils.isNotBlank(value) && value.equals("true"); } else { return isSnapshot(); } }
Source:
<code>private void onTest() { flush(); startProgress(null); Frontend.RunAction(VdcActionType.TestProviderConnectivity, new ProviderParameters(provider), new IFrontendActionAsyncCallback() { @Override public void executed(FrontendActionAsyncResult result) { VdcReturnValueBase res = result.getReturnValue(); <START> if (res != null && !res.getSucceeded() && res.getFault().getError().equals(VdcBllErrors.PROVIDER_SSL_FAILURE)) { <END> AsyncQuery getCertChainQuery = new AsyncQuery(); getCertChainQuery.asyncCallback = new INewAsyncCallback() { @Override public void onSuccess(Object model, Object result) { if (result != null) { ConfirmationModel confirmationModel = getImportChainConfirmationModel((String) result); sourceListModel.setConfirmWindow(confirmationModel); } else { stopProgress(); setTestResultValue((VdcQueryReturnValue) result); } } }; AsyncDataProvider.GetProviderCertificateChain(getCertChainQuery, provider); } else { stopProgress(); setTestResultValue(res); } } }, null, false); }</code><technical_language>avoid NPE please change to- VdcBllErrors.PROVIDER_SSL_FAILURE.equals(res.getFault().getError())</technical_language>

Target:
private void onTest() { flush(); startProgress(null); Frontend.RunAction(VdcActionType.TestProviderConnectivity, new ProviderParameters(provider), new IFrontendActionAsyncCallback() { @Override public void executed(FrontendActionAsyncResult result) { VdcReturnValueBase res = result.getReturnValue(); if (isFailedOnSSL(res)) { AsyncQuery getCertChainQuery = new AsyncQuery(); getCertChainQuery.asyncCallback = new INewAsyncCallback() { @Override public void onSuccess(Object model, Object result) { if (result != null) { ConfirmationModel confirmationModel = getImportChainConfirmationModel((String) result); sourceListModel.setConfirmWindow(confirmationModel); } else { stopProgress(); setTestResultValue((VdcQueryReturnValue) result); } } }; AsyncDataProvider.GetProviderCertificateChain(getCertChainQuery, provider); } else { stopProgress(); setTestResultValue(res); } } }, null, false); }
Source:
<code>public Set<ClientSourceId> getTrackedClients() { <START> return Collections.unmodifiableSet(trackedClients); <END> }</code><technical_language>I do this: @Override public Set<ClientSourceId> getTrackedClients() { return clientMessageTrackers.stream() .flatMap(tracker -> tracker.getTrackedClients().stream()) .distinct() .collect(Collectors.toSet()); } (of return Stream instead of a set)</technical_language>

Target:
public Stream<ClientSourceId> getTrackedClients() { return clientMessageTrackers.stream() .flatMap(tracker -> tracker.getTrackedClients().stream()) .distinct(); }
Source:
<code>private boolean isTwitterConfigured() { List<String> twitterConfigs = Arrays.asList( <START> getResources().getString(R.string.twitter_app_id), <END> getResources().getString(R.string.twitter_consumer_key), getResources().getString(R.string.twitter_consumer_secret) ); return !twitterConfigs.contains(UNCHANGED_CONFIG_VALUE); }</code><technical_language>Missed reference twitter_app_id</technical_language>

Target:
private boolean isTwitterConfigured() { List<String> twitterConfigs = Arrays.asList( getResources().getString(R.string.twitter_consumer_key), getResources().getString(R.string.twitter_consumer_secret) ); return !twitterConfigs.contains(UNCHANGED_CONFIG_VALUE); }
Source:
<code>public ColumnFilter build() { if (built) { return null; } <START> UserGroupCallback userGroupCallback = new CustomUserGroupCallbackImpl(); <END> List<String> potOwners = (List<String>)parameters.get("potOwner"); List<String> potOwnersList = new ArrayList<String>(); for(String potOwner: potOwners) { potOwnersList.add(potOwner); potOwnersList.addAll(userGroupCallback.getGroupsForUser(potOwner)); } String columnName = "potOwner"; ColumnFilter filter = FilterFactory.AND( FilterFactory.in("potOwner",potOwnersList)); filter.setColumnId(columnName); built = true; return filter; }</code><technical_language>this is limiting feature a lot, this class instead callback other parts of system (in of cases) <LINK_0></technical_language>

Target:
public ColumnFilter build() { if (built) { return null; } String columnName = "potOwner"; UserGroupCallback userGroupCallback = UserDataServiceProvider.getUserGroupCallback(); List<String> potOwners = (List<String>)parameters.get(columnName); List<String> potOwnersList = new ArrayList<String>(); for(String potOwner: potOwners) { potOwnersList.add(potOwner); if(userGroupCallback.getGroupsForUser(potOwner) != null) { potOwnersList.addAll(userGroupCallback.getGroupsForUser(potOwner)); } } ColumnFilter filter = FilterFactory.AND( FilterFactory.in(columnName,potOwnersList)); filter.setColumnId(columnName); built = true; return filter; }
Source:
<code>private void checkJobClientConfigured() { <START> Preconditions.checkNotNull(jobClient, "Job client must be configured before first use."); <END> }</code><technical_language>check gateway</technical_language>

Target:
private void checkJobClientConfigured() { Preconditions.checkNotNull(jobClient, "Job client must be configured before first use."); Preconditions.checkNotNull(gateway, "Coordination request gateway must be configured before first use."); }
Source:
<code>public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) { if (TextUtils.equals(getResources().getString(R.string.pref_searchProvider), key)) { setupSummaries(); <START> SearchEngineFactory.setDefault(sharedPreferences.getString(key, null)); <END> } }</code><technical_language>I a for ListPreference care of updating summary for you, I this preference change listener in SearchEngineFactory. setDefault a private method</technical_language>

Target:
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) { if (TextUtils.equals(PREF_SEARCH_ENGINE_KEY, key)) { final ListPreference searchEnginePref = (ListPreference) findPreference(PREF_SEARCH_ENGINE_KEY); searchEnginePref.setSummary(searchEnginePref.getEntry()); } }
Source:
<code>private void pipeRecord(final String topic, final Long timestamp, final byte[] key, final byte[] value, final Headers headers) { final String topicName = topic; if (!internalTopologyBuilder.getSourceTopicNames().isEmpty()) { validateSourceTopicNameRegexPattern(topic); } final TopicPartition topicPartition = getTopicPartition(topicName); if (topicPartition != null) { final long offset = offsetsByTopicPartition.get(topicPartition).incrementAndGet() - 1; task.addRecords(topicPartition, Collections.singleton(new ConsumerRecord<>( topicName, topicPartition.partition(), offset, timestamp, TimestampType.CREATE_TIME, (long) ConsumerRecord.NULL_CHECKSUM, <START> key == null ? 0 : key.length, <END> value == null ? 0 : value.length, key, value, headers))); task.process(); task.maybePunctuateStreamTime(); task.commit(); captureOutputRecords(); } else { final TopicPartition globalTopicPartition = globalPartitionsByTopic.get(topicName); if (globalTopicPartition == null) { throw new IllegalArgumentException("Unknown topic: " + topicName); } final long offset = offsetsByTopicPartition.get(globalTopicPartition).incrementAndGet() - 1; globalStateTask.update(new ConsumerRecord<>( globalTopicPartition.topic(), globalTopicPartition.partition(), offset, timestamp, TimestampType.CREATE_TIME, (long) ConsumerRecord.NULL_CHECKSUM, key == null ? 0 : key.length, value == null ? 0 : value.length, key, value, headers)); globalStateTask.flushState(); } }</code><technical_language>if key == null, size ConsumerRecord.NULL_SIZE (same for value)</technical_language>

Target:
private void pipeRecord(final String topic, final Long timestamp, final byte[] key, final byte[] value, final Headers headers) { final String topicName = topic; if (!internalTopologyBuilder.getSourceTopicNames().isEmpty()) { validateSourceTopicNameRegexPattern(topic); } final TopicPartition topicPartition = getTopicPartition(topicName); if (topicPartition != null) { final long offset = offsetsByTopicPartition.get(topicPartition).incrementAndGet() - 1; task.addRecords(topicPartition, Collections.singleton(new ConsumerRecord<>( topicName, topicPartition.partition(), offset, timestamp, TimestampType.CREATE_TIME, (long) ConsumerRecord.NULL_CHECKSUM, key == null ? ConsumerRecord.NULL_SIZE : key.length, value == null ? ConsumerRecord.NULL_SIZE : value.length, key, value, headers))); task.process(); task.maybePunctuateStreamTime(); task.commit(); captureOutputRecords(); } else { final TopicPartition globalTopicPartition = globalPartitionsByTopic.get(topicName); if (globalTopicPartition == null) { throw new IllegalArgumentException("Unknown topic: " + topicName); } final long offset = offsetsByTopicPartition.get(globalTopicPartition).incrementAndGet() - 1; globalStateTask.update(new ConsumerRecord<>( globalTopicPartition.topic(), globalTopicPartition.partition(), offset, timestamp, TimestampType.CREATE_TIME, (long) ConsumerRecord.NULL_CHECKSUM, key == null ? ConsumerRecord.NULL_SIZE : key.length, value == null ? ConsumerRecord.NULL_SIZE : value.length, key, value, headers)); globalStateTask.flushState(); } }
Source:
<code>@Override public void run() { String secretName = config.name; if (secretName == null || !validName(secretName)) { throw new IllegalArgumentException(format("Invalid name, must match %s", VALID_NAME_PATTERN)); } byte[] content = {}; if (config.contentProvided) { content = readSecretContent(); } partialUpdateSecret(secretName, content, config); if (!config.contentProvided) { try { InputStreamReader reader = new InputStreamReader(stream, "UTF-8"); if (reader.ready()) { System.out.println("\nWarning: Specify the --content flag to update a secret's content."); System.out.println("The secret has not been updated with any provided content."); } } catch (IOException e) { <START> throw new AssertionError(String.format("Unexpected error trying to create an InputStreamReader for stdin: %s", e.getMessage())); <END> } } }</code><technical_language>log & swallow this? constructing InputStreamReader for a warning</technical_language>

Target:
@Override public void run() { String secretName = config.name; if (secretName == null || !validName(secretName)) { throw new IllegalArgumentException(format("Invalid name, must match %s", VALID_NAME_PATTERN)); } byte[] content = {}; if (config.contentProvided) { content = readSecretContent(); } partialUpdateSecret(secretName, content, config); if (!config.contentProvided) { try { InputStreamReader reader = new InputStreamReader(stream, "UTF-8"); if (reader.ready()) { System.out.println("\nWarning: Specify the --content flag to update a secret's content."); System.out.println("The secret has not been updated with any provided content."); } } catch (IOException e) { logger.warn("Unexpected error trying to create an InputStreamReader for stdin: '{}'", e.getMessage()); } } }
Source:
<code>private static Target getTarget(ServletRequest request) { Target target = Target.Other; if (request instanceof HttpServletRequest) { HttpServletRequest httpRequest = (HttpServletRequest) request; if ("GET".equals(httpRequest.getMethod())) { String path = httpRequest.getPathInfo(); <START> if (path.endsWith("/apps") || path.endsWith("/apps/")) { <END> target = Target.FullFetch; } else if (path.endsWith("/apps/delta") || path.endsWith("/apps/delta/")) { target = Target.DeltaFetch; } } } return target; }</code><technical_language>ApplicationsResource allows calls of format /apps/{appId} for specific applications, want cover this Target type too. If want introduce more Target types roll FullFetch</technical_language>

Target:
private static Target getTarget(ServletRequest request) { Target target = Target.Other; if (request instanceof HttpServletRequest) { HttpServletRequest httpRequest = (HttpServletRequest) request; if ("GET".equals(httpRequest.getMethod())) { Matcher matcher = TARGET_RE.matcher(httpRequest.getPathInfo()); if (matcher.matches()) { if (matcher.groupCount() == 0 || "/".equals(matcher.group(1))) { target = Target.FullFetch; } else if ("/delta".equals(matcher.group(1))) { target = Target.DeltaFetch; } else { target = Target.Application; } } } } return target; }
Source:
<code>public void execute(JobExecutionContext context) throws JobExecutionException { Session session = sessionManager.getCurrentSession(); session.setUserEid("admin"); session.setUserId("admin"); String sql = "SELECT COLLECTION_ID FROM CONTENT_COLLECTION WHERE COLLECTION_ID LIKE \"%LB-CSS%\" "; LOG.debug("SQL to get collection Id for LB-CSS folder " + sql); List<String> collection_ids = sqlService.dbRead(sql); for(String id : collection_ids){ try { ContentCollectionEdit contentCollectionEdit = contentHostingService.editCollection(id); ResourcePropertiesEdit resourceProperties = contentCollectionEdit.getPropertiesEdit(); if(!("true".equals(resourceProperties.getProperty(ResourceProperties.PROP_HIDDEN_WITH_ACCESSIBLE_CONTENT)))){ resourceProperties.addProperty(ResourceProperties.PROP_HIDDEN_WITH_ACCESSIBLE_CONTENT, "true"); } contentHostingService.commitCollection(contentCollectionEdit); } catch (IdUnusedException e) { <START> LOG.error("IdUnusedException " + e); <END> } catch (TypeException e) { LOG.error("TypeException " + e); } catch (PermissionException e) { LOG.error("PermissionException " + e); } catch (InUseException e) { LOG.error("InUseException " + e); } } }</code><technical_language>log exception additional parameter get a stack trace</technical_language>

Target:
public void execute(JobExecutionContext context) throws JobExecutionException { ContentCollectionEdit contentCollectionEdit; ResourcePropertiesEdit resourceProperties; Session session = null; String sql = "SELECT COLLECTION_ID FROM CONTENT_COLLECTION WHERE COLLECTION_ID LIKE \"%LB-CSS/\" "; LOG.debug("SQL to get collection Id for LB-CSS folder " + sql); int totalFolders = 0 , foldersUpdated = 0, foldersAlreadySet = 0; try { session = sessionManager.getCurrentSession(); session.setUserEid("admin"); session.setUserId("admin"); List<String> collection_ids = sqlService.dbRead(sql); totalFolders = collection_ids.size(); LOG.info("Number of LB-CSS folders found is " + totalFolders); for (String id : collection_ids) { try { contentCollectionEdit = contentHostingService.editCollection(id); resourceProperties = contentCollectionEdit.getPropertiesEdit(); if (!("true".equals(resourceProperties.getProperty(ResourceProperties.PROP_HIDDEN_WITH_ACCESSIBLE_CONTENT)))) { resourceProperties.addProperty(ResourceProperties.PROP_HIDDEN_WITH_ACCESSIBLE_CONTENT, "true"); foldersUpdated++; LOG.info("Hiding the collection" + id + " from access user "); contentHostingService.commitCollection(contentCollectionEdit); } else { foldersAlreadySet++; contentHostingService.cancelCollection(contentCollectionEdit); LOG.info("The collection " + id +" has already been hidden "); } } catch (SakaiException exception) { LOG.error("Failed to update the LB-CSS folder: " + id, exception); } } } finally { LOG.info("Summary of LBCSSFolderHideJob , Total LB-CSS folders: " + totalFolders + " Updated: " + foldersUpdated + " Collection already hidden: " + foldersAlreadySet); session.invalidate(); } }
Source:
<code>protected Set<Value.Immutable<?>> api$getVanillaValues() { Set<Value.Immutable<?>> vanillaValues = super.api$getVanillaValues(); vanillaValues.add(this.foodLevel().asImmutable()); vanillaValues.add(this.exhaustion().asImmutable()); vanillaValues.add(this.saturation().asImmutable()); vanillaValues.add(this.gameMode().asImmutable()); vanillaValues.add(this.firstPlayed().asImmutable()); vanillaValues.add(this.lastPlayed().asImmutable()); vanillaValues.add(this.sleepingIgnored().asImmutable()); <START> if (this.shadow$getSpectatingEntity() != (ServerPlayerEntity) (Object) this) { <END> this.spectatorTarget().map(Value::asImmutable).ifPresent(vanillaValues::add); } return vanillaValues; }</code><technical_language>Delete if statement</technical_language>

Target:
protected Set<Value.Immutable<?>> api$getVanillaValues() { final Set<Value.Immutable<?>> values = super.api$getVanillaValues(); values.add(this.foodLevel().asImmutable()); values.add(this.exhaustion().asImmutable()); values.add(this.saturation().asImmutable()); values.add(this.gameMode().asImmutable()); values.add(this.firstPlayed().asImmutable()); values.add(this.lastPlayed().asImmutable()); values.add(this.sleepingIgnored().asImmutable()); this.spectatorTarget().map(Value::asImmutable).ifPresent(values::add); return values; }
Source:
<code>public void testAddPage() throws Exception { GroupByHash groupByHash = createGroupByHash(TEST_SESSION, ImmutableList.of(BIGINT), new int[] {0}, Optional.of(1), 100, JOIN_COMPILER); for (int tries = 0; tries < 2; tries++) { for (int value = 0; value < MAX_GROUP_ID; value++) { Block block = BlockAssertions.createLongsBlock(value); Block hashBlock = TypeUtils.getHashBlock(ImmutableList.of(BIGINT), block); Page page = new Page(block, hashBlock); for (int addValuesTries = 0; addValuesTries < 10; addValuesTries++) { groupByHash.addPage(page); assertEquals(groupByHash.getGroupCount(), tries == 0 ? value + 1 : MAX_GROUP_ID); <START> GroupByIdBlock groupIds = groupByHash.getGroupIds(page).getResult(); <END> assertEquals(groupByHash.getGroupCount(), tries == 0 ? value + 1 : MAX_GROUP_ID); assertEquals(groupIds.getGroupCount(), tries == 0 ? value + 1 : MAX_GROUP_ID); assertEquals(groupIds.getPositionCount(), 1); long groupId = groupIds.getGroupId(0); assertEquals(groupId, value); } } } }</code><technical_language>miss .process() &</technical_language>

Target:
public void testAddPage() throws Exception { GroupByHash groupByHash = createGroupByHash(TEST_SESSION, ImmutableList.of(BIGINT), new int[] {0}, Optional.of(1), 100, JOIN_COMPILER); for (int tries = 0; tries < 2; tries++) { for (int value = 0; value < MAX_GROUP_ID; value++) { Block block = BlockAssertions.createLongsBlock(value); Block hashBlock = TypeUtils.getHashBlock(ImmutableList.of(BIGINT), block); Page page = new Page(block, hashBlock); for (int addValuesTries = 0; addValuesTries < 10; addValuesTries++) { groupByHash.addPage(page).process(); assertEquals(groupByHash.getGroupCount(), tries == 0 ? value + 1 : MAX_GROUP_ID); Work<GroupByIdBlock> work = groupByHash.getGroupIds(page); work.process(); GroupByIdBlock groupIds = work.getResult(); assertEquals(groupByHash.getGroupCount(), tries == 0 ? value + 1 : MAX_GROUP_ID); assertEquals(groupIds.getGroupCount(), tries == 0 ? value + 1 : MAX_GROUP_ID); assertEquals(groupIds.getPositionCount(), 1); long groupId = groupIds.getGroupId(0); assertEquals(groupId, value); } } } }
Source:
<code><START> private Currency parseCurrency(CsvRow row, CurveName reference) { <END> Optional<String> currencyStr = row.findValue(CURRENCY_HEADER); if (currencyStr.isPresent()) { return LoaderUtils.parseCurrency(currencyStr.get()); } String referenceStr = reference.getName().toUpperCase(Locale.ENGLISH); try { Optional<IborIndex> ibor = IborIndex.extendedEnum().find(referenceStr); if (ibor.isPresent()) { return ibor.get().getCurrency(); } else { Optional<FloatingRateName> frName = FloatingRateName.extendedEnum().find(referenceStr); if (frName.isPresent()) { return frName.get().getCurrency(); } else if (referenceStr.length() == 3) { return Currency.of(referenceStr); } else if (referenceStr.length() > 3 && referenceStr.charAt(3) == '-' || referenceStr.charAt(3) == '_') { return LoaderUtils.parseCurrency(referenceStr.substring(0, 3)); } else { } } } catch (RuntimeException ex) { } throw new IllegalArgumentException("Unable to parse currency from reference, consider adding a 'Currency' column"); }</code><technical_language>static</technical_language>

Target:
private static Currency parseCurrency(CsvRow row, CurveName reference) { Optional<String> currencyStr = row.findValue(CURRENCY_HEADER); if (currencyStr.isPresent()) { return LoaderUtils.parseCurrency(currencyStr.get()); } String referenceStr = reference.getName().toUpperCase(Locale.ENGLISH); try { Optional<IborIndex> ibor = IborIndex.extendedEnum().find(referenceStr); if (ibor.isPresent()) { return ibor.get().getCurrency(); } else { Optional<FloatingRateName> frName = FloatingRateName.extendedEnum().find(referenceStr); if (frName.isPresent()) { return frName.get().getCurrency(); } else if (referenceStr.length() == 3) { return Currency.of(referenceStr); } else if (referenceStr.length() > 3 && referenceStr.charAt(3) == '-' || referenceStr.charAt(3) == '_') { return LoaderUtils.parseCurrency(referenceStr.substring(0, 3)); } else { } } } catch (RuntimeException ex) { } throw new IllegalArgumentException("Unable to parse currency from reference, consider adding a 'Currency' column"); }
Source:
<code>private List<InsightCard> insightCardsWithInfoPreviewAndMissingImages(final List<InsightCard> insightCards) { final List<InsightCard> cardsWithPreview = Lists.newArrayListWithExpectedSize(insightCards.size()); for (InsightCard card : insightCards) { <START> cardsWithPreview.add(card.withInfoPreview(insightProcessor.getInsightPreviewForCategory(card.category))); <END> } return InsightsDAODynamoDB.backfillImagesBasedOnCategory(cardsWithPreview); }</code><technical_language>Peaking InsightProcessor, appears this result in making DB query repeatedly in this loop</technical_language>

Target:
private List<InsightCard> insightCardsWithInfoPreviewAndMissingImages(final List<InsightCard> insightCards) { final Map<InsightCard.Category, String> categoryNames = insightProcessor.catgegoryNames(); return InsightsDAODynamoDB.backfillImagesBasedOnCategory(insightCards, categoryNames); }
Source:
<code>public StringBuilder getSQL(StringBuilder builder) { <START> return builder.append(getString()).append("::JSON"); <END> }</code><technical_language>StringUtils.quoteStringSQL(builder, string) instead of a raw string</technical_language>

Target:
public StringBuilder getSQL(StringBuilder builder) { return StringUtils.quoteStringSQL(builder, string).append("::JSON"); }
Source:
<code>private void parseContinuedParamDescription( int baselineIndentation, StringBuilder description) { int continuationIndentation = Integer.MAX_VALUE; while (nextLine()) { if (line.isEmpty()) { description.append('\n'); continue; } int lineIndentation = getIndentation(line); if (lineIndentation <= baselineIndentation) { break; } <START> if (lineIndentation < continuationIndentation) { <END> continuationIndentation = lineIndentation; } String trimmedLine = line.substring(continuationIndentation); description.append('\n'); description.append(trimmedLine); } }</code><technical_language>finding minimum indentation here, processing go. Consider difference in behavior for: Line Line Line Line Line Line</technical_language>

Target:
private void parseContinuedParamDescription( int baselineIndentation, StringBuilder description) { List<String> buffer = new ArrayList(); int continuationIndentation = Integer.MAX_VALUE; while (nextLine()) { if (!line.isEmpty()) { if (getIndentation(line) <= baselineIndentation) { break; } continuationIndentation = Math.min(getIndentation(line), continuationIndentation); } buffer.add(line); } for (String bufLine: buffer) { description.append('\n'); if (!bufLine.isEmpty()) { String trimmedLine = bufLine.substring(continuationIndentation); description.append(trimmedLine); } } }
Source:
<code>protected IDebugEventSetListener getDebugListener(final IProcess[] processes, final ILaunch launch) { return new IDebugEventSetListener() { @Override public void handleDebugEvents(DebugEvent[] events) { if (events != null) { int size = events.length; for (int i = 0; i < size; i++) { if (processes[0] != null && processes[0].equals(events[i].getSource()) && events[i].getKind() == DebugEvent.TERMINATE) { <START> ((LaunchManager)getLaunchManager()).fireUpdate(new ILaunch[] {launch}, LaunchManager.TERMINATE); <END> processTerminated(getServer(), this); DebugPlugin.getDefault().removeDebugEventListener(this); } } } } }; }</code><technical_language>![MINOR](<LINK_0> Remove this unnecessary cast "LaunchManager". [![rule](<LINK_1>](<LINK_2></technical_language>

Target:
protected IDebugEventSetListener getDebugListener(final IProcess[] processes, final ILaunch launch) { return new IDebugEventSetListener() { @Override public void handleDebugEvents(DebugEvent[] events) { if (events != null) { int size = events.length; for (int i = 0; i < size; i++) { if (processes[0] != null && processes[0].equals(events[i].getSource()) && events[i].getKind() == DebugEvent.TERMINATE) { ((LaunchManager)getLaunchManager()).fireUpdate(new ILaunch[] {launch}, LaunchManager.TERMINATE); processTerminated(getServer(), processes[0], this); DebugPlugin.getDefault().removeDebugEventListener(this); } } } } }; }
Source:
<code>static KeyPairProvider wrap(Iterable<KeyPair> pairs) { return (pairs == null) ? EMPTY_KEYPAIR_PROVIDER : new KeyPairProvider() { @Override public Iterable<KeyPair> loadKeys(SessionContext session) { return pairs; } @Override public KeyPair loadKey(SessionContext session, String type) { for (KeyPair kp : pairs) { String t = KeyUtils.getKeyType(kp); if (Objects.equals(type, t)) { return kp; } } return null; } @Override public Iterable<String> getKeyTypes(SessionContext session) { <START> Set<String> types = new LinkedHashSet<>(); <END> for (KeyPair kp : pairs) { String t = KeyUtils.getKeyType(kp); if (GenericUtils.isEmpty(t)) { continue; } if (!types.add(t)) { continue; } } return types; } }; }</code><technical_language>Please revert this type a Collection original code..</technical_language>

Target:
static KeyPairProvider wrap(Iterable<KeyPair> pairs) { return (pairs == null) ? EMPTY_KEYPAIR_PROVIDER : new KeyPairProvider() { @Override public Iterable<KeyPair> loadKeys(SessionContext session) { return pairs; } @Override public KeyPair loadKey(SessionContext session, String type) { for (KeyPair kp : pairs) { String t = KeyUtils.getKeyType(kp); if (Objects.equals(type, t)) { return kp; } } return null; } @Override public Iterable<String> getKeyTypes(SessionContext session) { Collection<String> types = new LinkedHashSet<>(); for (KeyPair kp : pairs) { String t = KeyUtils.getKeyType(kp); if (GenericUtils.isEmpty(t)) { continue; } if (!types.add(t)) { continue; } } return types; } }; }
Source:
<code>public double price(double strike, PutCall putCall) { <START> double price = 0d; <END> if (strike <= cutOffStrike) { double volatility = sabrFunction.getVolatility(forward, strike, timeToExpiry, sabrData); price = BlackFormulaRepository.price(forward, strike, timeToExpiry, volatility, putCall.isCall()); } else { price = extrapolation(strike); if (putCall.isPut()) { price -= (forward - strike); } } return price; }</code><technical_language>declaring a local variable, return if statements</technical_language>

Target:
public double price(double strike, PutCall putCall) { if (strike <= cutOffStrike) { double volatility = sabrFunction.getVolatility(forward, strike, timeToExpiry, sabrData); return BlackFormulaRepository.price(forward, strike, timeToExpiry, volatility, putCall.isCall()); } double price = extrapolation(strike); if (putCall.isPut()) { price -= (forward - strike); } return price; }
Source:
<code>public void testXml() { String cp = "REST_XML"; RestConnectionProfileWizard.openWizard(cp) <START> .setConnectionUrl("<LINK_0>") <END> .setType(RestConnectionProfileWizard.TYPE_XML) .testConnection() .finish(); String sourceModel = "RestXmlSource"; String viewModel = "RestXmlView"; RestImportWizard.openWizard() .setProfileName(cp) .nextPage() .setProject(PROJECT_NAME) .setSourceModelName(sourceModel) .setViewModelName(viewModel) .setProcedureName(PROCEDURE_NAME) .nextPage() .setJndiName(sourceModel + "DS") .nextPage() .setRootPath("schedule/day/broadcasts/broadcast") .setColumns("pid","start","end","programme/title") .finish(); String vdb = "RestXmlVdb"; VdbWizard.openVdbWizard() .setLocation(PROJECT_NAME) .setName(vdb) .addModel(PROJECT_NAME, viewModel) .finish(); ServersViewExt.getInstance().refreshServer(teiidServer.getName()); modelExplorer.deployVdb(PROJECT_NAME, vdb); TeiidJDBCHelper jdbchelper = new TeiidJDBCHelper(teiidServer, vdb); assertEquals(16, jdbchelper.getNumberOfResults("exec " + viewModel + "." + PROCEDURE_NAME + "()")); }</code><technical_language>Do internal url in public tests</technical_language>

Target:
public void testXml() { String sourceModel = "RestXmlSource"; String viewModel = "RestXmlView"; RestImportWizard.openWizard() .setProfileName(ConnectionProfileConstants.REST_XML) .nextPage() .setProject(PROJECT_NAME) .setSourceModelName(sourceModel) .setViewModelName(viewModel) .setProcedureName(PROCEDURE_NAME) .nextPage() .setJndiName(sourceModel + "DS") .nextPage() .setRootPath("schedule/day/broadcasts/broadcast") .setColumns("pid","start","end","programme/title") .finish(); String vdb = "RestXmlVdb"; VdbWizard.openVdbWizard() .setLocation(PROJECT_NAME) .setName(vdb) .addModel(PROJECT_NAME, viewModel) .finish(); ServersViewExt.getInstance().refreshServer(teiidServer.getName()); modelExplorer.deployVdb(PROJECT_NAME, vdb); TeiidJDBCHelper jdbchelper = new TeiidJDBCHelper(teiidServer, vdb); assertEquals(16, jdbchelper.getNumberOfResults("exec " + viewModel + "." + PROCEDURE_NAME + "()")); }
Source:
<code>private ProjectNode buildProjectedFilter(PlanBuilder planBuilder, Predicate<Symbol> projectionFilter) { Symbol a = planBuilder.symbol("a"); Symbol b = planBuilder.symbol("b"); return planBuilder.project( <START> Assignments.identity(ImmutableList.of(a, b).stream().filter(projectionFilter).collect(toImmutableSet())), <END> planBuilder.filter( planBuilder.expression("b > 5"), planBuilder.values(a, b))); }</code><technical_language>Stream.of(a, b)</technical_language>

Target:
private ProjectNode buildProjectedFilter(PlanBuilder planBuilder, Predicate<Symbol> projectionFilter) { Symbol a = planBuilder.symbol("a"); Symbol b = planBuilder.symbol("b"); return planBuilder.project( Assignments.identity(Stream.of(a, b).filter(projectionFilter).collect(toImmutableSet())), planBuilder.filter( planBuilder.expression("b > 5"), planBuilder.values(a, b))); }
Source:
<code>public void testVersion() throws Exception { <START> String[] args = new String[]{"-version"}; <END> MyStarter starter = new MyStarter(); starter.run(args); assertEquals(System.getProperty("vertxVersion"), starter.getVersion()); }</code><technical_language>need for new String[], for others</technical_language>

Target:
public void testVersion() throws Exception { String[] args = {"-version"}; MyStarter starter = new MyStarter(); starter.run(args); assertEquals(System.getProperty("vertxVersion"), starter.getVersion()); }
Source:
<code>public void setReviewedByCurrentUser(final Key patchKey, final boolean reviewed, AsyncCallback<VoidResult> callback) { run(callback, new Action<VoidResult>() { public VoidResult run(ReviewDb db) throws OrmException { Account.Id account = Common.getAccountId(); AccountPatchReview.Key key = new AccountPatchReview.Key(patchKey, account); AccountPatchReview apr = db.accountPatchReviews().get(key); if (apr == null && reviewed) { db.accountPatchReviews(). insert(Collections.singleton(new AccountPatchReview(patchKey, account))); <START> } else if (!reviewed) { <END> db.accountPatchReviews().delete(Collections.singleton(apr)); } return VoidResult.INSTANCE; } }); }</code><technical_language>be: } else if (apr != NULL && !reviewed) { I gwtorm if ask delete null a table; sense, NPE I check for null coming out of collection</technical_language>

Target:
public void setReviewedByCurrentUser(final Key patchKey, final boolean reviewed, AsyncCallback<VoidResult> callback) { run(callback, new Action<VoidResult>() { public VoidResult run(ReviewDb db) throws OrmException { Account.Id account = Common.getAccountId(); AccountPatchReview.Key key = new AccountPatchReview.Key(patchKey, account); AccountPatchReview apr = db.accountPatchReviews().get(key); if (apr == null && reviewed) { db.accountPatchReviews(). insert(Collections.singleton(new AccountPatchReview(patchKey, account))); } else if (apr != null && !reviewed) { db.accountPatchReviews().delete(Collections.singleton(apr)); } return VoidResult.INSTANCE; } }); }
Source:
<code>private static String toString(final String[] enumerators) { StringBuilder result = new StringBuilder("("); for (int i = 0; i < enumerators.length; i++) { result.append("'").append(enumerators[i]).append("'"); if (i < enumerators.length - 1) { result.append(", "); } } result.append(")"); <START> return result.toString(); <END> }</code><technical_language>StatementBuilder is in H2 codebase for operations, in appendExceptFirst() for ", "</technical_language>

Target:
private static String toString(final String[] enumerators) { String result = "("; for (int i = 0; i < enumerators.length; i++) { result += "'" + enumerators[i] + "'"; if (i < enumerators.length - 1) { result += ", "; } } result += ")"; return result; }
Source:
<code>private String extractVmIps(List<VmGuestAgentInterface> nics) { if (nics == null || nics.isEmpty()) { return null; } <START> Stream<String> ipsV4 = nics.stream().map(VmGuestAgentInterface::getIpv4Addresses).flatMap(List::stream); <END> Stream<String> ipsV6 = nics.stream().map(VmGuestAgentInterface::getIpv6Addresses).flatMap(List::stream); String ips = Stream.of(ipsV4, ipsV6).flatMap(stream -> stream).collect(Collectors.joining(" ")); return ips.isEmpty() ? null : ips; }</code><technical_language>filter out null ipV4Addresses</technical_language>

Target:
private String extractVmIps(List<VmGuestAgentInterface> nics) { Stream<String> ipsV4 = nics.stream().map(VmGuestAgentInterface::getIpv4Addresses).flatMap(List::stream); Stream<String> ipsV6 = nics.stream().map(VmGuestAgentInterface::getIpv6Addresses).flatMap(List::stream); String ips = Stream.of(ipsV4, ipsV6).flatMap(stream -> stream).collect(Collectors.joining(" ")); return ips.isEmpty() ? null : ips; }
Source:
<code>private static void copyFile(File sourceFile, File destFile) throws IOException { if (!destFile.exists()) { destFile.createNewFile(); } FileChannel source = null; FileChannel destination = null; try { source = new FileInputStream(sourceFile).getChannel(); destination = new FileOutputStream(destFile).getChannel(); destination.transferFrom(source, 0, source.size()); <START> System.out.println("Encrypted the file"); <END> } finally { if (source != null) { source.close(); } if (destination != null) { destination.close(); } } }</code><technical_language>copied file, encrypted, right</technical_language>

Target:
private static void copyFile(File sourceFile, File destFile) throws IOException { if (!destFile.exists()) { destFile.createNewFile(); } FileChannel source = null; FileChannel destination = null; try { source = new FileInputStream(sourceFile).getChannel(); destination = new FileOutputStream(destFile).getChannel(); destination.transferFrom(source, 0, source.size()); } finally { if (source != null) { source.close(); } if (destination != null) { destination.close(); } } }
Source:
<code>private void addPVToEditor(String pvAddress, final String displayName, DataBrowserEditor editor) { if (editor == null) { return; } Model model = editor.getModel(); final double period = Preferences.getScanPeriod(); try { final PVItem item = new PVItemWithUnits(displayName, pvAddress, period); item.useDefaultArchiveDataSources(); <START> AxisConfig axis = model.addAxis(item.getDisplayName()); <END> axis.setAutoScale(false); item.setAxis(axis); model.addItem(item); } catch (Exception ex) { MessageDialog.openError(editor.getSite().getShell(), Messages.Error, NLS.bind(Messages.ErrorFmt, ex.getMessage())); } }</code><technical_language>This typically setUnits item is called observer, meaning axis label is set EGU. force item initialize EGU instantiating</technical_language>

Target:
private void addPVToEditor(String pvAddress, final String displayName, DataBrowserEditor editor) { if (editor == null) { return; } Model model = editor.getModel(); final double period = Preferences.getScanPeriod(); try { AxisConfig axis = model.addAxis(displayName); axis.setAutoScale(false); final PVItem item = new PVItemWithUnits(displayName, pvAddress, period, axis); item.useDefaultArchiveDataSources(); item.setAxis(axis); model.addItem(item); } catch (Exception ex) { MessageDialog.openError(editor.getSite().getShell(), Messages.Error, NLS.bind(Messages.ErrorFmt, ex.getMessage())); } }
Source:
<code>public static boolean isDimAllowed(int dimId) { if(blacklistedDims.isEmpty() || !blacklistedDims.contains(dimId)) { return whitelistedDims.isEmpty() || whitelistedDims.contains(dimId); } <START> return true; <END> }</code><technical_language>This false</technical_language>

Target:
public static boolean isDimAllowed(int dimId) { if(blacklistedDims.isEmpty() || !blacklistedDims.contains(dimId)) { return whitelistedDims.isEmpty() || whitelistedDims.contains(dimId); } return false; }
Source:
<code>private void logNonDownVms(List<VM> notDownVms) { if (!notDownVms.isEmpty()) { AuditLogableBase logable = new AuditLogableBase(); logable.addCustomValue("URL", getParameters().getUrl()); logable.addCustomValue("Vms", StringUtils.join(notDownVms, ",")); <START> auditLogDirector.log(logable, AuditLogType.IMPORTEXPORT_GET_EXTERNAL_VMS_NOT_IN_DOWN_STATUS); <END> } }</code><technical_language>this logged audit log regular log printing? imagine a system 1000 VMs of running (production environment) want import 2 VMs - get audit messages.</technical_language>

Target:
private void logNonDownVms(List<VM> notDownVms) { if (!notDownVms.isEmpty()) { if (shouldLogToAuditLog()) { AuditLogableBase logable = new AuditLogableBase(); logable.addCustomValue("URL", getParameters().getUrl()); logable.addCustomValue("Vms", StringUtils.join(notDownVms, ",")); auditLogDirector.log(logable, AuditLogType.IMPORTEXPORT_GET_EXTERNAL_VMS_NOT_IN_DOWN_STATUS); } else { log.warn( "The following VMs retrieved from external server '{}' are not in down status and therefore can't be imported: '{}'.", getParameters().getUrl(), StringUtils.join(notDownVms, ",")); } } }
Source:
<code>private void readSubscribeCommands() throws IOException, TransportException { String line; ArrayList<SubscribeCommand> cmdList = null; Map<String, ObjectId> stateList = null; String repo = null; while (!(line = in.readString()).startsWith("done")) { if (line == PacketLineIn.END) { <START> commands.put(repo, cmdList); <END> refState.put(repo, stateList); repo = null; cmdList = null; stateList = null; } else if (line.startsWith("repository ")) { repo = line.substring("repository ".length()); cmdList = new ArrayList<SubscribeCommand>(); stateList = new HashMap<String, ObjectId>(); } else { if (repo == null || cmdList == null || stateList == null) throw new IOException(MessageFormat.format(JGitText .get().invalidSubscribeRequest, line)); if (line.startsWith("want ")) cmdList.add(new SubscribeCommand(SUBSCRIBE, line.substring( "want ".length()))); else if (line.startsWith("stop ")) throw new TransportException("stop command not supported"); else if (line.startsWith("have ")) { String[] parts = line.split(" ", 3); stateList.put(parts[2], ObjectId.fromString(parts[1])); } } } }</code><technical_language>check cmdList stateList null</technical_language>

Target:
private Request readSubscribeCommands() throws IOException, TransportException { Request r = new Request(); r.commands = new HashMap<String, List<SubscribeCommand>>(); r.clientRefState = new HashMap<String, Map<String, ObjectId>>(); String line; ArrayList<SubscribeCommand> cmdList = null; Map<String, ObjectId> stateList = null; String repo = null; while (!(line = in.readString()).startsWith("done")) { if (line == PacketLineIn.END && repo != null) { r.commands.put(repo, cmdList); r.clientRefState.put(repo, stateList); repo = null; cmdList = null; stateList = null; } else if (line.startsWith("repository ")) { repo = line.substring("repository ".length()); cmdList = new ArrayList<SubscribeCommand>(); stateList = new HashMap<String, ObjectId>(); } else { if (repo == null || cmdList == null || stateList == null) throw new TransportException(MessageFormat.format(JGitText .get().invalidSubscribeRequest, line)); if (line.startsWith("want ")) cmdList.add(new SubscribeCommand(SUBSCRIBE, line.substring( "want ".length()))); else if (line.startsWith("stop ")) throw new TransportException("stop command not supported"); else if (line.startsWith("have ")) { String[] parts = line.split(" ", 3); if (parts.length < 3) throw new TransportException(MessageFormat.format( JGitText.get().invalidSubscribeRequest, line)); stateList.put(parts[2], ObjectId.fromString(parts[1])); } } } return r; }
Source:
<code>public void refresh() { <START> fCategoryViewer.setInput(fModel); <END> super.refresh(); }</code><technical_language>Is this necessary? tree collapse</technical_language>

Target:
public void refresh() { fCategoryViewer.refresh(); super.refresh(); }
Source:
<code>public Money plus(List<Money> amounts) { <START> return new Money(this.wrapped.plus(amounts.stream().map(x -> x.wrapped).collect(Collectors.toList()))); <END> }</code><technical_language>I if [better performance](<LINK_0> java public Money plus(Collection<Money> amounts) { Stream<BigMoney> s = amounts.stream().map(x -> x.wrapped); return new Money(this.wrapped.plus((Iterable<BigMoney>)s::iterator)); }</technical_language>

Target:
public Money plus(List<Money> amounts) { return new Money(this.wrapped.plus((Iterable<BigMoney>)(amounts.stream().map(x -> x.wrapped)::iterator))); }
Source:
<code>public void testRegularAndRuntimeParametersAreEqualWithRequest() { ReadRowsRequest request = ReadRowsRequest.newBuilder().setRowsLimit(10).build(); CloudBigtableScanConfiguration withRegularParameters = config .toBuilder() .withRequest(request) .withKeys(START_ROW, STOP_ROW) .withConfiguration("somekey", "somevalue") .build(); CloudBigtableScanConfiguration withRuntimeParameters = new CloudBigtableScanConfiguration.Builder() .withTableId(StaticValueProvider.of(TABLE)) .withProjectId(StaticValueProvider.of(PROJECT)) .withInstanceId(StaticValueProvider.of(INSTANCE)) .withRequest(StaticValueProvider.of(request)) .withKeys(START_ROW, STOP_ROW) .withConfiguration("somekey", StaticValueProvider.of("somevalue")) .build(); <START> Assert.assertNotSame(withRegularParameters, withRuntimeParameters); <END> Assert.assertEquals(withRegularParameters, withRuntimeParameters); ReadRowsRequest updatedRequest = withRegularParameters.getRequest(); withRegularParameters = withRegularParameters.toBuilder().withRequest(updatedRequest).build(); withRuntimeParameters = withRuntimeParameters .toBuilder() .withRequest(StaticValueProvider.of(updatedRequest)) .build(); Assert.assertNotSame(withRegularParameters, withRuntimeParameters); Assert.assertEquals(withRegularParameters, withRuntimeParameters); }</code><technical_language>assertNotSame sense here, please remove it</technical_language>

Target:
public void testRegularAndRuntimeParametersAreEqualWithRequest() { ReadRowsRequest request = ReadRowsRequest.newBuilder().setRowsLimit(10).build(); CloudBigtableScanConfiguration withRegularParameters = config .toBuilder() .withRequest(request) .withKeys(START_ROW, STOP_ROW) .withConfiguration("somekey", "somevalue") .build(); CloudBigtableScanConfiguration withRuntimeParameters = new CloudBigtableScanConfiguration.Builder() .withTableId(StaticValueProvider.of(TABLE)) .withProjectId(StaticValueProvider.of(PROJECT)) .withInstanceId(StaticValueProvider.of(INSTANCE)) .withRequest(StaticValueProvider.of(request)) .withKeys(START_ROW, STOP_ROW) .withConfiguration("somekey", StaticValueProvider.of("somevalue")) .build(); Assert.assertEquals(withRegularParameters, withRuntimeParameters); ReadRowsRequest updatedRequest = withRegularParameters.getRequest(); withRegularParameters = withRegularParameters.toBuilder().withRequest(updatedRequest).build(); withRuntimeParameters = withRuntimeParameters .toBuilder() .withRequest(StaticValueProvider.of(updatedRequest)) .build(); Assert.assertEquals(withRegularParameters, withRuntimeParameters); }