auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code><START> protected boolean validateQuota() { <END> setQuotaId(QuotaHelper.getInstance().getQuotaIdToConsume(getQuotaId(), getStoragePool())); List<DiskImage> diskInfoList = getParameters().getDiskInfoDestinationList(); for (DiskImage diskImage : diskInfoList) { diskImage.setQuotaId(QuotaHelper.getInstance() .getQuotaIdToConsume(diskImage.getQuotaId(), getStoragePool())); } if (!isInternalExecution()) { return QuotaManager.validateMultiStorageQuota(getStoragePool().getQuotaEnforcementType(), getQuotaConsumeMap(diskInfoList), getCommandId(), getReturnValue().getCanDoActionMessages()); } return true; }</code><technical_language>validate for vms created</technical_language>

Target:
protected boolean validateQuota() { setQuotaId(QuotaHelper.getInstance().getQuotaIdToConsume(getQuotaId(), getStoragePool())); for (DiskImage diskImage : diskInfoDestinationMap.values()) { diskImage.setQuotaId(QuotaHelper.getInstance() .getQuotaIdToConsume(diskImage.getQuotaId(), getStoragePool())); } return QuotaManager.validateMultiStorageQuota(getStoragePool().getQuotaEnforcementType(), getQuotaConsumeMap(diskInfoDestinationMap.values()), getCommandId(), getReturnValue().getCanDoActionMessages()); }
Source:
<code>static boolean isFitForDictionaryBasedPlan(QueryContext queryContext, IndexSegment indexSegment) { List<ExpressionContext> selectExpressions = queryContext.getSelectExpressions(); for (ExpressionContext expression : selectExpressions) { FunctionContext function = expression.getFunction(); String functionName = function.getFunctionName(); <START> if (!functionName.equals("min") && !functionName.equals("max") && !functionName.equals("minmaxrange") <END> && !functionName.equals("distinctcount")) { return false; } ExpressionContext argument = function.getArguments().get(0); if (argument.getType() != ExpressionContext.Type.IDENTIFIER) { return false; } String column = argument.getIdentifier(); Dictionary dictionary = indexSegment.getDataSource(column).getDictionary(); if (dictionary == null || !dictionary.isSorted()) { return false; } } return true; }</code><technical_language>good AggregationFunctionType instead of string name. Also, good factor out isFunctionFitForDictionaryBasedComputation in AggregationFunctionUtils, for readability</technical_language>

Target:
static boolean isFitForDictionaryBasedPlan(QueryContext queryContext, IndexSegment indexSegment) { List<ExpressionContext> selectExpressions = queryContext.getSelectExpressions(); for (ExpressionContext expression : selectExpressions) { FunctionContext function = expression.getFunction(); String functionName = function.getFunctionName(); if(!AggregationFunctionUtils.isFitForDictionaryBasedComputation(functionName)) { return false; } ExpressionContext argument = function.getArguments().get(0); if (argument.getType() != ExpressionContext.Type.IDENTIFIER) { return false; } String column = argument.getIdentifier(); Dictionary dictionary = indexSegment.getDataSource(column).getDictionary(); if (dictionary == null || !dictionary.isSorted()) { return false; } } return true; }
Source:
<code>public UiContextResponse getContext() { JsonObject menu = appSettings.getMenu() != null ? new JsonParser().parse(appSettings.getMenu()).getAsJsonObject() : new JsonObject(); boolean authenticated = <START> !(SecurityContextHolder.getContext().getAuthentication() <END> instanceof AnonymousAuthenticationToken); boolean showCookieWall = cookieWallService.showCookieWall(); return UiContextResponse.builder() .setMenu(menu) .setNavBarLogo(appSettings.getLogoNavBarHref()) .setLogoTop(appSettings.getLogoTopHref()) .setLogoTopMaxHeight(appSettings.getLogoTopMaxHeight()) .setLoginHref(LOGIN_HREF) .setHelpLink(HELP_LINK_JSON) .setShowCookieWall(showCookieWall) .setAuthenticated(authenticated) .setAdditionalMessage(appSettings.getFooter()) .setVersion(this.molgenisVersion) .setBuildDate(this.molgenisBuildDate) .build(); }</code><technical_language>SecurityUtils method instead</technical_language>

Target:
public UiContextResponse getContext() { JsonObject menu = appSettings.getMenu() != null ? new JsonParser().parse(appSettings.getMenu()).getAsJsonObject() : new JsonObject(); boolean authenticated = SecurityUtils.currentUserIsAuthenticated(); boolean showCookieWall = cookieWallService.showCookieWall(); return UiContextResponse.builder() .setMenu(menu) .setCssHref(appSettings.getCssHref()) .setNavBarLogo(appSettings.getLogoNavBarHref()) .setLogoTop(appSettings.getLogoTopHref()) .setLogoTopMaxHeight(appSettings.getLogoTopMaxHeight()) .setLoginHref(LOGIN_HREF) .setHelpLink(HELP_LINK_JSON) .setShowCookieWall(showCookieWall) .setAuthenticated(authenticated) .setAdditionalMessage(appSettings.getFooter()) .setVersion(this.molgenisVersion) .setBuildDate(this.molgenisBuildDate) .build(); }
Source:
<code>public boolean isEmpty() { <START> return fInnerElements.isEmpty(); <END> }</code><technical_language>I super implementation is correct (size == 0). Nulls considered part of list, memory in internal structure</technical_language>

Target:
public boolean isEmpty() { return fSize == 0; }
Source:
<code><START> public DeploymentRepository getValue() throws IllegalStateException, IllegalArgumentException { <END> return this; }</code><technical_language>drop throws clause. thrown, RuntimeExceptions</technical_language>

Target:
public DeploymentRepository getValue() { return this; }
Source:
<code>public void init(GUIController guiController, ScrollPane panelsScrollPane) { this.guiController = guiController; this.panelsScrollPane = panelsScrollPane; restorePanels(); <START> selectPanel(0); <END> }</code><technical_language>leave selectFirstPanel in, define in terms of selectPanel</technical_language>

Target:
public void init(GUIController guiController, ScrollPane panelsScrollPane) { this.guiController = guiController; this.panelsScrollPane = panelsScrollPane; restorePanels(); selectFirstPanel(); }
Source:
<code>protected void readOsSection(XmlNode section) { _vmTemplate.setId(new Guid(section.Attributes.get("ovf:id").getValue())); XmlNode node = section.SelectSingleNode("Description"); if (node != null) { <START> _vmTemplate.setOs(Integer.valueOf(node.InnerText)); <END> } else { _vmTemplate.setOs(0); } }</code><technical_language>images int a string representing VmOsType</technical_language>

