auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public final synchronized void publish(Transcript transcript) { if (published) { return; } else { published = true; } if (this.recorder != null) { this.recorder.stop(); } <START> innerPublish(transcript); <END> maybeExecuteBashScripts(); }</code><technical_language>I unwritten convention of doPublish do methods</technical_language>

Target:
public final synchronized void publish(Transcript transcript) { if (published) { return; } else { published = true; } if (this.recorder != null) { this.recorder.stop(); } doPublish(transcript); maybeExecuteBashScripts(); }
Source:
<code>public void returnExistingTelephonePayment() { requestBody.put("card_expiry", "01/08"); createTelephonePaymentRequest <START> .withCardExpiry("01/08"); <END> connectorMockClient.respondOk_whenCreateTelephoneCharge(GATEWAY_ACCOUNT_ID, createTelephonePaymentRequest .build()); postPaymentResponse(toJson(requestBody)) .statusCode(200) .contentType(JSON) .body("amount", is(100)) .body("reference", is("Some reference")) .body("description", is("Some description")) .body("processor_id", is("1PROC")) .body("payment_outcome.status", is("success")) .body("card_type", is("visa")) .body("card_expiry", is("01/08")) .body("last_four_digits", is("1234")) .body("first_six_digits", is("123456")) .body("payment_id", is("dummypaymentid123notpersisted")) .body("state.status", is("success")) .body("state.finished", is(true)); }</code><technical_language>this? This integration test optional fields need pass card_expiry. mock modified return cardExpiry</technical_language>

Target:
public void returnExistingTelephonePayment() { connectorMockClient.respondOk_whenCreateTelephoneCharge(GATEWAY_ACCOUNT_ID, createTelephonePaymentRequest .build()); postPaymentResponse(toJson(requestBody)) .statusCode(200) .contentType(JSON) .body("amount", is(100)) .body("reference", is("Some reference")) .body("description", is("Some description")) .body("processor_id", is("1PROC")) .body("payment_outcome.status", is("success")) .body("card_type", is("visa")) .body("card_expiry", is(nullValue())) .body("last_four_digits", is("1234")) .body("first_six_digits", is("123456")) .body("payment_id", is("dummypaymentid123notpersisted")) .body("state.status", is("success")) .body("state.finished", is(true)); }
Source:
<code>public UpdateRequest processPreUpdate( UpdateRequest input, Map<String, Metacard> existingMetacards) throws StopProcessingException { Function<Metacard, Metacard> oldVersionOfMetacard = (update) -> { Optional<Metacard> oldMetacard = Optional.ofNullable(existingMetacards.get(update.getId())); if (oldMetacard.isPresent()) { return oldMetacard.get(); } return null; }; boolean foundNonWriteableMetacard = input .getUpdates() .stream() .map(Map.Entry::getValue) .filter(Objects::nonNull) .filter( <START> mc -> <END> !subjectIsAccessAdmin.test(mc) && !subjectIsOwner.test(mc) && !subjectHasWritePerms.test(mc)) .findFirst() .isPresent(); if (foundNonWriteableMetacard) { throw new StopProcessingException( "Cannot update metacard(s). Subject cannot change access control permissions because they are not in set of users with writeable permissions."); } boolean foundInaccessibleMetacard = input .getUpdates() .stream() .map(Map.Entry::getValue) .filter( newVersionOfMetacard -> isAccessControlUpdated( oldVersionOfMetacard.apply(newVersionOfMetacard), newVersionOfMetacard)) .filter(Objects::nonNull) .filter(mc -> !subjectIsAccessAdmin.test(mc) && !subjectIsOwner.test(mc)) .findFirst() .isPresent(); if (foundInaccessibleMetacard) { throw new StopProcessingException( "Cannot update metacard(s). Subject cannot change access control permissions because they are not in the assigned access-administrators list."); } return input; }</code><technical_language>is worth extract this function</technical_language>

Target:
public UpdateRequest processPreUpdate( UpdateRequest input, Map<String, Metacard> existingMetacards) throws StopProcessingException { Function<Metacard, Metacard> oldVersionOfMetacard = (update) -> { Optional<Metacard> oldMetacard = Optional.ofNullable(existingMetacards.get(update.getId())); if (oldMetacard.isPresent()) { return oldMetacard.get(); } return null; }; boolean foundInaccessibleMetacard = input .getUpdates() .stream() .map(Map.Entry::getValue) .filter( newVersionOfMetacard -> isAccessControlUpdated( oldVersionOfMetacard.apply(newVersionOfMetacard), newVersionOfMetacard)) .filter(Objects::nonNull) .filter(mc -> !subjectIsAccessAdmin.test(mc) && !subjectIsOwner.test(mc)) .findFirst() .isPresent(); if (foundInaccessibleMetacard) { throw new StopProcessingException( "Cannot update metacard(s). Subject cannot change access control permissions because they are not in the assigned access-administrators list."); } return input; }
Source:
<code>public static boolean tryActivate(@Nonnull Event e, @Nonnull SlimefunItem item) { <START> return (tryActivateAndGet(e, item) != null); <END> }</code><technical_language>suggestion return tryActivateAndGet(e, item) != null;</technical_language>

Target:
public static boolean tryActivate(@Nonnull Event e, @Nonnull SlimefunItem item) { return tryActivateAndGet(e, item) != null; }
Source:
<code>public void onActivityCreated(@Nullable Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); <START> final String PREFS_NAME = getString(R.string.openmrs_pref_filename); <END> SharedPreferences settings2 = getActivity().getSharedPreferences(PREFS_NAME, 0); if (settings2.getBoolean("my_first_time", true)) { showOverlayTutorialOne(); settings2.edit().putBoolean("my_first_time", false).apply(); } }</code><technical_language>Place in ApplicationConstants instead</technical_language>

Target:
public void onActivityCreated(@Nullable Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); final String PREFS_NAME = ApplicationConstants.OPENMRS_PREF_FILE; SharedPreferences settings2 = getActivity().getSharedPreferences(ApplicationConstants.OPENMRS_PREF_FILE, 0); if (settings2.getBoolean("my_first_time", true)) { showOverlayTutorial(R.id.findPatientView, getString(R.string.dashboard_search_icon_label), getString(R.string.showcase_find_patients), R.style.CustomShowcaseTheme, ApplicationConstants.ShowCaseViewConstants.SHOW_FIND_PATIENT, true); settings2.edit().putBoolean("my_first_time", false).apply(); } }
Source:
<code>private boolean belongToSameGroup(ITestResult result) { ITestNGMethod m = result.getMethod(); if (!m.isBeforeGroupsConfiguration()) { return false; } String[] mygroups = this.m_method.getGroups(); if (mygroups.length == 0) { return false; } <START> List<String> cfgMethodGroups = Arrays.asList(result.getMethod().getGroups()); <END> if (cfgMethodGroups.isEmpty()) { return false; } for (String each : mygroups) { if (cfgMethodGroups.contains(each)) { return true; } } return false; }</code><technical_language>m.getGroups()</technical_language>

