auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public List<DocumentModel> getCurrentPage() { <START> if (currentPage == null) { <END> currentPage = new ArrayList<DocumentModel>(); PageProviderService pps = Framework.getService(PageProviderService.class); PageProvider<?> pp = pps.getPageProvider(LATEST_AUDITED_CREATED_USERS_OR_GROUPS_PROVIDER, null, getPageSize(), getCurrentPageIndex(), getProperties(), new Object[] { null }); @SuppressWarnings("unchecked") List<LogEntry> entries = (List<LogEntry>) pp.getCurrentPage(); if (entries != null) { UserManager um = Framework.getService(UserManager.class); DirectoryService directoryService = Framework.getService(DirectoryService.class); try (Session userDir = directoryService.open(um.getUserDirectoryName(), null)) { for (LogEntry e : entries) { String id = (String) e.getExtendedInfos().get("id").getSerializableValue(); if (StringUtils.isNotBlank(id)) { DocumentModel doc; if (UserManagerImpl.GROUPCREATED_EVENT_ID.equals(e.getEventId())) { doc = um.getGroupModel(id); } else if (UserManagerImpl.USERCREATED_EVENT_ID.equals(e.getEventId())) { doc = um.getUserModel(id); if (doc == null) { continue; } } else { continue; } if (doc == null) { continue; } currentPage.add(doc); } } } } } return currentPage; }</code><technical_language>"early return" for currentPage != null entries == null avoid long code block a large indentation</technical_language>

Target:
public List<DocumentModel> getCurrentPage() { if (currentPage != null) { return currentPage; } currentPage = new ArrayList<DocumentModel>(); PageProviderService pps = Framework.getService(PageProviderService.class); CoreSession coreSession = (CoreSession) getProperties().get(CORE_SESSION_PROPERTY); PageProvider<?> pp = pps.getPageProvider(LATEST_AUDITED_CREATED_USERS_OR_GROUPS_PROVIDER, null, getPageSize(), getCurrentPageIndex(), getProperties(), coreSession != null ? coreSession.getRootDocument().getId() : new Object[] { null }); @SuppressWarnings("unchecked") List<LogEntry> entries = (List<LogEntry>) pp.getCurrentPage(); if (entries != null) { UserManager um = Framework.getService(UserManager.class); DirectoryService directoryService = Framework.getService(DirectoryService.class); try (Session userDir = directoryService.open(um.getUserDirectoryName(), null)) { for (LogEntry e : entries) { String id = (String) e.getExtendedInfos().get("id").getSerializableValue(); if (StringUtils.isNotBlank(id)) { DocumentModel doc; if (UserManagerImpl.GROUPCREATED_EVENT_ID.equals(e.getEventId())) { doc = um.getGroupModel(id); } else if (UserManagerImpl.USERCREATED_EVENT_ID.equals(e.getEventId())) { doc = um.getUserModel(id); } else { continue; } if (doc == null) { continue; } currentPage.add(doc); } } } } return currentPage; }
Source:
<code>public synchronized HttpClientRequest setStreamPriority(StreamPriority streamPriority) { synchronized (this) { if(!streamPriority.equals(getStreamPriority())) { this.streamPriority = streamPriority; if(stream != null) { stream.setStreamPriority(streamPriority); <START> stream.writePriorityFrame(); <END> } } } return this; }</code><technical_language>stream write frame setStreamPriority is called</technical_language>

Target:
public synchronized HttpClientRequest setStreamPriority(StreamPriority streamPriority) { synchronized (this) { if(!streamPriority.equals(getStreamPriority())) { this.streamPriority = streamPriority; if(stream != null) { stream.updatePriority(streamPriority); } } } return this; }
Source:
<code>public DateTime getTo() { <START> return to; <END> }</code><technical_language>add "this" qualifier</technical_language>

Target:
public DateTime getTo() { return this.to; }
Source:
<code>public void addReferenceToFilter() throws IOException { page.switchToReferenceToFilterSubTab(); page.addReferenceToFilter(GZIP_PAGE_FILTER_NAME); Assert.assertTrue("Filter reference " + GZIP_PAGE_FILTER_NAME + " is not present in table!", <START> page.getConfigFragment().getResourceManager().isResourcePresent(GZIP_PAGE_FILTER_NAME)); <END> }</code><technical_language>verify added model is updated in UI</technical_language>

Target:
public void addReferenceToFilter() throws Exception { page.switchToFilterReferencesSubTab(); page.addReferenceToFilter(GZIP_PAGE_FILTER_ADDRESS.getLastPairValue()); Assert.assertTrue("Filter reference " + GZIP_PAGE_FILTER_ADDRESS.getLastPairValue() + " is not present in table!", page.getConfigFragment().getResourceManager().isResourcePresent(GZIP_PAGE_FILTER_ADDRESS.getLastPairValue())); new ResourceVerifier(GZIP_FILTER_REFERENCE_ADDRESS, client).verifyExists(); }
Source:
<code>public int getSkippedSince() { if (skippedSince==0 && getSkipCount()==1) { CaseResult prev = getPreviousResult(); if(prev!=null && !prev.isPassed()) <START> this.skippedSince = prev.getSkippedSince(); <END> else if (getRun() != null) { this.skippedSince = getRun().getNumber(); } else { LOGGER.warning("trouble calculating getSkippedSince. We've got prev, but no owner."); } } return skippedSince; }</code><technical_language>if in previous test failed disabled now? previous.isPassed is false, too. a good setup for integration test</technical_language>

