auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>boolean authorize(URIish uri, CredentialsProvider credentialsProvider) { <START> String username = null; <END> String password = null; if (credentialsProvider != null) { Credentials credentials = credentialsProvider.getCredentials(uri); if (credentials instanceof UsernamePasswordCredentials) { UsernamePasswordCredentials usernamePasswordCredentials = (UsernamePasswordCredentials) credentials; username = usernamePasswordCredentials.getUsername(); password = usernamePasswordCredentials.getPassword(); } } else { username = uri.getUser(); password = uri.getPass(); } if (username != null) { authorize(username, password); return true; } return false; }</code><technical_language>initialize null. compiler require ensure values initialized in branch below</technical_language>

Target:
boolean authorize(URIish uri, CredentialsProvider credentialsProvider) { String username; String password; if (credentialsProvider != null) { if (credentialsProvider.supports(CredentialType.USERNAME, CredentialType.PASSWORD)) { username = (String) credentialsProvider.getCredentials(uri, CredentialType.USERNAME); password = (String) credentialsProvider.getCredentials(uri, CredentialType.PASSWORD); } else return false; } else { username = uri.getUser(); password = uri.getPass(); } if (username != null) { authorize(username, password); return true; } return false; }
Source:
<code>private CisConversionResult createFailureResult(String filename, ConversionOption conversionOption, MediaType mediaType, String message) { CisConversionResult result; StringBuilder msg = new StringBuilder(); if (filename != null) { msg.append(filename); } msg.append(" " + message); <START> LOGGER.info("Conversion not supported: " + msg.toString()); <END> result = CisConversionResult.createFailureResult(conversionOption, mediaType, filename, msg.toString()); return result; }</code><technical_language>This is warning</technical_language>

Target:
private CisConversionResult createFailureResult(String filename, ConversionOption conversionOption, MediaType mediaType, String message) { CisConversionResult result; StringBuilder msg = new StringBuilder(); if (filename != null) { msg.append(filename); } msg.append(" " + message); LOGGER.warn("Conversion not supported: " + msg.toString()); result = CisConversionResult.createFailureResult(conversionOption, mediaType, filename, msg.toString()); return result; }
Source:
<code>private void testJBossWSRuntimeEdition() { jbossWSRuntimePreferencePage.select(0); jbossWSRuntimePreferencePage.edit(); jbossWsRuntimeDialog = new JBossWSRuntimeListFieldEditor(true); jbossWsRuntimeDialog.setName(runtimeEditedName); jbossWsRuntimeDialog.finish(); <START> new WaitWhile(new ShellIsActive(EDIT_JBOSS_WS_RUNTIME_DIALOG_TITLE)); <END> assertRuntimeName(runtimeEditedName); }</code><technical_language>ShellIsAvailable</technical_language>

Target:
private void testJBossWSRuntimeEdition() { jbossWSRuntimePreferencePage.select(0); jbossWSRuntimePreferencePage.edit(); jbossWsRuntimeDialog = new JBossWSRuntimeListFieldEditor(true); jbossWsRuntimeDialog.setName(runtimeEditedName); jbossWsRuntimeDialog.finish(); new WaitWhile(new ShellIsAvailable(EDIT_JBOSS_WS_RUNTIME_DIALOG_TITLE)); assertRuntimeName(runtimeEditedName); }
Source:
<code>private static Function<String, BiFunction> fastClass(Executable member) { Class<?> hostClass = member.getDeclaringClass(); <START> if (hostClass.getSimpleName().contains(ENHANCER_BY_GUICE_MARKER)) { <END> hostClass = hostClass.getSuperclass(); } return FAST_CLASSES.get(hostClass); }</code><technical_language>this happen</technical_language>

Target:
private static Function<String, BiFunction> fastClass(Executable member) { return FAST_CLASSES.get(member.getDeclaringClass()); }
Source:
<code>public QueryUpdateEmitter resolveParameterValue(Message<?> message) { return CurrentUnitOfWork.map(uow -> (QueryUpdateEmitter) uow.getResource(QUERY_UPDATE_EMITTER_KEY)) <START> .orElse(null); <END> }</code><technical_language>else(...) case is exceptional one, apparently parameter is in a place shouldn't. Consider .orElseThrow(...) throw IllegalStateException</technical_language>

Target:
public QueryUpdateEmitter resolveParameterValue(Message<?> message) { return CurrentUnitOfWork.map(uow -> (QueryUpdateEmitter) uow.getResource(QUERY_UPDATE_EMITTER_KEY)) .orElseThrow(() -> new IllegalStateException( "QueryUpdateEmitter should have been injected")); }
Source:
<code>public PaginatedArrayList<Host> search(String filter, boolean showArchived, boolean showSystemHost, int limit, int offset, User user, boolean respectFrontendRoles) throws DotDataException, DotSecurityException { try { Structure st = CacheLocator.getContentTypeCache().getStructureByVelocityVarName("Host"); String condition=""; <START> if(showArchived){ <END> condition=" +deleted:true"; }else { condition=" +deleted:false"; } if(UtilMethods.isSet(filter)){ condition += " +Host.hostName:"+filter.trim()+"*"; } if(!showSystemHost){ condition += " +Host.isSystemHost:false"; } PaginatedArrayList<Contentlet> list = (PaginatedArrayList<Contentlet>)APILocator.getContentletAPI().search("+structureInode:" + st.getInode() + condition, limit, offset, "Host.hostName", user, respectFrontendRoles); return convertToHostPaginatedArrayList(list); } catch (Exception e) { Logger.error(HostAPIImpl.class, e.getMessage(), e); throw new DotRuntimeException(e.getMessage(), e); } }</code><technical_language>reduce condition = (showArchived)?" +deleted:true":" +deleted:false";</technical_language>