Target:
private boolean belongToSameGroup(ITestResult result) { ITestNGMethod m = result.getMethod(); if (!m.isBeforeGroupsConfiguration()) { return false; } String[] mygroups = this.m_method.getGroups(); if (mygroups.length == 0 || m.getGroups().length ==0) { return false; } List<String> cfgMethodGroups = Arrays.asList(m.getGroups()); return Arrays.stream(mygroups).anyMatch(cfgMethodGroups::contains); }
Source:
<code>private void updateDigest(PipelineTemplate pipelineTemplate) { <START> String digestId = String.format("%s@sha256%s", pipelineTemplate.getId(), computeSHA256Digest(pipelineTemplate)); <END> getPipelineTemplateDAO().update(digestId, pipelineTemplate); }</code><technical_language>in save digest uppercase for sha</technical_language>

Target:
private void updateDigest(PipelineTemplate pipelineTemplate) { String digestId = String.format("%s@sha256:%s", pipelineTemplate.getId(), computeSHA256Digest(pipelineTemplate)); getPipelineTemplateDAO().update(digestId, pipelineTemplate); }
Source:
<code>private static String getCustomErrorMsg(final String errorType) { StringBuilder errorBuilder = new StringBuilder(); errorBuilder.append(SamlConstants.SECURITY_ASSERTION_ISSUER_FORMAT); errorBuilder.append(" "); errorBuilder.append(SamlConstants.URN_OASIS_NAMES); errorBuilder.append(" and "); errorBuilder.append(errorType); errorBuilder.append(" "); errorBuilder.append(IS_PRESENT); <START> return errorBuilder.toString(); <END> }</code><technical_language>Suggestion for readability -- chaining calls append: java StringBuilder errorBuilder = new StringBuilder(SamlConstants.SECURITY_ASSERTION_ISSUER_FORMAT) .append(" ") ...SNIPPED... If feeling crazy, skip StringBuilder declaration function a single statement: java return new StringBuilder(SamlConstants.SECURITY_ASSERTION_ISSUER_FORMAT) .append(" ") ...SNIPPED... .toString();</technical_language>

Target:
private static String getCustomErrorMsg(final String errorType) { return new StringBuilder(SamlConstants.SECURITY_ASSERTION_ISSUER_FORMAT).append("").append(" ") .append(SamlConstants.URN_OASIS_NAMES).append(" and ").append(errorType).append(" ").append(IS_PRESENT) .toString(); }
Source:
<code>public CenterCrop(Context context) { <START> super(context, 0.5f, 0.5f); <END> }</code><technical_language>personal preference: private static final float CENTER = 0.5f;</technical_language>

Target:
public CenterCrop(Context context) { super(context, PositionedCrop.CENTER, PositionedCrop.CENTER); }
Source:
<code>public void preCommit() { <START> if (!deletionPlan.isRejected() && !deletionPlan.isEmpty()) { <END> final Set<String> deletedIds = deletionPlan.getDeletedItems() .stream() .filter(FSMUtil::isTransient) .filter(obj -> !(obj instanceof SnomedRefSetMember) && !(obj instanceof SnomedRefSet)) .map(Component.class::cast) .map(Component::getId) .collect(Collectors.toSet()); if (!deletedIds.isEmpty()) { deletionPlan.markForDeletion(getReferringRefSetMembers(deletedIds)); } delete(); } if (isUniquenessCheckEnabled()) { List<CDOIDAndVersion> newObjects = transaction.getChangeSetData().getNewObjects(); ComponentIdUniquenessValidator uniquenessEnforcer = new ComponentIdUniquenessValidator(this); for (CDOIDAndVersion newCdoIdAndVersion : newObjects) { CDOObject newObject = transaction.getObject(newCdoIdAndVersion.getID()); if (newObject instanceof Component) { Component newComponent = (Component) newObject; uniquenessEnforcer.validateAndReplaceComponentId(newComponent); } } } }</code><technical_language>throw exception if execution reaches this point deletion plan is rejected? This silently skip deletion parts of commit</technical_language>

Target:
public void preCommit() { if (deletionPlan.isRejected()) { throw new ConflictException(deletionPlan.toString()); } else if (!deletionPlan.isEmpty()) { final Set<String> deletedIds = deletionPlan.getDeletedItems() .stream() .filter(FSMUtil::isTransient) .filter(obj -> !(obj instanceof SnomedRefSetMember) && !(obj instanceof SnomedRefSet)) .map(Component.class::cast) .map(Component::getId) .collect(Collectors.toSet()); if (!deletedIds.isEmpty()) { deletionPlan.markForDeletion(getReferringRefSetMembers(deletedIds)); } delete(); deletionPlan = new SnomedDeletionPlan(); } if (isUniquenessCheckEnabled()) { List<CDOIDAndVersion> newObjects = transaction.getChangeSetData().getNewObjects(); ComponentIdUniquenessValidator uniquenessEnforcer = new ComponentIdUniquenessValidator(this); for (CDOIDAndVersion newCdoIdAndVersion : newObjects) { CDOObject newObject = transaction.getObject(newCdoIdAndVersion.getID()); if (newObject instanceof Component) { Component newComponent = (Component) newObject; uniquenessEnforcer.validateAndReplaceComponentId(newComponent); } } } }
Source:
<code>public AbstractSegmentStoreStatisticsViewer(Composite parent) { super(parent, false); setLabelProvider(new SegmentStoreStatisticsLabelProvider()); fTablePopupMenuManager = new MenuManager(); fTablePopupMenuManager.setRemoveAllWhenShown(true); <START> fTablePopupMenuManager.addMenuListener(new IMenuListener() { <END> @Override public void menuAboutToShow(final @Nullable IMenuManager manager) { TreeViewer viewer = getTreeViewer(); ISelection selection = viewer.getSelection(); if (selection instanceof IStructuredSelection) { IStructuredSelection sel = (IStructuredSelection) selection; if (manager != null) { appendToTablePopupMenu(manager, sel); } } } }); Menu tablePopup = fTablePopupMenuManager.createContextMenu(getTreeViewer().getTree()); getTreeViewer().getTree().setMenu(tablePopup); }</code><technical_language>Lambda</technical_language>

