auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected void executeCommand() { StoragePoolParametersBase parameters = new StoragePoolParametersBase(getStoragePoolId()); ActionReturnValue actionReturnValue = runInternalAction(ActionType.ProcessOvfUpdateForStoragePool, parameters, getContext()); Set<Guid> proccessedDomains = actionReturnValue.getActionReturnValue(); if (actionReturnValue.getSucceeded() && proccessedDomains != null && proccessedDomains.contains(getStorageDomainId())) { runInternalActionWithTasksContext(ActionType.ProcessOvfUpdateForStorageDomain, createProcessOvfUpdateForDomainParams()); <START> } <END> setSucceeded(true); }</code><technical_language>please add a log update process</technical_language>

Target:
protected void executeCommand() { Guid storageDomainId = getStorageDomainId(); StoragePoolParametersBase parameters = new StoragePoolParametersBase(getStoragePoolId()); ActionReturnValue actionReturnValue = runInternalAction(ActionType.ProcessOvfUpdateForStoragePool, parameters, getContext()); Set<Guid> proccessedDomains = actionReturnValue.getActionReturnValue(); if (actionReturnValue.getSucceeded() && proccessedDomains != null && proccessedDomains.contains(storageDomainId)) { runInternalActionWithTasksContext(ActionType.ProcessOvfUpdateForStorageDomain, createProcessOvfUpdateForDomainParams()); } log.info("OVFs update was ignored - nothing to update for storage domain '{}'", storageDomainId); setSucceeded(true); }
Source:
<code>public StudentProfileAttributes getCopy() { return builder() .withGoogleId(googleId) .withShortName(shortName) .withEmail(email) .withInstitute(institute) <START> .withGender(GenderType.other) <END> .withNationality(nationality) .withMoreInfo(moreInfo) .withPictureKey(pictureKey) .withModifiedDate(modifiedDate) .build(); }</code><technical_language>leave gender here</technical_language>

Target:
public StudentProfileAttributes getCopy() { return builder() .withGoogleId(googleId) .withShortName(shortName) .withEmail(email) .withInstitute(institute) .withGender(gender) .withNationality(nationality) .withMoreInfo(moreInfo) .withPictureKey(pictureKey) .withModifiedDate(modifiedDate) .build(); }
Source:
<code>public Preferences() { gameTileSortingOrder = new SimpleObjectProperty<>(TilesSortingOrder.PLAYER_DES); chat = new ChatPrefs(); login = new LoginPrefs(); localization = new LocalizationPrefs(); lastGamePrefs = new LastGamePrefs(); mainWindow = new WindowPrefs(); forgedAlliance = new ForgedAlliancePrefs(); themeName = new SimpleStringProperty(DEFAULT_THEME_NAME); ignoredNotifications = new SimpleListProperty<>(observableArrayList()); notification = new NotificationsPrefs(); rememberLastTab = new SimpleBooleanProperty(true); ladder1v1 = new Ladder1v1Prefs(); gamesViewMode = new SimpleStringProperty(); news = new NewsPrefs(); developer = new DeveloperPrefs(); gameListSorting = new SimpleListProperty<>(observableArrayList()); vaultPrefs = new VaultPrefs(); unitDataBaseType = new SimpleObjectProperty<>(UnitDataBaseType.RACKOVER); storedCookies = new SimpleMapProperty<>(FXCollections.observableHashMap()); showPasswordProtectedGames = new SimpleBooleanProperty(true); showModdedGames = new SimpleBooleanProperty(true); disallowJoinsViaDiscord = new SimpleBooleanProperty(); showGameDetailsSidePane = new SimpleBooleanProperty(false); advancedIceLogEnabled = new SimpleBooleanProperty(false); prereleaseCheckEnabled = new SimpleBooleanProperty(false); <START> cacheLifeTime = new SimpleIntegerProperty(30); <END> }</code><technical_language>reflect unit in name</technical_language>

Target:
public Preferences() { gameTileSortingOrder = new SimpleObjectProperty<>(TilesSortingOrder.PLAYER_DES); chat = new ChatPrefs(); login = new LoginPrefs(); generatorPrefs = new GeneratorPrefs(); localization = new LocalizationPrefs(); lastGamePrefs = new LastGamePrefs(); mainWindow = new WindowPrefs(); forgedAlliance = new ForgedAlliancePrefs(); themeName = new SimpleStringProperty(DEFAULT_THEME_NAME); ignoredNotifications = new SimpleListProperty<>(observableArrayList()); notification = new NotificationsPrefs(); ladder1v1 = new Ladder1v1Prefs(); gamesViewMode = new SimpleStringProperty(); news = new NewsPrefs(); developer = new DeveloperPrefs(); gameListSorting = new SimpleListProperty<>(observableArrayList()); vaultPrefs = new VaultPrefs(); unitDataBaseType = new SimpleObjectProperty<>(UnitDataBaseType.SPOOKY); storedCookies = new SimpleMapProperty<>(FXCollections.observableHashMap()); showPasswordProtectedGames = new SimpleBooleanProperty(true); showModdedGames = new SimpleBooleanProperty(true); disallowJoinsViaDiscord = new SimpleBooleanProperty(); showGameDetailsSidePane = new SimpleBooleanProperty(false); advancedIceLogEnabled = new SimpleBooleanProperty(false); prereleaseCheckEnabled = new SimpleBooleanProperty(false); cacheLifeTimeInDays = new SimpleIntegerProperty(30); gameDataCacheActivated = new SimpleBooleanProperty(false); }
Source:
<code>public void beforeLogon(Project project) throws PersistenceException, LoginException { String productVersion = VersionUtils.getDisplayVersion(); if (GlobalServiceRegister.getDefault().isServiceRegistered(IInstalledPatchService.class)) { IInstalledPatchService pachService = (IInstalledPatchService) GlobalServiceRegister .getDefault().getService(IInstalledPatchService.class); if (pachService != null && pachService.isMonthlyPatch()) { String patchVersion = pachService.getLatestInstalledVersion(); if(patchVersion != null) { <START> System.setProperty(VersionUtils.STUDIO_VERSION_PROP, patchVersion); <END> productVersion = patchVersion; } } } if (GlobalServiceRegister.getDefault().isServiceRegistered(IBrandingService.class)) { IBrandingService brandingService = (IBrandingService) GlobalServiceRegister.getDefault() .getService(IBrandingService.class); String version = brandingService.getFullProductName() + "-" + productVersion; if (!version.equals(project.getEmfProject().getProductVersion())) { updatePreferenceProjectVersion(project); } } }</code><technical_language>STUDIO_VERSION_PROP is for place talend.project/ .properties , easy bug if change this</technical_language>