Target:
public PaginatedArrayList<Host> search(String filter, boolean showArchived, boolean showSystemHost, int limit, int offset, User user, boolean respectFrontendRoles) { try { Structure st = CacheLocator.getContentTypeCache().getStructureByVelocityVarName("Host"); StringBuilder condition = new StringBuilder( String.format(" +deleted:%b", showArchived) ); if(UtilMethods.isSet(filter)){ condition.append( String.format(" +Host.hostName:%s*", filter.trim() ) ); } if(!showSystemHost){ condition.append( " +Host.isSystemHost:false" ); } PaginatedArrayList<Contentlet> list = (PaginatedArrayList<Contentlet>)APILocator.getContentletAPI().search("+structureInode:" + st.getInode() + condition, limit, offset, "Host.hostName", user, respectFrontendRoles); return convertToHostPaginatedArrayList(list); } catch (Exception e) { Logger.error(HostAPIImpl.class, e.getMessage(), e); throw new DotRuntimeException(e.getMessage(), e); } }
Source:
<code>protected void executeVdsBrokerCommand() { if (getParameters().getAction() == FenceActionType.STATUS || !isAlreadyInRequestedStatus()) { <START> _result = <END> fenceNode( getParameters().getAction(), getParameters().getAction() != FenceActionType.STATUS); FenceOperationResult actionResult = new FenceOperationResult( getParameters().getAction(), _result.mStatus.mCode, _result.mStatus.mMessage, _result.power, _result.operationStatus); setReturnValue(actionResult); getVDSReturnValue().setSucceeded(actionResult.getStatus() != Status.ERROR); if (getParameters().getAction() == FenceActionType.STATUS && actionResult.getPowerStatus() == HostPowerStatus.UNKNOWN &&!getParameters().getTargetVdsID().equals(Guid.Empty)) { alertPowerManagementStatusFailed(actionResult.getMessage()); } } else { alertActionSkippedAlreadyInStatus(); getVDSReturnValue().setSucceeded(true); setReturnValue( new FenceOperationResult(Status.SKIPPED_ALREADY_IN_STATUS, HostPowerStatus.UNKNOWN)); } }</code><technical_language>thoughts here, 'nice have' (it's ok is). 1) cleaning up, unnecessary hold _result instance variable? 2) fenceNode() return FenceOperationResult FenceStatusReturnForXmlRpc</technical_language>

Target:
protected void executeVdsBrokerCommand() { if (getParameters().getAction() == FenceActionType.STATUS || !isAlreadyInRequestedStatus()) { FenceStatusReturnForXmlRpc result = fenceNode(getParameters().getAction()); FenceOperationResult actionResult = new FenceOperationResult( getParameters().getAction(), result.mStatus.mCode, result.mStatus.mMessage, result.power, result.operationStatus); setReturnValue(actionResult); getVDSReturnValue().setSucceeded(actionResult.getStatus() != Status.ERROR); if (getParameters().getAction() == FenceActionType.STATUS && actionResult.getPowerStatus() == PowerStatus.UNKNOWN && !getParameters().getTargetVdsID().equals(Guid.Empty)) { alertPowerManagementStatusFailed(actionResult.getMessage()); } } else { alertActionSkippedAlreadyInStatus(); getVDSReturnValue().setSucceeded(true); setReturnValue( new FenceOperationResult(Status.SKIPPED_ALREADY_IN_STATUS, PowerStatus.UNKNOWN)); } }
Source:
<code>protected void onFirstPeerRegistered() { <START> assert(mDOMProvider == null); <END> mObjectMapper = new ObjectMapper(); mObjectIdMapper = new DOMObjectIdMapper(); mDOMProvider = mDOMProviderFactory.create(); mDOMProvider.setListener(new ProviderListener()); }</code><technical_language>Do assert. tragically broken in Java. Util.throwIfNotNull. Also, a race if synchronize methods. base class do I heavy handed (maybe I should've though)</technical_language>

Target:
protected synchronized void onFirstPeerRegistered() { mDOMProvider = mDOMProviderFactory.create(); mDOMProvider.setListener(new ProviderListener()); }
Source:
<code>KeyManagerFactoryWrapper(KeyManager km) { <START> this.km = km; <END> }</code><technical_language>ObjectUtil.checkNotNull(km, "km");</technical_language>

Target:
KeyManagerFactoryWrapper(KeyManager km) { this.km = ObjectUtil.checkNotNull(km, "km"); }
Source:
<code>public List<Tag> getTags(Tool tool) { LOG.info(quayToken.getUsername() + " ======================= Getting tags for: {}================================", tool.getPath()); final String repo = tool.getNamespace() + '/' + tool.getName(); final List<Tag> tags = new ArrayList<>(); final Optional<QuayRepo> toolFromQuay = getToolFromQuay(tool); if (toolFromQuay.isPresent()) { final QuayRepo quayRepo = toolFromQuay.get(); final Map<String, QuayTag> tagsFromRepo = quayRepo.getTags(); final int maxQuayTagsReturnedByRepo = 500; <START> if (tagsFromRepo.size() == maxQuayTagsReturnedByRepo) { <END> try { List<QuayTag> allQuayTags = getAllQuayTags(repo); for (QuayTag tagItem : allQuayTags) { try { final Tag tag = convertQuayTagToTag(tagItem, tool); tags.add(tag); } catch (IllegalAccessException | InvocationTargetException ex) { LOG.error(quayToken.getUsername() + " Exception: {}", ex); } } } catch (ApiException e) { throw new CustomWebApplicationException("Could not get QuayTag", HttpStatus.SC_INTERNAL_SERVER_ERROR); } } else { for (QuayTag tagItem : tagsFromRepo.values()) { try { final Tag tag = convertQuayTagToTag(tagItem, tool); tags.add(tag); } catch (IllegalAccessException | InvocationTargetException ex) { LOG.error(quayToken.getUsername() + " Exception: {}", ex); } } } } String repository = tool.getNamespace() + "/" + tool.getName(); updateTagsWithBuildInformation(repository, tags, tool); return tags; }</code><technical_language>simplify. If I understand correctly, this loop is handling case need paginate. loop is do not. getAllQuayTags is is putting tags big collection. simplify modifying getAllQuayTags tolerant of results page</technical_language>

Target:
public List<Tag> getTags(Tool tool) { LOG.info(quayToken.getUsername() + " ======================= Getting tags for: {}================================", tool.getPath()); final String repo = tool.getNamespace() + '/' + tool.getName(); final List<Tag> tags = new ArrayList<>(); final Optional<QuayRepo> toolFromQuay = getToolFromQuay(tool); if (toolFromQuay.isPresent()) { final QuayRepo quayRepo = toolFromQuay.get(); final Map<String, QuayTag> tagsFromRepo = quayRepo.getTags(); final int maxQuayTagsReturnedByRepo = 500; List<QuayTag> quayTags = new ArrayList<>(tagsFromRepo.values()); if (tagsFromRepo.size() == maxQuayTagsReturnedByRepo) { try { quayTags = getAllQuayTags(repo); } catch (ApiException e) { throw new CustomWebApplicationException("Could not get QuayTag", HttpStatus.SC_INTERNAL_SERVER_ERROR); } } for (QuayTag tagItem : quayTags) { try { final Tag tag = convertQuayTagToTag(tagItem, tool); tags.add(tag); } catch (IllegalAccessException | InvocationTargetException ex) { LOG.error(quayToken.getUsername() + " Exception: {}", ex); } } } String repository = tool.getNamespace() + "/" + tool.getName(); updateTagsWithBuildInformation(repository, tags, tool); return tags; }
Source:
<code>public boolean onTouchEvent(MotionEvent event) { if (!isEnabled()) return false; float eventX = event.getX(); float eventY = event.getY(); switch (event.getAction()) { case MotionEvent.ACTION_DOWN: getParent().requestDisallowInterceptTouchEvent(true); mPoints.clear(); <START> if (isDoubleClick()) { <END> setIsEmpty(true); break; } mLastTouchX = eventX; mLastTouchY = eventY; addPoint(getNewPoint(eventX, eventY)); if(mOnSignedListener != null) mOnSignedListener.onStartSigning(); case MotionEvent.ACTION_MOVE: resetDirtyRect(eventX, eventY); addPoint(getNewPoint(eventX, eventY)); break; case MotionEvent.ACTION_UP: resetDirtyRect(eventX, eventY); addPoint(getNewPoint(eventX, eventY)); getParent().requestDisallowInterceptTouchEvent(true); setIsEmpty(false); break; default: return false; } invalidate( (int) (mDirtyRect.left - mMaxWidth), (int) (mDirtyRect.top - mMaxWidth), (int) (mDirtyRect.right + mMaxWidth), (int) (mDirtyRect.bottom + mMaxWidth)); return true; }</code><technical_language>extract function isDoubleClick() part signature is cleared, clearing part setIsEmpty(true) in place? isDoubleClick() immutable method</technical_language>

Target:
public boolean onTouchEvent(MotionEvent event) { if (!isEnabled()) return false; float eventX = event.getX(); float eventY = event.getY(); switch (event.getAction()) { case MotionEvent.ACTION_DOWN: getParent().requestDisallowInterceptTouchEvent(true); mPoints.clear(); if (isDoubleClick()) { this.clearView(); setIsEmpty(true); break; } mLastTouchX = eventX; mLastTouchY = eventY; addPoint(getNewPoint(eventX, eventY)); if(mOnSignedListener != null) mOnSignedListener.onStartSigning(); case MotionEvent.ACTION_MOVE: resetDirtyRect(eventX, eventY); addPoint(getNewPoint(eventX, eventY)); break; case MotionEvent.ACTION_UP: resetDirtyRect(eventX, eventY); addPoint(getNewPoint(eventX, eventY)); getParent().requestDisallowInterceptTouchEvent(true); setIsEmpty(false); break; default: return false; } invalidate( (int) (mDirtyRect.left - mMaxWidth), (int) (mDirtyRect.top - mMaxWidth), (int) (mDirtyRect.right + mMaxWidth), (int) (mDirtyRect.bottom + mMaxWidth)); return true; }
Source:
<code>public void autoJPushReferrerRewardAlert(long loanId) { List<InvestModel> successInvestList = investMapper.findSuccessInvestsByLoanId(loanId); for (InvestModel invest : successInvestList) { List<InvestReferrerRewardModel> investReferrerRewardModelList = investReferrerRewardMapper.findByInvestId(invest.getId()); for(InvestReferrerRewardModel investReferrerRewardModel : investReferrerRewardModelList){ <START> if("SUCCESS".equals(investReferrerRewardModel.getStatus())){ <END> AccountModel accountModel = accountMapper.findByLoginName(investReferrerRewardModel.getReferrerLoginName()); JPushAlertModel jPushAlertModel = jPushAlertMapper.findJPushAlertByPushType(PushType.REFERRER_REWARD_ALERT); if (jPushAlertModel != null) { Map<String, List<String>> loginNameMap = Maps.newHashMap(); List<String> amountLists = Lists.newArrayList(invest.getLoginName(), AmountConverter.convertCentToString(investReferrerRewardModel.getAmount()), AmountConverter.convertCentToString(accountModel.getBalance())); loginNameMap.put(accountModel.getLoginName(), amountLists); autoJPushByRegistrationId(jPushAlertModel, loginNameMap); loginNameMap.clear(); } else { logger.debug("REFERRER_REWARD_ALERT is disabled"); } } } } }</code><technical_language>ReferrerRewardStatus.SUCCESS</technical_language>

Target:
public void autoJPushReferrerRewardAlert(long loanId) { List<InvestModel> successInvestList = investMapper.findSuccessInvestsByLoanId(loanId); for (InvestModel invest : successInvestList) { List<InvestReferrerRewardModel> investReferrerRewardModelList = investReferrerRewardMapper.findByInvestId(invest.getId()); for(InvestReferrerRewardModel investReferrerRewardModel : investReferrerRewardModelList){ if(investReferrerRewardModel.getStatus() == ReferrerRewardStatus.SUCCESS){ AccountModel accountModel = accountMapper.findByLoginName(investReferrerRewardModel.getReferrerLoginName()); JPushAlertModel jPushAlertModel = jPushAlertMapper.findJPushAlertByPushType(PushType.REFERRER_REWARD_ALERT); if (jPushAlertModel != null) { Map<String, List<String>> loginNameMap = Maps.newHashMap(); List<String> amountLists = Lists.newArrayList(invest.getLoginName(), AmountConverter.convertCentToString(investReferrerRewardModel.getAmount()), AmountConverter.convertCentToString(accountModel.getBalance())); loginNameMap.put(accountModel.getLoginName(), amountLists); autoJPushByRegistrationId(jPushAlertModel, loginNameMap); loginNameMap.clear(); } else { logger.debug("REFERRER_REWARD_ALERT is disabled"); } } } } }
Source:
<code>public void testCleanupJobsLimitsJobStatesToTerminalStates() { Set<JobState> jobStates = Util.asSet(JobState.values()); AsyncJobStatusQueryBuilder input = new AsyncJobStatusQueryBuilder() .setJobStates(jobStates); int expected = new Random().nextInt(); ArgumentCaptor<AsyncJobStatusQueryBuilder> captor = ArgumentCaptor.forClass(AsyncJobStatusQueryBuilder.class); doReturn(expected).when(this.jobCurator).deleteJobs(eq(input)); JobManager manager = this.createJobManager(); int output = manager.cleanupJobs(input); verify(this.jobCurator, times(1)).deleteJobs(captor.capture()); AsyncJobStatusQueryBuilder captured = captor.getValue(); assertNotNull(captured); Collection<JobState> actual = captured.getJobStates(); assertNotNull(actual); <START> assertTrue(actual.size() > 0); <END> assertTrue(jobStates.size() > actual.size()); for (JobState state : actual) { assertNotNull(state); assertTrue(state.isTerminal()); } }</code><technical_language>This is kind of a pet peeve of mine. assertThat(actual.size(), Matchers.greaterThan(0)); import static org.hamcrest.MatcherAssert.*; import static org.mockito.Mockito.*; assertThat a more readable failure message ("X is greater Y") instead of assertTrue message is "Condition true" telling actual condition was. I assertTrue in accompanied a message, Hamcrest Matcher asserts end more concise</technical_language>

Target:
public void testCleanupJobsLimitsJobStatesToTerminalStates() { Set<JobState> jobStates = Util.asSet(JobState.values()); AsyncJobStatusQueryBuilder input = new AsyncJobStatusQueryBuilder() .setJobStates(jobStates); int expected = new Random().nextInt(); ArgumentCaptor<AsyncJobStatusQueryBuilder> captor = ArgumentCaptor.forClass(AsyncJobStatusQueryBuilder.class); doReturn(expected).when(this.jobCurator).deleteJobs(eq(input)); JobManager manager = this.createJobManager(); int output = manager.cleanupJobs(input); verify(this.jobCurator, times(1)).deleteJobs(captor.capture()); AsyncJobStatusQueryBuilder captured = captor.getValue(); assertNotNull(captured); Collection<JobState> actual = captured.getJobStates(); assertNotNull(actual); assertThat(actual, not(empty())); assertThat(actual.size(), lessThan(jobStates.size())); for (JobState state : actual) { assertNotNull(state); assertTrue(state.isTerminal()); } }
Source:
<code>private String getIndex(BridgeDefinedField bridgeDefinedField) { <START> if ( bridgeDefinedField.getType().equals( FieldType.BOOLEAN ) ) { <END> return "not_analyzed"; } Field.Index index = bridgeDefinedField.getIndex(); return getIndexValue( index ); }</code><technical_language>for dates numerics, a lines (it change recently)</technical_language>

Target:
private String getIndex(BridgeDefinedField bridgeDefinedField) { if ( FieldHelper.isBoolean( bridgeDefinedField ) || FieldHelper.isNumeric( bridgeDefinedField ) || FieldHelper.isDate( bridgeDefinedField ) ) { return NOT_ANALYZED; } Field.Index index = bridgeDefinedField.getIndex(); return getIndexValue( index ); }
Source:
<code>public void clearMappingErrors(String vreName) { final GraphTraversal<Vertex, Vertex> collectionT = getRawCollectionsTraversal(vreName); while (collectionT.hasNext()) { final Vertex collection = collectionT.next(); <START> collection.vertices(Direction.OUT, HAS_NEXT_ERROR).forEachRemaining(this::clearMappingErrors); <END> } }</code><technical_language>This loops vertices errors not. A faster approach traverse error vertices in RawCollection.java verticesWithErrors = collection.out(HAS_NEXT_ERROR) .emit() .repeat(__.out(HAS_NEXT_ERROR)) Also, I guess need remove error property itself</technical_language>

Target:
public void clearMappingErrors(String vreName) { getRawCollectionsTraversal(vreName) .emit() .repeat(__.out(HAS_NEXT_ERROR)) .forEachRemaining(vertex -> { vertex.edges(Direction.IN, HAS_NEXT_ERROR).forEachRemaining(Edge::remove); vertex.properties().forEachRemaining(property -> { if (property.key().startsWith(ERROR_PREFIX)) { property.remove(); } }); }); }
Source:
<code>public static void viewCurrentSite(Context context, SiteModel site, boolean openFromHeader) { if (site == null) { ToastUtils.showToast(context, R.string.blog_not_found, ToastUtils.Duration.SHORT); return; } AnalyticsTracker.Stat stat = openFromHeader ? AnalyticsTracker.Stat.OPENED_VIEW_SITE_FROM_HEADER : AnalyticsTracker.Stat.OPENED_VIEW_SITE; AnalyticsUtils.trackWithSiteDetails(stat, site); <START> final String siteUrl = site.getUrl(); <END> if (siteUrl == null) { ToastUtils.showToast(context, context.getString(R.string.site_url_null), ToastUtils.Duration.LONG); AppLog.w(AppLog.T.UTILS, "Site URL is null. Login URL: " + site.getLoginUrl()); } else { openUrlExternal(context, siteUrl); } }</code><technical_language>rarity of this bug, do additional string resource changing check top of this method if (site == null) if (site == null || site.getUrl() == null)</technical_language>

Target:
public static void viewCurrentSite(Context context, SiteModel site, boolean openFromHeader) { AnalyticsTracker.Stat stat = openFromHeader ? AnalyticsTracker.Stat.OPENED_VIEW_SITE_FROM_HEADER : AnalyticsTracker.Stat.OPENED_VIEW_SITE; AnalyticsUtils.trackWithSiteDetails(stat, site); if (site == null) { ToastUtils.showToast(context, R.string.blog_not_found, ToastUtils.Duration.SHORT); } else if (site.getUrl() == null) { ToastUtils.showToast(context, R.string.blog_not_found, ToastUtils.Duration.SHORT); AppLog.w(AppLog.T.UTILS, "Site URL is null. Login URL: " + site.getLoginUrl()); } else { openUrlExternal(context, site.getUrl()); } }
Source:
<code>private void updateActionAvailability(GlusterVolumeEntity volumeEntity) { boolean allowNewSessionCommand = true; if(volumeEntity == null) { allowNewSessionCommand = false; } <START> if(getEntity().getStatus() != GlusterStatus.UP) { <END> allowNewSessionCommand = false; } getNewSessionCommand().setIsAvailable(allowNewSessionCommand); getRemoveSessionCommand().setIsAvailable(false); getStartSessionCommand().setIsAvailable(false); getStopSessionCommand().setIsAvailable(false); getSessionOptionsCommand().setIsAvailable(false); getViewSessionDetailsCommand().setIsAvailable(false); getRefreshSessionsCommand().setIsAvailable(true); }</code><technical_language>volumeEntity.getStatus()</technical_language>

Target:
private void updateActionAvailability(GlusterVolumeEntity volumeEntity) { boolean allowNewGeoRepSessionCommand = true; boolean allowStartSessionCommand = false; boolean allowStopSessionCommand = false; boolean allowResumeSessionCommand = false; boolean allowPauseSessionCommand = false; if(volumeEntity == null) { return; } if (getSelectedItems() != null && getSelectedItems().size() == 1) { GlusterGeoRepSession selectedSession = getSelectedItem(); GeoRepSessionStatus sessionStatus = selectedSession.getStatus(); allowStartSessionCommand = sessionStatus == GeoRepSessionStatus.NOTSTARTED || sessionStatus == GeoRepSessionStatus.STOPPED; allowStopSessionCommand = !allowStartSessionCommand; allowResumeSessionCommand = sessionStatus == GeoRepSessionStatus.PAUSED; allowPauseSessionCommand = sessionStatus == GeoRepSessionStatus.ACTIVE || sessionStatus == GeoRepSessionStatus.INITIALIZING; allowNewGeoRepSessionCommand = volumeEntity.getStatus() == GlusterStatus.UP; } getNewSessionCommand().setIsExecutionAllowed(allowNewGeoRepSessionCommand); getRemoveSessionCommand().setIsAvailable(false); getStartSessionCommand().setIsExecutionAllowed(allowStartSessionCommand); getStopSessionCommand().setIsExecutionAllowed(allowStopSessionCommand); getPauseSessionCommand().setIsExecutionAllowed(allowPauseSessionCommand); getResumeSessionCommand().setIsExecutionAllowed(allowResumeSessionCommand); getSessionOptionsCommand().setIsExecutionAllowed(true); getViewSessionDetailsCommand().setIsAvailable(false); getRefreshSessionsCommand().setIsAvailable(true); }
Source:
<code>public void activate(ComponentContext componentContext) { XmlDocumentReader<BindingInfoXmlResult> bindingInfoReader = new BindingInfoReader(); bindingInfoTracker = new XmlDocumentBundleTracker<>(componentContext.getBundleContext(), XML_DIRECTORY, bindingInfoReader, this, READY_MARKER, readyService); <START> trackerJob = scheduler.schedule(() -> { <END> bindingInfoTracker.open(); }, 0, TimeUnit.SECONDS); }</code><technical_language>submit</technical_language>

Target:
public void activate(ComponentContext componentContext) { XmlDocumentReader<BindingInfoXmlResult> bindingInfoReader = new BindingInfoReader(); bindingInfoTracker = new XmlDocumentBundleTracker<>(componentContext.getBundleContext(), XML_DIRECTORY, bindingInfoReader, this, READY_MARKER, readyService); trackerJob = scheduler.submit(() -> { bindingInfoTracker.open(); }); }
Source:
<code>public Map<String, ValueResolver<? extends Object>> getParameters() { <START> return resolverSet.getResolvers(); <END> }</code><technical_language>unmodifiable</technical_language>

Target:
public Map<String, ValueResolver<? extends Object>> getParameters() { return unmodifiableMap(resolverSet.getResolvers()); }
Source:
<code>public Entity toEntity() { <START> Entity branchEntity = new <END> Entity(this.key); return branchEntity; }</code><technical_language>return</technical_language>

Target:
public Entity toEntity() { return new Entity(this.key); }
Source:
<code>private void testSegmentSplitsHelperNoFilter(PinotTableHandle table, int segmentsPerSplit, int expectedNumSplits, boolean expectFilter) { PinotConfig pinotConfig = new PinotConfig().setForbidBrokerQueries(false); SessionHolder sessionHolder = new SessionHolder(pinotConfig); PlanBuilder planBuilder = createPlanBuilder(sessionHolder); PlanNode plan = tableScan(planBuilder, table, regionId, city, fare, secondsSinceEpoch); PinotQueryGenerator.PinotQueryGeneratorResult pinotQueryGeneratorResult = new PinotQueryGenerator(pinotConfig, typeManager, functionMetadataManager, standardFunctionResolution).generate(plan, sessionHolder.getConnectorSession()).get(); <START> ImmutableList<PinotColumnHandle> expectedHandles = ImmutableList.copyOf(pinotQueryGeneratorResult.getContext().getAssignments().values()); <END> PinotQueryGenerator.GeneratedPql generatedPql = pinotQueryGeneratorResult.getGeneratedPql(); PinotTableHandle pinotTableHandle = new PinotTableHandle(table.getConnectorId(), table.getSchemaName(), table.getTableName(), Optional.of(false), Optional.of(expectedHandles), Optional.of(generatedPql)); List<PinotSplit> splits = getSplitsHelper(pinotTableHandle, segmentsPerSplit, false); assertSplits(splits, expectedNumSplits, SEGMENT); splits.forEach(s -> assertSegmentSplitWellFormed(s, expectFilter)); }</code><technical_language>List<PinotColumnHandle></technical_language>

Target:
private void testSegmentSplitsHelperNoFilter(PinotTableHandle table, int segmentsPerSplit, int expectedNumSplits, boolean expectFilter) { PinotConfig pinotConfig = new PinotConfig().setForbidBrokerQueries(false); SessionHolder sessionHolder = new SessionHolder(pinotConfig); PlanBuilder planBuilder = createPlanBuilder(sessionHolder); PlanNode plan = tableScan(planBuilder, table, regionId, city, fare, secondsSinceEpoch); PinotQueryGenerator.PinotQueryGeneratorResult pinotQueryGeneratorResult = new PinotQueryGenerator(pinotConfig, typeManager, functionMetadataManager, standardFunctionResolution).generate(plan, sessionHolder.getConnectorSession()).get(); List<PinotColumnHandle> expectedHandles = ImmutableList.copyOf(pinotQueryGeneratorResult.getContext().getAssignments().values()); PinotQueryGenerator.GeneratedPql generatedPql = pinotQueryGeneratorResult.getGeneratedPql(); PinotTableHandle pinotTableHandle = new PinotTableHandle(table.getConnectorId(), table.getSchemaName(), table.getTableName(), Optional.of(false), Optional.of(expectedHandles), Optional.of(generatedPql)); List<PinotSplit> splits = getSplitsHelper(pinotTableHandle, segmentsPerSplit, false); assertSplits(splits, expectedNumSplits, SEGMENT); splits.forEach(s -> assertSegmentSplitWellFormed(s, expectFilter)); }
Source:
<code>public void logout(final HttpServletRequest request, final HttpServletResponse response) { assertNotNull("logoutLogic", logoutLogic); assertNotNull("config", config); final JEEContext context = new JEEContext(request, response, config.getSessionStore()); <START> logoutLogic.perform(context, config, (action, theContext) -> null, this.defaultUrl, this.logoutUrlPattern, this.localLogout, this.destroySession, this.centralLogout); <END> }</code><technical_language>JEEHttpActionAdapter.INSTANCE</technical_language>

Target:
public void logout(final HttpServletRequest request, final HttpServletResponse response) { assertNotNull("logoutLogic", logoutLogic); assertNotNull("config", config); final JEEContext context = new JEEContext(request, response, config.getSessionStore()); logoutLogic.perform(context, config, JEEHttpActionAdapter.INSTANCE, this.defaultUrl, this.logoutUrlPattern, this.localLogout, this.destroySession, this.centralLogout); }
Source:
<code>private Stringer getLinearStringerForName(String name, byte code, int createMediaMask) { if ((name == null) || (name.length() == 0)) return null; Table t = getTable(code); Stringer rv; try { t.acquireReadLock(); rv = getLinearStringerForNameWhileLocked(t, name); if (rv != null && rv.hasMediaMask(createMediaMask)) return rv; } finally { t.releaseReadLock(); } try { t.acquireWriteLock(); rv = getLinearStringerForNameWhileLocked(t, name); if (rv != null && rv.hasMediaMask(createMediaMask)) return rv; if ( rv == null ) { rv = new Stringer(getNextWizID()); rv.name = name; <START> rv.ignoreCaseHash = rv.name.toLowerCase().hashCode(); <END> rv.setMediaMask(createMediaMask); t.add(rv, true); } else { rv.addMediaMask(createMediaMask); logUpdate(rv, code); } return rv; } finally { t.releaseWriteLock(); } }</code><technical_language>name instead of rv.name avoid extra dereference</technical_language>

Target:
private Stringer getLinearStringerForName(String name, byte code, int createMediaMask) { if ((name == null) || (name.length() == 0)) return null; Table t = getTable(code); Stringer rv; try { t.acquireReadLock(); rv = getLinearStringerForNameWhileLocked(t, name); if (rv != null && rv.hasMediaMask(createMediaMask)) return rv; } finally { t.releaseReadLock(); } try { t.acquireWriteLock(); rv = getLinearStringerForNameWhileLocked(t, name); if (rv != null && rv.hasMediaMask(createMediaMask)) return rv; if ( rv == null ) { rv = new Stringer(getNextWizID()); rv.name = name; rv.ignoreCaseHash = name.toLowerCase().hashCode(); rv.setMediaMask(createMediaMask); t.add(rv, true); } else { rv.addMediaMask(createMediaMask); logUpdate(rv, code); } return rv; } finally { t.releaseWriteLock(); } }
Source:
<code>public void processModule(Study study, String isModuleEnabled, String accessToken) { StudyParameterValueDAO spvdao = new StudyParameterValueDAO(dataSource); StudyParameterValueBean spv = spvdao.findByHandleAndStudy(study.getStudyId(), "participantPortal"); <START> String statusValue = isModuleEnabled.toLowerCase(); <END> if (!spv.isActive()) { spv = new StudyParameterValueBean(); spv.setStudyId(study.getStudyId()); spv.setParameter("participantPortal"); spv.setValue(statusValue); spvdao.create(spv); } else if (spv.isActive() && !spv.getValue().equals(statusValue)) { spv.setValue(statusValue); spvdao.update(spv); } }</code><technical_language>please enum values instead of name</technical_language>

Target:
public void processModule(Study study, String isModuleEnabled, String accessToken) { StudyParameterValueDAO spvdao = new StudyParameterValueDAO(dataSource); StudyParameterValueBean spv = spvdao.findByHandleAndStudy(study.getStudyId(), "participantPortal"); String statusValue = isModuleEnabled; if (!spv.isActive()) { spv = new StudyParameterValueBean(); spv.setStudyId(study.getStudyId()); spv.setParameter("participantPortal"); spv.setValue(statusValue); spvdao.create(spv); } else if (spv.isActive() && !spv.getValue().equals(statusValue)) { spv.setValue(statusValue); spvdao.update(spv); } }
Source:
<code><START> InMemorySystemDescriptor withInMemoryScope(String inMemoryScope) { <END> this.inMemoryScope = inMemoryScope; return this; }</code><technical_language>Clarify this param does, systemName</technical_language>

Target:
public InMemorySystemDescriptor withInMemoryScope(String inMemoryScope) { this.inMemoryScope = inMemoryScope; return this; }
Source:
<code>protected boolean canDoAction() { if (!checkRemoveEditValidations()) { return false; } if (SchedulingManager.getInstance().getClustersByClusterPolicyId(getParameters().getClusterPolicyId()).size() > 0) { <START> return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_CLUSTER_POLICY_INUSE); <END> } return true; }</code><technical_language>store clusters list pass DO users</technical_language>

Target:
protected boolean canDoAction() { if (!checkRemoveEditValidations()) { return false; } if (SchedulingManager.getInstance().getClustersByClusterPolicyId(getParameters().getClusterPolicyId()).size() > 0) { StringBuffer attachedClustersStringBf = new StringBuffer(""); List<VDSGroup> attachedClustersList = SchedulingManager.getInstance().getClustersByClusterPolicyId(getParameters().getClusterPolicyId()); boolean isFirstCluster = true; for (VDSGroup vdsGroup : attachedClustersList) { if (isFirstCluster == false) attachedClustersStringBf.append(','); attachedClustersStringBf.append('\'').append(vdsGroup.getName()).append('\''); isFirstCluster = false; } return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_CLUSTER_POLICY_INUSE, String.format("$clusters %1$s", attachedClustersStringBf.toString())); } return true; }
Source:
<code>void removeTableQuotasnapshot(TableName table) { <START> this.tableQuotaSnapshots.remove(table); <END> }</code><technical_language>I need some synchronization modifications this data structure. If I understand correctly, Chore run in thread, while quota changes dispatched IPC handler thread</technical_language>