Target:
protected void readOsSection(XmlNode section) { _vmTemplate.setId(new Guid(section.Attributes.get("ovf:id").getValue())); XmlNode node = section.SelectSingleNode("Description"); if (node != null) { _vmTemplate.setOs(OsRepositoryImpl.INSTANCE.getOsIdByUniqueName(node.InnerText)); } }
Source:
<code>public String getInput() { Serializable input = getProperty(RetentionConstants.INPUT_PROPERTY_KEY); if (input instanceof String) { <START> return (String) input; <END> } return null; }</code><technical_language>i wondering if cast instead of check ( return (String)getProperty(RetentionConstants.INPUT_PROPERTY_KEY))if type is a string, i find ourself a consistent data this code returns null setInput do insertion correctly</technical_language>

Target:
public String getInput() { return (String) getProperty(RetentionConstants.INPUT_PROPERTY_KEY); }
Source:
<code>public FormValidation doCreateTokenByCredentials( @QueryParameter String apiUrl, @QueryParameter String credentialsId) { Jenkins.getActiveInstance().checkPermission(Jenkins.ADMINISTER); if (isEmpty(credentialsId)) { return FormValidation.error("Please specify credentials to create token"); } StandardUsernamePasswordCredentials creds = firstOrNull(lookupCredentials( StandardUsernamePasswordCredentials.class, Jenkins.getInstance(), ACL.SYSTEM, fromUri(defaultIfBlank(apiUrl, GITHUB_URL)).build()), withId(credentialsId)); if (creds == null) { creds = firstOrNull(lookupCredentials( StandardUsernamePasswordCredentials.class, Jenkins.getInstance(), Jenkins.getAuthentication(), fromUri(defaultIfBlank(apiUrl, GITHUB_URL)).build()), withId(credentialsId)); } GHAuthorization token; if (null == creds) { return FormValidation.error("Can't create GH token - credentials are null."); } try { token = createToken( creds.getUsername(), Secret.toString(creds.getPassword()), defaultIfBlank(apiUrl, GITHUB_URL) ); <START> } catch (Exception e) { <END> return FormValidation.error(e, "Can't create GH token - %s", e.getMessage()); } StandardCredentials credentials = createCredentials(apiUrl, token.getToken(), creds.getUsername()); return FormValidation.ok("Created credentials with id %s (can use it for GitHub Server Config)", credentials.getId()); }</code><technical_language>why</technical_language>

Target:
public FormValidation doCreateTokenByCredentials( @QueryParameter String apiUrl, @QueryParameter String credentialsId) { Jenkins.getActiveInstance().checkPermission(Jenkins.ADMINISTER); if (isEmpty(credentialsId)) { return FormValidation.error("Please specify credentials to create token"); } StandardUsernamePasswordCredentials creds = firstOrNull(lookupCredentials( StandardUsernamePasswordCredentials.class, Jenkins.getInstance(), ACL.SYSTEM, fromUri(defaultIfBlank(apiUrl, GITHUB_URL)).build()), withId(credentialsId)); if (creds == null) { creds = firstOrNull(lookupCredentials( StandardUsernamePasswordCredentials.class, Jenkins.getInstance(), Jenkins.getAuthentication(), fromUri(defaultIfBlank(apiUrl, GITHUB_URL)).build()), withId(credentialsId)); } GHAuthorization token; if (Objects.isNull(creds)) { return FormValidation.error("Can't create GH token - credentials are null."); } try { token = createToken( creds.getUsername(), Secret.toString(creds.getPassword()), defaultIfBlank(apiUrl, GITHUB_URL) ); } catch (IOException e) { return FormValidation.error(e, "Can't create GH token - %s", e.getMessage()); } StandardCredentials credentials = createCredentials(apiUrl, token.getToken(), creds.getUsername()); return FormValidation.ok("Created credentials with id %s (can use it for GitHub Server Config)", credentials.getId()); }
Source:
<code>public List<Token> getTokensOf(TokenType... types) { if (typeToTokensMap == null) { typeToTokensMap = Maps.newHashMap(); for (Token token : tokens) { List<Token> subtokens = typeToTokensMap.get(token.getType()); if (subtokens == null) { subtokens = Lists.newArrayList(token); typeToTokensMap.put(token.getType(), subtokens); } else { subtokens.add(token); } } } if (types.length == 1) { List<Token> tokens = typeToTokensMap.get(types[0]); <START> return (tokens != null) ? tokens : Lists.<Token>newArrayList(); <END> } List<Token> subtokens = Lists.newArrayList(); for (TokenType type : types) { List<Token> tokens = typeToTokensMap.get(type); subtokens.addAll((tokens != null) ? tokens : Lists.<Token>newArrayList()); } return subtokens; }</code><technical_language>return Collections.emptyList() instead</technical_language>

Target:
public List<Token> getTokensOf(TokenType... types) { if (typeToTokensMap == null) { typeToTokensMap = Maps.newHashMap(); for (Token token : tokens) { List<Token> subtokens = typeToTokensMap.get(token.getType()); if (subtokens == null) { subtokens = Lists.newArrayList(token); typeToTokensMap.put(token.getType(), subtokens); } else { subtokens.add(token); } } } if (types.length == 1) { List<Token> tokens = typeToTokensMap.get(types[0]); return (tokens != null) ? tokens : Collections.<Token>emptyList(); } List<Token> subtokens = Lists.newArrayList(); for (TokenType type : types) { List<Token> tokens = typeToTokensMap.get(type); if (tokens != null) { subtokens.addAll(tokens); } } return subtokens; }
Source:
<code><START> public static boolean hasDefaultModifier(Collection<Modifier> modifiers) { <END> for (Modifier m : modifiers) { if (m.name().equals("DEFAULT")) { return true; } } return false; }</code><technical_language>public</technical_language>

Target:
public static boolean hasDefaultModifier(Collection<Modifier> modifiers) { return DEFAULT != null && modifiers.contains(DEFAULT); }
Source:
<code><START> public static String providerIdToProviderName(@NonNull String providerId) { <END> switch (providerId) { case GoogleAuthProvider.PROVIDER_ID: return "Google"; case FacebookAuthProvider.PROVIDER_ID: return "Facebook"; case TwitterAuthProvider.PROVIDER_ID: return "Twitter"; case GithubAuthProvider.PROVIDER_ID: return "Github"; case PhoneAuthProvider.PROVIDER_ID: return "Phone number"; case EmailAuthProvider.PROVIDER_ID: case EMAIL_LINK_PROVIDER: return "Email"; default: return null; } }</code><technical_language>If this is meant for display in UI, pointing string resources works translation</technical_language>