Target:
public void beforeLogon(Project project) throws PersistenceException, LoginException { if (GlobalServiceRegister.getDefault().isServiceRegistered(IBrandingService.class)) { IBrandingService brandingService = (IBrandingService) GlobalServiceRegister.getDefault() .getService(IBrandingService.class); String productVersion = VersionUtils.getDisplayVersion(); String version = brandingService.getFullProductName() + "-" + productVersion; if (!version.equals(project.getEmfProject().getProductVersion())) { updatePreferenceProjectVersion(project); } } }
Source:
<code>public List<Metacard> getMetacardListByTag(String tagStr) { Filter filter = filterBuilder.attribute(Core.METACARD_TAGS).is().like().text(tagStr); return resultIterable( catalogFramework, new QueryRequestImpl( new QueryImpl( filter, 1, pageSize, new SortByImpl(Core.MODIFIED, SortOrder.DESCENDING), false, TimeUnit.SECONDS.toMillis(10)), false, null, additionalSort(new HashMap<>(), Core.ID, SortOrder.ASCENDING))) .stream() .filter(Objects::nonNull) <START> .map(this::getMetacardFromResult) <END> .filter(Objects::nonNull) .collect(Collectors.toList()); }</code><technical_language>Result::getMetacard? This method extraction necessarily more readable</technical_language>

Target:
public List<Metacard> getMetacardListByTag(String tagStr) { Filter filter = filterBuilder.attribute(Core.METACARD_TAGS).is().like().text(tagStr); return resultIterable( catalogFramework, new QueryRequestImpl( new QueryImpl( filter, 1, pageSize, new SortByImpl(Core.MODIFIED, SortOrder.DESCENDING), false, TimeUnit.SECONDS.toMillis(10)), false, null, null)) .stream() .filter(Objects::nonNull) .map(Result::getMetacard) .filter(Objects::nonNull) .collect(Collectors.toList()); }
Source:
<code>private boolean isInstructorPage(String actionName) { return actionName.toLowerCase().startsWith(Const.ActivityLog.PREFIX_INSTRUCTOR_PAGE) <START> || Const.ActionURIs.INSTRUCTOR_FEEDBACK_STATS_PAGE.contains(actionName); <END> }</code><technical_language>need include INSTRUCTOR_COURSE_STATS_PAGE well</technical_language>

Target:
private boolean isInstructorPage(String actionName) { return actionName.toLowerCase().startsWith(Const.ActivityLog.PREFIX_INSTRUCTOR_PAGE) || Const.ActionURIs.INSTRUCTOR_FEEDBACK_STATS_PAGE.contains(actionName) || Const.ActionURIs.INSTRUCTOR_COURSE_STATS_PAGE.contains(actionName); }
Source:
<code><START> public boolean isNoexcept(boolean inCalledContext) { <END> if (inCalledContext) { return EvalUtil.bindingIsNoexcept(getMember()); } else return true; }</code><technical_language>need check fOwnerEval well. Test case: struct S { int mem; }; S foo(); // throw constexpr bool n = noexcept(foo().mem); // false</technical_language>

Target:
public boolean isNoexcept(boolean inCalledContext) { if (!fOwnerEval.isNoexcept(inCalledContext)) return false; if (inCalledContext) { return EvalUtil.bindingIsNoexcept(getMember()); } else return true; }
Source:
<code>final void onPrimaryError(GridNearAtomicAbstractUpdateRequest req, GridNearAtomicUpdateResponse res) { assert res.error() != null; if (err == null) err = new CachePartialUpdateCheckedException("Failed to update keys (retry update if possible)."); Collection<KeyCacheObject> keys0 = res.failedKeys() != null ? res.failedKeys() : req.keys(); Collection<Object> keys = new ArrayList<>(keys0.size()); for (KeyCacheObject key : keys0) <START> keys.add(cctx.cacheObjectContext().unwrapBinaryIfNeeded(key, true, false)); <END> err.add(keys, res.error(), req.topologyVersion()); }</code><technical_language>I suggest keys.add(cctx.toCacheKeyObject(key)); instead</technical_language>

Target:
final void onPrimaryError(GridNearAtomicAbstractUpdateRequest req, GridNearAtomicUpdateResponse res) { assert res.error() != null; if (err == null) err = new CachePartialUpdateCheckedException("Failed to update keys (retry update if possible)."); Collection<KeyCacheObject> keys0 = res.failedKeys() != null ? res.failedKeys() : req.keys(); Collection<Object> keys = new ArrayList<>(keys0.size()); Collection<Object> failedToUnwrapKeys = null; Exception suppressedErr = null; for (KeyCacheObject key : keys0) { try { keys.add(cctx.cacheObjectContext().unwrapBinaryIfNeeded(key, keepBinary, false)); } catch (BinaryInvalidTypeException e) { keys.add(cctx.toCacheKeyObject(key)); if (log.isDebugEnabled()) { if (failedToUnwrapKeys == null) failedToUnwrapKeys = new ArrayList<>(); if (failedToUnwrapKeys.size() < 5) failedToUnwrapKeys.add(key); } suppressedErr = e; } catch (Exception e) { keys.add(cctx.toCacheKeyObject(key)); suppressedErr = e; } } if (failedToUnwrapKeys != null) { log.warning("Failed to unwrap keys: " + failedToUnwrapKeys + " (the binary objects will be used instead)."); } IgniteCheckedException error = res.error(); if (suppressedErr != null) error.addSuppressed(suppressedErr); err.add(keys, error, req.topologyVersion()); }
Source:
<code>public static void main(String[] args) throws IOException { List<String> lines = FileUtils.readLines(new File( "/Users/Shyam/mention.eval.dl")); <START> <END> for (String line : lines) { String[] parts = line.split("\\s+"); logger.info(parts[0] + parts[1] + parts[2]); StringBuilder sb = new StringBuilder(); for (int i = 3; i < parts.length; i++) sb.append(parts[i] + " "); if (mentionFilter(parts)) { logger.info("removing " + Arrays.asList(parts)); continue; } if (mentions.containsKey(parts[0])) { mentions.get(parts[0]) .add(new DocMention(parts[0], sb.toString(), Integer .parseInt(parts[1]), Integer.parseInt(parts[2]))); } else { mentions.put(parts[0], new ArrayList<DocMention>()); mentions.get(parts[0]) .add(new DocMention(parts[0], sb.toString(), Integer .parseInt(parts[1]), Integer.parseInt(parts[2]))); } } for (String doc : mentions.keySet()) { handleDoc(mentions.get(doc)); } outputMentions(); }</code><technical_language>This is a main() please leave println()</technical_language>