Target:
public int getSkippedSince() { recomputeSkippedSinceIfNeeded(); return skippedSince; }
Source:
<code>protected void performBoottime(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException { super.performBoottime(context, operation, model); context.addStep(new AbstractDeploymentChainStep() { public void execute(DeploymentProcessorTarget processorTarget) { <START> final int DEPENDENCIES_MICROPROFILE_REACTIVE_STREAMS_OPERATORS = 6288; <END> processorTarget.addDeploymentProcessor(MicroProfileReactiveStreamsOperatorsExtension.SUBSYSTEM_NAME, DEPENDENCIES, DEPENDENCIES_MICROPROFILE_REACTIVE_STREAMS_OPERATORS, new ReactiveStreamsOperatorsDependencyProcessor()); } }, RUNTIME); MicroProfileReactiveStreamsOperatorsLogger.LOGGER.activatingSubsystem(); }</code><technical_language>of 6288</technical_language>

Target:
protected void performBoottime(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException { super.performBoottime(context, operation, model); context.addStep(new AbstractDeploymentChainStep() { public void execute(DeploymentProcessorTarget processorTarget) { final int DEPENDENCIES_MICROPROFILE_REACTIVE_STREAMS_OPERATORS = 6320; processorTarget.addDeploymentProcessor(MicroProfileReactiveStreamsOperatorsExtension.SUBSYSTEM_NAME, DEPENDENCIES, DEPENDENCIES_MICROPROFILE_REACTIVE_STREAMS_OPERATORS, new ReactiveStreamsOperatorsDependencyProcessor()); } }, RUNTIME); MicroProfileReactiveStreamsOperatorsLogger.LOGGER.activatingSubsystem(); }
Source:
<code>private void onBlock(Block block) { if (onTransactions(block.getTransactionsList())) { ++idx; <START> if (idx == getBlocksRecount()) { <END> Long newGasPrice = getGasPrice(); if (newGasPrice != null) { this.recommendedGasPrice = newGasPrice; } idx = 0; } } }</code><technical_language>strict >= condition here, in case. another is modulo operand if idx param reset</technical_language>

Target:
private void onBlock(Block block) { if (onTransactions(block.getTransactionsList())) { ++idx; if (idx >= getBlocksRecount()) { Long newGasPrice = getGasPrice(); if (newGasPrice != null) { this.recommendedGasPrice = newGasPrice; } idx = 0; } } }
Source:
<code>public static <T> void put(String key, List<T> list) { throwExceptionIf(key == null, "Key cannot be null"); throwExceptionIf(list == null, "List<T> may not be null"); <START> throwExceptionIf(list.size() == 0, "List<T> may not be null"); <END> String fullText = getMarshalledValue(list.get(0), list); storage.put(key, fullText); }</code><technical_language>message "List< T> empty"</technical_language>

Target:
public static <T> boolean put(String key, List<T> list) { if (list == null) { throw new NullPointerException("List<T> may not be null"); } if (list.size() == 0) { throw new NullPointerException("List<T> cannot be empty"); } String cipherText = encoder.encode(list); if (cipherText == null) { return false; } Class clazz = list.get(0).getClass(); String fullText = DataUtil.addType(cipherText, clazz, true); return storage.put(key, fullText); }
Source:
<code>ArrayList<Domino> formPartialChain(ArrayList<Domino> current, List<Domino> remaining) { if (remaining.size() == 0) { if (isValidChain(current)) { return current; } else { throw new ChainNotFoundException("No chain found."); } } for (int i = 0; i < remaining.size(); i++) { ArrayList<Domino> newRemaining = new ArrayList<Domino>(remaining); newRemaining.remove(i); ArrayList<Domino> newChainA = new ArrayList<Domino>(current); newChainA.add(remaining.get(i)); ArrayList<Domino> newChainB = new ArrayList<Domino>(current); newChainB.add(new Domino(remaining.get(i).getRight(), remaining.get(i).getLeft())); if (isValidPartialChain(newChainA)) { try { return formPartialChain(newChainA, newRemaining); <START> } catch (ChainNotFoundException e) { <END> } } if (isValidPartialChain(newChainB)) { try { return formPartialChain(newChainB, newRemaining); } catch (ChainNotFoundException e) { } } } throw new ChainNotFoundException("No domino chain found."); }</code><technical_language>Okay, I see. fine then, thanks for explaining</technical_language>

Target:
ArrayList<Domino> formPartialChain(ArrayList<Domino> current, List<Domino> remaining) throws ChainNotFoundException { if (remaining.size() == 0) { if (isValidChain(current)) { return current; } else { throw new ChainNotFoundException("No domino chain found."); } } for (int i = 0; i < remaining.size(); i++) { ArrayList<Domino> newRemaining = new ArrayList<Domino>(remaining); newRemaining.remove(i); ArrayList<Domino> newChainA = new ArrayList<Domino>(current); newChainA.add(remaining.get(i)); ArrayList<Domino> newChainB = new ArrayList<Domino>(current); newChainB.add(new Domino(remaining.get(i).getRight(), remaining.get(i).getLeft())); if (isValidPartialChain(newChainA)) { try { return formPartialChain(newChainA, newRemaining); } catch (ChainNotFoundException e) { } } if (isValidPartialChain(newChainB)) { try { return formPartialChain(newChainB, newRemaining); } catch (ChainNotFoundException e) { } } } throw new ChainNotFoundException("No domino chain found."); }
Source:
<code>public void writeToParcel(Parcel dest, int flags) { super.writeToParcel(dest, flags); writeInteger(genericIntField1, dest); writeLong(genericLongField1, dest); writeString(genericStringField1, dest); writeString(genericStringField2, dest); <START> ParcelCompat.writeBoolean(dest, genericBooleanField1); <END> writeDouble(genericDoubleField1, dest); }</code><technical_language>(Boolean)null -> boolean = NPE. ParcelCompat.writeBoolean() works primitive types, object types values</technical_language>

Target:
public void writeToParcel(Parcel dest, int flags) { super.writeToParcel(dest, flags); writeInteger(genericIntField1, dest); writeLong(genericLongField1, dest); writeString(genericStringField1, dest); writeString(genericStringField2, dest); writeBoolean(genericBooleanField1, dest); writeDouble(genericDoubleField1, dest); }
Source:
<code>public static boolean isStrictType(String type) { int idx; if((idx = type.indexOf(';')) < 0) { return false; } Map<String, String> parameters = Arrays.asList(type.substring(idx + 1).split(",")).stream().map(e -> e.split("=")).collect(Collectors.toMap(e -> ((String[]) e)[0], e -> ((String[]) e)[1])); if (parameters.containsKey("strict")) { return Boolean.parseBoolean(parameters.get("strict")); <START> } <END> return false; }</code><technical_language>I traverse map twice. call get check if is null not. Based parse return false</technical_language>

Target:
public static boolean isStrictType(String type) { int idx; if ((idx = type.indexOf(';')) < 0 || (idx + 1) == type.length()) { return false; } Map<String, String> parameters = Arrays.asList(type.substring(idx + 1).split(",")) .stream() .filter(e -> e.split("=").length > 1) .map(e -> e.split("=")) .collect(Collectors.toMap(e -> ((String[]) e)[0].trim(), e -> ((String[]) e)[1])); return Boolean.parseBoolean(parameters.get(Marshaller.MARSHALLER_PARAMETER_STRICT)); }
Source:
<code>public static void handleNotificationOpen(Context inContext, JSONArray data, boolean fromAlert, String notificationId) { if (shouldLogUserPrivacyConsentErrorMessageForMethodName(null)) return; notificationOpenedRESTCall(inContext, data); if (trackFirebaseAnalytics != null && getFirebaseAnalyticsEnabled()) trackFirebaseAnalytics.trackOpenedEvent(generateOsNotificationOpenResult(data, true, fromAlert)); boolean urlOpened = false; boolean defaultOpenActionDisabled = "DISABLE".equals(OSUtils.getManifestMeta(inContext, "com.onesignal.NotificationOpened.DEFAULT")); if (!defaultOpenActionDisabled) urlOpened = openURLFromNotification(inContext, data); runNotificationOpenedCallback(data, true, fromAlert); if (sessionManager != null && shouldInitDirectSessionFromNotificationOpen(inContext, fromAlert, urlOpened, defaultOpenActionDisabled)) { appEntryState = AppEntryAction.NOTIFICATION_CLICK; <START> sessionManager.onDirectSessionFromNotificationOpen(notificationId); <END> } }</code><technical_language>i this check if application foreground right? in theory onDirectSessionFromNotificationOpen wont set if app foreground notification clicked</technical_language>

Target:
public static void handleNotificationOpen(Context inContext, JSONArray data, boolean fromAlert, String notificationId) { if (shouldLogUserPrivacyConsentErrorMessageForMethodName(null)) return; notificationOpenedRESTCall(inContext, data); if (trackFirebaseAnalytics != null && getFirebaseAnalyticsEnabled()) trackFirebaseAnalytics.trackOpenedEvent(generateOsNotificationOpenResult(data, true, fromAlert)); boolean urlOpened = false; boolean defaultOpenActionDisabled = "DISABLE".equals(OSUtils.getManifestMeta(inContext, "com.onesignal.NotificationOpened.DEFAULT")); if (!defaultOpenActionDisabled) urlOpened = openURLFromNotification(inContext, data); runNotificationOpenedCallback(data, true, fromAlert); if (shouldInitDirectSessionFromNotificationOpen(inContext, fromAlert, urlOpened, defaultOpenActionDisabled)) { appEntryState = AppEntryAction.NOTIFICATION_CLICK; sessionManager.onDirectSessionFromNotificationOpen(notificationId); } }
Source:
<code>public Applications list() { VM vm = getEntity(entityType, VdcQueryType.GetVmByVmId, new IdQueryParameters(vmId), vmId.toString(), true); Applications applications = new Applications(); int index = 1; if (vm.getAppList() != null) { <START> for (String appName : vm.getAppList().split(",")) { <END> Application app = new Application(); app.setName(appName); app.setId(buildId(index)); applications.getApplications().add(addLinks(app)); index++; } } return applications; }</code><technical_language>this mapper => map (String app, Applications application)</technical_language>

Target:
public Applications list() { VM vm = getEntity(entityType, VdcQueryType.GetVmByVmId, new IdQueryParameters(vmId), vmId.toString(), true); Applications applications = new Applications(); int index = 1; if (vm.getAppList() != null) { for (String appName : vm.getAppList().split(",")) { applications.getApplications().add(addLinks(map(appName))); } } return applications; }
Source:
<code>public void sleep(IInteger seconds) { try { <START> Thread.sleep(TimeUnit.SECONDS.toMillis(seconds.longValue())); <END> } catch (InterruptedException e) { } }</code><technical_language>FYI, TimeUnit.SECONDS.sleep(seconds.longValue())</technical_language>

Target:
public void sleep(IInteger seconds) { try { TimeUnit.SECONDS.sleep(seconds.longValue()); } catch (InterruptedException e) { } }
Source:
<code>public void TestTimeStampBefore1970() { TimeZone.setDefault(TimeZone.getTimeZone("UTC")); TimestampUtils tsu = ((BaseConnection) con).getTimestampUtils(); Date date = tsu.convertToDate(Timestamp.valueOf("1969-01-10 12:00:00").getTime(), TimeZone.getDefault()); <START> assertEquals(new GregorianCalendar(1969, Calendar.JANUARY, 10).getTime(), date ); <END> }</code><technical_language>comparing java.sql.Date java.util.Date here. mean</technical_language>

Target:
public void TestTimeStampBefore1970() { TimeZone.setDefault(TimeZone.getTimeZone("UTC")); TimestampUtils tsu = ((BaseConnection) con).getTimestampUtils(); Date date = tsu.convertToDate(Timestamp.valueOf("1969-01-10 12:00:00").getTime(), TimeZone.getDefault()); assertEquals(new GregorianCalendar(1969, Calendar.JANUARY, 10).getTime().getTime(), date.getTime() ); }
Source:
<code>public String getUpsertQuery(final String table, Collection<String> keyCols, Collection<String> cols) { StringBuilder builder = new StringBuilder("UPSERT "); builder.append(escaped(table)); builder.append("("); joinToBuilder(builder, ",", keyCols, cols, escaper()); builder.append(") VALUES("); nCopiesToBuilder(builder, ",", "?", keyCols.size() + cols.size()); builder.append(")"); builder.append(" WITH PRIMARY KEY"); <START> log.trace("Upsert Query: " + builder.toString()); <END> return builder.toString(); }</code><technical_language>log this for batch, in BufferedRecords.add(), remove this log line</technical_language>

Target:
public String getUpsertQuery(final String table, Collection<String> keyCols, Collection<String> cols) { StringBuilder builder = new StringBuilder("UPSERT "); builder.append(escaped(table)); builder.append("("); joinToBuilder(builder, ",", keyCols, cols, escaper()); builder.append(") VALUES("); nCopiesToBuilder(builder, ",", "?", keyCols.size() + cols.size()); builder.append(")"); builder.append(" WITH PRIMARY KEY"); return builder.toString(); }
Source:
<code>Mono<DigitalTwinsResponse<Void>> updateDigitalTwinWithResponse(String digitalTwinId, List<Object> digitalTwinUpdateOperations, UpdateDigitalTwinRequestOptions options, Context context) { return protocolLayer .getDigitalTwins() <START> .updateWithResponseAsync(digitalTwinId, digitalTwinUpdateOperations, options.getIfMatch(), context) <END> .map(response -> { DigitalTwinsResponseHeaders twinHeaders = mapper.convertValue(response.getDeserializedHeaders(), DigitalTwinsResponseHeaders.class); return new DigitalTwinsResponse<>(response.getRequest(), response.getStatusCode(), response.getHeaders(), response.getValue(), twinHeaders); }); }</code><technical_language>do add a null check for options invoking getter for ifMatch</technical_language>

Target:
Mono<DigitalTwinsResponse<Void>> updateDigitalTwinWithResponse(String digitalTwinId, List<Object> digitalTwinUpdateOperations, UpdateDigitalTwinRequestOptions options, Context context) { String ifMatch = options != null ? options.getIfMatch() : null; return protocolLayer .getDigitalTwins() .updateWithResponseAsync(digitalTwinId, digitalTwinUpdateOperations, ifMatch, context) .map(response -> { DigitalTwinsResponseHeaders twinHeaders = mapper.convertValue(response.getDeserializedHeaders(), DigitalTwinsResponseHeaders.class); return new DigitalTwinsResponse<>(response.getRequest(), response.getStatusCode(), response.getHeaders(), response.getValue(), twinHeaders); }); }
Source:
<code>public void testQueryTaskByVariablesWithByProcessVar() { Map<String, Object> variables = emptyMap(); Map<String, Object> attributes = emptyMap(); Map<String, Object> processVariables = Collections.singletonMap("var_a", "a1"); List<String> potOwners = Collections.emptyList(); <START> List<UserTaskInstanceWithPotOwnerDesc> data = advanceVariableDataService.queryUserTasksByVariables(attributes, variables, processVariables, potOwners, new QueryContext(0, 2)); Assert.assertEquals(2, data.size()); <END> }</code><technical_language>Number of instances matching search criteria ( processVariable = "var_a", "a1" ) 3, I missing something?. If I change below, I get data size = 3 (which I presume is correct): Map<String, Object> variables = Collections.<String, Object> singletonMap("task_in_a1", "a1");</technical_language>

Target:
public void testQueryTaskByVariablesWithByProcessVar() { List<QueryParam> processVariables = list(equalsTo("var_a", "a1")); List<String> potOwners = Collections.emptyList(); List<UserTaskInstanceWithPotOwnerDesc> data = advanceVariableDataService.queryUserTasksByVariables(emptyList(), emptyList(), processVariables, potOwners, queryContext); if (queryContext.getCount() > 0) { Assert.assertThat(data.size(), is(queryContext.getCount())); } else { Assert.assertThat(data.size(), is(3)); } }
Source:
<code>public void onMapReady(@NonNull final MapboxMap mapboxMap) { this.mapboxMap = mapboxMap; mapboxMap.setStyle(Style.MAPBOX_STREETS, new Style.OnStyleLoaded() { @Override public void onStyleLoaded(@NonNull Style style) { setUpMapImagePins(); FeatureCollection featureCollection = FeatureCollection.fromJson(loadGeoJsonFromAsset("weather_data_per_state_before2006.geojson")); for (Feature feature : featureCollection.features()) { String stateName = feature.getStringProperty("state"); String lat = feature.getStringProperty("latitude"); String lon = feature.getStringProperty("longitude"); LatLng latLng = new LatLng( Double.parseDouble(lat), Double.parseDouble(lon)); State state = null; for (State curState : states) { if (curState.name.equals(stateName)) { state = curState; break; } } if (state == null) { state = new State(stateName, latLng); states.add(state); } else { state.add(latLng); <START> } <END> } GeoJsonSource geoJsonSource = new GeoJsonSource(GEOJSON_SRC_ID, featureCollection); mapboxMap.getStyle().addSource(geoJsonSource); initTemperatureLayers(); populateMenu(); int indexOfState = indexOfState("Connecticut"); selectState(states.get(indexOfState).name, indexOfState); unitsFab.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { if (mapboxMap != null) { changeTemperatureUnits(!isImperial); } } }); } }); }</code><technical_language>move for loop asynctask</technical_language>

