auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected void onBackupWithoutLoadedSession( @Nonnull final String sessionId, @Nonnull final String requestId, @Nonnull final BackupSessionService backupSessionService ) { if ( !_sessionIdFormat.isValid( sessionId ) ) { return; } try { final long start = System.currentTimeMillis(); final String validityKey = _sessionIdFormat.createValidityInfoKeyName( sessionId ); final SessionValidityInfo validityInfo = loadSessionValidityInfoForValidityKey( validityKey ); if ( validityInfo == null ) { _log.warn( "Found no validity info for session id " + sessionId ); return; } final int maxInactiveInterval = validityInfo.getMaxInactiveInterval(); final byte[] validityData = encode( maxInactiveInterval, System.currentTimeMillis(), System.currentTimeMillis() ); final int expiration = maxInactiveInterval <= 0 ? 0 : maxInactiveInterval; <START> _memcached.set( validityKey, toMemcachedExpiration(expiration), validityData ); <END> final Callable<?> backupSessionTask = new OnBackupWithoutLoadedSessionTask( sessionId, _storeSecondaryBackup, validityKey, validityData, maxInactiveInterval ); _executor.submit( backupSessionTask ); if ( _log.isDebugEnabled() ) { _log.debug( "Stored session validity info for session " + sessionId ); } _stats.registerSince( NON_STICKY_ON_BACKUP_WITHOUT_LOADED_SESSION, start ); } catch( final Throwable e ) { _log.warn( "An error when trying to load/update validity info.", e ); } }</code><technical_language>If isSessionBackupAsync this block</technical_language>

Target:
protected void onBackupWithoutLoadedSession( @Nonnull final String sessionId, @Nonnull final String requestId, @Nonnull final BackupSessionService backupSessionService ) { if ( !_sessionIdFormat.isValid( sessionId ) ) { return; } try { final long start = System.currentTimeMillis(); final String validityKey = _sessionIdFormat.createValidityInfoKeyName( sessionId ); final SessionValidityInfo validityInfo = loadSessionValidityInfoForValidityKey( validityKey ); if ( validityInfo == null ) { _log.warn( "Found no validity info for session id " + sessionId ); return; } final int maxInactiveInterval = validityInfo.getMaxInactiveInterval(); final byte[] validityData = encode( maxInactiveInterval, System.currentTimeMillis(), System.currentTimeMillis() ); final int expiration = maxInactiveInterval <= 0 ? 0 : maxInactiveInterval; final Future<Boolean> validityResult = _memcached.set( validityKey, toMemcachedExpiration(expiration), validityData ); if ( !_manager.isSessionBackupAsync() ) { validityResult.get( _manager.getSessionBackupTimeout(), TimeUnit.MILLISECONDS ); } final Callable<?> backupSessionTask = new OnBackupWithoutLoadedSessionTask( sessionId, _storeSecondaryBackup, validityKey, validityData, maxInactiveInterval ); _executor.submit( backupSessionTask ); if ( _log.isDebugEnabled() ) { _log.debug( "Stored session validity info for session " + sessionId ); } _stats.registerSince( NON_STICKY_ON_BACKUP_WITHOUT_LOADED_SESSION, start ); } catch( final Throwable e ) { _log.warn( "An error when trying to load/update validity info.", e ); } }
Source:
<code>private boolean hasMembership(String userId, String roleExpression) { if(roleExpression.equals("*") || roleExpression.equals(IdentityConstants.ANY)) return true; ConversationState conversationState = ConversationState.getCurrent(); Identity identity = conversationState.getIdentity(); String membershipType = roleExpression.substring(0, roleExpression.indexOf(":")); String groupName = roleExpression.substring(roleExpression.indexOf(":") + 1); try { MembershipHandler membershipHandler = organizationService_.getMembershipHandler(); if ("*".equals(membershipType)) { <START> if (userId.equals(ConversationState.getCurrent().getIdentity().getUserId())) { <END> return identity.isMemberOf(groupName); } else { return !membershipHandler.findMembershipsByUserAndGroup( userId,groupName).isEmpty(); } } if (userId.equals(ConversationState.getCurrent().getIdentity().getUserId())) { return identity.isMemberOf(groupName, membershipType); } else { return membershipHandler.findMembershipByUserGroupAndType(userId,groupName,membershipType) != null; } } catch(Exception e) { return false; } }</code><technical_language>check userId == null line</technical_language>