Target:
public AbstractSegmentStoreStatisticsViewer(Composite parent) { super(parent, false); setLabelProvider(new SegmentStoreStatisticsLabelProvider()); fTablePopupMenuManager = new MenuManager(); fTablePopupMenuManager.setRemoveAllWhenShown(true); fTablePopupMenuManager.addMenuListener(manager -> { TreeViewer viewer = getTreeViewer(); ISelection selection = viewer.getSelection(); if (selection instanceof IStructuredSelection) { IStructuredSelection sel = (IStructuredSelection) selection; if (manager != null) { appendToTablePopupMenu(manager, sel); } } }); Menu tablePopup = fTablePopupMenuManager.createContextMenu(getTreeViewer().getTree()); getTreeViewer().getTree().setMenu(tablePopup); }
Source:
<code>private void handleMetadataBlob(BlobData blobData) throws IOException, MessageFormatException { ByteBuffer serializedMetadataContent = blobData.getStream().getByteBuffer(); CompositeBlobInfo compositeBlobInfo = MetadataContentSerDe.deserializeMetadataContentRecord(serializedMetadataContent, blobIdFactory); chunkSize = compositeBlobInfo.getChunkSize(); totalSize = compositeBlobInfo.getTotalSize(); List<StoreKey> keys = compositeBlobInfo.getKeys(); if (options != null && options.getRange() != null) { try { resolvedByteRange = options.getRange().toResolvedByteRange(totalSize); } catch (IllegalArgumentException e) { onInvalidRange("ByteRange " + options.getRange() + " is not within total blob size " + totalSize); <START> return; <END> } int firstChunkIndexInRange = (int) (resolvedByteRange.getStartOffset() / chunkSize); int lastChunkIndexInRange = (int) (resolvedByteRange.getEndOffset() / chunkSize); keys = keys.subList(firstChunkIndexInRange, lastChunkIndexInRange + 1); } chunkIdIterator = keys.listIterator(); numChunksTotal = keys.size(); dataChunks = new GetChunk[Math.min(keys.size(), NonBlockingRouter.MAX_IN_MEM_CHUNKS)]; for (int i = 0; i < dataChunks.length; i++) { dataChunks[i] = new GetChunk(chunkIdIterator.nextIndex(), (BlobId) chunkIdIterator.next()); } }</code><technical_language>is get rid of this return? Nested returns beginning of a function hard understand flow</technical_language>

Target:
private void handleMetadataBlob(BlobData blobData) throws IOException, MessageFormatException { ByteBuffer serializedMetadataContent = blobData.getStream().getByteBuffer(); CompositeBlobInfo compositeBlobInfo = MetadataContentSerDe.deserializeMetadataContentRecord(serializedMetadataContent, blobIdFactory); chunkSize = compositeBlobInfo.getChunkSize(); totalSize = compositeBlobInfo.getTotalSize(); List<StoreKey> keys = compositeBlobInfo.getKeys(); boolean rangeResolutionFailure = false; try { if (options != null && options.getRange() != null) { resolvedByteRange = options.getRange().toResolvedByteRange(totalSize); int firstChunkIndexInRange = (int) (resolvedByteRange.getStartOffset() / chunkSize); int lastChunkIndexInRange = (int) (resolvedByteRange.getEndOffset() / chunkSize); keys = keys.subList(firstChunkIndexInRange, lastChunkIndexInRange + 1); } } catch (IllegalArgumentException e) { onInvalidRange(e); rangeResolutionFailure = true; } if (!rangeResolutionFailure) { chunkIdIterator = keys.listIterator(); numChunksTotal = keys.size(); dataChunks = new GetChunk[Math.min(keys.size(), NonBlockingRouter.MAX_IN_MEM_CHUNKS)]; for (int i = 0; i < dataChunks.length; i++) { dataChunks[i] = new GetChunk(chunkIdIterator.nextIndex(), (BlobId) chunkIdIterator.next()); } } }
Source:
<code>protected String getPath(String filename) throws IOException { return super.getPath("checks" + File.separator <START> + "SeparatorWrap" + File.separator + filename); <END> }</code><technical_language>Package name lowercase</technical_language>

Target:
protected String getPath(String filename) throws IOException { return super.getPath("checks" + File.separator + "whitespace" + File.separator + "separatorwrap" + File.separator + filename); }
Source:
<code>private List<String> getToolTip(RulesetManagementInterface ruleset, Process linkedProcess) throws IOException { Collection<String> summaryKeys = ruleset.getFunctionalKeys(FunctionalMetadata.DISPLAY_SUMMARY); List<String> toolTip = new ArrayList<>(); if (!summaryKeys.isEmpty()) { Workpiece workpiece = metsService.loadWorkpiece(processService.getMetadataFileUri(linkedProcess)); IncludedStructuralElement rootElement = workpiece.getRootElement(); final String metadataLanguage = ServiceManager.getUserService().getCurrentUser().getMetadataLanguage(); List<LanguageRange> priorityList = Locale.LanguageRange.parse(metadataLanguage); for (String key : summaryKeys) { String value = MetadataEditor.getMetadataValue(rootElement, key); if (Objects.nonNull(value)) { Optional<String> label = ruleset.getTranslationForKey(rootElement.getType(), priorityList); <START> toolTip.add(label.orElse(rootElement.getType()) + ": " + value); <END> } } } if (toolTip.isEmpty()) { toolTip.add(linkedProcess.toString()); } return toolTip; }</code><technical_language>suggestion toolTip.add(key + ": " + value);</technical_language>