Target:
public void onMapReady(@NonNull final MapboxMap mapboxMap) { this.mapboxMap = mapboxMap; mapboxMap.setStyle(Style.MAPBOX_STREETS, new Style.OnStyleLoaded() { @Override public void onStyleLoaded(@NonNull final Style style) { setUpMapImagePins(style); new LoadGeoJson(ExpressionIntegrationActivity.this).execute(); } }); }
Source:
<code>public static void main(String[] args) throws IOException { extractKSTS(); String servicesJson = System.getenv("VCAP_SERVICES"); if (servicesJson == null || servicesJson.isEmpty()) { System.err.println("No service found!!!"); return; } BasicJsonParser parser = new BasicJsonParser(); Map<String, Object> json = parser.parseMap(servicesJson); List hazelcast = (List) json.get("hazelcast"); Map map = (Map) hazelcast.get(0); Map credentials = (Map) map.get("credentials"); List<String> members = (List<String>) credentials.get("members"); clientConfig = new ClientConfig(); ClientNetworkConfig networkConfig = clientConfig.getNetworkConfig(); for (String member : members) { networkConfig.addAddress(member.replace('"', ' ').trim()); <START> } <END> SpringApplication.run(Application.class, args); }</code><technical_language>@kwart, @tezc reviewed lines decide configure it? removed cluster-name cluster-pass hazelcast client code base: <LINK_1> Application.java starts client parameters PCF service defined member side json file: <LINK_0> I remove password Application.java json file configure client: String clusterName = (String) credentials.get("cluster_name"); List<String> members = (List<String>) credentials.get("members"); clientConfig = new ClientConfig(); clientConfig.setClientName(clusterName); Is this correct</technical_language>