Target:
synchronized void removeTableQuotasnapshot(TableName table) { this.tableQuotaSnapshots.remove(table); }
Source:
<code>public AdaptTempAuthResponseToAccess setContext(HttpRequest request) { String host = request.getEndpoint().getHost(); this.host = host; <START> this.username = request.getFirstHeaderOrNull(SwiftAuthenticationModule.getIdentityHeaderName()); <END> return this; }</code><technical_language>inject header variable in this class too, avoid dealing static methods</technical_language>

Target:
public AdaptTempAuthResponseToAccess setContext(HttpRequest request) { String host = request.getEndpoint().getHost(); this.host = host; this.username = request.getFirstHeaderOrNull(identityHeaderNameUser); return this; }
Source:
<code>private <T> T callRecurlySafeXmlContent(final AsyncHttpClient.BoundRequestBuilder builder, @Nullable final Class<T> clazz) { try { return callRecurlyXmlContent(builder, clazz); } catch (IOException e) { log.warn("Error while calling Recurly", e); return null; } catch (ExecutionException e) { if (e.getCause() != null && <START> e.getCause() instanceof ConnectException) { <END> throw new ConnectionErrorException(e.getCause()); } else if (e.getCause() != null && e.getCause().getCause() != null && e.getCause().getCause() instanceof TransactionErrorException) { throw (TransactionErrorException) e.getCause().getCause(); } else if (e.getCause() != null && e.getCause() instanceof TransactionErrorException) { throw (TransactionErrorException) e.getCause(); } log.error("Execution error", e); return null; } catch (InterruptedException e) { log.error("Interrupted while calling Recurly", e); return null; } }</code><technical_language>Nit: need null check instanceof</technical_language>