Target:
private List<String> getToolTip(RulesetManagementInterface ruleset, Process linkedProcess) throws IOException { Collection<String> summaryKeys = ruleset.getFunctionalKeys(FunctionalMetadata.DISPLAY_SUMMARY); List<String> toolTip = new ArrayList<>(); if (!summaryKeys.isEmpty()) { Workpiece workpiece = metsService.loadWorkpiece(processService.getMetadataFileUri(linkedProcess)); IncludedStructuralElement rootElement = workpiece.getRootElement(); final String metadataLanguage = ServiceManager.getUserService().getCurrentUser().getMetadataLanguage(); List<LanguageRange> priorityList = Locale.LanguageRange.parse(metadataLanguage); for (String key : summaryKeys) { String value = MetadataEditor.getMetadataValue(rootElement, key); if (Objects.nonNull(value)) { Optional<String> label = ruleset.getTranslationForKey(key, priorityList); toolTip.add(label.orElse(key) + ": " + value); } } } if (toolTip.isEmpty()) { toolTip.add(linkedProcess.toString()); } return toolTip; }
Source:
<code>public IntegrationTestingConfig get() { return new IntegrationTestingConfig() { @Override public String getCoordinatorUrl() { return "http://" + dockerIp + ":8081"; } @Override public String getIndexerUrl() { return "http://" + dockerIp + ":8090"; } @Override public String getRouterUrl() { return "http://" + dockerIp + ":8888"; } @Override public String getBrokerUrl() { return "http://" + dockerIp + ":8082"; } @Override public String getHistoricalUrl() { return "http://" + dockerIp + ":8083"; } @Override public String getMiddleManagerHost() { return dockerIp; } @Override public String getZookeeperHosts() { return dockerIp + ":2181"; } @Override <START> public String getZookeeperIntenalHosts() <END> { return "druid-zookeeper-kafka:2181"; } @Override public String getKafkaHost() { return dockerIp + ":9093"; } @Override public String getKafkaInternalHost() { return "druid-zookeeper-kafka:9092"; } @Override public String getProperty(String prop) { if (prop.equals("hadoopTestDir")) { return hadoopDir; } throw new UnsupportedOperationException("DockerConfigProvider does not support property " + prop); } @Override public String getUsername() { return null; } @Override public String getPassword() { return null; } @Override public Map<String, String> getProperties() { return new HashMap<>(); } @Override public boolean manageKafkaTopic() { return true; } }; }</code><technical_language>Intenal -> Internal</technical_language>

Target:
public IntegrationTestingConfig get() { return new IntegrationTestingConfig() { @Override public String getCoordinatorUrl() { return "http://" + dockerIp + ":8081"; } @Override public String getIndexerUrl() { return "http://" + dockerIp + ":8090"; } @Override public String getRouterUrl() { return "http://" + dockerIp + ":8888"; } @Override public String getBrokerUrl() { return "http://" + dockerIp + ":8082"; } @Override public String getHistoricalUrl() { return "http://" + dockerIp + ":8083"; } @Override public String getMiddleManagerHost() { return dockerIp; } @Override public String getZookeeperHosts() { return dockerIp + ":2181"; } @Override public String getZookeeperInternalHosts() { return "druid-zookeeper-kafka:2181"; } @Override public String getKafkaHost() { return dockerIp + ":9093"; } @Override public String getKafkaInternalHost() { return "druid-zookeeper-kafka:9092"; } @Override public String getProperty(String prop) { if (prop.equals("hadoopTestDir")) { return hadoopDir; } throw new UnsupportedOperationException("DockerConfigProvider does not support property " + prop); } @Override public String getUsername() { return null; } @Override public String getPassword() { return null; } @Override public Map<String, String> getProperties() { return new HashMap<>(); } @Override public boolean manageKafkaTopic() { return true; } }; }
Source:
<code><START> public IPath buildPath(IPath <END> sourcePath, IPath targetPath, int count) { sourcePath = sourcePath.removeFirstSegments(count); return targetPath.append(sourcePath); }</code><technical_language>static</technical_language>

Target:
public static IPath buildPath(IPath sourcePath, IPath targetPath, int count) { sourcePath = sourcePath.removeFirstSegments(count); return targetPath.append(sourcePath); }
Source:
<code>public void checkNotExists() throws IOException, XmlPullParserException { final File baseDir = new File("src/test/files/structure/test-resources-folder-exists/not-exists"); when(fs.baseDir()).thenReturn(baseDir); final TestResourcesFolderExistsCheck check = new TestResourcesFolderExistsCheck(fs); final Iterable<ConnectorIssue> pomIssues = check.analyze(null); assertThat(Iterables.size(pomIssues), is(1)); <START> final ConnectorIssue first = Iterables.getFirst(pomIssues, null); <END> assertThat(first.ruleKey(), is("test-resources-folder-exists")); assertThat(first.message(), is("Test Resources directory doesn't exist.")); }</code><technical_language>getOnlyElement() instead of getFirst()</technical_language>

Target:
public void checkNotExists() throws IOException, XmlPullParserException { final File baseDir = new File("src/test/files/structure/test-resources-folder-exists/not-exists"); when(fs.baseDir()).thenReturn(baseDir); final TestResourcesFolderExistsCheck check = new TestResourcesFolderExistsCheck(fs); final Iterable<ConnectorIssue> pomIssues = check.analyze(null); assertThat(Iterables.size(pomIssues), is(1)); final ConnectorIssue first = Iterables.getOnlyElement(pomIssues, null); assertThat(first.ruleKey(), is("test-resources-folder-exists")); assertThat(first.message(), is("src/test/resources doesn't exist.")); }
Source:
<code>public OrderRequestBuilder withAuthorisationDetails(AuthCardDetails authCardDetails) { OrderRequestBuilder orderRequestBuilder = super.withAuthorisationDetails(authCardDetails); <START> authCardDetails.getAddress().ifPresent(address -> northAmericanRegionMapper.getNorthAmericanRegionForCountry(address) .ifPresent(stateOrProvince -> worldpayTemplateData.setState(stateOrProvince.getAbbreviation())) <END> ); return orderRequestBuilder; }</code><technical_language>java authCardDetails.getAddress() .flatMap(northAmericanRegionMapper::getNorthAmericanRegionForCountry) .map(NorthAmericaRegion::getAbbreviation) .ifPresent(worldpayTemplateData::setState);</technical_language>