Target:
public static void main(String[] args) throws IOException { extractKSTS(); String servicesJson = System.getenv("VCAP_SERVICES"); if (servicesJson == null || servicesJson.isEmpty()) { System.err.println("No service found!!!"); return; } BasicJsonParser parser = new BasicJsonParser(); Map<String, Object> json = parser.parseMap(servicesJson); List hazelcast = (List) json.get("hazelcast"); Map map = (Map) hazelcast.get(0); Map credentials = (Map) map.get("credentials"); String clusterName = (String) credentials.get("cluster_name"); List<String> members = (List<String>) credentials.get("members"); clientConfig = new ClientConfig(); clientConfig.setClusterName(clusterName); ClientNetworkConfig networkConfig = clientConfig.getNetworkConfig(); for (String member : members) { networkConfig.addAddress(member.replace('"', ' ').trim()); } SpringApplication.run(Application.class, args); }
Source:
<code>public void saveConceptProposal_shouldReturnSavedConceptProposalObject() { ConceptProposal conceptProposal = new ConceptProposal(); <START> conceptProposal.setOriginalText("OriginalText"); <END> List<ConceptProposal> existingConceptProposals = conceptService.getConceptProposals("OriginalText"); assertTrue(existingConceptProposals == null || existingConceptProposals.isEmpty()); ConceptProposal savedConceptProposal = conceptService.saveConceptProposal(conceptProposal); assertEquals(conceptProposal, savedConceptProposal); }</code><technical_language>OriginalText in more place, a constant for it</technical_language>