Target:
private boolean hasMembership(String userId, String roleExpression) { if (userId == null || userId.length() == 0) { return false; } if(roleExpression.equals("*") || roleExpression.equals(IdentityConstants.ANY)) return true; ConversationState conversationState = ConversationState.getCurrent(); Identity identity = conversationState.getIdentity(); String membershipType = roleExpression.substring(0, roleExpression.indexOf(":")); String groupName = roleExpression.substring(roleExpression.indexOf(":") + 1); try { MembershipHandler membershipHandler = organizationService_.getMembershipHandler(); if ("*".equals(membershipType)) { if (userId.equals(ConversationState.getCurrent().getIdentity().getUserId())) { return identity.isMemberOf(groupName); } else { return !membershipHandler.findMembershipsByUserAndGroup( userId,groupName).isEmpty(); } } if (userId.equals(ConversationState.getCurrent().getIdentity().getUserId())) { return identity.isMemberOf(groupName, membershipType); } else { return membershipHandler.findMembershipByUserGroupAndType(userId,groupName,membershipType) != null; } } catch(Exception e) { return false; } }
Source:
<code>public void onBackPressed() { boolean isDragAndDropActiveInFragment = getCurrentFragment() instanceof DragAndDropInterface && ((DragAndDropInterface) getCurrentFragment()).isCurrentlyMoving(); if (isDragAndDropActiveInFragment) { ((DragAndDropInterface) getCurrentFragment()).cancelMove(); return; } if (getCurrentFragment() instanceof FormulaEditorFragment) { ((FormulaEditorFragment) getCurrentFragment()).promptSave(); return; } if (getSupportFragmentManager().getBackStackEntryCount() > 0) { getSupportFragmentManager().popBackStack(); return; } <START> if (getCurrentFragment() instanceof ScriptFragment <END> && ((ScriptFragment) getCurrentFragment()).isCurrentlyHighlighted()) { ((ScriptFragment) getCurrentFragment()).cancelHighlighting(); return; } super.onBackPressed(); }</code><technical_language>pretty this if (getSupportFragmentManager().getBackStackEntryCount() > 0) { .. if is stack pressing button cancel highlighting. combine isCurrentlyMoving(..) call above, for states in ScriptFragment. suggest this: Fragment currentFragment = getCurrentFragment(); if (currentFragment instanceof ScriptFragment) { if (((DragAndDropInterface) getCurrentFragment()).isCurrentlyMoving()) { ((DragAndDropInterface) getCurrentFragment()).cancelMove(); return; } if (((ScriptFragment) getCurrentFragment()).isCurrentlyHighlighted())) { ((ScriptFragment) getCurrentFragment()).cancelHighlighting(); return; } 100 % if is correct behaviour now. highlighting happen time drag drop</technical_language>

Target:
public void onBackPressed() { Fragment currentFragment = getCurrentFragment(); if (currentFragment instanceof ScriptFragment) { if (((DragAndDropInterface) currentFragment).isCurrentlyMoving()) { ((DragAndDropInterface) currentFragment).cancelMove(); return; } if (((ScriptFragment) currentFragment).isCurrentlyHighlighted()) { ((ScriptFragment) currentFragment).cancelHighlighting(); return; } } if (getCurrentFragment() instanceof FormulaEditorFragment) { ((FormulaEditorFragment) getCurrentFragment()).promptSave(); return; } if (getSupportFragmentManager().getBackStackEntryCount() > 0) { getSupportFragmentManager().popBackStack(); return; } super.onBackPressed(); }
Source:
<code>private void loadOfflineUsers() { <START> Disposable mLoadOfflineUserDisposable = Observable.merge(mFavoriteRepository.getFavorites()) <END> .filter(Resource::hasData) .map(userResource -> userResource.data) .observeOn(AndroidSchedulers.mainThread()) .subscribe(user -> { boolean added = mOfflineUserIds.add(user.id); if (!added) { return; } addUserToCluster(user); mMarkerClusterer.invalidate(); }); getCreateDestroyDisposable().add(mLoadOfflineUserDisposable); }</code><technical_language>loadOfflineUserDisposable</technical_language>

Target:
private void loadOfflineUsers() { Disposable loadOfflineUserDisposable = Observable.merge(mFavoriteRepository.getFavorites()) .filter(Resource::hasData) .map(userResource -> userResource.data) .distinct() .observeOn(AndroidSchedulers.mainThread()) .subscribe(user -> { addUserToCluster(user); mMarkerClusterer.invalidate(); }); getCreateDestroyDisposable().add(loadOfflineUserDisposable); }
Source:
<code>private void startappintro(final Context context) { mthread = new Thread(new Runnable() { @Override public void run() { SharedPreferences PREF = PreferenceManager .getDefaultSharedPreferences(context); misFirstStart = PREF.getBoolean("firstStart", true); if (misFirstStart) { final Intent INTENT = new Intent(SplashScreenActivity.this, AppIntroUser.class); runOnUiThread(new Runnable() { @Override public void run() { startActivity(INTENT); } }); <START> SharedPreferences.Editor E = PREF.edit(); <END> E.putBoolean("firstStart", false); E.apply(); } } }); mthread.start(); }</code><technical_language>Do do Preference related operations activity. predefined helper methods PrefManager class in utils folder give variables a descriptive name **Camel Case** naming style</technical_language>

Target:
private void startappintro(final Context context) { mthread = new Thread(new Runnable() { @Override public void run() { mprefManager = PrefManager.getPreferences(); misFirstStart = PrefManager.getBoolean(getResources(). getString(R.string.firststart_splash_screen), true); if (misFirstStart) { final Intent INTENT = new Intent(SplashScreenActivity.this, AppIntroUser.class); runOnUiThread(new Runnable() { @Override public void run() { startActivity(INTENT); } }); SharedPreferences.Editor Editor = mprefManager.edit(); Editor.putBoolean(getResources(). getString(R.string.firststart_splash_screen), false); Editor.apply(); } } }); mthread.start(); }
Source:
<code>public List<PermissionSubject> getPermissionCheckSubjects() { List<PermissionSubject> permissionList = super.getPermissionCheckSubjects(); if (getParameters().getInterface() != null && StringUtils.isNotEmpty(getNetworkName()) && getVm() != null) { Network network = getNetworkDAO().getByNameAndCluster(getNetworkName(), getVm().getVdsGroupId()); permissionList.add(new PermissionSubject(network == null ? null : network.getId(), <START> VdcObjectType.Network, <END> ActionGroup.CONFIGURE_VM_NETWORK)); if (getParameters().getInterface().isPortMirroring()) { permissionList.add(new PermissionSubject(network == null ? null : network.getId(), VdcObjectType.Network, ActionGroup.PORT_MIRRORING)); } } return permissionList; }</code><technical_language>getActionType().getActionGroup() instead of CONFIGURE_VM_NETWORK</technical_language>

Target:
public List<PermissionSubject> getPermissionCheckSubjects() { List<PermissionSubject> permissionList = super.getPermissionCheckSubjects(); if (getParameters().getInterface() != null && StringUtils.isNotEmpty(getNetworkName()) && getVm() != null) { Network network = getNetworkDAO().getByNameAndCluster(getNetworkName(), getVm().getVdsGroupId()); if (getParameters().getInterface().isPortMirroring()) { permissionList.add(new PermissionSubject(network == null ? null : network.getId(), VdcObjectType.Network, ActionGroup.PORT_MIRRORING)); } else { permissionList.add(new PermissionSubject(network == null ? null : network.getId(), VdcObjectType.Network, getActionType().getActionGroup())); } } return permissionList; }
Source:
<code>public List<Challenge> getChallenges() { <START> return challenges; <END> }</code><technical_language>unmodifiableList</technical_language>

Target:
public List<Challenge> getChallenges() { return Collections.unmodifiableList(challenges); }
Source:
<code>public Response putService(ServiceInstance<T> instance, @PathParam("name") String name, @PathParam("id") String id) { if ( !instance.getId().equals(id) || !instance.getName().equals(name) ) { log.info("Request where path id and/or name doesn't match entity"); return Response.status(Response.Status.BAD_REQUEST).build(); } <START> if ( instance.getServiceType() == ServiceType.DYNAMIC || instance.getServiceType() == ServiceType.DYNAMIC_SEQUENTIAL ) <END> { log.info("Service type cannot be dynamic"); return Response.status(Response.Status.BAD_REQUEST).build(); } try { context.getServiceDiscovery().registerService(instance); } catch ( Exception e ) { ThreadUtils.checkInterrupted(e); log.error("Trying to register service", e); return Response.serverError().build(); } return Response.status(Response.Status.CREATED).build(); }</code><technical_language>add .isDynamic() method ServiceType call instead of checking specific cases</technical_language>

Target:
public Response putService(ServiceInstance<T> instance, @PathParam("name") String name, @PathParam("id") String id) { if ( !instance.getId().equals(id) || !instance.getName().equals(name) ) { log.info("Request where path id and/or name doesn't match entity"); return Response.status(Response.Status.BAD_REQUEST).build(); } if ( instance.getServiceType().isDynamic() ) { log.info("Service type cannot be dynamic"); return Response.status(Response.Status.BAD_REQUEST).build(); } try { context.getServiceDiscovery().registerService(instance); } catch ( Exception e ) { ThreadUtils.checkInterrupted(e); log.error("Trying to register service", e); return Response.serverError().build(); } return Response.status(Response.Status.CREATED).build(); }
Source:
<code>private Set<SitemapEvent> constructSitemapEvents(Item item, List<Widget> widgets) { Set<SitemapEvent> events = new HashSet<>(); for (Widget w : widgets) { if (w instanceof Frame) { events.addAll(constructSitemapEvents(item, itemUIRegistry.getChildren((Frame) w))); } if ((w.getItem() != null && w.getItem().equals(item.getName())) || definesVisibility(w, item.getName())) { SitemapWidgetEvent event = new SitemapWidgetEvent(); event.sitemapName = sitemapName; event.pageId = pageId; event.label = itemUIRegistry.getLabel(w); event.labelcolor = itemUIRegistry.getLabelColor(w); event.valuecolor = itemUIRegistry.getValueColor(w); event.widgetId = itemUIRegistry.getWidgetId(w); event.visibility = itemUIRegistry.getVisiblity(w); String widgetTypeName = w.eClass().getInstanceTypeName() .substring(w.eClass().getInstanceTypeName().lastIndexOf(".") + 1); <START> event.item = EnrichedItemDTOMapper.map(item, "mapview".equalsIgnoreCase(widgetTypeName), <END> CoreItemFactory.LOCATION, null, null); event.state = itemUIRegistry.getState(w).toFullString(); if (event.state != null && event.state.equals(event.item.state)) { event.state = null; } events.add(event); } } return events; }</code><technical_language>extract "mapview".equalsIgnoreCase(widgetTypeName) a variable for readability</technical_language>

Target:
private Set<SitemapEvent> constructSitemapEvents(Item item, List<Widget> widgets) { Set<SitemapEvent> events = new HashSet<>(); for (Widget w : widgets) { if (w instanceof Frame) { events.addAll(constructSitemapEvents(item, itemUIRegistry.getChildren((Frame) w))); } if ((w.getItem() != null && w.getItem().equals(item.getName())) || definesVisibility(w, item.getName())) { SitemapWidgetEvent event = new SitemapWidgetEvent(); event.sitemapName = sitemapName; event.pageId = pageId; event.label = itemUIRegistry.getLabel(w); event.labelcolor = itemUIRegistry.getLabelColor(w); event.valuecolor = itemUIRegistry.getValueColor(w); event.widgetId = itemUIRegistry.getWidgetId(w); event.visibility = itemUIRegistry.getVisiblity(w); String widgetTypeName = w.eClass().getInstanceTypeName() .substring(w.eClass().getInstanceTypeName().lastIndexOf(".") + 1); boolean drillDown = "mapview".equalsIgnoreCase(widgetTypeName); Predicate<Item> itemFilter = (i -> i.getType().equals(CoreItemFactory.LOCATION)); event.item = EnrichedItemDTOMapper.map(item, drillDown, itemFilter, null, null); event.state = itemUIRegistry.getState(w).toFullString(); if (event.state != null && event.state.equals(event.item.state)) { event.state = null; } events.add(event); } } return events; }
Source:
<code>protected List<FileStatus> listStatus(Path... dirs) throws IOException { List<FileStatus> result = new ArrayList<FileStatus>(); if (dirs.length == 0) { throw new IOException("No input paths specified in job"); } List<IOException> errors = new ArrayList<IOException>(); List<PathFilter> filters = new ArrayList<PathFilter>(); filters.add(hiddenFileFilter); PathFilter inputFilter = new MultiPathFilter(filters); for (int i = 0; i < dirs.length; ++i) { Path p = dirs[i]; FileStatus[] matches = fs.globStatus(p, inputFilter); if (matches == null) { LOG.warn("Input path does not exist: " + p); } else if (matches.length == 0) { <START> errors.add(new IOException("Input Pattern " + p + " matches 0 files")); <END> } else { for (FileStatus globStat : matches) { if (globStat.isDirectory()) { for (FileStatus stat : fs.listStatus(globStat.getPath(), inputFilter)) { result.add(stat); } } else { result.add(globStat); } } } } if (!errors.isEmpty()) { throw new InvalidInputException(errors); } LOG.info("Total input paths to process : " + result.size()); return result; }</code><technical_language>This error</technical_language>

Target:
protected List<FileStatus> listStatus(Path... dirs) throws IOException { List<FileStatus> result = new ArrayList<>(); if (dirs.length == 0) { throw new IOException("No input paths specified in job"); } List<IOException> errors = new ArrayList<>(); List<PathFilter> filters = new ArrayList<>(); filters.add(hiddenFileFilter); PathFilter inputFilter = new MultiPathFilter(filters); for (int i = 0; i < dirs.length; ++i) { Path p = dirs[i]; FileStatus[] matches = fs.globStatus(p, inputFilter); if (matches == null) { LOG.warn("Input path does not exist: " + p); } else if (matches.length == 0) { LOG.warn("Input Pattern " + p + " matches 0 files"); } else { for (FileStatus globStat : matches) { if (globStat.isDirectory()) { for (FileStatus stat : fs.listStatus(globStat.getPath(), inputFilter)) { result.add(stat); } } else { result.add(globStat); } } } } if (!errors.isEmpty()) { throw new InvalidInputException(errors); } LOG.info("Total input paths to process : " + result.size()); return result; }
Source:
<code>public CrossGammaMultiCurveCalculator(final InstrumentDerivativeVisitor<MulticurveProviderInterface, MultipleCurrencyMulticurveSensitivity> curveSensitivityCalculator) { _psc = new ParameterSensitivityParameterCalculator<>(curveSensitivityCalculator); <START> _shift = BP1; <END> }</code><technical_language>add a note in java doc stating shift a basis point if specified</technical_language>

Target:
public CrossGammaMultiCurveCalculator(final InstrumentDerivativeVisitor<MulticurveProviderInterface, MultipleCurrencyMulticurveSensitivity> curveSensitivityCalculator) { ArgumentChecker.notNull(curveSensitivityCalculator, "sensitivity calculator"); _psc = new ParameterSensitivityParameterCalculator<>(curveSensitivityCalculator); _shift = BP1; }
Source:
<code>public void testEquivalence() { <START> EquivalenceTester.equivalenceTester().addEquivalentGroup(new PinotTableHandle("connector", "schema", "table"), new PinotTableHandle("connector", "schema", "table")).addEquivalentGroup(new PinotTableHandle("connectorX", "schema", "table"), new PinotTableHandle("connectorX", "schema", "table")).addEquivalentGroup(new PinotTableHandle("connector", "schemaX", "table"), new PinotTableHandle("connector", "schemaX", "table")).addEquivalentGroup(new PinotTableHandle("connector", "schema", "tableX"), new PinotTableHandle("connector", "schema", "tableX")).check(); <END> }</code><technical_language>break multiple lines</technical_language>

Target:
public void testEquivalence() { EquivalenceTester.equivalenceTester() .addEquivalentGroup(new PinotTableHandle("schema", "table"), new PinotTableHandle("schema", "table")) .addEquivalentGroup(new PinotTableHandle("schemaX", "table"), new PinotTableHandle("schemaX", "table")) .addEquivalentGroup(new PinotTableHandle("schema", "tableX"), new PinotTableHandle("schema", "tableX")) .check(); }
Source:
<code>private @CheckForNull Runnable makeBuildable(final BuildableItem p) { if (p.task instanceof FlyweightTask) { if (!isBlockedByShutdown(p.task)) { Jenkins h = Jenkins.getInstance(); Map<Node,Integer> hashSource = new HashMap<Node, Integer>(h.getNodes().size()); <START> hashSource.put(h, Math.max(h.getNumExecutors() * 100, 1)); <END> for (Node n : h.getNodes()) { hashSource.put(n, n.getNumExecutors() * 100); } ConsistentHash<Node> hash = new ConsistentHash<Node>(NODE_HASH); hash.addAll(hashSource); for (Node n : hash.list(p.task.getFullDisplayName())) { final Computer c = n.toComputer(); if (n.canTake(p) != null) continue; if (c==null || c.isOffline()) continue; return new Runnable() { @Override public void run() { c.startFlyWeightTask(new WorkUnitContext(p).createWorkUnit(p.task)); makePending(p); } }; } } return null; } else { return new Runnable() { @Override public void run() { p.enter(Queue.this); } }; } }</code><technical_language>Is a reason this check deleted here? (Much more visible in [whitespace-ignoring diff](<LINK_0></technical_language>

Target:
private @CheckForNull Runnable makeBuildable(final BuildableItem p) { if (p.task instanceof FlyweightTask) { if (!isBlockedByShutdown(p.task)) { Runnable runnable = makeFlyWeightTaskBuildable(p); if(runnable != null){ return runnable; } return new BuildableRunnable(p); } return null; } else { return new BuildableRunnable(p); } }
Source:
<code>public static boolean isServiceEnabled(String prefix, String name, Properties properties) { <START> ObjectHelper.notNull(prefix, "prefix"); <END> ObjectHelper.notNull(name, "prefix"); ObjectHelper.notNull(properties, "prefix"); if (!prefix.endsWith(".")) { prefix = prefix + "."; } final String group = properties.getProperty(prefix + "enabled", "true"); final String item = properties.getProperty(prefix + name + ".enabled", group); return Boolean.valueOf(item); }</code><technical_language>copy paste error in 3 lines</technical_language>

Target:
public static boolean isServiceEnabled(String prefix, String name, Properties properties) { ObjectHelper.notNull(prefix, "prefix"); ObjectHelper.notNull(name, "name"); ObjectHelper.notNull(properties, "properties"); if (!prefix.endsWith(".")) { prefix = prefix + "."; } final String group = properties.getProperty(prefix + "enabled", "true"); final String item = properties.getProperty(prefix + name + ".enabled", group); return Boolean.valueOf(item); }
Source:
<code>public static AggregationFunctionType getAggregationFunctionType(String functionName) { <START> String upperCaseFunctionName = functionName.toUpperCase().replace("_", ""); <END> if (upperCaseFunctionName.startsWith("PERCENTILE")) { String remainingFunctionName = upperCaseFunctionName.substring(10); if (remainingFunctionName.isEmpty() || remainingFunctionName.matches("\\d+")) { return PERCENTILE; } else if (remainingFunctionName.equals("EST") || remainingFunctionName.matches("EST\\d+")) { return PERCENTILEEST; } else if (remainingFunctionName.equals("TDIGEST") || remainingFunctionName.matches("TDIGEST\\d+")) { return PERCENTILETDIGEST; } else if (remainingFunctionName.equals("MV") || remainingFunctionName.matches("\\d+MV")) { return PERCENTILEMV; } else if (remainingFunctionName.equals("ESTMV") || remainingFunctionName.matches("EST\\d+MV")) { return PERCENTILEESTMV; } else if (remainingFunctionName.equals("TDIGESTMV") || remainingFunctionName.matches("TDIGEST\\d+MV")) { return PERCENTILETDIGESTMV; } else { throw new IllegalArgumentException("Invalid aggregation function name: " + functionName); } } else { try { return AggregationFunctionType.valueOf(upperCaseFunctionName); } catch (Exception e) { throw new IllegalArgumentException("Invalid aggregation function name: " + functionName); } } }</code><technical_language>This break ST_Union. original function name, if found, replace _ then</technical_language>

Target:
public static AggregationFunctionType getAggregationFunctionType(String functionName) { String upperCaseFunctionName = StringUtils.remove(functionName, '_').toUpperCase(); if (upperCaseFunctionName.startsWith("PERCENTILE")) { String remainingFunctionName = upperCaseFunctionName.substring(10); if (remainingFunctionName.isEmpty() || remainingFunctionName.matches("\\d+")) { return PERCENTILE; } else if (remainingFunctionName.equals("EST") || remainingFunctionName.matches("EST\\d+")) { return PERCENTILEEST; } else if (remainingFunctionName.equals("TDIGEST") || remainingFunctionName.matches("TDIGEST\\d+")) { return PERCENTILETDIGEST; } else if (remainingFunctionName.equals("MV") || remainingFunctionName.matches("\\d+MV")) { return PERCENTILEMV; } else if (remainingFunctionName.equals("ESTMV") || remainingFunctionName.matches("EST\\d+MV")) { return PERCENTILEESTMV; } else if (remainingFunctionName.equals("TDIGESTMV") || remainingFunctionName.matches("TDIGEST\\d+MV")) { return PERCENTILETDIGESTMV; } else { throw new IllegalArgumentException("Invalid aggregation function name: " + functionName); } } else { try { return AggregationFunctionType.valueOf(upperCaseFunctionName); } catch (Exception e) { throw new IllegalArgumentException("Invalid aggregation function name: " + functionName); } } }
Source:
<code>public ServiceCreationConfiguration<ClusteringService> parseServiceCreationConfiguration(final Element fragment) { if ("cluster".equals(fragment.getLocalName())) { final Attr aliasAttribute = fragment.getAttributeNode("alias"); final String alias = (aliasAttribute == null ? "" : aliasAttribute.getValue()); URI connectionUri = null; final NodeList childNodes = fragment.getChildNodes(); for (int i = 0; i < childNodes.getLength(); i++) { final Node item = childNodes.item(i); if (Node.ELEMENT_NODE == item.getNodeType()) { if ("connection".equals(item.getLocalName())) { final Attr urlAttribute = ((Element)item).getAttributeNode("url"); final String urlValue = urlAttribute.getValue(); try { connectionUri = URI.create(urlValue); } catch (IllegalArgumentException e) { <START> throw new RuntimeException( <END> String.format("Value of %s attribute on XML configuration element <%s> in <%s> is not a valid URI - '%s'", urlAttribute.getName(), fragment.getTagName(), (fragment.getParentNode() == null ? "null" : fragment.getParentNode().getLocalName()), connectionUri)); } } } } return new ClusteringServiceConfiguration(alias, connectionUri); } throw new RuntimeException(String.format("XML configuration element <%s> in <%s> is not supported", fragment.getTagName(), (fragment.getParentNode() == null ? "null" : fragment.getParentNode().getLocalName()))); }</code><technical_language>Throwing RuntimeException is a brilliant idea especially is done in other locations specialized exception. IMHO this is indicator a bit of refactoring happen here, context of this task</technical_language>

Target:
public ServiceCreationConfiguration<ClusteringService> parseServiceCreationConfiguration(final Element fragment) { if ("cluster".equals(fragment.getLocalName())) { URI connectionUri = null; final NodeList childNodes = fragment.getChildNodes(); for (int i = 0; i < childNodes.getLength(); i++) { final Node item = childNodes.item(i); if (Node.ELEMENT_NODE == item.getNodeType()) { if ("connection".equals(item.getLocalName())) { final Attr urlAttribute = ((Element)item).getAttributeNode("url"); final String urlValue = urlAttribute.getValue(); try { connectionUri = new URI(urlValue); } catch (URISyntaxException e) { throw new XmlConfigurationException( String.format("Value of %s attribute on XML configuration element <%s> in <%s> is not a valid URI - '%s'", urlAttribute.getName(), fragment.getTagName(), (fragment.getParentNode() == null ? "null" : fragment.getParentNode().getLocalName()), connectionUri), e); } } } } return new ClusteringServiceConfiguration(connectionUri); } throw new XmlConfigurationException(String.format("XML configuration element <%s> in <%s> is not supported", fragment.getTagName(), (fragment.getParentNode() == null ? "null" : fragment.getParentNode().getLocalName()))); }
Source:
<code>public boolean artifactOmitted(Artifact artifact) { <START> throw new UnsupportedOperationException(); <END> }</code><technical_language>return perActionCache.artifactOmitted(artifact) || perBuildFileCache.artifactOmitted(artifact)</technical_language>

Target:
public boolean artifactOmitted(Artifact artifact) { return perActionCache.artifactOmitted(artifact) || perBuildFileCache.artifactOmitted(artifact); }
Source:
<code>public void testCanDecreaseMemoryCategory() { MemoryCache memoryCache = mock(MemoryCache.class); BitmapPool bitmapPool = mock(BitmapPool.class); MemoryCategory memoryCategory = MemoryCategory.NORMAL; Glide glide = new GlideBuilder().setMemoryCache(memoryCache).setBitmapPool(bitmapPool) <START> .build(getContext()); <END> glide.setMemoryCategory(memoryCategory); verify(memoryCache).setSizeMultiplier(eq(memoryCategory.getMultiplier())); verify(bitmapPool).setSizeMultiplier(eq(memoryCategory.getMultiplier())); MemoryCategory newMemoryCategory = MemoryCategory.LOW; MemoryCategory oldMemoryCategory = glide.setMemoryCategory(newMemoryCategory); assertEquals(memoryCategory, oldMemoryCategory); verify(memoryCache).setSizeMultiplier(eq(newMemoryCategory.getMultiplier())); verify(bitmapPool).setSizeMultiplier(eq(newMemoryCategory.getMultiplier())); }</code><technical_language>Indentation a here</technical_language>

Target:
public void testCanDecreaseMemoryCategory() { MemoryCache memoryCache = mock(MemoryCache.class); BitmapPool bitmapPool = mock(BitmapPool.class); MemoryCategory memoryCategory = MemoryCategory.NORMAL; Glide glide = new GlideBuilder().setBitmapPool(bitmapPool).setMemoryCache(memoryCache) .build(getContext()); glide.setMemoryCategory(memoryCategory); verify(memoryCache).setSizeMultiplier(eq(memoryCategory.getMultiplier())); verify(bitmapPool).setSizeMultiplier(eq(memoryCategory.getMultiplier())); MemoryCategory newMemoryCategory = MemoryCategory.LOW; MemoryCategory oldMemoryCategory = glide.setMemoryCategory(newMemoryCategory); assertEquals(memoryCategory, oldMemoryCategory); verify(memoryCache).setSizeMultiplier(eq(newMemoryCategory.getMultiplier())); verify(bitmapPool).setSizeMultiplier(eq(newMemoryCategory.getMultiplier())); }
Source:
<code>public void compactInternally(TableReference tableRef, boolean inMaintenanceMode) { long startTime = System.currentTimeMillis(); maybeLog(() -> delegate.compactInternally(tableRef, inMaintenanceMode), (logger, stopwatch) -> { if (inMaintenanceMode) { logger.log("Call to KVS.compactInternally (in maintenance mode) at time {}, on table took ms.", LoggingArgs.startTimeMillis(startTime), LoggingArgs.tableRef(tableRef), LoggingArgs.durationMillis(stopwatch)); } else { <START> logTimeAndTable("compactInternally", tableRef); <END> } }); }</code><technical_language>need pass startTime this method compactInternally logTimeAndTable get a startTime logger is called</technical_language>

Target:
public void compactInternally(TableReference tableRef, boolean inMaintenanceMode) { long startTime = System.currentTimeMillis(); maybeLog(() -> delegate.compactInternally(tableRef, inMaintenanceMode), (logger, stopwatch) -> { if (inMaintenanceMode) { logger.log("Call to KVS.compactInternally (in maintenance mode) at time {}, on table took ms.", LoggingArgs.startTimeMillis(startTime), LoggingArgs.tableRef(tableRef), LoggingArgs.durationMillis(stopwatch)); } else { logger.log("Call to KVS.{} at time {}, on table took ms.", LoggingArgs.method("compactInternally"), LoggingArgs.startTimeMillis(startTime), LoggingArgs.tableRef(tableRef), LoggingArgs.durationMillis(stopwatch)); } }); }
Source:
<code>public void setup() { bundles = new HashMap<ArtifactKey, File>(); ArtifactKey key1 = new DefaultArtifactKey("eclipse-plugin", "foo.bar.artifact1", "1.0"); ArtifactKey key2 = new DefaultArtifactKey("eclipse-plugin", "foo.bar.artifact2", "1.0"); File file1 = createNiceMock(File.class); File file2 = createNiceMock(File.class); expect(file1.getAbsolutePath()).andReturn("absolute/path/to/bundle1"); expect(file2.getAbsolutePath()).andReturn("absolute/path/to/bundle2"); <START> replay(file1, file2); <END> bundles.put(key1, file1); bundles.put(key2, file2); startLevel = new HashMap<String, BundleStartLevel>(); BundleStartLevel startLevel1 = new BundleStartLevel("foo.bar.artifact1", 6, true); startLevel.put("foo.bar.artifact1", startLevel1); Logger log = createNiceMock(Logger.class); factory = new DefaultEquinoxInstallationFactory(log); }</code><technical_language>is need change this now, recommend Mockito EasyMock - Mockito is more modern e.g. need this replay call</technical_language>

Target:
public void setup() { bundles = new HashMap<ArtifactKey, File>(); bundles.put(new DefaultArtifactKey("eclipse-plugin", "org.example.bundle1", "1.0"), mockFile("absolute/path/to/bundle1")); bundles.put(new DefaultArtifactKey("eclipse-plugin", "org.example.bundle2", "1.0"), mockFile("absolute/path/to/bundle2")); instDesc = new DefaultEquinoxInstallationDescription(); defaultLevel = new BundleStartLevel(null, 7, false); subject = new DefaultEquinoxInstallationFactory(mock(Logger.class)); }
Source:
<code>public ICompletionProposal[] <START> computeCompletionProposals(ITextViewer <END> textViewer, int offset) { IDocument document = textViewer.getDocument(); try { IRegion lineInformationOfOffset = document.getLineInformationOfOffset(offset); String line = document.get(lineInformationOfOffset.getOffset(), lineInformationOfOffset.getLength()); if (line != null) { int indexOf = -1; Optional<String> prefix = fileRefPrefixes.stream().filter(p -> line.indexOf(p) != -1).findAny(); if (prefix.isPresent()) { indexOf = line.indexOf(prefix.get()); } if (indexOf == -1) { indexOf = line.indexOf(File.separator); } if (indexOf != -1) { IContainer parent = file.getParent(); int lastIndexOf = line.lastIndexOf(File.separator); if (lastIndexOf != -1 && indexOf != lastIndexOf) { String inlinePath = line.substring(indexOf + prefix.map(p -> p.length()).orElse(0), lastIndexOf); IResource member = parent.findMember(inlinePath, false); return computeProposals(line, offset, lastIndexOf, offset - lineInformationOfOffset.getOffset(), member); } return computeProposals(line, offset, lastIndexOf + prefix.map(p -> p.length()).orElse(0), offset - lineInformationOfOffset.getOffset(), parent); } } } catch (BadLocationException e) { } catch (CoreException e) { } return null; }</code><technical_language>great some tests for this</technical_language>

Target:
public ICompletionProposal[] computeCompletionProposals(ITextViewer textViewer, int offset) { IDocument document = textViewer.getDocument(); try { IRegion lineInformationOfOffset = document.getLineInformationOfOffset(offset); String line = document.get(lineInformationOfOffset.getOffset(), lineInformationOfOffset.getLength()); if (line != null) { int indexOf = -1; Optional<FileRefPrefix> prefix = fileRefPrefixes.stream() .filter(p -> line.indexOf(p.getFileRefPrefix()) != -1) .findAny(); if (prefix.isPresent()) { indexOf = line.indexOf(prefix.get().getFileRefPrefix()); } if (indexOf == -1) { indexOf = line.indexOf(File.separator); } if (indexOf != -1) { IContainer parent = file.getParent(); int lastIndexOf = line.lastIndexOf(File.separator); if (lastIndexOf != -1 && indexOf != lastIndexOf) { String inlinePath = line.substring( indexOf + prefix.map(p -> p.getFileRefPrefix().length()).orElse(0), lastIndexOf); IResource member = parent.findMember(inlinePath, false); return computeProposals(line, offset, lastIndexOf, offset - lineInformationOfOffset.getOffset(), member); } return computeProposals(line, offset, lastIndexOf + prefix.map(p -> p.getFileRefPrefix().length()).orElse(0), offset - lineInformationOfOffset.getOffset(), parent); } } } catch (BadLocationException e) { } catch (CoreException e) { } return null; }
Source:
<code>public void testExecuteAndPostProcess() { <START> prepareTestData(); <END> testModifyResponses(); testIncorrectParameters(); testDifferentPrivileges(); testSubmitResponseForInvalidQuestion(); testClosedSession(); }</code><technical_language>Is this needed</technical_language>

Target:
public void testExecuteAndPostProcess() { testModifyResponses(); testIncorrectParameters(); testSubmitResponseForInvalidQuestion(); testClosedSession(); }
Source:
<code>public int compareTypeSafe(Value v, CompareMode mode, CastDataProvider provider) { <START> return 0; <END> }</code><technical_language>throw exception this method? keys comparable</technical_language>

Target:
public int compareTypeSafe(Value v, CompareMode mode, CastDataProvider provider) { throw new UnsupportedOperationException(); }
Source:
<code>public BlueprintProvisioningState getBlueprintProvisioningState() { BlueprintProvisioningState blueprintProvisioningState = null; ClusterEntity clusterEntity = getClusterEntity(); <START> blueprintProvisioningState = clusterEntity.getBlueprintProvisioningState(); <END> return blueprintProvisioningState; }</code><technical_language>Code: I local variable blueprintProvisioningState is unnecessary, returned directly. variable pre-declared null value</technical_language>

Target:
public BlueprintProvisioningState getBlueprintProvisioningState() { ClusterEntity clusterEntity = getClusterEntity(); return clusterEntity.getBlueprintProvisioningState(); }
Source:
<code>public Chain build() { List<Element> elements = new ArrayList<>(); for (final ByteBuffer buffer : buffers) { <START> elements.add(new Element() { <END> @Override public ByteBuffer getPayload() { return buffer.asReadOnlyBuffer(); } @Override public String toString() { return "Element{size=" + buffer.capacity() + "}"; } }); } return chainFromList(elements); }</code><technical_language>I if this performance impact. a hot path</technical_language>

Target:
public Chain build() { List<Element> elements = new ArrayList<>(); for (final ByteBuffer buffer : buffers) { elements.add(buffer::asReadOnlyBuffer); } return chainFromList(elements); }
Source:
<code>public void after() { <START> admin.getSession().getAdminClient().deleteSubpopulationPermanently(guid); <END> developer.signOutAndDeleteUser(); }</code><technical_language>a null check guid deleting SubPop. Otherwise, if creating Subpop fails, fail a NullPointerException mask original error</technical_language>

Target:
public void after() { if (guid != null) { admin.getSession().getAdminClient().deleteSubpopulationPermanently(guid); } developer.signOutAndDeleteUser(); }
Source:
<code>protected boolean validate() { macPool = getMacPool(); if (getCluster() == null) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_CLUSTER_CAN_NOT_BE_EMPTY); } List<VmNetworkInterface> nicsUnableToBeImported = getVm().getInterfaces() .stream() <START> .filter(iface -> !shouldReassignMac(iface) && macPool.isMacInUse(iface.getMacAddress())) <END> .collect(Collectors.toList()); if (!nicsUnableToBeImported.isEmpty()) { EngineMessage engineMessage = EngineMessage.ACTION_TYPE_FAILED_CANNOT_ADD_IFACE_DUE_TO_MAC_DUPLICATES; Collection<String> replacements = ReplacementUtils.getListVariableAssignmentString(engineMessage, nicsUnableToBeImported); validate(new ValidationResult(engineMessage, replacements)); } return true; }</code><technical_language>1. check duplicate macs allowed. 2. 'ImportVmFromConfigurationCommand' validation ('validateMacs(..) '), please remove there</technical_language>

Target:
protected boolean validate() { macPool = getMacPool(); if (getCluster() == null) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_CLUSTER_CAN_NOT_BE_EMPTY); } List<VmNetworkInterface> nicsUnableToBeImported = getVm().getInterfaces() .stream() .filter(this::ifaceMacCannotBeAddedToMacPool) .collect(Collectors.toList()); if (!nicsUnableToBeImported.isEmpty()) { EngineMessage engineMessage = EngineMessage.ACTION_TYPE_FAILED_CANNOT_ADD_IFACE_DUE_TO_MAC_DUPLICATES; Collection<String> replacements = ReplacementUtils.getListVariableAssignmentString(engineMessage, nicsUnableToBeImported); validate(new ValidationResult(engineMessage, replacements)); } return true; }
Source:
<code>public JRDataSource getDataSource() { List<TestDetailsDTO> result = new ArrayList<TestDetailsDTO>(); if (!sessionScopeAvailable){ return new JRBeanCollectionDataSource(result); } <START> SystemUnderTestPlotsGeneralProvider plotsGeneralProvider = (SystemUnderTestPlotsGeneralProvider) getContext().getMappedProvider("sysUTPlotsGeneral"); <END> Set<String> boxIdentifiers = plotsGeneralProvider.getStatistics().findBoxIdentifiers(); Set<String> sutUrls = plotsGeneralProvider.getStatistics().findSutUrls(); for (GroupKey groupName : plotsGeneralProvider.getPlotGroups().getPlotGroups().keySet()) { if (hasGlobalStatistics(plotsGeneralProvider, groupName)) { TestDetailsDTO testDetailsDTO = new TestDetailsDTO(); testDetailsDTO.setTestId(groupName.getUpperName()); testDetailsDTO.setTestName(groupName.getUpperName()); result.add(testDetailsDTO); } for (String boxIdentifier : boxIdentifiers) { if (hasBoxStatistics(plotsGeneralProvider, boxIdentifier, groupName)) { String name = groupName.getUpperName() + " on " + boxIdentifier; TestDetailsDTO testDetailsDTO = new TestDetailsDTO(); testDetailsDTO.setTestId(name); testDetailsDTO.setTestName(name); result.add(testDetailsDTO); } } for (String sutUrl : sutUrls) { if (hasSutStatistics(plotsGeneralProvider, sutUrl, groupName)) { String name = groupName.getUpperName() + " on " + sutUrl; TestDetailsDTO testDetailsDTO = new TestDetailsDTO(); testDetailsDTO.setTestId(name); testDetailsDTO.setTestName(name); result.add(testDetailsDTO); } } } return new JRBeanCollectionDataSource(result); }</code><technical_language>I bet in another pull request <LINK_0></technical_language>