Target:
public static String providerIdToProviderName(@NonNull String providerId) { switch (providerId) { case GoogleAuthProvider.PROVIDER_ID: return AuthUI.getApplicationContext().getString(R.string.fui_idp_name_google); case FacebookAuthProvider.PROVIDER_ID: return AuthUI.getApplicationContext().getString(R.string.fui_idp_name_facebook); case TwitterAuthProvider.PROVIDER_ID: return AuthUI.getApplicationContext().getString(R.string.fui_idp_name_twitter); case GithubAuthProvider.PROVIDER_ID: return AuthUI.getApplicationContext().getString(R.string.fui_idp_name_github); case PhoneAuthProvider.PROVIDER_ID: return AuthUI.getApplicationContext().getString(R.string.fui_idp_name_phone); case EmailAuthProvider.PROVIDER_ID: case EMAIL_LINK_PROVIDER: return AuthUI.getApplicationContext().getString(R.string.fui_idp_name_email); default: return null; } }
Source:
<code><START> private char forDigit(int digit) { <END> digit = digit & 0xF; return (char) (digit < 10 ? '0' + digit : 55 + digit); }</code><technical_language>static</technical_language>

Target:
private static char forDigit(int digit) { return CHAR_MAP[digit & 0xF]; }
Source:
<code><START> public void setSedModel(SedModel sedModel) { <END> this.sedModel = sedModel; }</code><technical_language>this function change sortedStarTable</technical_language>

Target:
public void setSedModel(SedModel sedModel) { this.sedModel = sedModel; updateSortedStarTable(); }
Source:
<code>public double sum(String colName) { <START> double[] colArray = toDoubleArray(colName); double arraySum = StatUtils.sum(colArray); return arraySum; <END> }</code><technical_language>return StatUtils. sum(toDoubleArray(colName)) directly</technical_language>

Target:
public double sum(String colName) { return StatUtils.sum(toDoubleArray(colName)); }
Source:
<code><START> public List<String> getReviews(String taskUrl) { <END> if (deserializationJob.getResult() == null) { String repositoryUrl = TasksUiPlugin.getRepositoryManager() .getConnectorForRepositoryTaskUrl(taskUrl) .getRepositoryUrlFromTaskUrl(taskUrl); deserialize(new File(getSaveFileName(), URLEncoder.encode(repositoryUrl))); } List<String> reviewUrls = taskReviewsMap.get(taskUrl); return reviewUrls == null ? new ArrayList<String>() : reviewUrls; }</code><technical_language>I a simply iterate this. need expose interface List. Return a Iterable<String> Consider renaming getReviewUrls is happening. "URL" semantics else in this class</technical_language>

Target:
public Collection<ITask> getReviews(String taskUrl) { if (deserializationJob.getResult() == null) { String repositoryUrl = repositoryManager.getConnectorForRepositoryTaskUrl(taskUrl) .getRepositoryUrlFromTaskUrl(taskUrl); deserialize(new File(getSaveFileName(), URLEncoder.encode(repositoryUrl))); } System.out.println(taskReviewsMap.size()); List<String> reviewUrls = taskReviewsMap.get(taskUrl); if (reviewUrls == null) { return Collections.emptyList(); } List<ITask> reviews = new ArrayList<ITask>(); for (String reviewUrl : reviewUrls) { AbstractRepositoryConnector connector = repositoryManager.getConnectorForRepositoryTaskUrl(reviewUrl); if (connector == null) { continue; } String repositoryUrl = connector.getRepositoryUrlFromTaskUrl(reviewUrl); String reviewId = connector.getTaskIdFromTaskUrl(reviewUrl); if (repositoryUrl == null || reviewId == null) { continue; } ITask review = taskList.getTask(repositoryUrl, reviewId); if (review != null) { reviews.add(review); } else { } } return reviews; }
Source:
<code><START> public void remove(TopicPartition topicPartition) { <END> removed.add(topicPartition); next.remove(topicPartition); sessionPartitions.remove(topicPartition); }</code><technical_language>a note FetchSessionHandler is consumer too, need separate implementations works for consumer too</technical_language>

Target:
public void remove(TopicPartition topicPartition) { if (sessionPartitions.remove(topicPartition) != null) { removed.add(topicPartition); } }
Source:
<code><START> protected Composite createWidgets(Composite parent, CDKServer cdkServer, FormToolkit toolkit) { <END> Composite composite = initializeSectionWidget(parent, toolkit); createChooseCredentialsWidgets(composite, toolkit); createEnvironmentWidgets(composite, toolkit, cdkServer); addRegistrationWidgets(parent, cdkServer, toolkit); return composite; }</code><technical_language>![MAJOR](<LINK_1> 'Severity: MAJOR') Add "@Override" annotation this method signature [![rule](<LINK_2>](<LINK_0></technical_language>

Target:
protected Composite createWidgets(Composite parent, CDKServer cdkServer, FormToolkit toolkit) { Composite composite = initializeSectionWidget(parent, toolkit); createChooseCredentialsWidgets(composite, toolkit); createEnvironmentWidgets(composite, toolkit, cdkServer); addRegistrationWidgets(composite, cdkServer, toolkit); return composite; }
Source:
<code>protected boolean validate() { StorageServerConnections paramConnection = getConnection(); if (StringUtils.isNotEmpty(paramConnection.getId())) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_STORAGE_CONNECTION_ID_NOT_EMPTY); } if (!isValidConnection(paramConnection)) { return false; } Guid storagePoolId = Guid.isNullOrEmpty(getParameters().getVdsId()) ? null : getVds().getStoragePoolId(); if (isConnWithSameDetailsExists(paramConnection, storagePoolId)) { String storageId = getDuplicateStorageDomainId(paramConnection, storagePoolId); String storageDomainName = getStorageDomainNameById(storageId); addValidationMessageVariable("storage", storageId); addValidationMessageVariable("storageDomainName", storageDomainName); return <START> failValidation(EngineMessage.ACTION_TYPE_FAILED_STORAGE_CONNECTION_NFS_ALREADY_EXISTS); <END> } if (!Guid.isNullOrEmpty(getParameters().getVdsId())) { if (getVds() == null) { return failValidation(EngineMessage.VDS_INVALID_SERVER_ID); } if (getVds().getStatus() != VDSStatus.Up) { return failValidation(EngineMessage.VDS_ADD_STORAGE_SERVER_STATUS_MUST_BE_UP); } } return true; }</code><technical_language>This error shown in case of ISCSI domain local no</technical_language>