Target:
public void saveConceptProposal_shouldReturnSavedConceptProposalObject() { final String ORIGINAL_TEXT = "OriginalText"; ConceptProposal conceptProposal = new ConceptProposal(); conceptProposal.setOriginalText(ORIGINAL_TEXT); List<ConceptProposal> existingConceptProposals = conceptService.getConceptProposals(ORIGINAL_TEXT); assertTrue(existingConceptProposals.isEmpty()); ConceptProposal savedConceptProposal = conceptService.saveConceptProposal(conceptProposal); assertEquals(ORIGINAL_TEXT, savedConceptProposal.getOriginalText()); assertEquals(conceptProposal, savedConceptProposal); }
Source:
<code>private boolean ensureEitherCssOrGss(List<URL> resources, TreeLogger logger) throws UnableToCompleteException { boolean css = resources.get(0).toString().endsWith(".css"); for (URL stylesheet : resources) { <START> if (css) { <END> if (!stylesheet.toString().endsWith(".css")) { logger.log(Type.ERROR, "Only either css files or gss files are supported on one interface"); throw new UnableToCompleteException(); } } else { if (!stylesheet.toString().endsWith(".gss")) { logger.log(Type.ERROR, "Only either css files or gss files are supported on one interface"); throw new UnableToCompleteException(); } } } return css; }</code><technical_language>combine if conditions in</technical_language>

Target:
private boolean ensureEitherCssOrGss(List<URL> resources, TreeLogger logger) throws UnableToCompleteException { boolean css = resources.get(0).toString().endsWith(".css"); for (URL stylesheet : resources) { if (css && !stylesheet.toString().endsWith(".css")) { logger.log(Type.ERROR, "Only either css files or gss files are supported on one interface"); throw new UnableToCompleteException(); } else if (!css && !stylesheet.toString().endsWith(".gss")) { logger.log(Type.ERROR, "Only either css files or gss files are supported on one interface"); throw new UnableToCompleteException(); } } return css; }
Source:
<code>public void selectAll() throws CandybeanException { String tag = we.getTagName(); if (tag.equals("input")) { executeJavascript("arguments[0].select()"); <START> } else throw new CandybeanException("Cannot select text of a non-" + <END> "text element. Actual element was of tag: "+ tag); }</code><technical_language>a big fan of this format. consistent put curly braces throw new CandybeanException</technical_language>

Target:
public void selectAll() throws CandybeanException { String tag = we.getTagName(); if (!"input".equals(tag)) { throw new CandybeanException("Cannot select text of a non-" + "INPUT element. Actual element was of tag: " + tag); } executeJavascript("arguments[0].select()"); }
Source:
<code>public Collection<Pair<BlockState, TRSRTransformation>> getBlocks(ItemStack stack, float growth) { Set<Pair<BlockState, TRSRTransformation>> ret = new HashSet(); Matrix4f stemMatrix = new Matrix4f(); stemMatrix.setIdentity(); <START> stemMatrix.rotY(-1.571f); END> stemMatrix.setTranslation(new Vector3f(.75f, .0625f, 0)); if(growth < .375) { int age = Math.min(7, Math.round(7*growth/.375f)); return ImmutableList.of(Pair.of(this.stemBlock.getDefaultState().with(StemBlock.AGE, age), new TRSRTransformation(stemMatrix))); } else { float scale = ((growth-.375f)/.625f)*.3125f; Matrix4f cropMatrix = new Matrix4f(); cropMatrix.setIdentity(); cropMatrix.setTranslation(new Vector3f(0.75f-scale/2, .5625f-scale, 0.5f-scale/2)); cropMatrix.setScale(scale); return ImmutableList.of(Pair.of(this.attachedStemBlock.getDefaultState(), new TRSRTransformation(stemMatrix)), Pair.of(this.cropBlock.getDefaultState(), new TRSRTransformation(cropMatrix))); } }</code><technical_language>(float)Math.PI/2 clearer IMO</technical_language>

Target:
public Collection<Pair<BlockState, TRSRTransformation>> getBlocks(ItemStack stack, float growth) { Set<Pair<BlockState, TRSRTransformation>> ret = new HashSet(); Matrix4f stemMatrix = new Matrix4f(); stemMatrix.setIdentity(); stemMatrix.rotY(-(float)Math.PI/2); stemMatrix.setTranslation(new Vector3f(.75f, .0625f, 0)); if(growth < .375) { int age = Math.round(7*growth/.375f); return ImmutableList.of(Pair.of(this.stemBlock.getDefaultState().with(StemBlock.AGE, age), new TRSRTransformation(stemMatrix))); } else { float scale = ((growth-.375f)/.625f)*.3125f; Matrix4f cropMatrix = new Matrix4f(); cropMatrix.setIdentity(); cropMatrix.setTranslation(new Vector3f(0.75f-scale/2, .5625f-scale, 0.5f-scale/2)); cropMatrix.setScale(scale); return ImmutableList.of(Pair.of(this.attachedStemBlock.getDefaultState(), new TRSRTransformation(stemMatrix)), Pair.of(this.cropBlock.getDefaultState(), new TRSRTransformation(cropMatrix))); } }
Source:
<code>private BoundedContext buildDefault(SystemBoundedContext system) { BiFunction<BoundedContextBuilder, SystemGateway, DomainBoundedContext> instanceFactory = <START> (builder, systemGateway) -> DomainBoundedContext.newInstance(builder, <END> system, systemGateway); SystemGateway systemGateway = new DefaultSystemGateway(system); BoundedContext result = buildPartial(instanceFactory, systemGateway); return result; }</code><technical_language>This block of changes odd. In buildPartial() fact system bounded context _and_ gateway create a DomainBoundedContext instance. discuss in person</technical_language>