Target:
public JRDataSource getDataSource() { if (!sessionScopeAvailable){ return new JRBeanCollectionDataSource(Collections.EMPTY_LIST); } List<TestDetailsDTO> result = new ArrayList<TestDetailsDTO>(); SystemUnderTestPlotsGeneralProvider plotsGeneralProvider = (SystemUnderTestPlotsGeneralProvider) getContext().getMappedProvider("sysUTPlotsGeneral"); Set<String> boxIdentifiers = plotsGeneralProvider.getStatistics().findBoxIdentifiers(); Set<String> sutUrls = plotsGeneralProvider.getStatistics().findSutUrls(); for (GroupKey groupName : plotsGeneralProvider.getPlotGroups().getPlotGroups().keySet()) { if (hasGlobalStatistics(plotsGeneralProvider, groupName)) { TestDetailsDTO testDetailsDTO = new TestDetailsDTO(); testDetailsDTO.setTestId(groupName.getUpperName()); testDetailsDTO.setTestName(groupName.getUpperName()); result.add(testDetailsDTO); } for (String boxIdentifier : boxIdentifiers) { if (hasBoxStatistics(plotsGeneralProvider, boxIdentifier, groupName)) { String name = groupName.getUpperName() + " on " + boxIdentifier; TestDetailsDTO testDetailsDTO = new TestDetailsDTO(); testDetailsDTO.setTestId(name); testDetailsDTO.setTestName(name); result.add(testDetailsDTO); } } for (String sutUrl : sutUrls) { if (hasSutStatistics(plotsGeneralProvider, sutUrl, groupName)) { String name = groupName.getUpperName() + " on " + sutUrl; TestDetailsDTO testDetailsDTO = new TestDetailsDTO(); testDetailsDTO.setTestId(name); testDetailsDTO.setTestName(name); result.add(testDetailsDTO); } } } return new JRBeanCollectionDataSource(result); }
Source:
<code>private void checkAnnotatedAssignment(SubscriptionContext ctx) { AnnotatedAssignment assignment = (AnnotatedAssignment) ctx.syntaxNode(); Expression variable = assignment.variable(); Token equalToken = assignment.equalToken(); <START> if (equalToken != null && shouldReportIssue(variable, variable)) { <END> ctx.addIssue(variable, String.format(MESSAGE, VRBL_ISSUE_TYPE)); } }</code><technical_language>For assignment statements, I understand raise class attributes: class MyClass: max = 42 # OK suggest ancestor of assignment is a FUNCDEF a CLASS avoid raising issue in case a class</technical_language>