Target:
private <T> T callRecurlySafeXmlContent(final AsyncHttpClient.BoundRequestBuilder builder, @Nullable final Class<T> clazz) { try { return callRecurlyXmlContent(builder, clazz); } catch (IOException e) { log.warn("Error while calling Recurly", e); return null; } catch (ExecutionException e) { if (e.getCause() instanceof ConnectException) { throw new ConnectionErrorException(e.getCause()); } else if (e.getCause() != null && e.getCause().getCause() != null && e.getCause().getCause() instanceof TransactionErrorException) { throw (TransactionErrorException) e.getCause().getCause(); } else if (e.getCause() != null && e.getCause() instanceof TransactionErrorException) { throw (TransactionErrorException) e.getCause(); } log.error("Execution error", e); return null; } catch (InterruptedException e) { log.error("Interrupted while calling Recurly", e); return null; } }
Source:
<code><START> public void removeFromParentSlot() { <END> assert parent != null : "Tried to remove a presenter that has no parent from its parent"; parent.removeFromSlot(slot, this); }</code><technical_language>Do naming removeFromParent() enough</technical_language>

Target:
public void removeFromParentSlot() { if (parent == null) { return; } parent.removeFromSlot(slot, this); }
Source:
<code>public <A extends CanvasControl> A newControl(final Class<A> type) { if (CONTROL_TYPES.containsKey(type)) { final Annotation q = CONTROL_TYPES.get(type); <START> return beanManager.lookupBean(type, <END> q).newInstance(); } else { LOGGER.log(Level.WARNING, "Canvas Control for type [" + type.getName() + "] is not supported by " + "this canvas factory [" + this.getClass().getName() + "]"); } return null; }</code><technical_language>@romartin Well.. if control references instantiated object steps 1, 2 3 OK. However, for example, a reference "instance" is in Errai's AbstractContext.factoriesByCreatedInstances property (follow code beanManager.lookup(X).newInstance()). a reference instances released. is why, **if** BeanManager need handle destruction too. Alternatively BeanManager inject (many, more) @YourQualifier ManagedInstance<ResizeControl>, add CONTROL_TYPES map ManagedInstance class "factory" (instead of SyncBeanManager). @mbarkley is (other?) get benefits of ManagedInstance a generic bean factory (like SyncBeanManager etc)</technical_language>