Target:
protected boolean validate() { StorageServerConnections paramConnection = getConnection(); if (StringUtils.isNotEmpty(paramConnection.getId())) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_STORAGE_CONNECTION_ID_NOT_EMPTY); } if (!isValidConnection(paramConnection)) { return false; } Guid storagePoolId = Guid.isNullOrEmpty(getParameters().getVdsId()) ? null : getVds().getStoragePoolId(); if (isConnWithSameDetailsExists(paramConnection, storagePoolId)) { List<StorageServerConnections> storageServerConnections = null; String storageId = ""; String storageDomainName = ""; storageServerConnections = getConnWithSameDetailsExists(paramConnection, storagePoolId); if (storageServerConnections != null && storageServerConnections.size() > 0 ) { storageId = storageServerConnections.get(0).getId(); } if (getStorageDomainsByConnId(storageId) != null && getStorageDomainsByConnId(storageId).size() > 0) { if ( getStorageDomainsByConnId(storageId).get(0).getStorageStaticData() != null ) { storageDomainName = getStorageDomainsByConnId(storageId).get(0).getStorageStaticData().getName(); } } addValidationMessageVariable("storage", storageId); addValidationMessageVariable("storageDomainName", storageDomainName); return failValidation(EngineMessage.ACTION_TYPE_FAILED_STORAGE_CONNECTION_ALREADY_EXISTS_INFO); } if (!Guid.isNullOrEmpty(getParameters().getVdsId())) { if (getVds() == null) { return failValidation(EngineMessage.VDS_INVALID_SERVER_ID); } if (getVds().getStatus() != VDSStatus.Up) { return failValidation(EngineMessage.VDS_ADD_STORAGE_SERVER_STATUS_MUST_BE_UP); } } return true; }
Source:
<code>private void updateGpodnetPreferenceScreen() { final boolean loggedIn = GpodnetPreferences.loggedIn(); findPreference(PREF_GPODNET_LOGIN).setEnabled(!loggedIn); findPreference(PREF_GPODNET_SETLOGIN_INFORMATION).setEnabled(loggedIn); findPreference(PREF_GPODNET_SYNC).setEnabled(loggedIn); findPreference(PREF_GPODNET_FORCE_FULL_SYNC).setEnabled(loggedIn); findPreference(PREF_GPODNET_LOGOUT).setEnabled(loggedIn); findPreference(PREF_GPODNET_NOTIFICATIONS).setEnabled(loggedIn); if (loggedIn) { String format = getActivity().getString(R.string.pref_gpodnet_login_status); String summary = String.format(format, GpodnetPreferences.getUsername(), GpodnetPreferences.getDeviceID()); <START> findPreference(PREF_GPODNET_LOGOUT).setSummary(HtmlCompat.fromHtml(summary, HtmlCompat.FROM_HTML_MODE_LEGACY)); <END> updateLastGpodnetSyncReport(SyncService.isLastSyncSuccessful(getContext()), SyncService.getLastSyncAttempt(getContext())); } else { findPreference(PREF_GPODNET_LOGOUT).setSummary(null); } findPreference(PREF_GPODNET_HOSTNAME).setSummary(GpodnetPreferences.getHostname()); }</code><technical_language>This line is long, now. CircleCI complains :)</technical_language>

Target:
private void updateGpodnetPreferenceScreen() { final boolean loggedIn = GpodnetPreferences.loggedIn(); findPreference(PREF_GPODNET_LOGIN).setEnabled(!loggedIn); findPreference(PREF_GPODNET_SETLOGIN_INFORMATION).setEnabled(loggedIn); findPreference(PREF_GPODNET_SYNC).setEnabled(loggedIn); findPreference(PREF_GPODNET_FORCE_FULL_SYNC).setEnabled(loggedIn); findPreference(PREF_GPODNET_LOGOUT).setEnabled(loggedIn); findPreference(PREF_GPODNET_NOTIFICATIONS).setEnabled(loggedIn); if (loggedIn) { String format = getActivity().getString(R.string.pref_gpodnet_login_status); String summary = String.format(format, GpodnetPreferences.getUsername(), GpodnetPreferences.getDeviceID()); Spanned formattedSummary = HtmlCompat.fromHtml(summary, HtmlCompat.FROM_HTML_MODE_LEGACY); findPreference(PREF_GPODNET_LOGOUT).setSummary(formattedSummary); updateLastGpodnetSyncReport(SyncService.isLastSyncSuccessful(getContext()), SyncService.getLastSyncAttempt(getContext())); } else { findPreference(PREF_GPODNET_LOGOUT).setSummary(null); } findPreference(PREF_GPODNET_HOSTNAME).setSummary(GpodnetPreferences.getHostname()); }
Source:
<code>private boolean filterMaxSpeed(Position position, Position last) { if (filterMaxSpeed != 0 && last != null) { double distance = position.getDouble(Position.KEY_DISTANCE); long time = position.getFixTime().getTime() - last.getFixTime().getTime(); <START> return UnitsConverter.knotsFromMps(distance / (time / 1000.0)) > filterMaxSpeed; <END> } return false; }</code><technical_language>do need decimal point here</technical_language>

Target:
private boolean filterMaxSpeed(Position position, Position last) { if (filterMaxSpeed != 0 && last != null) { double distance = position.getDouble(Position.KEY_DISTANCE); double time = position.getFixTime().getTime() - last.getFixTime().getTime(); return UnitsConverter.knotsFromMps(distance / (time / 1000)) > filterMaxSpeed; } return false; }
Source:
<code>public Object instantiateItem(ViewGroup collection, int position) { <START> int resId = PAGE_READING_LISTS; <END> switch (position) { case PAGE_READING_LISTS: resId = R.id.list_of_lists_page; break; case PAGE_LIST_DETAIL: resId = R.id.list_detail_page; break; default: } return getView().findViewById(resId); }</code><technical_language>Is this a find/replace artifact? Semantically explicitly set 0. (I imagine initialized please IDE/checkstyle)</technical_language>