Target:
public OrderRequestBuilder withAuthorisationDetails(AuthCardDetails authCardDetails) { OrderRequestBuilder orderRequestBuilder = super.withAuthorisationDetails(authCardDetails); authCardDetails.getAddress() .flatMap(northAmericanRegionMapper::getNorthAmericanRegionForCountry) .map(NorthAmericaRegion::getAbbreviation) .ifPresent(worldpayTemplateData::setState); return orderRequestBuilder; }
Source:
<code>public static String extractEndpointName(String name) { NhincConstants.NHIN_SERVICE_NAMES[] nhinServices = NhincConstants.NHIN_SERVICE_NAMES.values(); for (NhincConstants.NHIN_SERVICE_NAMES nhinService : nhinServices) { try { String serviceNames = PropertyAccessor.getInstance().getProperty(NhincConstants.FHIR_DIRECTORY_FILE, nhinService.getUDDIServiceName()); <START> if (serviceNames == null) { <END> LOG.warn("Service does not have any FHIR property defined", nhinService.getUDDIServiceName()); } else if (isServiceNameMatch(serviceNames.split(SEPARATOR), name)) { return nhinService.getUDDIServiceName(); } } catch (PropertyAccessException ex) { LOG.error("Unable to read from for NHIN Service {}", nhinService.toString(), NhincConstants.FHIR_DIRECTORY_FILE, nhinService, ex); } } return null; }</code><technical_language>Suggestion: <LINK_0> need catch exception in here. code more readable</technical_language>

Target:
public static String extractEndpointName(String name) { NhincConstants.NHIN_SERVICE_NAMES[] nhinServices = NhincConstants.NHIN_SERVICE_NAMES.values(); for (NhincConstants.NHIN_SERVICE_NAMES nhinService : nhinServices) { String serviceNames = PropertyAccessor.getInstance().getProperty(NhincConstants.FHIR_DIRECTORY_FILE, nhinService.getUDDIServiceName(), null); if (serviceNames == null) { LOG.warn("Service does not have any FHIR property defined", nhinService.getUDDIServiceName()); } else if (isServiceNameMatch(serviceNames.split(SEPARATOR), name)) { return nhinService.getUDDIServiceName(); } } return null; }
Source:
<code>public GameDetails(GameBean game, int detailsRequesterId) { this.gameId = game.getGameId(); this.creatorId = game.getCreator().getId(); this.privateGame = game.isPrivateGame(); this.privateCode = game.isPrivateGame() ? game.getPrivateCode() : null; this.dateCreated = game.getDateCreated().getTime(); this.dateStarted = game.getDateStarted() != null ? game.getDateStarted().getTime() : 0; this.status = game.getStatus().name(); this.gameUsers = game.getGameUserDetails(detailsRequesterId); this.minPlayers = game.getMinPlayers(); this.maxPlayers = game.getMaxPlayers(); this.targetVictoryPoints = game.getTargetVictoryPoints(); this.currentMove = game.getCurrentMove(); <START> this.dice = new DiceDetails(game.getDiceFirstValue(), game.getDiceSecondValue()); <END> this.map = new MapDetails(game.getEdgeDetails(), game.getHexDetails(), game.getNodeDetails()); }</code><technical_language>temporary decision, I refactored "dice = null" in case if dices thrown yet. IMHO, in future shoud create separated JSONs for new/playing status preparation/main stage</technical_language>

Target:
public GameDetails(GameBean game, int detailsRequesterId) { this.gameId = game.getGameId(); this.creatorId = game.getCreator().getId(); this.privateGame = game.isPrivateGame(); this.privateCode = game.isPrivateGame() ? game.getPrivateCode() : null; this.dateCreated = game.getDateCreated().getTime(); this.dateStarted = game.getDateStarted() != null ? game.getDateStarted().getTime() : 0; this.status = game.getStatus().name(); this.gameUsers = game.getGameUserDetails(detailsRequesterId); this.minPlayers = game.getMinPlayers(); this.maxPlayers = game.getMaxPlayers(); this.targetVictoryPoints = game.getTargetVictoryPoints(); this.currentMove = game.getCurrentMove(); this.dice = game.isDiceThrown() == null ? null : new DiceDetails(game.isDiceThrown(), game.calculateDiceSumValue(), game.getDiceFirstValue(), game.getDiceSecondValue()); this.map = new MapDetails(game.getEdgeDetails(), game.getHexDetails(), game.getNodeDetails()); }
Source:
<code><START> protected String getZkfcServerBindHost(Configuration conf) { <END> String addr = conf.getTrimmed(DFSConfigKeys.DFS_NAMENODE_SERVICE_RPC_BIND_HOST_KEY); if (addr == null || addr.isEmpty()) { addr = conf.getTrimmed(DFSConfigKeys.DFS_NAMENODE_RPC_BIND_HOST_KEY); if (addr == null || addr.isEmpty()) { return null; } } return addr; }</code><technical_language>This private static. 1. static refer this ZKFC object fields 2. Other methods protected I *guess* overriding parent class ZKFailoverController methods. overriding, change scope a smaller (aka weaker access privilege). protected keyword</technical_language>

Target:
private static String getZkfcServerBindHost(Configuration conf) { String addr = conf.getTrimmed( DFSConfigKeys.DFS_NAMENODE_SERVICE_RPC_BIND_HOST_KEY); if (addr == null || addr.isEmpty()) { addr = conf.getTrimmed(DFSConfigKeys.DFS_NAMENODE_RPC_BIND_HOST_KEY); } return addr; }
Source:
<code>private void startService() { try { lastCacheCleanupMillis = new Date().getTime(); serviceTrans.startThreads(); StepInterface serviceStep = serviceTrans.findRunThread( serviceStepName ); if ( serviceStep == null ) { throw Throwables.propagate( new KettleException( "Service step is not accessible" ) ); } serviceStep.addRowListener( new RowAdapter() { @Override public void rowWrittenEvent( RowMetaInterface rowMeta, Object[] row ) throws KettleStepException { LogChannelInterface log = serviceTrans.getLogChannel(); try { if ( log.isRowLevel() ) { log.logRowlevel( DataServiceConstants.PASSING_ALONG_ROW + rowMeta.getString( row ) ); } } catch ( KettleValueException e ) { } <START> RowMetaAndData rowData = new RowMetaAndData(); <END> rowData.setRowMeta( rowMeta ); rowData.setData( row ); serviceCacheCleanup(); if ( serviceListeners.size() > 0 ) { stepStream.add( rowData ); } else { isRunning.compareAndSet( true, false ); serviceTrans.stopAll(); serviceTrans.waitUntilFinished(); stepStream = null; log.logDebug( DataServiceConstants.STREAMING_TRANSFORMATION_STOPPED ); } } } ); } catch ( KettleException e ) { throw Throwables.propagate( e ); } }</code><technical_language>rowData field serviceListeners.size() > 0 if below, of scope</technical_language>