Target:
public <A extends CanvasControl> A newControl(final Class<A> type) { if (controls.containsKey(type)) { final ManagedInstance<A> mi = controls.get(type); return mi.get(); } else { LOGGER.log(Level.WARNING, "Canvas Control for type [" + type.getName() + "] is not supported by " + "this canvas factory [" + this.getClass().getName() + "]"); } return null; }
Source:
<code>protected Case getElement(int recordId, QueryContext context) { if(context == null) { return super.getElement(recordId, context); } <START> CaseGroupResultCache cue = context.getQueryCacheOrNull(CaseGroupResultCache.class); <END> if(cue != null && cue.hasMatchingCaseSet(recordId)) { if(!cue.isLoaded(recordId)) { EvaluationTrace loadTrace = new EvaluationTrace("Bulk Case Load"); SqlStorage<ACase> sqlStorage = ((SqlStorage<ACase>)storage); LinkedHashSet<Integer> body = cue.getTranche(recordId); sqlStorage.bulkRead(body, cue.getLoadedCaseMap()); loadTrace.setOutcome("Loaded: " + body.size()); context.reportTrace(loadTrace); } return cue.getLoadedCase(recordId); } return super.getElement(recordId, context); }</code><technical_language>bad variable name</technical_language>

Target:
protected Case getElement(int recordId, QueryContext context) { if(context == null) { return super.getElement(recordId, context); } CaseGroupResultCache caseGroupCache = context.getQueryCacheOrNull(CaseGroupResultCache.class); if(caseGroupCache != null && caseGroupCache.hasMatchingCaseSet(recordId)) { if(!caseGroupCache.isLoaded(recordId)) { EvaluationTrace loadTrace = new EvaluationTrace("Bulk Case Load"); SqlStorage<ACase> sqlStorage = ((SqlStorage<ACase>)storage); LinkedHashSet<Integer> body = caseGroupCache.getTranche(recordId); sqlStorage.bulkRead(body, caseGroupCache.getLoadedCaseMap()); loadTrace.setOutcome("Loaded: " + body.size()); context.reportTrace(loadTrace); } return caseGroupCache.getLoadedCase(recordId); } return super.getElement(recordId, context); }
Source:
<code>String getEnvName(String serverName) { <START> String serverNameEnv = serverName.replaceAll("[^\\w]", "_"); <END> return String.format(SERVER_PORT_ENV_FMT, serverNameEnv.toUpperCase()); }</code><technical_language>"[\W]", "_" simpler</technical_language>