Target:
public static void main(String[] args) throws IOException { List<String> lines = FileUtils.readLines(new File( "/Users/Shyam/mention.eval.dl")); for (String line : lines) { String[] parts = line.split("\\s+"); System.out.println(parts[0] + parts[1] + parts[2]); StringBuilder sb = new StringBuilder(); for (int i = 3; i < parts.length; i++) sb.append(parts[i] + " "); if (mentionFilter(parts)) { System.out.println("removing " + Arrays.asList(parts)); continue; } if (mentions.containsKey(parts[0])) { mentions.get(parts[0]) .add(new DocMention(parts[0], sb.toString(), Integer .parseInt(parts[1]), Integer.parseInt(parts[2]))); } else { mentions.put(parts[0], new ArrayList<DocMention>()); mentions.get(parts[0]) .add(new DocMention(parts[0], sb.toString(), Integer .parseInt(parts[1]), Integer.parseInt(parts[2]))); } } for (String doc : mentions.keySet()) { handleDoc(mentions.get(doc)); } outputMentions(); }
Source:
<code>public LocalContainerEntityManagerFactoryBean entityManagerFactory() { LocalContainerEntityManagerFactoryBean retVal = super.entityManagerFactory(); retVal.setPersistenceUnitName("HAPI_PU"); retVal.setDataSource(myDataSource); <START> retVal.setPackagesToScan("ca.uhn.fhir.jpa.model.entity", "ca.uhn.fhir.jpa.entity"); <END> retVal.setPersistenceProvider(new HibernatePersistenceProvider()); retVal.setJpaProperties(myJpaProperties); return retVal; }</code><technical_language>I able eliminate this line entirely, in super.entityManagerFactory() call</technical_language>

Target:
public LocalContainerEntityManagerFactoryBean entityManagerFactory() { LocalContainerEntityManagerFactoryBean retVal = super.entityManagerFactory(); retVal.setPersistenceUnitName("HAPI_PU"); retVal.setDataSource(myDataSource); retVal.setJpaProperties(myJpaProperties); return retVal; }
Source:
<code>List<NameValuePair> buildCommonParams(List<String> journalKeys, int start, int rows, SearchCriterion sortOrder, SearchCriterion dateRange, boolean forHomePage) { List<NameValuePair> params = new ArrayList<>(); params.add(new BasicNameValuePair("wt", "json")); params.add(new BasicNameValuePair("fl", FL)); params.add(new BasicNameValuePair("fq", "doc_type:full")); params.add(new BasicNameValuePair("fq", "!article_type_facet:\"Issue Image\"")); params.add(new BasicNameValuePair("rows", Integer.toString(rows))); if (start > 0) { params.add(new BasicNameValuePair("start", Integer.toString(start))); } params.add(new BasicNameValuePair("hl", "false")); params.add(new BasicNameValuePair("facet", "false")); String sortOrderStr = sortOrder.getValue(); if (!forHomePage) { sortOrderStr += ",id desc"; } params.add(new BasicNameValuePair("sort", sortOrderStr)); String dateRangeStr = dateRange.getValue(); if (!Strings.isNullOrEmpty(dateRangeStr)) { params.add(new BasicNameValuePair("fq", "publication_date:" + dateRangeStr)); } StringBuilder crossPublishedJournals = new StringBuilder(); <START> for (int i = 0; i < journalKeys.size(); i++) { <END> crossPublishedJournals.append("cross_published_journal_key:"); crossPublishedJournals.append(journalKeys.get(i)); if (i < journalKeys.size() - 1) { crossPublishedJournals.append(" OR "); } } params.add(new BasicNameValuePair("fq", crossPublishedJournals.toString())); return params; }</code><technical_language>this a simpler a forEach loop, a Joiner? java List<String> crossPublishedJournals = new ArrayList<>(); for (String journalKey : journalKeys) { crossPublishedJournals.add("cross_published_journal_key:" + journalKey); } Joiner.on(" ").join(crossPublishedJournals);</technical_language>

Target:
List<NameValuePair> buildCommonParams(List<String> journalKeys, int start, int rows, SearchCriterion sortOrder, SearchCriterion dateRange, boolean forHomePage) { List<NameValuePair> params = new ArrayList<>(); params.add(new BasicNameValuePair("wt", "json")); params.add(new BasicNameValuePair("fl", FL)); params.add(new BasicNameValuePair("fq", "doc_type:full")); params.add(new BasicNameValuePair("fq", "!article_type_facet:\"Issue Image\"")); params.add(new BasicNameValuePair("rows", Integer.toString(rows))); if (start > 0) { params.add(new BasicNameValuePair("start", Integer.toString(start))); } params.add(new BasicNameValuePair("hl", "false")); params.add(new BasicNameValuePair("facet", "false")); String sortOrderStr = sortOrder.getValue(); if (!forHomePage) { sortOrderStr += ",id desc"; } params.add(new BasicNameValuePair("sort", sortOrderStr)); String dateRangeStr = dateRange.getValue(); if (!Strings.isNullOrEmpty(dateRangeStr)) { params.add(new BasicNameValuePair("fq", "publication_date:" + dateRangeStr)); } List<String> crossPublishedJournals = new ArrayList<>(); for (String journalKey : journalKeys) { crossPublishedJournals.add("cross_published_journal_key:" + journalKey); } params.add(new BasicNameValuePair("fq", Joiner.on(" OR ").join(crossPublishedJournals))); return params; }
Source:
<code>private <T> LinkedList<T> getEventJournalEvents(EventJournalReader<T> reader) { final LinkedList<T> events = new LinkedList<T>(); for (int i = 1; i < TEST_PARTITION_COUNT; i++) { try { final EventJournalInitialSubscriberState state = reader.subscribeToEventJournal(i).get(); final ReadResultSet<T> partitionEvents = reader.readFromEventJournal( state.getOldestSequence(), 1, (int) (state.getNewestSequence() - state.getOldestSequence() + 1), i, <START> new TruePredicate<T>(), new IdentityFunction<>()).get(); <END> for (T event : partitionEvents) { events.add(event); } } catch (Exception e) { throw rethrow(e); } } return events; }</code><technical_language>Missing type</technical_language>

Target:
private <T> LinkedList<T> getEventJournalEvents(EventJournalReader<T> reader) { final LinkedList<T> events = new LinkedList<T>(); for (int i = 1; i < TEST_PARTITION_COUNT; i++) { try { final EventJournalInitialSubscriberState state = reader.subscribeToEventJournal(i).get(); final ReadResultSet<T> partitionEvents = reader.readFromEventJournal( state.getOldestSequence(), 1, (int) (state.getNewestSequence() - state.getOldestSequence() + 1), i, new TruePredicate<T>(), new IdentityFunction<T>()).get(); for (T event : partitionEvents) { events.add(event); } } catch (Exception e) { throw rethrow(e); } } return events; }
Source:
<code>void onDependencyPathSelectedEvent(@Observes final DependencyPathSelectedEvent event) { if (event != null && event.getContext() != null && event.getPath() != null) { <START> m2RepoService.call(new RemoteCallback<String>() { <END> @Override public void callback(String kMoudleText) { m2RepoService.call(new RemoteCallback<String>() { @Override public void callback(String kieDeploymentDescriptorText) { setupView(createProcessConfig(kieDeploymentDescriptorText, kMoudleText)); } }).getKieDeploymentDescriptorText(event.getPath()); } }).getKMoudleText(event.getPath()); } }</code><technical_language>please lambda style</technical_language>