Target:
public Object instantiateItem(ViewGroup collection, int position) { int resId; switch (position) { case PAGE_LIST_DETAIL: resId = R.id.list_detail_page; break; case PAGE_READING_LISTS: default: resId = R.id.list_of_lists_page; break; } return getView().findViewById(resId); }
Source:
<code>private void drawWaypoints(UiDrawer uiDrawer, ArrayList<Waypoint> waypoints, SolCam cam, MapDrawer mapDrawer) { Vector2 camPos = cam.getPosition(); for (Waypoint waypoint : waypoints) { float closeness = 1 - waypoint.position.dst(camPos) / MAX_ICON_DIST; float size; if(closeness < 0.5f) { size = BORDER_ICON_SZ * 0.5f; } else { size = BORDER_ICON_SZ * closeness; } Vector2 position = new Vector2(); SolMath.toRel(waypoint.position, position, cam.getAngle(), camPos); <START> <END> float len = position.len(); float newLen = len - .25f * .3f; position.scl(newLen / len); if(cam.isRelVisible(position)) { continue; } float prefX = displayDimensions.getRatio() / 2 - size / 2; float prefY = .5f - size / 2; float dimensionsRatio = prefX / prefY; boolean prefXAxis = position.y == 0 || dimensionsRatio < SolMath.abs(position.x / position.y); float mul = SolMath.abs(prefXAxis ? (prefX / position.x) : (prefY / position.y)); position.scl(mul); position.add(displayDimensions.getRatio() /2, .5f); mapDrawer.drawWaypointIcon(size, position, mapDrawer.getWaypointTexture(), uiDrawer, waypoint.color); } }</code><technical_language>reason for newlines here</technical_language>

Target:
private void drawWaypoints(UiDrawer uiDrawer, ArrayList<Waypoint> waypoints, SolCam cam, MapDrawer mapDrawer) { Vector2 camPos = cam.getPosition(); for (Waypoint waypoint : waypoints) { float closeness = 1 - waypoint.position.dst(camPos) / MAX_ICON_DIST; float size; if (closeness < 0.5f) { size = BORDER_ICON_SZ * 0.5f; } else { size = BORDER_ICON_SZ * closeness; } Vector2 position = new Vector2(); SolMath.toRel(waypoint.position, position, cam.getAngle(), camPos); float len = position.len(); float newLen = len - (.25f * .3f); position.scl(newLen / len); if (cam.isRelVisible(position)) { continue; } float prefX = (displayDimensions.getRatio() - size) / 2; float prefY = .5f - size / 2; float dimensionsRatio = prefX / prefY; boolean prefXAxis = position.y == 0 || dimensionsRatio < SolMath.abs(position.x / position.y); float mul = SolMath.abs(prefXAxis ? (prefX / position.x) : (prefY / position.y)); position.scl(mul); position.add(displayDimensions.getRatio() / 2, .5f); mapDrawer.drawWaypointIcon(size, position, mapDrawer.getWaypointTexture(), uiDrawer, waypoint.color); } }
Source:
<code>public void setIgnoreEmptyResponses(boolean ignoreEmptyResponses) { <START> } <END></code><technical_language>This is a deprecation, right? changing behavior (ignoring setting advising requires-reply). I ok that, log a WARN refer migration guide??</technical_language>

Target:
public void setIgnoreEmptyResponses(boolean ignoreEmptyResponses) { if (logger.isWarnEnabled()) { logger.warn("'ignoreEmptyResponses' is no longer supported. " + "Use 'requiresReply = true' instead. " + "If it is necessary, configure some downstream Filter to skip empty string payloads."); } }
Source:
<code>public byte[] read(final int length) { try { return InputStreamUtils.readFully(inputStream, length); } catch (IOException e) { <START> throw new RuntimeException(e); <END> } }</code><technical_language>> RuntimeIOException</technical_language>

Target:
public byte[] read(final int length) { try { return InputStreamUtils.readFully(inputStream, length); } catch (IOException e) { throw new RuntimeIOException(e); } }
Source:
<code>protected int doWork() throws Exception { <START> try (Connection connection = ConnectionFactory.createConnection(getConf())) { <END> try (Admin admin = connection.getAdmin()) { admin.snapshot(new SnapshotDescription(snapshotName, tableName, snapshotType)); } } catch (Exception e) { System.err.println("failed to take the snapshot: " + e.getMessage()); return -1; } return 0; }</code><technical_language>A syntax sugar, do try multiple resources try (Connection connection = ConnectionFactory.createConnection(getConf()); Admin admin = connection.getAdmin()) { }</technical_language>

Target:
protected int doWork() throws Exception { try (Connection connection = ConnectionFactory.createConnection(getConf()); Admin admin = connection.getAdmin()) { admin.snapshot(new SnapshotDescription(snapshotName, tableName, snapshotType)); } catch (Exception e) { System.err.println("failed to take the snapshot: " + e.getMessage()); return -1; } return 0; }
Source:
<code>public static void assertEquality(Object one, Object two) { assertEquals(one, two); <START> assertEquals(two, one); <END> assertEquals(one.hashCode(), two.hashCode()); assertEquality(one); assertEquality(two); }</code><technical_language>assertNotNull run NPEs if pass null</technical_language>

Target:
public static void assertEquality(Object one, Object two) { checkNotNull(one, "Must provide a value"); checkNotNull(two, "Must provide a value"); assertEquals(one, two); assertEquals(two, one); assertEquals(one.hashCode(), two.hashCode()); assertEquality(one); assertEquality(two); }
Source:
<code>private Callback<Long> fetchAccountUpdateBodyCallback(CopyingAsyncWritableChannel channel) { return buildCallback(frontendMetrics.postAccountsReadRequestMetrics, bytesRead -> { updateAccounts(FrontendUtils.readJsonFromChannel(channel)); restResponseChannel.setHeader(RestUtils.Headers.DATE, new GregorianCalendar().getTime()); restResponseChannel.setHeader(RestUtils.Headers.CONTENT_LENGTH, 0); <START> finalCallback.onCompletion(null, null); <END> }, uri, LOGGER, finalCallback); }</code><technical_language>Correct if I wrong. If updateAccounts throws exception, handled? exception parameter is null in onCompletion ? question in GetAccountsHandler</technical_language>