Target:
String getEnvName(String serverName) { String serverNameEnv = serverName.replaceAll("\\W", "_"); return String.format(SERVER_PORT_ENV_FMT, serverNameEnv.toUpperCase()); }
Source:
<code>public void update(LogData entry) { long entryAddress = entry.getGlobalAddress(); updateGlobalTail(entryAddress); for (UUID streamId : entry.getStreams()) { long currentStreamTail = streamTails.getOrDefault(streamId, Address.NON_ADDRESS); streamTails.put(streamId, Math.max(currentStreamTail, entryAddress)); if (streamsAddressSpaceMap.containsKey(streamId)) { streamsAddressSpaceMap.get(streamId).addAddress(entryAddress); } else { streamsAddressSpaceMap.put(streamId, new StreamAddressSpace(Address.NON_ADDRESS, Roaring64NavigableMap.bitmapOf(entryAddress))); } } if (entry.hasCheckpointMetadata()) { UUID streamId = entry.getCheckpointedStreamId(); long streamTailAtCP = entry.getCheckpointedStreamStartLogAddress(); if (Address.isAddress(streamTailAtCP)) { long currentStreamTail = streamTails.getOrDefault(streamId, Address.NON_ADDRESS); streamTails.put(streamId, Math.max(currentStreamTail, streamTailAtCP)); <START> if (streamsAddressSpaceMap.containsKey(streamId) && <END> streamsAddressSpaceMap.get(streamId).getAddressCount() != 0) { StreamAddressSpace streamAddressSpace = streamsAddressSpaceMap.get(streamId); streamAddressSpace.setTrimMark(Math.max(streamAddressSpace.getTrimMark(), streamTailAtCP)); } else { streamsAddressSpaceMap.put(streamId, new StreamAddressSpace(streamTailAtCP, new Roaring64NavigableMap())); } } } }</code><technical_language>I this if branch is necessary in StreamAddressSpace, update trimMark removing addresses trimMark bitmap is empty</technical_language>