Target:
private BoundedContext buildDefault(SystemBoundedContext system) { BiFunction<BoundedContextBuilder, SystemGateway, DomainBoundedContext> instanceFactory = DomainBoundedContext::newInstance; SystemGateway systemGateway = new DefaultSystemGateway(system); BoundedContext result = buildPartial(instanceFactory, systemGateway); return result; }
Source:
<code>private final void createTraceTypeGroup(Composite parent) { Composite composite = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(); layout.numColumns = 3; layout.makeColumnsEqualWidth = false; composite.setLayout(layout); composite.setFont(parent.getFont()); GridData buttonData = new GridData(SWT.FILL, SWT.FILL, true, false); composite.setLayoutData(buttonData); Label typeLabel = new Label(composite, SWT.NONE); typeLabel.setText(Messages.ImportTraceWizard_TraceType); typeLabel.setFont(parent.getFont()); fTraceTypes = new Combo(composite, SWT.BORDER | SWT.READ_ONLY); GridData data = new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1); fTraceTypes.setLayoutData(data); fTraceTypes.setFont(parent.getFont()); String[] availableTraceTypes = TmfTraceType.getAvailableTraceTypes(); String[] traceTypeList = new String[availableTraceTypes.length + 1]; traceTypeList[0] = TRACE_TYPE_AUTO_DETECT; <START> for (int i = 0; i < availableTraceTypes.length; i++) { <END> traceTypeList[i + 1] = availableTraceTypes[i]; } fTraceTypes.setItems(traceTypeList); fTraceTypes.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { updateWidgetEnablements(); boolean enabled = fTraceTypes.getText().equals(TRACE_TYPE_AUTO_DETECT); fImportUnrecognizedButton.setEnabled(enabled); } }); fTraceTypes.select(0); fImportUnrecognizedButton = new Button(composite, SWT.CHECK); fImportUnrecognizedButton.setSelection(true); fImportUnrecognizedButton.setText(Messages.ImportTraceWizard_ImportUnrecognized); }</code><technical_language>regression, fix please</technical_language>

Target:
private final void createTraceTypeGroup(Composite parent) { Composite composite = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(); layout.numColumns = 3; layout.makeColumnsEqualWidth = false; composite.setLayout(layout); composite.setFont(parent.getFont()); GridData buttonData = new GridData(SWT.FILL, SWT.FILL, true, false); composite.setLayoutData(buttonData); Label typeLabel = new Label(composite, SWT.NONE); typeLabel.setText(Messages.ImportTraceWizard_TraceType); typeLabel.setFont(parent.getFont()); fTraceTypes = new Combo(composite, SWT.BORDER | SWT.READ_ONLY); GridData data = new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1); fTraceTypes.setLayoutData(data); fTraceTypes.setFont(parent.getFont()); String[] availableTraceTypes = TmfTraceType.getAvailableTraceTypes(); String[] traceTypeList = new String[availableTraceTypes.length + 1]; traceTypeList[0] = TRACE_TYPE_AUTO_DETECT; System.arraycopy(availableTraceTypes,0,traceTypeList,1,availableTraceTypes.length); fTraceTypes.setItems(traceTypeList); fTraceTypes.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { updateWidgetEnablements(); boolean enabled = fTraceTypes.getText().equals(TRACE_TYPE_AUTO_DETECT); fImportUnrecognizedButton.setEnabled(enabled); } }); fTraceTypes.select(0); fImportUnrecognizedButton = new Button(composite, SWT.CHECK); fImportUnrecognizedButton.setSelection(true); fImportUnrecognizedButton.setText(Messages.ImportTraceWizard_ImportUnrecognized); }
Source:
<code>public void createEndpointWithMinimalArnConfiguration() throws Exception { AmazonSQSClientMock mock = new AmazonSQSClientMock(); ((JndiRegistry) ((PropertyPlaceholderDelegateRegistry) context.getRegistry()).getRegistry()).bind("amazonSQSClient", mock); SqsComponent component = new SqsComponent(context); SqsEndpoint endpoint = (SqsEndpoint) component.createEndpoint("aws-sqs://arn:aws:sqs:region:account:MyQueue?amazonSQSClient=#amazonSQSClient&accessKey=xxx&secretKey=yyy&region=US_EAST_2"); <START> assertEquals("US_EAST_2", endpoint.getConfiguration().getRegion()); <END> assertEquals("account", endpoint.getConfiguration().getQueueOwnerAWSAccountId()); assertEquals("MyQueue", endpoint.getConfiguration().getQueueName()); assertEquals("xxx", endpoint.getConfiguration().getAccessKey()); }</code><technical_language>this assert null this change</technical_language>

Target:
public void createEndpointWithMinimalArnConfiguration() throws Exception { AmazonSQSClientMock mock = new AmazonSQSClientMock(); ((JndiRegistry) ((PropertyPlaceholderDelegateRegistry) context.getRegistry()).getRegistry()).bind("amazonSQSClient", mock); SqsComponent component = new SqsComponent(context); SqsEndpoint endpoint = (SqsEndpoint) component.createEndpoint("aws-sqs://arn:aws:sqs:us-east-1:account:MyQueue?amazonSQSClient=#amazonSQSClient&accessKey=xxx&secretKey=yyy"); assertEquals("US_EAST_1", endpoint.getConfiguration().getRegion()); assertEquals("account", endpoint.getConfiguration().getQueueOwnerAWSAccountId()); assertEquals("MyQueue", endpoint.getConfiguration().getQueueName()); assertEquals("xxx", endpoint.getConfiguration().getAccessKey()); }
Source:
<code>public void globalVerify() throws Exception { <START> Thread.sleep(expiryDuration * 4); <END> IList<Counter> results = targetInstance.getList(basename); Counter total = new Counter(); for (Counter i : results) { total.add(i); } log.info(basename + ": " + total + " from " + results.size() + " worker Threads"); final ICache<Integer, Long> cache = cacheManager.getCache(basename, Integer.class, Long.class); for(int i=0; i<keyCount; i++){ assertFalse(basename + ": cache should not contain any keys ", cache.containsKey(i) ); } assertFalse(basename + ": iterator should not have elements ", cache.iterator().hasNext()); assertEquals(basename + ": cache size not 0", 0, cache.size()); }</code><technical_language>do this end of running phase</technical_language>