Target:
private Callback<Long> fetchAccountUpdateBodyCallback(CopyingAsyncWritableChannel channel) { return buildCallback(frontendMetrics.postAccountsReadRequestMetrics, bytesRead -> { updateAccounts(readJsonFromChannel(channel)); restResponseChannel.setHeader(RestUtils.Headers.DATE, new GregorianCalendar().getTime()); restResponseChannel.setHeader(RestUtils.Headers.CONTENT_LENGTH, 0); finalCallback.onCompletion(null, null); }, uri, LOGGER, finalCallback); }
Source:
<code>public String getViewLabelPrefix() { if (!fType.equals(XmlAnalysisModuleType.PATTERN)) { return null; } <START> String viewLabel = TmfXmlStrings.EMPTY_STRING; <END> List<Element> head = TmfXmlUtils.getChildElements(fSourceElement, TmfXmlStrings.HEAD); if (head.size() == 1) { List<Element> labels = TmfXmlUtils.getChildElements(head.get(0), TmfXmlStrings.VIEW_LABEL_PREFIX); if (!labels.isEmpty()) { viewLabel = labels.get(0).getAttribute(TmfXmlStrings.VALUE); } } return viewLabel.equals(TmfXmlStrings.EMPTY_STRING) ? null : viewLabel; }</code><technical_language>a good opportunity remove "Latency" view name. view names Statistics, Table, etc. here, instead of empty string, put Latency default. view names "Contention Statistics", "Contention Table", instead of "Contention Latency Statistics" do think? Pattern analyses create segments, relate "latencies"</technical_language>

Target:
public @NonNull String getViewLabelPrefix() { if (!fType.equals(XmlAnalysisModuleType.PATTERN)) { return TmfXmlStrings.EMPTY_STRING; } String viewLabel = TmfXmlStrings.EMPTY_STRING; List<Element> head = TmfXmlUtils.getChildElements(fSourceElement, TmfXmlStrings.HEAD); if (head.size() == 1) { List<Element> labels = TmfXmlUtils.getChildElements(head.get(0), TmfXmlStrings.VIEW_LABEL_PREFIX); if (!labels.isEmpty()) { viewLabel = labels.get(0).getAttribute(TmfXmlStrings.VALUE); } } return viewLabel; }
Source:
<code>public void addL10nSubstitution(HTMLNode node, String key, String[] patterns, HTMLNode[] values) { List<HTMLNode> newContent = getL10nSubstitution(key, patterns, values); <START> if (newContent != null) { <END> node.addChildren(newContent); } }</code><technical_language>newContent is null definition of getL10nSubstitution</technical_language>

Target:
public void addL10nSubstitution(HTMLNode node, String key, String[] patterns, HTMLNode[] values) { List<HTMLNode> newContent = getHTMLWithSubstitutions(key, patterns, values); node.addChildren(newContent); }
Source:
<code>public static Error invalidParams(String message, Object params) { <START> return error(INVALID_PARAMS, String.format("Invalid params: %s", message), params); <END> }</code><technical_language>This message odd me. "Invalid params: <some message>"</technical_language>

Target:
public static Error invalidParams(String message, Object params) { return error(INVALID_PARAMS, String.format("Invalid parameters: %s", message), params); }
Source:
<code>@Override public boolean send(CarbonMessage carbonMessage, CarbonCallback carbonCallback) throws ClientConnectorException { <START> return false; <END> }</code><technical_language>in this method</technical_language>

Target:
public boolean send(CarbonMessage carbonMessage, CarbonCallback carbonCallback) throws ClientConnectorException { return false; }
Source:
<code>public PythonInterpreterInfo build(String target, Path venvDir){ LOG.info(String.format("Invoking the .venv builder with target %s at %s", target, venvDir)); try { Process process = new ProcessBuilder(executable.toString(), <START> "--target", target, <END> "--venv-dir", venvDir.toString(), "--pip" ).start(); process.waitFor(); BufferedReader output = new BufferedReader(new InputStreamReader(process.getInputStream())); LOG.info("Output of the .venv builder:"); output.lines().forEach(l -> LOG.info(" " + l)); PythonInterpreterInfo result = new PythonInterpreterInfo(); result.setBinary(venvDir.resolve("bin/python").toString()); result.setChroot(venvDir.toString()); return result; } catch(IOException | InterruptedException ie) { throw new RuntimeException("An error occurred while running the .venv builder", ie); } }</code><technical_language>want to/can't pass target specs import one? multiple times for project (once. target)</technical_language>

Target:
public PythonInterpreterInfo build(String target, Path venvDir) { LOG.info(String.format("Invoking the .venv builder with target %s at %s", target, venvDir)); try { GeneralCommandLine command = buildAndRunVenvBuilder(target, venvDir); final ProcessOutput processOutput = getProcessOutput(command); if(processOutput.checkSuccess(LOG)) { PythonInterpreterInfo result = new PythonInterpreterInfo(); result.setBinary(venvDir.resolve("bin/python").toString()); result.setChroot(venvDir.toString()); return result; } else { throw new RuntimeException(String.format("Failed to create a Python virtual environment in %s", venvDir)); } } catch(ExecutionException ee) { throw new RuntimeException("An error occurred while running the .venv builder", ee); } }
Source:
<code>public PointSensitivityBuilder presentValueSensitivity( ResolvedCdsIndex cdsIndex, CreditRatesProvider ratesProvider, LocalDate referenceDate, ReferenceData refData) { if (isExpired(cdsIndex, ratesProvider)) { return PointSensitivityBuilder.none(); } ResolvedCds cds = cdsIndex.toSingleNameCds(); LocalDate stepinDate = cds.getStepinDateOffset().adjust(ratesProvider.getValuationDate(), refData); LocalDate effectiveStartDate = cds.calculateEffectiveStartDate(stepinDate); double recoveryRate = underlyingPricer.recoveryRate(cds, ratesProvider); Triple<CreditDiscountFactors, LegalEntitySurvivalProbabilities, Double> rates = reduceDiscountFactors(cds, ratesProvider); double signedNotional = cds.getBuySell().normalize(cds.getNotional()); PointSensitivityBuilder protectionLegSensi = underlyingPricer.protectionLegSensitivity( cds, rates.getFirst(), rates.getSecond(), referenceDate, effectiveStartDate, recoveryRate) <START> .multipliedBy(signedNotional * rates.getThird()); <END> PointSensitivityBuilder riskyAnnuitySensi = underlyingPricer.riskyAnnuitySensitivity( cds, rates.getFirst(), rates.getSecond(), referenceDate, stepinDate, effectiveStartDate) .multipliedBy(-cds.getFixedRate() * signedNotional * rates.getThird()); return protectionLegSensi.combinedWith(riskyAnnuitySensi); }</code><technical_language>method arguments a method invoke result this, hard read, Suggest splitting line in get a local variable for underlying sensitivity</technical_language>