Target:
void onDependencyPathSelectedEvent(@Observes final DependencyPathSelectedEvent event) throws IOException { if (event != null && event.getContext() != null && event.getPath() != null) { deploymentDescriptorService.call(processConfigModule -> { ProcessConfigModule module = (ProcessConfigModule) processConfigModule; view.setContent(ClientRuntimeStrategy.convert(module.getRuntimeStrategy()).getValue(view.getTranslationService()), module.getKBase(), module.getKSession(), ClientMergeMode.MERGE_COLLECTIONS.getValue(view.getTranslationService())); }).getProcessConfig(event.getPath()); } }
Source:
<code>protected void onResume() { super.onResume(); Log.v(LOG_TAG, "mainService onResume is: " + mMainService); if (!UsageSharedPrefernceHelper.isServiceRunning(mContext)) { mFragment.setmUsageAppData(UsageSharedPrefernceHelper.getAllKeyValuePairs(mContext)); } else { if (mMainService != null) { Log.v(LOG_TAG, "Data : " + mMainService.getCurrentMap()); if (Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.LOLLIPOP) mFragment.setmUsageAppData(mMainService.getCurrentMap()); <START> else <END> mFragment.setmUsageAppData(Utils.getAppUsageFromLAndroidDb(this)); mFragment.setmMusicData(mMainService.mListMusicPlayTimes); } } }</code><technical_language>Please braces in if-else</technical_language>

Target:
protected void onResume() { super.onResume(); Log.v(LOG_TAG, "mainService onResume is: " + mMainService); if (!UsageSharedPrefernceHelper.isServiceRunning(mContext)) { mFragment.setmUsageAppData(UsageSharedPrefernceHelper.getAllKeyValuePairs(mContext)); } else { if (mMainService != null) { Log.v(LOG_TAG, "Data : " + mMainService.getCurrentMap()); if (Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.LOLLIPOP) { mFragment.setmUsageAppData(mMainService.getCurrentMap()); } else { mFragment.setmUsageAppData(Utils.getAppUsageFromLAndroidDb(this)); } mFragment.setmMusicData(mMainService.mListMusicPlayTimes); } } }
Source:
<code>private Callback<Long> fetchAccountUpdateBodyCallback(RetainingAsyncWritableChannel channel) { return buildCallback(frontendMetrics.postAccountsReadRequestMetrics, bytesRead -> { JSONObject jsonPayload = readJsonFromChannel(channel); ReadableStreamChannel outputChannel; <START> if (restRequest.getPath().startsWith(Operations.UPDATE_ACCOUNT_CONTAINERS)) { <END> logger.debug("Got request for with payload {}", Operations.UPDATE_ACCOUNT_CONTAINERS, jsonPayload); JSONObject outputPayload = updateContainers(jsonPayload); outputChannel = serializeJsonToChannel(outputPayload); } else { updateAccounts(jsonPayload); outputChannel = new ByteBufferReadableStreamChannel(ByteBuffer.allocate(0)); } restResponseChannel.setHeader(RestUtils.Headers.DATE, new GregorianCalendar().getTime()); restResponseChannel.setHeader(RestUtils.Headers.CONTENT_TYPE, RestUtils.JSON_CONTENT_TYPE); restResponseChannel.setHeader(RestUtils.Headers.CONTENT_LENGTH, outputChannel.getSize()); finalCallback.onCompletion(outputChannel, null); }, uri, logger, finalCallback); }</code><technical_language>RestUtils.getRequestPath(restRequest).matchesOperation(UPDATE_ACCOUNT_CONTAINERS) here. This ensure prefixes cluster name CDN path prefixes stripped of correctly (not this specific API necessarily encounter is internal, non-blob ID based API) handles edge cases relating leading/trailing slashes. Still, I good consistent operations dealt in other places</technical_language>

Target:
private Callback<Long> fetchAccountUpdateBodyCallback(RetainingAsyncWritableChannel channel) { return buildCallback(frontendMetrics.postAccountsReadRequestMetrics, bytesRead -> { JSONObject jsonPayload = readJsonFromChannel(channel); ReadableStreamChannel outputChannel; if (RestUtils.getRequestPath(restRequest).matchesOperation(UPDATE_ACCOUNT_CONTAINERS)) { logger.debug("Got request for with payload {}", UPDATE_ACCOUNT_CONTAINERS, jsonPayload); JSONObject outputPayload = updateContainers(jsonPayload); outputChannel = serializeJsonToChannel(outputPayload); } else { updateAccounts(jsonPayload); outputChannel = new ByteBufferReadableStreamChannel(ByteBuffer.allocate(0)); } restResponseChannel.setHeader(RestUtils.Headers.DATE, new GregorianCalendar().getTime()); restResponseChannel.setHeader(RestUtils.Headers.CONTENT_TYPE, RestUtils.JSON_CONTENT_TYPE); restResponseChannel.setHeader(RestUtils.Headers.CONTENT_LENGTH, outputChannel.getSize()); finalCallback.onCompletion(outputChannel, null); }, uri, logger, finalCallback); }
Source:
<code>public void testGetMenuLanguage() throws Exception { HdmiCecUtils hdmiCecUtils = new HdmiCecUtils(CecDevice.PLAYBACK_1, "1.0.0.0"); if (!HdmiCecUtils.isHdmiCecFeatureSupported(getDevice())) { CLog.v("No HDMI CEC feature running, should skip test."); return; } try { hdmiCecUtils.init(); hdmiCecUtils.sendCecMessage(CecDevice.TV, CecMessage.GET_MENU_LANGUAGE); String message = hdmiCecUtils.checkExpectedOutput(CecDevice.TV, CecMessage.FEATURE_ABORT); int <START> messageId = <END> hdmiCecUtils.getParamsFromMessage(message, CecMessage.GET_MENU_LANGUAGE.toString().length()); assertEquals(CecMessage.getMessage(messageId), CecMessage.GET_MENU_LANGUAGE); } finally { hdmiCecUtils.killCecProcess(); } }</code><technical_language>abortedOpcode</technical_language>