Target:
public void globalVerify() throws Exception { IList<Counter> results = targetInstance.getList(basename); Counter total = new Counter(); for (Counter i : results) { total.add(i); } log.info(basename + ": " + total + " from " + results.size() + " worker Threads"); final ICache<Integer, Long> cache = cacheManager.getCache(basename, Integer.class, Long.class); for(int i=0; i<keyCount; i++){ assertFalse(basename + ": cache should not contain any keys ", cache.containsKey(i) ); } assertFalse(basename + ": iterator should not have elements ", cache.iterator().hasNext()); assertEquals(basename + ": cache size not 0", 0, cache.size()); }
Source:
<code>public void testGetNetwork() throws Exception { Network found = networkApi.getNetwork(network.id()); assertEquals(found, network); checkNetwork(found); assertEquals(found.networkIdentifier(), "192.168.253.0"); assertEquals(found.name(), "NetworkApiLiveTestNetwork"); assertEquals(found.cidr(), 24); <START> assertEquals(found.notes(), "this is a test network from JClouds NetworkApiLiveTest."); <END> }</code><technical_language>[minor] jclouds</technical_language>

Target:
public void testGetNetwork() throws Exception { Network found = networkApi.getNetwork(network.id()); assertEquals(found, network); checkNetwork(found); assertEquals(found.networkIdentifier(), "192.168.253.0"); assertEquals(found.name(), "NetworkApiLiveTestNetwork"); assertEquals(found.cidr(), 24); assertEquals(found.notes(), "this is a test network from jclouds NetworkApiLiveTest."); }
Source:
<code>public Object visitPrepareCommand(TxInvocationContext ctx, PrepareCommand command) throws Throwable { VersionedPrepareCommand versionedPrepareCommand = (VersionedPrepareCommand) command; if (ctx.isOriginLocal()) { <START> (versionedPrepareCommand).setVersionsSeen(ctx.getCacheTransaction().getVersionsRead()); <END> } wrapEntriesForPrepare(ctx, command); EntryVersionsMap newVersionData= null; if (ctx.isOriginLocal() && !ctx.getCacheTransaction().isFromStateTransfer()) { newVersionData = cdl.createNewVersionsAndCheckForWriteSkews(versionGenerator, ctx, versionedPrepareCommand); } Object retval = invokeNextInterceptor(ctx, command); if (!ctx.isOriginLocal()) newVersionData = cdl.createNewVersionsAndCheckForWriteSkews(versionGenerator, ctx, versionedPrepareCommand); if (command.isOnePhaseCommit()) { ctx.getCacheTransaction().setUpdatedEntryVersions((versionedPrepareCommand).getVersionsSeen()); } if (newVersionData != null) { retval = newVersionData; } if (command.isOnePhaseCommit()) { commitContextEntries(ctx, null, null); } return retval; }</code><technical_language>parens removed</technical_language>

Target:
public Object visitPrepareCommand(TxInvocationContext ctx, PrepareCommand command) throws Throwable { if (ctx.isOriginLocal()) { ((VersionedPrepareCommand) command).setVersionsSeen(ctx.getCacheTransaction().getVersionsRead()); } wrapEntriesForPrepare(ctx, command); EntryVersionsMap newVersionData= null; if (ctx.isOriginLocal() && !ctx.getCacheTransaction().isFromStateTransfer()) newVersionData = cdl.createNewVersionsAndCheckForWriteSkews(versionGenerator, ctx, (VersionedPrepareCommand) command); Object retval = invokeNextInterceptor(ctx, command); if (!ctx.isOriginLocal()) newVersionData = cdl.createNewVersionsAndCheckForWriteSkews(versionGenerator, ctx, (VersionedPrepareCommand) command); if (command.isOnePhaseCommit()) ctx.getCacheTransaction().setUpdatedEntryVersions(((VersionedPrepareCommand) command).getVersionsSeen()); if (newVersionData != null) retval = newVersionData; if (command.isOnePhaseCommit()) commitContextEntries(ctx, null, null); return retval; }
Source:
<code>protected PreparedStatement deleteSnapshots(Connection connection, String aggregateIdentifier, long sequenceNumber) throws SQLException { final String sql = schema.deleteSnapshotsSqlStatement(); PreparedStatement preparedStatement = connection.prepareStatement(sql); <START> preparedStatement.setString(1, aggregateIdentifier); <END> preparedStatement.setLong(2, sequenceNumber); return preparedStatement; }</code><technical_language>Hmmm... This pretty tightly couples SQL string prepared statement in terms of parameters. approach schema creates statement parameters (aggregateIdentifier, sequenceNumber in this case). do think</technical_language>

Target:
protected PreparedStatement deleteSnapshots(Connection connection, String aggregateIdentifier, long sequenceNumber) throws SQLException { return deleteSnapshots.build(connection, schema, aggregateIdentifier, sequenceNumber); }
Source:
<code>public ProcessInstance createProcessInstance(ProcessInstanceBuilderImpl processInstanceBuilder) { <START> if (processInstanceBuilder.getProcessDefinitionId() != null || processInstanceBuilder.getProcessDefinitionKey() != null) { <END> return commandExecutor.execute(new CreateProcessInstanceCmd(processInstanceBuilder)); } else { throw new ActivitiIllegalArgumentException("No processDefinitionId, processDefinitionKey nor messageName provided"); } }</code><technical_language>In order simplify code this for start create add a method hasProcessDefinitionIdOrKey in ProcessInstanceBuilder condition becomes: if(processInstanceBuilder.hasProcessDefinitionIdOrKey()) do think</technical_language>