Target:
public void update(LogData entry) { long entryAddress = entry.getGlobalAddress(); updateGlobalTail(entryAddress); for (UUID streamId : entry.getStreams()) { long currentStreamTail = streamTails.getOrDefault(streamId, Address.NON_ADDRESS); streamTails.put(streamId, Math.max(currentStreamTail, entryAddress)); streamsAddressSpaceMap.putIfAbsent(streamId, new StreamAddressSpace(entry.getBackpointer(streamId), new Roaring64NavigableMap())); streamsAddressSpaceMap.get(streamId).addAddress(entryAddress); } if (entry.hasCheckpointMetadata()) { UUID streamId = entry.getCheckpointedStreamId(); long streamTailAtCP = entry.getCheckpointedStreamStartLogAddress(); if (Address.isAddress(streamTailAtCP)) { long currentStreamTail = streamTails.getOrDefault(streamId, Address.NON_ADDRESS); streamTails.put(streamId, Math.max(currentStreamTail, streamTailAtCP)); streamsAddressSpaceMap.putIfAbsent(streamId, new StreamAddressSpace(streamTailAtCP, new Roaring64NavigableMap())); } } }
Source:
<code>private void addApplication(File file) { String app; if (isApp(file)) { if (!isResigned(file)) { app = file.getAbsolutePath(); selendroidConfiguration.addSupportedApp(app); <START> log.info("added:\n\t" + app); <END> } } }</code><technical_language>"added" what? obvious code. obvious user INFO messages</technical_language>