Target:
public void testGetMenuLanguage() throws Exception { HdmiCecUtils hdmiCecUtils = new HdmiCecUtils(CecDevice.PLAYBACK_1, "1.0.0.0"); if (!HdmiCecUtils.isHdmiCecFeatureSupported(getDevice())) { CLog.v("No HDMI CEC feature running, should skip test."); return; } try { hdmiCecUtils.init(); hdmiCecUtils.sendCecMessage(CecDevice.TV, CecMessage.GET_MENU_LANGUAGE); String message = hdmiCecUtils.checkExpectedOutput(CecDevice.TV, CecMessage.FEATURE_ABORT); int abortedOpcode = hdmiCecUtils.getParamsFromMessage(message, CecMessage.GET_MENU_LANGUAGE.toString().length()); assertEquals(CecMessage.getMessage(abortedOpcode), CecMessage.GET_MENU_LANGUAGE); } finally { hdmiCecUtils.killCecProcess(); } }
Source:
<code>public void validateObservationsValuesDataTypes(final Table<String, String, String> inputData, final List<MeasurementVariable> measurementVariables) throws ApiRequestValidationException { final Map<String, MeasurementVariable> mappedVariables = Maps.uniqueIndex(measurementVariables, new Function<MeasurementVariable, String>() { public String apply(final MeasurementVariable from) { return from.getAlias(); } }); final BindingResult errors = new MapBindingResult(new HashMap<String, String>(), ObservationsPutRequestInput.class.getName()); for (final String observationUnitId : inputData.rowKeySet()) { for (final String variableName : inputData.columnKeySet()) { if (!this.isValidValue(mappedVariables.get(variableName), inputData.get(observationUnitId, variableName))) { errors.reject("warning.import.save.invalidCellValue", new String[] {variableName, inputData.get(observationUnitId, variableName)}, ""); throw new ApiRequestValidationException(errors.getAllErrors()); <START> } else if (!this.validateCategoricalValue(mappedVariables.get(variableName))) { <END> errors.reject("warning.import.save.invalidCategoricalValue", new String[] {variableName}, ""); throw new ApiRequestValidationException(errors.getAllErrors()); } } } }</code><technical_language>I this checking done</technical_language>

Target:
public void validateObservationsValuesDataTypes(final Table<String, String, String> inputData, final List<MeasurementVariable> measurementVariables) throws ApiRequestValidationException { final Map<String, MeasurementVariable> mappedVariables = Maps.uniqueIndex(measurementVariables, new Function<MeasurementVariable, String>() { public String apply(final MeasurementVariable from) { return from.getAlias(); } }); final BindingResult errors = new MapBindingResult(new HashMap<String, String>(), ObservationsPutRequestInput.class.getName()); for (final String observationUnitId : inputData.rowKeySet()) { for (final String variableName : inputData.columnKeySet()) { if (!this.validateCategoricalVariableHasAPossibleValue(mappedVariables.get(variableName))) { errors.reject("warning.import.save.invalidCategoricalValue", new String[] {variableName}, ""); throw new ApiRequestValidationException(errors.getAllErrors()); } else if (!this.isValidValue(mappedVariables.get(variableName), inputData.get(observationUnitId, variableName))) { errors.reject("warning.import.save.invalidCellValue", new String[] {variableName, inputData.get(observationUnitId, variableName)}, ""); throw new ApiRequestValidationException(errors.getAllErrors()); } } } }
Source:
<code>public String getOrcSchemaMapFile() { <START> String prefix = "secor.orc.schema.mapfile"; <END> return getString(prefix); }</code><technical_language>lines combined one</technical_language>

Target:
public String getOrcSchemaMapFile() { return getString("secor.orc.schema.mapfile"); }
Source:
<code>public void setInSlot(Object slot, Widget content) { if (content == null) { main.clear(); } else if (slot == ApplicationPresenter.TYPE_SetMainContent) { <START> main.clear(); <END> main.add(content); } }</code><technical_language>set in slot</technical_language>

Target:
public void setInSlot(Object slot, Widget content) { if (slot == ApplicationPresenter.TYPE_SetMainContent) { main.setWidget(content); } else { super.setInSlot(slot, content); } }
Source:
<code>public Set<Integer> getPartitionIds(String stream) { return wrapExceptions(() -> { <START> Map<String, List<PartitionInfo>> topics = consumer.listTopics(); <END> if (topics == null || topics.get(stream) == null) { throw new ISE("Topic [%s] is not found in KafkaConsumer's list of topics", stream); } return topics.get(stream).stream().map(PartitionInfo::partition).collect(Collectors.toSet()); }); }</code><technical_language>I this explicitly changed partitionsFor of overhead of listTopics if a ton of topics. #6455</technical_language>

Target:
public Set<Integer> getPartitionIds(String stream) { return wrapExceptions(() -> { List<PartitionInfo> partitions = consumer.partitionsFor(stream); if (partitions == null) { throw new ISE("Topic [%s] is not found in KafkaConsumer's list of topics", stream); } return partitions.stream().map(PartitionInfo::partition).collect(Collectors.toSet()); }); }
Source:
<code>public void handleInitiateResponseMessage(InitiateResponseMessage message) { if (message.isReadOnly() && m_defaultConsistencyReadLevel.hasShortcutRead()) { m_mailbox.send(message.getInitiatorHSId(), message); return; } final long spHandle = message.getSpHandle(); final DuplicateCounterKey dcKey = new DuplicateCounterKey(message.getTxnId(), spHandle); DuplicateCounter counter = m_duplicateCounters.get(dcKey); if (counter != null) { int result = counter.offer(message); if (result == DuplicateCounter.DONE) { m_duplicateCounters.remove(dcKey); m_repairLogTruncationHandle = spHandle; m_mailbox.send(counter.m_destinationId, counter.getLastResponse()); } else if (result == DuplicateCounter.MISMATCH) { VoltDB.crashGlobalVoltDB("HASH MISMATCH: replicas produced different results.", true, null); } } else { m_repairLogTruncationHandle = spHandle; m_mailbox.send(message.getInitiatorHSId(), message); } if (m_defaultConsistencyReadLevel == ReadLevel.SAFE && m_isLeader && message.isReadOnly() && m_shortCircuitReadLog != null) { <START> m_shortCircuitReadLog.offerSp(message, m_repairLogTruncationHandle); <END> } }</code><technical_language>notify m_shortCircuitReadLog truncation handle advances reads queued in a long latency if more txns a read, read stuck in forever</technical_language>