Target:
public ProcessInstance createProcessInstance(ProcessInstanceBuilderImpl processInstanceBuilder) { if (processInstanceBuilder.hasProcessDefinitionIdOrKey()) { return commandExecutor.execute(new CreateProcessInstanceCmd(processInstanceBuilder)); } else { throw new ActivitiIllegalArgumentException("No processDefinitionId, processDefinitionKey nor messageName provided"); } }
Source:
<code>public BlobHolder convert(BlobHolder blobHolder, Map<String, Serializable> parameters) throws ConversionException { ImagingService service = Framework.getService(ImagingService.class); List<Blob> sources = blobHolder.getBlobs(); <START> List<Blob> results = new ArrayList<Blob>(sources.size()); <END> for (Blob source : sources) { if (source != null) { Blob result = service.convertToPDF(source); if (result != null) { results.add(result); } } } return new SimpleCachableBlobHolder(results); }</code><technical_language>new ArrayList<> here</technical_language>

Target:
public BlobHolder convert(BlobHolder blobHolder, Map<String, Serializable> parameters) throws ConversionException { ImagingService service = Framework.getService(ImagingService.class); List<Blob> sources = blobHolder.getBlobs(); List<Blob> results = new ArrayList<>(sources.size()); sources.stream().filter(source -> source != null).forEach(source -> { Blob result = service.convertToPDF(source); if (result != null) { results.add(result); } }); return new SimpleCachableBlobHolder(results); }
Source:
<code>public ReactiveJwtDecoder createDecoder(ClientRegistration clientRegistration) { return this.jwtDecoders.computeIfAbsent(clientRegistration.getRegistrationId(), key -> { if (!StringUtils.hasText(clientRegistration.getProviderDetails().getJwkSetUri())) { OAuth2Error oauth2Error = new OAuth2Error( MISSING_SIGNATURE_VERIFIER_ERROR_CODE, "Failed to find a Signature Verifier for Client Registration: '" + clientRegistration.getRegistrationId() + "'. Check to ensure you have configured the JwkSet URI.", null ); throw new OAuth2AuthenticationException(oauth2Error, oauth2Error.toString()); } NimbusReactiveJwtDecoder jwtDecoder = new NimbusReactiveJwtDecoder( clientRegistration.getProviderDetails().getJwkSetUri()); <START> OAuth2TokenValidator<Jwt> jwtValidator = new DelegatingOAuth2TokenValidator<>(jwtValidatorFactory.apply(clientRegistration)); <END> jwtDecoder.setJwtValidator(jwtValidator); return jwtDecoder; }); }</code><technical_language>need DelegatingOAuth2TokenValidator assigning returned instance</technical_language>

Target:
public ReactiveJwtDecoder createDecoder(ClientRegistration clientRegistration) { Assert.notNull(clientRegistration, "clientRegistration cannot be null."); return this.jwtDecoders.computeIfAbsent(clientRegistration.getRegistrationId(), key -> { if (!StringUtils.hasText(clientRegistration.getProviderDetails().getJwkSetUri())) { OAuth2Error oauth2Error = new OAuth2Error( MISSING_SIGNATURE_VERIFIER_ERROR_CODE, "Failed to find a Signature Verifier for Client Registration: '" + clientRegistration.getRegistrationId() + "'. Check to ensure you have configured the JwkSet URI.", null ); throw new OAuth2AuthenticationException(oauth2Error, oauth2Error.toString()); } NimbusReactiveJwtDecoder jwtDecoder = new NimbusReactiveJwtDecoder( clientRegistration.getProviderDetails().getJwkSetUri()); OAuth2TokenValidator<Jwt> jwtValidator = jwtValidatorFactory.apply(clientRegistration); jwtDecoder.setJwtValidator(jwtValidator); return jwtDecoder; }); }
Source:
<code>private Optional<KafkaDatastreamStatesResponse> getDatastreamStatesResponse(String streamName) { List<KafkaDatastreamStatesResponse> responses; synchronized (_runningTasks) { responses = _runningTasks.values() .stream() <START> .filter(connectorTaskEntry -> connectorTaskEntry.getConnectorTask().hasDatastream(streamName)) .map(connectorTaskEntry -> connectorTaskEntry.getConnectorTask().getKafkaDatastreamStatesResponse()) <END> .collect(Collectors.toList()); } if (responses.size() > 0) { Map<TopicPartition, PausedSourcePartitionMetadata> autoPausedPartitions = new HashMap<>(); Map<String, Set<String>> manualPausedPartitions = new HashMap<>(); Set<TopicPartition> assignedTopicPartitions = new HashSet<>(); responses.forEach(t -> { autoPausedPartitions.putAll(t.getAutoPausedPartitions()); manualPausedPartitions.putAll(t.getManualPausedPartitions()); assignedTopicPartitions.addAll(t.getAssignedTopicPartitions()); }); return Optional.of(new KafkaDatastreamStatesResponse(responses.get(0).getDatastream(), autoPausedPartitions, manualPausedPartitions, assignedTopicPartitions)); } return Optional.empty(); }</code><technical_language>I this simplified adding a map() filter(): java .map(ConnectorTaskEntry::getConnectorTask) .filter(task -> task.hasDatastream(streamName)) .map(task -> task.getKafkaDatastreamStatesResponse())</technical_language>

Target:
private Optional<KafkaDatastreamStatesResponse> getDatastreamStatesResponse(String streamName) { List<KafkaDatastreamStatesResponse> responses; synchronized (_runningTasks) { responses = _runningTasks.values() .stream() .map(ConnectorTaskEntry::getConnectorTask) .filter(task -> task.hasDatastream(streamName)) .map(AbstractKafkaBasedConnectorTask::getKafkaDatastreamStatesResponse) .collect(Collectors.toList()); } if (responses.size() > 0) { Map<TopicPartition, PausedSourcePartitionMetadata> autoPausedPartitions = new HashMap<>(); Map<String, Set<String>> manualPausedPartitions = new HashMap<>(); Set<TopicPartition> assignedTopicPartitions = new HashSet<>(); responses.forEach(t -> { autoPausedPartitions.putAll(t.getAutoPausedPartitions()); manualPausedPartitions.putAll(t.getManualPausedPartitions()); assignedTopicPartitions.addAll(t.getAssignedTopicPartitions()); }); return Optional.of(new KafkaDatastreamStatesResponse(responses.get(0).getDatastream(), autoPausedPartitions, manualPausedPartitions, assignedTopicPartitions)); } return Optional.empty(); }