Target:
private void checkAnnotatedAssignment(SubscriptionContext ctx) { AnnotatedAssignment assignment = (AnnotatedAssignment) ctx.syntaxNode(); Tree ancestor = TreeUtils.firstAncestorOfKind(assignment, Tree.Kind.FUNCDEF, Tree.Kind.CLASSDEF); if (ancestor == null || ancestor.is(Tree.Kind.FUNCDEF)) { Expression variable = assignment.variable(); Token equalToken = assignment.equalToken(); if (equalToken != null && shouldReportIssue(variable)) { ctx.addIssue(variable, String.format(MESSAGE, VRBL_ISSUE_TYPE)); } } }
Source:
<code>public Operation exec(Prolog engine) throws PrologException { engine.setB0(); Term a1 = arg1.dereference(); PrologEnvironment env = (PrologEnvironment) engine.control; Term topicTerm = Prolog.Nil; Change change = StoredValues.CHANGE.get(engine); String topic = change.getTopic(); if (topic != null) { <START> topicTerm = SymbolTerm.intern(topic); <END> } if (!a1.unify(topicTerm, engine.trail)) { return engine.fail(); } return cont; }</code><technical_language>create instead</technical_language>

Target:
public Operation exec(Prolog engine) throws PrologException { engine.setB0(); Term a1 = arg1.dereference(); PrologEnvironment env = (PrologEnvironment) engine.control; Term topicTerm = Prolog.Nil; Change change = StoredValues.CHANGE.get(engine); String topic = change.getTopic(); if (topic != null) { topicTerm = SymbolTerm.create(topic); } if (!a1.unify(topicTerm, engine.trail)) { return engine.fail(); } return cont; }
Source:
<code>public void purgeMemberships(List<CohortMembership> cohortMembershipList) { <START> cohortMembershipList.forEach(m -> getMembers().remove(m)); <END> }</code><technical_language>This able remove a membership matches patient, if is multiple for patient ignore</technical_language>