Target:
public void handleInitiateResponseMessage(InitiateResponseMessage message) { if (message.isReadOnly()) { if (m_defaultConsistencyReadLevel == ReadLevel.FAST) { m_mailbox.send(message.getInitiatorHSId(), message); return; } if (m_defaultConsistencyReadLevel == ReadLevel.SAFE && m_isLeader) { assert(m_bufferedReadLog != null); m_bufferedReadLog.offerSp(message, m_repairLogTruncationHandle); return; } } final long spHandle = message.getSpHandle(); final DuplicateCounterKey dcKey = new DuplicateCounterKey(message.getTxnId(), spHandle); DuplicateCounter counter = m_duplicateCounters.get(dcKey); if (counter != null) { int result = counter.offer(message); if (result == DuplicateCounter.DONE) { m_duplicateCounters.remove(dcKey); m_repairLogTruncationHandle = spHandle; m_mailbox.send(counter.m_destinationId, counter.getLastResponse()); } else if (result == DuplicateCounter.MISMATCH) { VoltDB.crashGlobalVoltDB("HASH MISMATCH: replicas produced different results.", true, null); } } else { m_repairLogTruncationHandle = spHandle; m_mailbox.send(message.getInitiatorHSId(), message); } }
Source:
<code>public void run(@Nonnull JDefinedClassOrInterface type) throws Exception { if (type instanceof JDefinedClass) { JDefinedClass definedClass = (JDefinedClass) type; if (!DirectlyDerivedClassesMarker.hasDirectlyDerivedClasses(definedClass)) { if (!type.isAbstract() && !type.isFinal()) { <START> EffectivelyFinalClassMarker.markAsEffectivelyFinal(definedClass); <END> if (!preserveReflections()) { definedClass.setFinal(); tracer.getStatistic(TYPES_FINALIZED).incValue(); } } } } }</code><technical_language>mark final classes effectively final? I a strong opinion of that, I guess is for consumers marker if method is final</technical_language>

Target:
public void run(@Nonnull JDefinedClassOrInterface type) throws Exception { if (type instanceof JDefinedClass) { JDefinedClass definedClass = (JDefinedClass) type; if (!DirectlyDerivedClassesMarker.hasDirectlyDerivedClasses(definedClass)) { if (!type.isAbstract() && !type.isFinal()) { EffectivelyFinalClassMarker.markAsEffectivelyFinal(definedClass); if (!preserveReflections) { definedClass.setFinal(); tracer.getStatistic(TYPES_FINALIZED).incValue(); } } } } }
Source:
<code>private HttpHandler withAuthenticationHandlersChain(HttpHandler next) { AuthenticationConfiguration authConfig = authenticationConfigurationProvider.getAuthenticationConfiguration() .orElseThrow(() -> new IllegalStateException("AuthenticationConfiguration was not provided")); try { return createAuthenticationHandlersChain(next, authConfig); } catch (Exception e) { <START> throw new IllegalStateException("Could not create authentication handlers chain", e); <END> } }</code><technical_language>wrong here? info topic</technical_language>

Target:
private HttpHandler withAuthenticationHandlersChain(HttpHandler next) { AuthenticationConfiguration authConfig = authenticationConfigurationProvider.getAuthenticationConfiguration() .orElseThrow(() -> new IllegalStateException("AuthenticationConfiguration was not provided")); try { return createAuthenticationHandlersChain(next, authConfig); } catch (Exception e) { logger.error("Could not create authentication handlers chain", e); throw e; } }
Source:
<code>public PrePushHook getPrePushHook(Repository repo, PrintStream outputStream) { if <START> (isAvailable() && <END> isEnabled(repo)) { return new LfsPrePushHook(repo, outputStream); } return null; }</code><technical_language>this is true skipped</technical_language>

Target:
public PrePushHook getPrePushHook(Repository repo, PrintStream outputStream) { if (isEnabled(repo)) { return new LfsPrePushHook(repo, outputStream); } return null; }
Source:
<code>public void visitEnumConstant(EnumConstantTree tree) { <START> scan(((NewClassTree) tree.initializer()).classBody()); <END> }</code><technical_language>I created ticket fixed : <LINK_0></technical_language>

Target:
public void visitEnumConstant(EnumConstantTree tree) { scan(tree.initializer().classBody()); }
Source:
<code>public void doFilter(ServletRequest req, ServletResponse rsp, FilterChain chain) throws IOException, ServletException { findNegotiatingProfiles(req); if (!profiles.isEmpty()) { doAuth((HttpServletRequest) req, (HttpServletResponse) rsp, chain); } <START> chain.doFilter(req, rsp); <END> }</code><technical_language>else is missing here... time perform doAuth process request webapp, this happen long nego. add else here</technical_language>

Target:
public void doFilter(ServletRequest req, ServletResponse rsp, FilterChain chain) throws IOException, ServletException { findNegotiatingProfiles(req); if (!profiles.isEmpty()) { doAuth((HttpServletRequest) req, (HttpServletResponse) rsp, chain); } else { chain.doFilter(req, rsp); } }
Source:
<code>private void updateTrackWith(@NonNull Track track) { trackView.setText(track.name().toUpperCase(Locale.getDefault())); trackView.setTextColor(track.color()); <START> trackBgPaint.setColor(track.color()); <END> }</code><technical_language>call invalidate() time change paint color</technical_language>

Target:
private void updateTrackWith(@NonNull Track track) { trackView.setText(track.name().toUpperCase(Locale.getDefault())); trackView.setTextColor(track.color()); trackBgPaint.setColor(track.color()); invalidate(trackDrawableBounds); invalidate(toRect(trackLineBounds)); }
Source:
<code>public void should_fail_if_actual_does_not_match() { byte[] actual = new byte[] { -1, 0, 1 }; AssertionError assertionError = expectAssertionError(() -> assertThat(actual).asHexString().isEqualTo("010203")); assertThat(assertionError).hasMessageContaining("Expecting:") .hasMessageContaining("<\"FF0001\">") .hasMessageContaining("to be equal to:") .hasMessageContaining("<\"010203\">") <START> .hasMessageContaining("but was not."); <END> assertThat(assertionError).isExactlyInstanceOf(AssertionFailedError.class); }</code><technical_language>hasMessageContainingAll avoid repeating hasMessageContaining ;-)</technical_language>