Target:
private void startService() { try { lastCacheCleanupMillis = System.currentTimeMillis(); serviceTrans.startThreads(); StepInterface serviceStep = serviceTrans.findRunThread( serviceStepName ); if ( serviceStep == null ) { throw Throwables.propagate( new KettleException( "Service step is not accessible" ) ); } serviceStep.addRowListener( new RowAdapter() { @Override public void rowWrittenEvent( RowMetaInterface rowMeta, Object[] row ) throws KettleStepException { LogChannelInterface log = serviceTrans.getLogChannel(); try { if ( log.isRowLevel() ) { log.logRowlevel( DataServiceConstants.PASSING_ALONG_ROW + rowMeta.getString( row ) ); } } catch ( KettleValueException e ) { } serviceCacheCleanup(); if ( serviceListeners.size() > 0 ) { RowMetaAndData rowData = new RowMetaAndData(); rowData.setRowMeta( rowMeta ); rowData.setData( row ); stepStream.add( rowData ); } else if ( isRunning.compareAndSet( true, false ) ) { serviceTrans.stopAll(); serviceTrans.waitUntilFinished(); stepStream = null; log.logDebug( DataServiceConstants.STREAMING_TRANSFORMATION_STOPPED ); } } } ); } catch ( KettleException e ) { throw Throwables.propagate( e ); } }
Source:
<code>public CompletableFuture<Boolean> bootstrapNewNode(String endpoint) { Layout layout = new Layout(runtime.getLayoutView().getLayout()); <START> CompletableFuture<Boolean> future = new CompletableFuture<>(); try { boolean bootstrapped = runtime.getLayoutView().bootstrapLayoutServer(endpoint, layout); future.complete(bootstrapped); return future; } catch (TimeoutException toe){ future.completeExceptionally(toe); return future; } <END> }</code><technical_language>This hacky, besides this is needed? bootstrapLayoutServer exceptionally block: java .exceptionally(throwable -> { try { CFUtils.unwrap(throwable, AlreadyBootstrappedException.class); } catch (AlreadyBootstrappedException e) { log.info("bootstrapLayoutServer: Layout Server bootstrapped.", endpoint); } return true; }) Notice this CFUtils.unwrap(throwable, AlreadyBootstrappedException.class); throw a RutimeException in case of exceptions other AlreadyBootstrappedException, returned future exceptionally completed . in this bootstrapNewNode method get a exceptionally completed future of RutimeException a TimeoutException wrapped inside</technical_language>

Target:
public CompletableFuture<Boolean> bootstrapNewNode(String endpoint) { Layout layout = new Layout(runtime.getLayoutView().getLayout()); return runtime.getLayoutView().bootstrapLayoutServer(endpoint, layout) .thenApply(result -> { log.info("bootstrapNewNode: New node bootstrapped.", endpoint); return true; }); }
Source:
<code>public Position scrollToColumnHeader(Position position, int headerRow, int scrollableColumn) { int column = scrollViewport(position, <START> position.row, scrollableColumn).column; <END> return new Position(headerRow, column); }</code><technical_language>position parameter is in NatTable coordinates out of range in scrollableLayer. Ideally scrollableColumn row underlying scrollable layer row is NatTable position, change scrolling. Position viewportPosition = new Position(position); ViewportLayer viewportLayer = getViewportLayer(viewportPosition); if (viewportLayer == null) { throw new IllegalArgumentException("No viewport layer position " + position); } int scrollableRow = viewportLayer.localToUnderlyingRowPosition(viewportPosition.row);</technical_language>

Target:
public Position scrollToColumnHeader(Position position, int headerRow, int scrollableColumn) { Position viewportPosition = new Position(position); ViewportLayer viewportLayer = getViewportLayer(viewportPosition); if (viewportLayer == null) { throw new IllegalArgumentException("No viewport layer found at position " + position); } int scrollableRow = viewportLayer.localToUnderlyingRowPosition(viewportPosition.row); int column = scrollViewport(position, scrollableRow, scrollableColumn).column; return new Position(headerRow, column); }
Source:
<code>protected String getExpressionForOperation(InitialOperation initialOperation) { if (initialOperation != null) { <START> Optional<SiriusInitialOperationAdapter> optionalAdapter = initialOperation.eAdapters().stream().filter(SiriusInitialOperationAdapter.class::isInstance) .map(SiriusInitialOperationAdapter.class::cast).findFirst(); <END> String expression = optionalAdapter.map(SiriusInitialOperationAdapter::getInitialOperationURI).orElseGet(() -> EcoreUtil.getURI(initialOperation).toString()); expression = expression.replace("'", "\\'"); return MessageFormat.format("aql:input.executeOperation(self, ''{0}'')", expression); } return null; }</code><technical_language>EcoreUtil.getExistingAdapter()</technical_language>

Target:
protected String getExpressionForOperation(InitialOperation initialOperation) { if (initialOperation != null) { String expression = ""; Adapter adapter = EcoreUtil.getExistingAdapter(initialOperation, SiriusInitialOperationAdapter.class); if (adapter instanceof SiriusInitialOperationAdapter) { expression = ((SiriusInitialOperationAdapter) adapter).getInitialOperationURI().toString(); } else { expression = EcoreUtil.getURI(initialOperation).toString(); } expression = expression.replace("'", "\\'"); return MessageFormat.format("aql:input.executeOperation(self, ''{0}'')", expression); } return null; }
Source:
<code>protected void restore(Bundle savedInstanceState) { blocksApiVersion = config.getApiUrlVersionConfig().getBlocksApiVersion(); courseData = (EnrolledCoursesResponse) savedInstanceState.getSerializable(Router.EXTRA_COURSE_DATA); <START> courseUpgradeData = (CourseUpgradeResponse) savedInstanceState.getParcelable(Router.EXTRA_COURSE_UPGRADE_DATA); <END> courseComponentId = savedInstanceState.getString(Router.EXTRA_COURSE_COMPONENT_ID); if (courseComponentId == null) { final String courseId = courseData.getCourse().getId(); getHierarchyCall = courseApi.getCourseStructure(blocksApiVersion, courseId); getHierarchyCall.enqueue(new CourseAPI.GetCourseStructureCallback(this, courseId, new ProgressViewController(progressWheel), errorNotification, snackbarErrorNotification, this) { @Override protected void onResponse(@NonNull final CourseComponent courseComponent) { courseComponentId = courseComponent.getId(); invalidateOptionsMenu(); onLoadData(); } @Override protected void onFinish() { isInitialServerCallDone = true; } }); } }</code><technical_language>Need remove redundant cast</technical_language>