Target:
public PointSensitivityBuilder presentValueSensitivity( ResolvedCdsIndex cdsIndex, CreditRatesProvider ratesProvider, LocalDate referenceDate, ReferenceData refData) { if (isExpired(cdsIndex, ratesProvider)) { return PointSensitivityBuilder.none(); } ResolvedCds cds = cdsIndex.toSingleNameCds(); LocalDate stepinDate = cds.getStepinDateOffset().adjust(ratesProvider.getValuationDate(), refData); LocalDate effectiveStartDate = cds.calculateEffectiveStartDate(stepinDate); double recoveryRate = underlyingPricer.recoveryRate(cds, ratesProvider); Triple<CreditDiscountFactors, LegalEntitySurvivalProbabilities, Double> rates = reduceDiscountFactors(cds, ratesProvider); double signedNotional = cds.getBuySell().normalize(cds.getNotional()); PointSensitivityBuilder protectionLegSensi = underlyingPricer.protectionLegSensitivity( cds, rates.getFirst(), rates.getSecond(), referenceDate, effectiveStartDate, recoveryRate); protectionLegSensi = protectionLegSensi.multipliedBy(signedNotional * rates.getThird()); PointSensitivityBuilder riskyAnnuitySensi = underlyingPricer.riskyAnnuitySensitivity( cds, rates.getFirst(), rates.getSecond(), referenceDate, stepinDate, effectiveStartDate); riskyAnnuitySensi = riskyAnnuitySensi.multipliedBy(-cds.getFixedRate() * signedNotional * rates.getThird()); return protectionLegSensi.combinedWith(riskyAnnuitySensi); }
Source:
<code>public void beforeFormPresentMain() throws Exception { try (SandboxedInstance sandboxedInstance = getSandboxedInstance( <START> "org.talend.components.salesforce.runtime.SalesforceSourceOrSink", true)) { <END> SalesforceRuntimeSourceOrSink ss = (SalesforceRuntimeSourceOrSink) sandboxedInstance.getInstance(); ss.initialize(null, this); ValidationResult vr = ss.validate(null); if (vr.getStatus() == ValidationResult.Result.OK) { try { moduleNames = ss.getSchemaNames(null); } catch (Exception ex) { throw new ComponentException(ExceptionUtil.exceptionToValidationResult(ex)); } selectedModuleNames.setPossibleValues(moduleNames); getForm(Form.MAIN).setAllowBack(true); getForm(Form.MAIN).setAllowFinish(true); } else { throw new ComponentException(vr); } } }</code><technical_language>want create a public static final boolean USE_JMV_PROPS = true; call getSandboxInstance("xxx", USE_JMV_PROPS) is more explicit true false</technical_language>

Target:
public void beforeFormPresentMain() throws Exception { try (SandboxedInstance sandboxedInstance = getSandboxedInstance(SOURCE_OR_SINK_CLASS, USE_CURRENT_JVM_PROPS)) { SalesforceRuntimeSourceOrSink ss = (SalesforceRuntimeSourceOrSink) sandboxedInstance.getInstance(); ss.initialize(null, this); ValidationResult vr = ss.validate(null); if (vr.getStatus() == ValidationResult.Result.OK) { try { moduleNames = ss.getSchemaNames(null); } catch (Exception ex) { throw new ComponentException(ExceptionUtil.exceptionToValidationResult(ex)); } selectedModuleNames.setPossibleValues(moduleNames); getForm(Form.MAIN).setAllowBack(true); getForm(Form.MAIN).setAllowFinish(true); } else { throw new ComponentException(vr); } } }
Source:
<code>public void resolveVars(Map<String, String> variables, Map<String, String> env) { for (Map.Entry<String, String> entry : variables.entrySet()) { String value = Util.replaceMacro(entry.getValue(), env); entry.setValue(value); } boolean stopToResolveVars = false; int nbUnresolvedVar = 0; while (!stopToResolveVars) { int previousNbUnresolvedVar = nbUnresolvedVar; nbUnresolvedVar = 0; for (Map.Entry<String, String> entry : variables.entrySet()) { String key = entry.getKey(); String value = entry.getValue(); Map<String, String> resolveVariables = new HashMap<String, String>(variables); resolveVariables.remove(key); String newValue = Util.replaceMacro(value, resolveVariables); entry.setValue(newValue); boolean variableChanged = !newValue.equals(value); <START> if (variableChanged && isUnresolvedVar(newValue)) { <END> nbUnresolvedVar++; } } if (previousNbUnresolvedVar == nbUnresolvedVar) { stopToResolveVars = true; } } }</code><technical_language><code> variableChanged</code> is required here. For counter incremented properly if is unresolved variables</technical_language>

Target:
public void resolveVars(Map<String, String> variables, Map<String, String> env) { for (Map.Entry<String, String> entry : variables.entrySet()) { String value = Util.replaceMacro(entry.getValue(), env); entry.setValue(value); } boolean stopToResolveVars = false; int nbUnresolvedVar = 0; while (!stopToResolveVars) { int previousNbUnresolvedVar = nbUnresolvedVar; nbUnresolvedVar = 0; for (Map.Entry<String, String> entry : variables.entrySet()) { Map<String, String> resolveVariables = new HashMap<String, String>(variables); resolveVariables.remove(entry.getKey()); String value = Util.replaceMacro(entry.getValue(), resolveVariables); entry.setValue(value); if (isUnresolvedVar(value)) { nbUnresolvedVar++; } } if (previousNbUnresolvedVar == nbUnresolvedVar) { stopToResolveVars = true; } } }
Source:
<code>public String getDeviceManufacturer() { <START> return String.valueOf(Build.MANUFACTURER); <END> }</code><technical_language>String.valueOf is needed parameter a string, Build.Manufacturer/Model strings</technical_language>

Target:
public String getDeviceManufacturer() { return Build.MANUFACTURER; }
Source:
<code>public void addLogger() throws Exception { AddLogCategory addLogCategory = new AddLogCategory.Builder(TEST_LOGGER_NAME) .level(Level.OFF) .filter("match(\"filter\")") .setUseParentHandler(true) .build(); client.apply(addLogCategory); <START> assertTrue("logger wasn't created", ops.exists(TEST_LOGGER_ADDRESS)); <END> RemoveLogCategory removeLogger = new RemoveLogCategory(TEST_LOGGER_NAME); client.apply(removeLogger); assertFalse("logger wasn't deleted", ops.exists(TEST_LOGGER_ADDRESS)); }</code><technical_language>Please "should"-style assertion messages. e.g. "Logger created"</technical_language>