Target:
public void should_fail_if_actual_does_not_match() { byte[] actual = new byte[] { -1, 0, 1 }; AssertionError assertionError = expectAssertionError(() -> assertThat(actual).asHexString().isEqualTo("010203")); assertThat(assertionError) .hasMessageContainingAll("Expecting:", "<\"FF0001\">", "to be equal to:", "<\"010203\">", "but was not.") .isExactlyInstanceOf(AssertionFailedError.class); }
Source:
<code>public boolean invoke(Object object) { org.apache.synapse.MessageContext messageContext = null; try { messageContext = createMessageContext(); MessageContext axis2MsgCtx = null; if (messageContext != null) { axis2MsgCtx = ((org.apache.synapse.core.axis2.Axis2MessageContext) messageContext).getAxis2MessageContext(); } Builder builder = null; if (axis2MsgCtx != null) { builder = BuilderUtil.getBuilderFromSelector(contentType, axis2MsgCtx); } if (builder == null) { if (log.isDebugEnabled()) { log.debug("No message builder found for type '" + contentType + "'. Falling back to SOAP."); } } OMElement documentElement = (OMElement) object; messageContext.setEnvelope(TransportUtils.createSOAPEnvelope(documentElement)); } catch (AxisFault axisFault) { <START> log.error("Error while setting message to the message context :: " + axisFault.getMessage(), axisFault); <END> } if (StringUtils.isEmpty(injectingSeq)) { log.error("Sequence name not specified. Sequence : " + injectingSeq); throw new SynapseException("Sequence name not specified. Sequence : " + injectingSeq); } SequenceMediator seq = (SequenceMediator) synapseEnvironment.getSynapseConfiguration().getSequence(injectingSeq); seq.setErrorHandler(onErrorSeq); if (log.isDebugEnabled()) { log.debug("injecting message to sequence : " + injectingSeq); } synapseEnvironment.injectInbound(messageContext, seq, sequential); return true; }</code><technical_language>Remove colon punctuation mark (:)</technical_language>

Target:
public boolean invoke(Object object) { org.apache.synapse.MessageContext messageContext = null; try { messageContext = (org.apache.synapse.MessageContext) createMessageContext(); MessageContext axis2MsgCtx = null; if (messageContext != null) { axis2MsgCtx = ((Axis2MessageContext) messageContext).getAxis2MessageContext(); } Builder builder = null; if (axis2MsgCtx != null) { builder = BuilderUtil.getBuilderFromSelector(contentType, axis2MsgCtx); } if (builder == null) { if (log.isDebugEnabled()) { log.debug("No message builder found for type '" + contentType + "'. Falling back to SOAP."); } } OMElement documentElement = (OMElement) object; messageContext.setEnvelope(TransportUtils.createSOAPEnvelope(documentElement)); } catch (AxisFault axisFault) { log.error("Error while setting message to the message context : " + axisFault.getMessage(), axisFault); } if (StringUtils.isEmpty(injectingSeq)) { log.error("Sequence name not specified. Sequence : " + injectingSeq); throw new SynapseException("Sequence name not specified. Sequence : " + injectingSeq); } SequenceMediator seq = (SequenceMediator) synapseEnvironment.getSynapseConfiguration().getSequence(injectingSeq); seq.setErrorHandler(onErrorSeq); if (log.isDebugEnabled()) { log.debug("injecting message to sequence : " + injectingSeq); } synapseEnvironment.injectInbound(messageContext, seq, sequential); return true; }
Source:
<code>private void pushUpstream(final RevCommit commit) { RemoteConfig config = SimpleConfigurePushDialog .getConfiguredRemote(repository); if (config == null) { final Display display = Display.getDefault(); display.asyncExec(new Runnable() { public void run() { try { PushBranchWizard pushWizard = null; <START> if (repository.getBranch() != null) { <END> Ref ref = repository.getRef(repository.getBranch()); pushWizard = new PushBranchWizard(repository, ref); } else { pushWizard = new PushBranchWizard(repository, commit.getId()); } WizardDialog wizardDialog = new WizardDialog(display .getActiveShell(), pushWizard); wizardDialog.setHelpAvailable(true); wizardDialog.open(); } catch (IOException e) { Activator.handleError( NLS.bind(UIText.CommitUI_pushFailedMessage, e), e, true); } } }); } else { PushOperationUI op = new PushOperationUI(repository, config.getName(), false); op.start(); } }</code><technical_language>This work for detached HEAD: Caused by: java.lang.NullPointerException org.eclipse.egit.ui.internal.push.PushBranchWizard.<init>(PushBranchWizard.java:59) org.eclipse.egit.ui.internal.commit.CommitJob$2.run(CommitJob.java:143) reason for this is getBranch() return null for a detached HEAD. this instead: String fullBranch = repository.getFullBranch(); if (fullBranch != null && fullBranch.startsWith(Constants.R_HEADS)) { Ref ref = repository.getRef(fullBranch); ... } else { ... }</technical_language>

Target:
private void pushUpstream(final RevCommit commit) { RemoteConfig config = SimpleConfigurePushDialog .getConfiguredRemote(repository); if (config == null) { final Display display = Display.getDefault(); display.asyncExec(new Runnable() { public void run() { try { PushBranchWizard pushWizard = null; String fullBranch = repository.getFullBranch(); if (fullBranch != null && fullBranch.startsWith(Constants.R_HEADS)) { Ref ref = repository.getRef(repository.getBranch()); pushWizard = new PushBranchWizard(repository, ref); } else { pushWizard = new PushBranchWizard(repository, commit.getId()); } WizardDialog wizardDialog = new WizardDialog(display .getActiveShell(), pushWizard); wizardDialog.setHelpAvailable(true); wizardDialog.open(); } catch (IOException e) { Activator.handleError( NLS.bind(UIText.CommitUI_pushFailedMessage, e), e, true); } } }); } else { PushOperationUI op = new PushOperationUI(repository, config.getName(), false); op.start(); } }
Source:
<code>public static void setRoundedCornerImage(@NonNull ImageView imageView, @DrawableRes int drawableRes) { final Context context = imageView.getContext(); final float cornerRadius = context.getResources().getDimension(R.dimen.subject_item_corner_radius); Glide.with(context) .load(drawableRes) .asBitmap() .into(new BitmapImageViewTarget(imageView) { @Override protected void setResource(Bitmap resource) { <START> RoundedBitmapDrawable circularBitmapDrawable = <END> RoundedBitmapDrawableFactory.create(context.getResources(), resource); circularBitmapDrawable.setCornerRadius(cornerRadius); view.setImageDrawable(circularBitmapDrawable); } }); }</code><technical_language>final</technical_language>