Target:
private void addApplication(File file) { String app; if (isApp(file)) { if (!isResigned(file)) { app = file.getAbsolutePath(); selendroidConfiguration.addSupportedApp(app); log.info("File added to supported list:\n\t" + app); } } }
Source:
<code>public org.codice.solr.client.solrj.SolrClient newClient(String core) { String solrUrl = StringUtils.defaultIfBlank( AccessController.doPrivileged( (PrivilegedAction<String>) () -> System.getProperty(SOLR_HTTP_URL)), getDefaultHttpsAddress()); final String coreUrl = solrUrl + "/" + core; final String solrDataDir = AccessController.doPrivileged( (PrivilegedAction<String>) () -> System.getProperty(SOLR_DATA_DIR)); if (solrDataDir != null) { ConfigurationStore.getInstance().setDataDirectoryPath(solrDataDir); } LOGGER.debug("Solr({}): Creating an HTTP Solr client using url [{}]", core, coreUrl); SolrClientAdapter adaptor = new SolrClientAdapter(core, () -> createSolrHttpClient(solrUrl, core, coreUrl)); try { if (!adaptor.isAvailable(30, 5, TimeUnit.SECONDS)) { LOGGER.warn("Solr Client is not available after 30 seconds", core); } } catch (InterruptedException e) { <START> LOGGER.error("Unable to connect to solr client {}: ", core, e.getStackTrace()); <END> } return adaptor; }</code><technical_language>Improper handle interruptions. need propagated re-interrupting current thread</technical_language>

Target:
public org.codice.solr.client.solrj.SolrClient newClient(String core) { String solrUrl = StringUtils.defaultIfBlank( AccessController.doPrivileged( (PrivilegedAction<String>) () -> System.getProperty(SOLR_HTTP_URL)), getDefaultHttpsAddress()); final String coreUrl = solrUrl + "/" + core; final String solrDataDir = AccessController.doPrivileged( (PrivilegedAction<String>) () -> System.getProperty(SOLR_DATA_DIR)); if (solrDataDir != null) { ConfigurationStore.getInstance().setDataDirectoryPath(solrDataDir); } LOGGER.debug("Solr({}): Creating an HTTP Solr client using url [{}]", core, coreUrl); SolrClientAdapter adaptor = new SolrClientAdapter(core, () -> createSolrHttpClient(solrUrl, core, coreUrl)); try { if (!adaptor.isAvailable(30, 5, TimeUnit.SECONDS)) { LOGGER.warn("Solr Client is not available after 30 seconds", core); } } catch (InterruptedException e) { LOGGER.error("Unable to connect to solr client {}: ", core, e.getStackTrace()); Thread.currentThread().interrupt(); } return adaptor; }
Source:
<code>public void listSettingsContext() { <START> ConfigurationClient configurationClient = createSyncConfigurationClient(); <END> SettingSelector settingSelector = new SettingSelector().keys("prodDBConnection"); Context ctx = new Context(key2, value2); PagedIterable<ConfigurationSetting> csStream = configurationClient.listSettings(settingSelector, ctx); csStream.streamByPage().forEach(setting -> { System.out.printf("Key: %s, Value: %s", setting.value().get(0).key(), setting.value().get(0).value()); }); END: com.azure.data.applicationconfig.configurationclient.listSettings#SettingSelector-Context }</code><technical_language>design docs, this be: com.azure.data.applicationconfig.configurationclient.listSettings#settingSelector-context a too</technical_language>

Target:
public void listSettingsContext() { ConfigurationClient configurationClient = createSyncConfigurationClient(); SettingSelector settingSelector = new SettingSelector().keys("prodDBConnection"); Context ctx = new Context(key2, value2); configurationClient.listSettings(settingSelector, ctx).forEach(setting -> { System.out.printf("Key: %s, Value: %s", setting.key(), setting.value()); }); END: com.azure.data.applicationconfig.configurationclient.listSettings#settingSelector-context }
Source:
<code>protected WebsocketProxyConfig getConfig() { if (config != null) { <START> new WebsocketProxyConfig( <END> (String) AsyncDataProvider.getInstance().getConfigValuePreConverted(ConfigurationValues.WebSocketProxy), getVncHost()); } return config; }</code><technical_language>config = ... ? :)</technical_language>

Target:
protected WebsocketProxyConfig getConfig() { if (config != null) { config = new WebsocketProxyConfig((String) AsyncDataProvider.getInstance().getConfigValuePreConverted(ConfigurationValues.WebSocketProxy), getVncHost()); } return config; }