Target:
public void addLogger() throws Exception { LogCategoryCommand addLogCategory = LogCategoryCommand.add(TEST_LOGGER_NAME) .level(Level.OFF) .filter("match(\"filter\")") .setUseParentHandler(true) .build(); client.apply(addLogCategory); assertTrue("logger should be created", ops.exists(TEST_LOGGER_ADDRESS)); LogCategoryCommand removeLogger = LogCategoryCommand.remove(TEST_LOGGER_NAME); client.apply(removeLogger); assertFalse("logger should be deleted", ops.exists(TEST_LOGGER_ADDRESS)); }
Source:
<code>public SortedMap<String, List<String>> parseTopAndSecondLevelCategories(final String journalKey) throws IOException { String cacheKey = "topAndSecondLevelCategories:" + CacheParams.createKeyHash(journalKey); SortedMap<String, List<String>> categories = cache.get(cacheKey); if (categories == null) { categories = parseTopAndSecondLevelCategoriesWithoutCache(journalKey); <START> cache.put(cacheKey, (Serializable) categories); <END> } return categories; }</code><technical_language>a good time deal code repetition "get cache; if null, put in cache". A good caching library do this a callback. homegrown caching library. is some weird divergence (I why) org.ambraproject.rhombat.cache.Cache org.ambraproject.service.cache.Cache. Wombat Rhombat one, support callbacks. Ambra does, a ton of other junk want keep. trivial add Rhombat. is, talking like: java default <T extends Serializable> T getOrCompute(String key, Supplier<? extends T> supplier) { T = get(key); if (value == null) { = supplier.get(); put(key, value); } return value; } nontrivial part deploying a Rhombat upgrade making needs be, a pain broken builds. alternative, drop equivalent utility method in Wombat. good quickly check a reuse Wombat's existing caching logic, in CachedRemoteService.requestCached. main difference CachedRemoteService controls caching If-Modified-Since header, while this forklifted Ambra code wants cache results indefinitely, skipping request if is cached. I this difference is significant, reuse worth a rabbit hole</technical_language>

Target:
public SortedMap<String, List<String>> parseTopAndSecondLevelCategories(final String journalKey) throws IOException { String cacheKey = "topAndSecondLevelCategories:" + CacheParams.createKeyHash(journalKey); return CacheUtil.getOrCompute(cache, cacheKey, () -> parseTopAndSecondLevelCategoriesWithoutCache(journalKey)); }
Source:
<code>private void executeToolForImmutableTables(ConnectionQueryServices queryServices, ArrayList<String> immutableList) { boolean atLeastOneHasIndexes=false; for (String dataTableFullName : immutableList) { HashSet<String> indexes = tablesAndIndexes.get(dataTableFullName); <START> if (!(indexes.isEmpty() || atLeastOneHasIndexes)) { <END> atLeastOneHasIndexes = true; } try (Admin admin = queryServices.getAdmin()) { LOGGER.info("Executing " + operation + " of " + dataTableFullName + " (immutable)"); disableTable(admin, dataTableFullName, indexes); modifyTable(admin, dataTableFullName, indexes); } catch (IOException | SQLException e) { LOGGER.severe("Something went wrong while disabling or modifying immutable " + "table " + dataTableFullName+ " " + e); } } if (!(test || dryRun) && atLeastOneHasIndexes) { LOGGER.info("The input list has at least one immutable table with indexes, " + "waiting for " + (GLOBAL_INDEX_CHECKER_ENABLED_MAP_EXPIRATION_MIN + 1) + " minutes for client cache to expire"); try { Thread.sleep((GLOBAL_INDEX_CHECKER_ENABLED_MAP_EXPIRATION_MIN + 1) * 60 * 1000); } catch (InterruptedException e) { LOGGER.warning("Sleep before starting index rebuild is interrupted. " + e.getMessage()); } } for (String dataTableFullName : immutableList) { try (Admin admin = queryServices.getAdmin()) { HashSet<String> indexes = tablesAndIndexes.get(dataTableFullName); enableTable(admin, dataTableFullName, indexes); } catch (IOException | SQLException e) { LOGGER.severe("Something went wrong while enabling immutable table " + dataTableFullName + " " + e); } LOGGER.info("Completed " + operation + " of " + dataTableFullName + " (immutable)"); } }</code><technical_language>need "|| atLeastOneHasIndexes" here. If atLeastOneHasIndexes is true, need set true again</technical_language>

Target:
private long executeToolForImmutableTables(ConnectionQueryServices queryServices, ArrayList<String> immutableList) { LOGGER.info("Started " + operation + " for immutable tables"); for (String dataTableFullName : immutableList) { try (Admin admin = queryServices.getAdmin()) { HashSet<String> indexes = tablesAndIndexes.get(dataTableFullName); LOGGER.info("Executing " + operation + " of " + dataTableFullName + " (immutable)"); disableTable(admin, dataTableFullName, indexes); modifyTable(admin, dataTableFullName, indexes); } catch (IOException | SQLException e) { LOGGER.severe("Something went wrong while disabling " + "or modifying immutable table " + e); handleFailure(queryServices, dataTableFullName, immutableList); } } long startWaitTime = EnvironmentEdgeManager.currentTimeMillis(); return startWaitTime; }
Source:
<code>public void shouldNotFireAssignmentEventOnAssigneeChangesInDeleteListener() { BpmnModelInstance model = createModelWithTaskEventsRecorderOnAssignedUserTask(TRACKED_EVENTS, null, TaskListener.EVENTNAME_DELETE, <START> CandidateUserAssignment.class); <END> testRule.deploy(model); ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("process"); runtimeService.deleteProcessInstance(processInstance.getId(), "Canceled!"); LinkedList<String> orderedEvents = RecorderTaskListener.getOrderedEvents(); assertThat(orderedEvents.size()).isEqualTo(2); assertThat(orderedEvents.getFirst()).isEqualToIgnoringCase(TaskListener.EVENTNAME_CREATE); assertThat(orderedEvents.getLast()).isEqualToIgnoringCase(TaskListener.EVENTNAME_DELETE); }</code><technical_language>I suspect wanted listener assigns task, right? suggestion AssigneeAssignment.class);</technical_language>

Target:
public void shouldNotFireAssignmentEventOnAssigneeChangesInDeleteListener() { BpmnModelInstance model = createModelWithTaskEventsRecorderOnAssignedUserTask(TRACKED_EVENTS, null, TaskListener.EVENTNAME_DELETE, AssigneeAssignment.class); testRule.deploy(model); ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("process"); runtimeService.deleteProcessInstance(processInstance.getId(), "Canceled!"); LinkedList<String> orderedEvents = RecorderTaskListener.getOrderedEvents(); assertThat(orderedEvents.size()).isEqualTo(2); assertThat(orderedEvents.getFirst()).isEqualToIgnoringCase(TaskListener.EVENTNAME_CREATE); assertThat(orderedEvents.getLast()).isEqualToIgnoringCase(TaskListener.EVENTNAME_DELETE); }