Target:
public static void setRoundedCornerImage(@NonNull ImageView imageView, @DrawableRes int drawableRes) { final Context context = imageView.getContext(); final float cornerRadius = context.getResources().getDimension(R.dimen.subject_item_corner_radius); Glide.with(context) .load(drawableRes) .asBitmap() .into(new BitmapImageViewTarget(imageView) { @Override protected void setResource(Bitmap resource) { final RoundedBitmapDrawable circularBitmapDrawable = RoundedBitmapDrawableFactory.create(context.getResources(), resource); circularBitmapDrawable.setCornerRadius(cornerRadius); view.setImageDrawable(circularBitmapDrawable); } }); }
Source:
<code>public void updateRealTimeFootprint(FootPrint footprint) { List<LatLong> pathPoints = footprint == null ? Collections.<LatLong>emptyList() : footprint.getVertexInGlobalFrame(); if (pathPoints.isEmpty()) { if (mFootprintPoly != null) { mFootprintPoly.remove(); mFootprintPoly = null; } } else { if (mFootprintPoly == null) { PolygonOptions pathOptions = new PolygonOptions() <START> .stroke(new Stroke(FOOTPRINT_DEFAULT_WIDTH, FOOTPRINT_DEFAULT_COLOR)) <END> .fillColor(FOOTPRINT_FILL_COLOR); List<LatLng> list = new ArrayList<LatLng>(); for (LatLong vertex : pathPoints) { list.add(CoordToLatLang(vertex)); } pathOptions.points(list); mFootprintPoly = (Polygon)getBaiduMap().addOverlay(pathOptions); } else { List<LatLng> list = new ArrayList<LatLng>(); for (LatLong vertex : pathPoints) { list.add(CoordToLatLang(vertex)); } mFootprintPoly.setPoints(list); } } }</code><technical_language>@droneboost store new Stroke(...) a constant change</technical_language>

Target:
public void updateRealTimeFootprint(FootPrint footprint) { List<LatLong> pathPoints = footprint == null ? Collections.<LatLong>emptyList() : footprint.getVertexInGlobalFrame(); if (pathPoints.isEmpty()) { if (mFootprintPoly != null) { mFootprintPoly.remove(); mFootprintPoly = null; } } else { if (mFootprintPoly == null) { PolygonOptions pathOptions = new PolygonOptions() .stroke(mFootprintStroke) .fillColor(FOOTPRINT_FILL_COLOR); List<LatLng> list = new ArrayList<LatLng>(); for (LatLong vertex : pathPoints) { list.add(CoordToLatLng(vertex)); } pathOptions.points(list); mFootprintPoly = (Polygon)getBaiduMap().addOverlay(pathOptions); } else { List<LatLng> list = new ArrayList<LatLng>(); for (LatLong vertex : pathPoints) { list.add(CoordToLatLng(vertex)); } mFootprintPoly.setPoints(list); } } }
Source:
<code>public void run() { <START> shareFileClient.uploadFromFile(TEMP_FILE.toString()); <END> }</code><technical_language>Cache file name string</technical_language>

Target:
public void run() { shareFileClient.uploadFromFile(TEMP_FILE_PATH); }
Source:
<code>public RegionScanner postScannerOpen(ObserverContext<RegionCoprocessorEnvironment> c, Scan scan, RegionScanner s) throws IOException { if (!ScanUtil.isMaskTTLExpiredRows(scan) && !ScanUtil.isDeleteTTLExpiredRows(scan)) { return s; } if (ScanUtil.isMaskTTLExpiredRows(scan)) { metricSource.incrementMaskExpiredRequestCount(); } if (ScanUtil.isDeleteTTLExpiredRows(scan)) { metricSource.incrementDeleteExpiredRequestCount(); } scan.setAttribute(PhoenixTTLRegionScanner.MASK_PHOENIX_TTL_EXPIRED_REQUEST_ID_ATTR, Bytes.toBytes(metricSource.getMaskExpiredRequestCount())); <START> LOG.debug(String.format( <END> "********** PHOENIX-TTL: PhoenixTTLRegionObserver::postScannerOpen TTL for table = " + "[%s], scan = [%s], PHOENIX_TTL = %d ***************, numRequests=%d", s.getRegionInfo().getTable().getNameAsString(), scan.toJSON(Integer.MAX_VALUE), ScanUtil.getPhoenixTTL(scan), metricSource.getMaskExpiredRequestCount())); return new PhoenixTTLRegionScanner(c.getEnvironment(), scan, s); }</code><technical_language>This blow logs. enable TRACE level instead</technical_language>

Target:
public RegionScanner postScannerOpen(ObserverContext<RegionCoprocessorEnvironment> c, Scan scan, RegionScanner s) throws IOException { if (!ScanUtil.isMaskTTLExpiredRows(scan) && !ScanUtil.isDeleteTTLExpiredRows(scan)) { return s; } else if (ScanUtil.isMaskTTLExpiredRows(scan) && ScanUtil.isDeleteTTLExpiredRows(scan)) { throw new IOException("Both mask and delete expired rows property cannot be set"); } else if (ScanUtil.isMaskTTLExpiredRows(scan)) { metricSource.incrementMaskExpiredRequestCount(); scan.setAttribute(PhoenixTTLRegionScanner.MASK_PHOENIX_TTL_EXPIRED_REQUEST_ID_ATTR, Bytes.toBytes(String.format("MASK-EXPIRED-%d", metricSource.getMaskExpiredRequestCount()))); } else if (ScanUtil.isDeleteTTLExpiredRows(scan)) { metricSource.incrementDeleteExpiredRequestCount(); scan.setAttribute(PhoenixTTLRegionScanner.MASK_PHOENIX_TTL_EXPIRED_REQUEST_ID_ATTR, Bytes.toBytes(String.format("DELETE-EXPIRED-%d", metricSource.getDeleteExpiredRequestCount()))); } LOG.trace(String.format( "********** PHOENIX-TTL: PhoenixTTLRegionObserver::postScannerOpen TTL for table = " + "[%s], scan = [%s], PHOENIX_TTL = %d ***************, " + "numMaskExpiredRequestCount=%d, " + "numDeleteExpiredRequestCount=%d", s.getRegionInfo().getTable().getNameAsString(), scan.toJSON(Integer.MAX_VALUE), ScanUtil.getPhoenixTTL(scan), metricSource.getMaskExpiredRequestCount(), metricSource.getDeleteExpiredRequestCount() )); return new PhoenixTTLRegionScanner(c.getEnvironment(), scan, s); }
Source:
<code>private void waitForRunning(final List<KeyValue<KafkaStreams.State, KafkaStreams.State>> observed) throws Exception { waitForCondition( <START> () -> observed.get(observed.size() - 1).equals(new KeyValue<>(State.REBALANCING, State.RUNNING)), <END> MAX_WAIT_TIME_MS, () -> "Client did not startup on time. Observers transitions: " + observed ); }</code><technical_language>this fail if observed is empty? Also, simplify this? interested in RUNNING state, right? need check previous state</technical_language>

Target:
private void waitForRunning(final List<KeyValue<KafkaStreams.State, KafkaStreams.State>> observed) throws Exception { waitForCondition( () -> !observed.isEmpty() && observed.get(observed.size() - 1).value.equals(State.RUNNING), MAX_WAIT_TIME_MS, () -> "Client did not startup on time. Observers transitions: " + observed ); }