Target:
public void purgeMemberships(List<CohortMembership> cohortMembershipList) { List<CohortMembership> membersToPurge = getMembers().stream() .filter(m -> cohortMembershipList.stream() .anyMatch(c -> m.getPatient().getPatientId().equals(c.getPatient().getPatientId()))) .collect(Collectors.toList()); membersToPurge.forEach(m -> getMembers().remove(m)); }
Source:
<code>public void testCreateSubscriptionNullProject() throws Exception { <START> notificationService.createSubscription(null, mock(Account.class), mock(Subscription.class)); <END> }</code><technical_language>testing happy path - a POST is a correct URL if correct arguments provided</technical_language>

Target:
public void testCreateSubscriptionNullProject() throws Exception { notificationService.createSubscription(null, account, subscription); }
Source:
<code>public VolumeType getSelectedVolumeType() { <START> if (!(Boolean) collapseSnapshots.getEntity() || selectedVolumeType == null) { <END> return getVolumeType(); } return selectedVolumeType; }</code><technical_language>I figured out bugging this line. logic is in semantics. be: if ((Boolean) collapseSnapshots.getEntity() && selectedVolumeType != null) { return selectedVolumeType; } return getVolumeType(); This is clearer case user affect volume type is if collapse is selected user changed value</technical_language>

Target:
public VolumeType getSelectedVolumeType() { if ((Boolean) collapseSnapshots.getEntity() && selectedVolumeType != null) { return selectedVolumeType; } return getVolumeType(); }
Source:
<code>private static boolean hasHMSAGConnectLibrary() { try { return com.huawei.agconnect.config.AGConnectServicesConfig.class != null; <START> } catch (Throwable e) { <END> return false; } }</code><technical_language>this Throwable find specific Exception(s)</technical_language>

Target:
private static boolean hasHMSAGConnectLibrary() { try { return com.huawei.agconnect.config.AGConnectServicesConfig.class != null; } catch (Exception e) { return false; } }
Source:
<code>public void addModelListeners() { <START> super.addModelListeners(); <END> getTable().getSelectionModel().addSelectionChangeHandler(event -> { getModelProvider().setSelectedItems(getTable().getSelectedItems()); }); }</code><technical_language>super is a no-op -- do want leave it</technical_language>

Target:
public void addModelListeners() { super.addModelListeners(); getTable().getSelectionModel().addSelectionChangeHandler(event -> getModelProvider().setSelectedItems(getTable().getSelectedItems()) ); }