Target:
protected void restore(Bundle savedInstanceState) { blocksApiVersion = config.getApiUrlVersionConfig().getBlocksApiVersion(); courseData = (EnrolledCoursesResponse) savedInstanceState.getSerializable(Router.EXTRA_COURSE_DATA); courseUpgradeData = savedInstanceState.getParcelable(Router.EXTRA_COURSE_UPGRADE_DATA); courseComponentId = savedInstanceState.getString(Router.EXTRA_COURSE_COMPONENT_ID); if (courseComponentId == null) { final String courseId = courseData.getCourse().getId(); getHierarchyCall = courseApi.getCourseStructure(blocksApiVersion, courseId); getHierarchyCall.enqueue(new CourseAPI.GetCourseStructureCallback(this, courseId, new ProgressViewController(progressWheel), errorNotification, snackbarErrorNotification, this) { @Override protected void onResponse(@NonNull final CourseComponent courseComponent) { courseComponentId = courseComponent.getId(); invalidateOptionsMenu(); onLoadData(); } @Override protected void onFinish() { isInitialServerCallDone = true; } }); } }
Source:
<code>private void loadData(int episodeId, int showId) { Observable<Integer> userShowEpisodesObservable = client.profileEpisodesOfShow(showId) .defaultIfEmpty(new UserShowEpisodes(showId, Collections.emptyList())) .map(userShowEpisodes -> extractMyRating(userShowEpisodes, episodeId)) <START> .subscribeOn(Schedulers.computation()); <END> Observable.combineLatest(client.episodeInformation(episodeId), client.comments(episodeId), userShowEpisodesObservable, ActivityInformation::new) .compose(bindToLifecycle()) .subscribe(this::bind); }</code><technical_language>I want compute extractMyRating() computation scheduler. do this observeOn(Schedulers.computation()) map observeOn(AndroidSchedulers.mainThread()) subscribe()</technical_language>

Target:
private void loadData(int episodeId, int showId) { Observable<Integer> userShowEpisodesObservable = client.profileEpisodesOfShow(showId) .defaultIfEmpty(new UserShowEpisodes(showId, Collections.emptyList())) .observeOn(Schedulers.computation()) .map(userShowEpisodes -> extractMyRating(userShowEpisodes, episodeId)) .observeOn(AndroidSchedulers.mainThread()); Observable.combineLatest(client.episodeInformation(episodeId), client.comments(episodeId), userShowEpisodesObservable, ActivityInformation::new) .compose(bindToLifecycle()) .subscribe(this::bind); }
Source:
<code>public String getGsCredentialsPath() { <START> return getString("secor.gs.credentials.path", null); <END> }</code><technical_language>prefer people providing default properties file, want default more explicit. provide default in secor.common.properties</technical_language>

Target:
public String getGsCredentialsPath() { return getString("secor.gs.credentials.path"); }
Source:
<code>public void foo(String r) { String init = "Bob is a Bird... Bob is a Plane... Bob is Superman!"; String changed = init.replaceAll("Bob is", "It's"); changed = init.replaceAll("\\w*\\sis", "It's"); changed = init.replaceAll(r, "It's"); changed = init.replaceAll(".", "It's"); changed = init.replaceAll("$", "It's"); changed = init.replaceAll("|", "It's"); changed = init.replaceAll("(", "It's"); <START> changed = init.replaceAll(")", "It's"); END> changed = init.replaceAll("[", "It's"); changed = init.replaceAll("{", "It's"); changed = init.replaceAll("^", "It's"); changed = init.replaceAll("?", "It's"); changed = init.replaceAll("*", "It's"); changed = init.replaceAll("+", "It's"); changed = init.replaceAll("\\", "It's"); }</code><technical_language>This line needs removed commit</technical_language>

Target:
public void foo(String r) { String init = "Bob is a Bird... Bob is a Plane... Bob is Superman!"; String changed = init.replaceAll("Bob is", "It's"); changed = init.replaceAll("\\w*\\sis", "It's"); changed = init.replaceAll(r, "It's"); changed = init.replaceAll(".", "It's"); changed = init.replaceAll("$", "It's"); changed = init.replaceAll("|", "It's"); changed = init.replaceAll("(", "It's"); changed = init.replaceAll("[", "It's"); changed = init.replaceAll("{", "It's"); changed = init.replaceAll("^", "It's"); changed = init.replaceAll("?", "It's"); changed = init.replaceAll("*", "It's"); changed = init.replaceAll("+", "It's"); changed = init.replaceAll("\\", "It's"); }
Source:
<code>public synchronized Map<Object, Object> getMap() throws IOException { if (valuesMap == null) { HttpURLConnection urlConnection = createURLConnection(url); InputStreamReader reader = request(urlConnection); <START> this.valuesMap = reader!=null?read(reader):new HashMap<Object, Object>(); <END> } return valuesMap; }</code><technical_language>do this null handling in read() reader get closed in a try/finally</technical_language>

Target:
public synchronized Map<Object, Object> getMap() throws IOException { if (valuesMap == null) { HttpURLConnection urlConnection = createURLConnection(url); InputStreamReader reader = request(urlConnection); if(reader != null) { try { Properties pr = new Properties(); pr.load(reader); valuesMap = pr; } finally { reader.close(); } } if(valuesMap == null) { valuesMap = Collections.emptyMap(); } } return valuesMap; }
Source:
<code>public void within(double seconds, Closure<?> conditions) throws InterruptedException { long timeoutMillis = toMillis(seconds); long start = System.currentTimeMillis(); long lastAttempt = 0; if (initialDelay > 0) { Thread.sleep(toMillis(initialDelay)); } long currDelay = toMillis(delay); int attempts = 0; long elapsedTime = 0; Throwable testException = null; while (elapsedTime <= timeoutMillis) { try { try { GroovyRuntimeUtil.invokeClosure(conditions); } finally { <START> lastAttempt = System.currentTimeMillis(); <END> attempts++; } return; } catch (Throwable e) { testException = e; elapsedTime = lastAttempt - start; final long timeout = Math.min(currDelay, start + timeoutMillis - System.currentTimeMillis()); if (timeout > 0) { Thread.sleep(timeout); } currDelay *= factor; } } String msg = String.format("Condition not satisfied after %1.2f seconds and %d attempts", elapsedTime / 1000d, attempts); throw new SpockTimeoutError(seconds, msg, testException); }</code><technical_language>is this better? IMHO do lastAttempt completely elapsedTime = System.currentTimeMillis() - start; move attempts++ closure</technical_language>

Target:
public void within(double seconds, Closure<?> conditions) throws InterruptedException { long timeoutMillis = toMillis(seconds); long start = System.currentTimeMillis(); if (initialDelay > 0) { Thread.sleep(toMillis(initialDelay)); } long currDelay = toMillis(delay); int attempts = 0; long elapsedTime = 0; Throwable testException = null; while (elapsedTime <= timeoutMillis) { try { attempts++; GroovyRuntimeUtil.invokeClosure(conditions); return; } catch (Throwable e) { elapsedTime = System.currentTimeMillis() - start; testException = e; final long sleepMillis = Math.min(currDelay, start + timeoutMillis - System.currentTimeMillis()); if (sleepMillis > 0) { Thread.sleep(sleepMillis); } currDelay *= factor; } } String msg = String.format("Condition not satisfied after %1.2f seconds and %d attempts", elapsedTime / 1000d, attempts); throw new SpockTimeoutError(seconds, msg, testException); }
Source:
<code>private boolean doPoll() { IntegrationResourceHolder holder = this.bindResourceHolderIfNecessary( this.getResourceKey(), this.getResourceToBind()); Message<?> message = null; try { message = this.receiveMessage(); } catch (Exception e) { if (Thread.interrupted()) { if (logger.isDebugEnabled()) { logger.debug("Poll interrupted - during stop()? : " + e.getMessage()); } return false; } else { throw (RuntimeException) e; } } boolean result; if (message == null) { if (this.logger.isDebugEnabled()) { this.logger.debug("Received no Message during the poll, returning 'false'"); } result = false; } else { if (this.logger.isDebugEnabled()) { this.logger.debug("Poll resulted in Message: " + message); } if (holder != null) { holder.setMessage(message); } try { this.handleMessage(message); } catch (Exception e) { if (e instanceof MessagingException) { throw new OriginalMessageContainingMessagingException(message, (MessagingException) e); } else { throw new MessagingException(message, e); <START> } <END> } result = true; } return result; }</code><technical_language>I slightly confused. do need a new class if existing (MessagingException) provides need hold access _cause_ _message_. Is a Marker interface? If simplify implementation rely getFailedMessage() other provided functionality I missing</technical_language>

Target:
private boolean doPoll() { IntegrationResourceHolder holder = this.bindResourceHolderIfNecessary( this.getResourceKey(), this.getResourceToBind()); Message<?> message = null; try { message = this.receiveMessage(); } catch (Exception e) { if (Thread.interrupted()) { if (logger.isDebugEnabled()) { logger.debug("Poll interrupted - during stop()? : " + e.getMessage()); } return false; } else { throw (RuntimeException) e; } } boolean result; if (message == null) { if (this.logger.isDebugEnabled()) { this.logger.debug("Received no Message during the poll, returning 'false'"); } result = false; } else { if (this.logger.isDebugEnabled()) { this.logger.debug("Poll resulted in Message: " + message); } if (holder != null) { holder.setMessage(message); } try { this.handleMessage(message); } catch (Exception e) { if (e instanceof MessagingException) { throw new MessagingExceptionWrapper(message, (MessagingException) e); } else { throw new MessagingException(message, e); } } result = true; } return result; }
Source:
<code>public void canDoReverseLookups() throws UnknownHostException, ExecutionException, InterruptedException { assertThat(dnsResolver.reverseLookup(InetAddress.getByName("173.242.186.51")).get().get(), equalTo("rnd.opennms.ca")); assertThat(dnsResolver.reverseLookup(InetAddress.getByName("1.1.1.1")).get(), equalTo(Optional.empty())); <START> assertThat(dnsResolver.reverseLookup(InetAddressUtils.addr("fe80::")).get(), equalTo(Optional.empty())); <END> }</code><technical_language>some non-link local IP resolver filter out anyway</technical_language>

Target:
public void canDoReverseLookups() throws UnknownHostException, ExecutionException, InterruptedException { assertThat(dnsResolver.reverseLookup(InetAddress.getByName("173.242.186.51")).get().get(), equalTo("rnd.opennms.ca")); assertThat(dnsResolver.reverseLookup(InetAddress.getByName("2600:5800:fc29:0003:0000:0000:0000:0001")).get().get(), equalTo("secret.opennms.com")); assertThat(dnsResolver.reverseLookup(InetAddress.getByName("1.1.1.1")).get(), equalTo(Optional.empty())); assertThat(dnsResolver.reverseLookup(InetAddressUtils.addr("2606:4700:4700::1111")).get(), equalTo(Optional.empty())); }
Source:
<code>public static Entry create(String accountId, String bucketId, String contentType, String fileId, Map<String, String> fileInfo, String fileName, long uploadTimestamp) { <START> return new AutoValue_ListUnfinishedLargeFilesResponse_Entry(accountId, bucketId, contentType, fileId, fileInfo, fileName, new Date(uploadTimestamp)); <END> }</code><technical_language>fileInfo map immutable</technical_language>

Target:
public static Entry create(String accountId, String bucketId, String contentType, String fileId, Map<String, String> fileInfo, String fileName, long uploadTimestamp) { return new AutoValue_ListUnfinishedLargeFilesResponse_Entry(accountId, bucketId, contentType, fileId, ImmutableMap.copyOf(fileInfo), fileName, new Date(uploadTimestamp)); }
Source:
<code>public V put(K key, V value, long ttl, TimeUnit ttlUnit, long maxIdle, TimeUnit maxIdleUnit) { checkNotNull(key, NULL_KEY_IS_NOT_ALLOWED); checkNotNull(value, NULL_VALUE_IS_NOT_ALLOWED); Data valueData = toData(value); Data result = putInternal(key, valueData, ttl, ttlUnit, maxIdle, maxIdleUnit); return toObject(result); <START> } <END></code><technical_language>New methods guarded for cluster version eg: if (isClusterVersionLessThan(V3_11)) { throw new UnsupportedOperationException("Not supported ..."); }</technical_language>

Target:
public V put(K key, V value, long ttl, TimeUnit ttlUnit, long maxIdle, TimeUnit maxIdleUnit) { if (isClusterVersionLessThan(V3_11)) { throw new UnsupportedOperationException("put with Max-Idle operation is available " + "when cluster version is 3.11 or higher"); } checkNotNull(key, NULL_KEY_IS_NOT_ALLOWED); checkNotNull(value, NULL_VALUE_IS_NOT_ALLOWED); Data valueData = toData(value); Data result = putInternal(key, valueData, ttl, ttlUnit, maxIdle, maxIdleUnit); return toObject(result); }