auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private ModelAndView serveDebugPage() { ModelAndView mav = new ModelAndView(" <START> mav.addObject("environment", runtimeConfiguration.getEnvironment()); <END> mav.addObject("siteKeys", siteSet.getSiteKeys()); mav.addObject("mappingTable", buildMappingTable()); mav.addObject("themeTable", ImmutableList.copyOf(themeGraph.describe(siteSet))); try { mav.addObject("imageCode", getResourceAsBase64("/WEB-INF/themes/root/app/wombat.jpg")); } catch (IOException e) { log.error("Error displaying root page image", e); } return mav; }</code><technical_language>removed POC approot.ftl, do need this</technical_language>

Target:
private ModelAndView serveDebugPage() { ModelAndView mav = new ModelAndView(" mav.addObject("siteKeys", siteSet.getSiteKeys()); mav.addObject("mappingTable", buildMappingTable()); mav.addObject("themeTable", ImmutableList.copyOf(themeGraph.describe(siteSet))); try { mav.addObject("imageCode", getResourceAsBase64("/WEB-INF/themes/root/app/wombat.jpg")); } catch (IOException e) { log.error("Error displaying root page image", e); } return mav; }
Source:
<code>public boolean replace(String key, String oldValue, String newValue) { Assert.notNull(key, "'key' must not be null."); Assert.notNull(oldValue, "'oldValue' must not be null."); Assert.notNull(newValue, "'newValue' must not be null."); <START> Query query = new Query(Criteria.where("key").is(key)); <END> Update update = new Update(); update.set("value", newValue); WriteResult result = template.updateFirst(query, update, Datastore.class,collectionName); return result.isUpdateOfExisting(); }</code><technical_language>missed oldValue in criteria. replace contract in ConcurrentMap.replace</technical_language>

Target:
public boolean replace(String key, String oldValue, String newValue) { Assert.notNull(key, "'key' must not be null."); Assert.notNull(oldValue, "'oldValue' must not be null."); Assert.notNull(newValue, "'newValue' must not be null."); Query query = new Query(Criteria.where(ID_FIELD).is(key).and(VALUE).is(oldValue)); return template.updateFirst(query, Update.update(VALUE, newValue), collectionName) .isUpdateOfExisting(); }
Source:
<code>protected Object getReply(ResponseEntity<?> httpResponse) { if (this.expectReply) { HttpHeaders httpHeaders = httpResponse.getHeaders(); Map<String, Object> headers = this.headerMapper.toHeaders(httpHeaders); if (this.transferCookies) { this.doConvertSetCookie(headers); } AbstractIntegrationMessageBuilder<?> replyBuilder = null; if (httpResponse.hasBody()) { Object responseBody = httpResponse.getBody(); replyBuilder = (responseBody instanceof Message<?>) ? this.getMessageBuilderFactory().fromMessage((Message<?>) responseBody) : this.getMessageBuilderFactory().withPayload(responseBody); } else { replyBuilder = this.getMessageBuilderFactory().withPayload(httpResponse); } replyBuilder.setHeader(org.springframework.integration.http.HttpHeaders.STATUS_CODE, httpResponse.getStatusCode()); <START> return replyBuilder.copyHeaders(headers).build(); <END> } return null; }</code><technical_language>already, consider include fix for this well: <LINK_0></technical_language>

Target:
protected Object getReply(ResponseEntity<?> httpResponse) { if (this.expectReply) { HttpHeaders httpHeaders = httpResponse.getHeaders(); Map<String, Object> headers = this.headerMapper.toHeaders(httpHeaders); if (this.transferCookies) { this.doConvertSetCookie(headers); } AbstractIntegrationMessageBuilder<?> replyBuilder = null; if (httpResponse.hasBody()) { Object responseBody = httpResponse.getBody(); replyBuilder = (responseBody instanceof Message<?>) ? this.getMessageBuilderFactory().fromMessage((Message<?>) responseBody) : this.getMessageBuilderFactory().withPayload(responseBody); } else { replyBuilder = this.getMessageBuilderFactory().withPayload(httpResponse); } replyBuilder.setHeader(org.springframework.integration.http.HttpHeaders.STATUS_CODE, httpResponse.getStatusCode()); return replyBuilder.copyHeaders(headers); } return null; }
Source:
<code>public void testBuildCoordinatorStreamConfigWithJobName() { Map<String, String> mapConfig = new HashMap<>(); mapConfig.put("job.name", "testName"); mapConfig.put("job.id", "testId"); mapConfig.put("job.coordinator.system", "testSamza"); mapConfig.put("test.only", "nothing"); mapConfig.put("systems.testSamza.test", "test"); Config config = factory.buildCoordinatorStreamConfig(new MapConfig(mapConfig)); <START> assertEquals(config.get("systems.testSamza.test"), "test"); <END> assertEquals(config.get(JobConfig.JOB_NAME), "testName"); assertNull(config.get("test.only")); }</code><technical_language>please check full expected result? do this build expected Config manually compare output of buildCoordinatorStreamConfig</technical_language>

Target:
public void testBuildCoordinatorStreamConfigWithJobName() { Map<String, String> mapConfig = new HashMap<>(); mapConfig.put("job.name", "testName"); mapConfig.put("job.id", "testId"); mapConfig.put("job.coordinator.system", "testSamza"); mapConfig.put("test.only", "nothing"); mapConfig.put("systems.testSamza.test", "test"); Config config = factory.buildCoordinatorStreamConfig(new MapConfig(mapConfig)); Map<String, String> expectedMap = new HashMap<>(); expectedMap.put("job.name", "testName"); expectedMap.put("job.id", "testId"); expectedMap.put("systems.testSamza.test", "test"); expectedMap.put(JobConfig.JOB_COORDINATOR_SYSTEM, "testSamza"); expectedMap.put(JobConfig.MONITOR_PARTITION_CHANGE_FREQUENCY_MS, "300000"); assertEquals(config, new MapConfig(expectedMap)); }
Source:
<code>public Builder initialData(Realm.Transaction transaction) { <START> if (readOnly) { <END> throw new IllegalStateException("This Realm is marked as read-only. Read-only Realms cannot use initialData(Realm.Transaction)."); } initialDataTransaction = transaction; return this; }</code><technical_language>Check throw in Builder.build() instead. worth check this deal initialData() readOnly()</technical_language>

Target:
public Builder initialData(Realm.Transaction transaction) { initialDataTransaction = transaction; return this; }
Source:
<code>public String toString() { <START> return com.google.common.base.Objects.toStringHelper(this) <END> .add("super", super.toString()) .add("application", m_application) .toString(); }</code><technical_language>This is deprecated, MoreObjects.ToStringHelper(this) instead</technical_language>

Target:
public String toString() { return MoreObjects.toStringHelper(this) .add("m_application", m_application) .toString(); }
Source:
<code><START> public void collectionWithSameJobNameShouldTakeHighestJobNumber() throws Exception { <END> List<BuildResult> results = new ArrayList<BuildResult>(); results.add(new BuildResult(0, "", BuildStatus.STARTED, 1, "SameJob")); results.add(new BuildResult(1, "", BuildStatus.STARTED, 1, "SameJob")); TaskBuildStatusMapper mapper = new TaskBuildStatusMapper(results); TaskAttribute root = createRootAttribute(); mapper.applyTo(root); assertEquals(1, root.getAttributes().size()); assertNotNull(root.getAttribute("BUILD_RESULT-0")); int buildNumber = Integer.parseInt(root.getAttribute("BUILD_RESULT-0").getAttribute("NUMBER").getValue()); assertEquals(1, buildNumber); }</code><technical_language>tests check name url showing correctly in TaskData</technical_language>

Target:
public void collectionWithSameJobNameShouldTakeHighestJobNumber() throws Exception { List<BuildResult> results = new ArrayList<BuildResult>(); final String HUDSON_BUILD_URL = "<LINK_0>"; final String JOB_NAME = "SameJob"; results.add(new BuildResult(0, HUDSON_BUILD_URL, BuildStatus.STARTED, 1, JOB_NAME)); results.add(new BuildResult(1, HUDSON_BUILD_URL, BuildStatus.STARTED, 1, JOB_NAME)); TaskBuildStatusMapper mapper = new TaskBuildStatusMapper(results); TaskAttribute root = createRootAttribute(); mapper.applyTo(root); assertEquals(1, root.getAttributes().size()); assertNotNull(root.getAttribute("BUILD_RESULT-0")); TaskAttribute taskAttribute = root.getAttribute("BUILD_RESULT-0"); int buildNumber = Integer.parseInt(taskAttribute.getAttribute("NUMBER").getValue()); assertEquals(1, buildNumber); assertEquals(taskAttribute.getAttribute("JOB"), JOB_NAME); assertEquals(taskAttribute.getAttribute("URL"), HUDSON_BUILD_URL); }
Source:
<code>private static String unquote(String eTag) { <START> if (eTag.startsWith("\"") && eTag.endsWith("\"")) { <END> eTag = eTag.substring(1, eTag.length() - 1); } return eTag; }</code><technical_language>Check for eTag.length() >= 2</technical_language>

Target:
static String unquote(String eTag) { return QUOTED_STRING.matcher(eTag).replaceAll("$1"); }
Source:
<code>public <START> Iterable<Icon> getProjectIcons(String <END> project) { List<Icon> icons = Lists.newArrayList(); for (ProjectCustomIcon customIcon : projectIcons) { for (CustomIconInfo icon : customIcon.getIcons(project)) { icons.add(new Icon(icon.name, icon.path)); } } return icons; }</code><technical_language>return CustomIconInfo here? unneeded convert CustomIconInfo Icon convert Icon in ListProjects ProjectJson CustomIconInfo</technical_language>

Target:
public Iterable<CustomIconInfo> getProjectIcons(String project) { List<CustomIconInfo> icons = Lists.newArrayList(); for (ProjectCustomIcon customIcon : projectIcons) { for (CustomIconInfo icon : customIcon.getIcons(project)) { icons.add(icon); } } return icons; }
Source:
<code>public void dispose() { historyPage.removePropertyChangeListener(this); <START> if (dialog != null) <END> dialog.close(); }</code><technical_language>missing braces</technical_language>

Target:
public void dispose() { historyPage.removePropertyChangeListener(this); if (dialog != null) { dialog.close(); } }
Source:
<code>public View getView(int pos, View convertView, ViewGroup parent) { if (convertView == null) { convertView = getLayoutInflater().inflate(R.layout.item_usercontribs_entry, parent, false); } TextView titleText = (TextView) convertView.findViewById(R.id.user_contrib_item_page_name); TextView summaryText = (TextView) convertView.findViewById(R.id.user_contrib_item_edit_summary); TextView timeAgoText = (TextView) convertView.findViewById(R.id.user_contrib_item_time_ago); PageHistoryItem item = (PageHistoryItem) getItem(pos); titleText.setText(item.getTitle().getDisplayText()); <START> summaryText.setText(Html.fromHtml(item.getSummary())); <END> timeAgoText.setText(Utils.formatDateRelative(item.getTimestamp())); if (summaryText.getText().length() == 0) { summaryText.setVisibility(View.GONE); } else { summaryText.setVisibility(View.VISIBLE); } return convertView; }</code><technical_language>item.getSummary() returns unparsed text, HTML..</technical_language>

Target:
public View getView(int pos, View convertView, ViewGroup parent) { if (convertView == null) { convertView = getLayoutInflater().inflate(R.layout.item_usercontribs_entry, parent, false); } TextView titleText = (TextView) convertView.findViewById(R.id.user_contrib_item_page_name); TextView summaryText = (TextView) convertView.findViewById(R.id.user_contrib_item_edit_summary); TextView timeAgoText = (TextView) convertView.findViewById(R.id.user_contrib_item_time_ago); PageHistoryItem item = (PageHistoryItem) getItem(pos); titleText.setText(item.getTitle().getDisplayText()); summaryText.setText(item.getSummary()); timeAgoText.setText(Utils.formatDateRelative(item.getTimestamp())); if (summaryText.getText().length() == 0) { summaryText.setVisibility(View.GONE); } else { summaryText.setVisibility(View.VISIBLE); } return convertView; }
Source:
<code>private List<AccountInfo> suggestAccountFullTextSearch( VisibilityControl visibilityControl) throws OrmException { String str = query.toLowerCase(); LinkedHashMap<Account.Id, AccountInfo> accountMap = Maps.newLinkedHashMap(); List<Account> fullNameMatches = Lists.newArrayList(); List<Account> emailMatches = Lists.newArrayList(); for (Account a : dbProvider.get().accounts().all()) { <START> if (a.getFullName() != null && a.getFullName().toLowerCase().contains(str)) { fullNameMatches.add(a); } <END> if (fullNameMatches.size() >= MAX_MATCHES) { break; } if (a.getPreferredEmail() != null && emailMatches.size() < MAX_MATCHES && a.getPreferredEmail().toLowerCase().contains(str)) { emailMatches.add(a); } } for (Account a : fullNameMatches) { addSuggestion(accountMap, a, new AccountInfo(a.getId()), visibilityControl); if (accountMap.size() >= limit) { break; } } if (accountMap.size() < limit) { for (Account a : emailMatches) { addSuggestion(accountMap, a, new AccountInfo(a.getId()), visibilityControl); if (accountMap.size() >= limit) { break; } } } return Lists.newArrayList(accountMap.values()); }</code><technical_language>if (a.getFullName() != null && a.getFullName().toLowerCase().contains(str)) { fullNameMatches.add(a); }else if(a.getPreferredEmail() != null && emailMatches.size() < MAX_MATCHES && a.getPreferredEmail().toLowerCase().contains(str)) { emailMatches.add(a); }</technical_language>

Target:
private List<AccountInfo> suggestAccountFullTextSearch( VisibilityControl visibilityControl) throws OrmException { String str = query.toLowerCase(); LinkedHashMap<Account.Id, AccountInfo> accountMap = Maps.newLinkedHashMap(); List<Account> fullNameMatches = Lists.newArrayList(); List<Account> emailMatches = Lists.newArrayList(); for (Account a : dbProvider.get().accounts().all()) { if (a.getFullName() != null && a.getFullName().toLowerCase().contains(str)) { fullNameMatches.add(a); }else if (a.getPreferredEmail() != null && emailMatches.size() < MAX_MATCHES && a.getPreferredEmail().toLowerCase().contains(str)) { emailMatches.add(a); } if (fullNameMatches.size() >= MAX_MATCHES) { break; } } for (Account a : fullNameMatches) { addSuggestion(accountMap, a, new AccountInfo(a.getId()), visibilityControl); if (accountMap.size() >= limit) { break; } } if (accountMap.size() < limit) { for (Account a : emailMatches) { addSuggestion(accountMap, a, new AccountInfo(a.getId()), visibilityControl); if (accountMap.size() >= limit) { break; } } } return Lists.newArrayList(accountMap.values()); }
Source:
<code>public int hashCode() { <START> return getRepositoryName() != null ? getRepositoryName().hashCode() : <END> System.identityHashCode(this); }</code><technical_language>Style-nit: This is hard read. Maybe: if (getRepositoryName() != null) return getRepositoryName().hashCode(); return System.identityHashCode(this);</technical_language>

Target:
public int hashCode() { if (getRepositoryName() != null) return getRepositoryName().hashCode(); return System.identityHashCode(this); }
Source:
<code>protected boolean validate() { if (!(getSourceVmFromDb().getStatus() == VMStatus.Suspended || getSourceVmFromDb().isDown())) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN); } DiskImagesValidator diskImagesValidator = new DiskImagesValidator(diskImagesFromConfiguration); <START> validate(diskImagesValidator.diskImagesNotIllegal()); <END> return super.validate(); }</code><technical_language>need for if (!validate(diskImagesValidator.diskImagesNotIllegal()) { ... }</technical_language>

Target:
protected boolean validate() { if (!(getSourceVmFromDb().getStatus() == VMStatus.Suspended || getSourceVmFromDb().isDown())) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN); } DiskImagesValidator diskImagesValidator = new DiskImagesValidator(diskImagesFromConfiguration); if (!validate(diskImagesValidator.diskImagesNotIllegal())) { return false; } return super.validate(); }
Source:
<code>protected List<VmDevice> getRngDevices() { <START> return getVmDeviceDao().getVmDeviceByVmIdAndType(getParameters().getRngDevice().getVmId(), <END> VmDeviceGeneralType.RNG); }</code><technical_language>nice cache result call in remove</technical_language>

Target:
protected List<VmDevice> getRngDevices() { return cachedRngDevices; }
Source:
<code>private List<DeepLinkAnnotatedElement> generateCustomDeepLinkAnnotatedElements(Element element, DeepLinkEntry.Type type, Map<Element, String[]> prefixesMap) { List<DeepLinkAnnotatedElement> deepLinkElements = new ArrayList<>(); Set<? extends AnnotationMirror> annotationMirrors = AnnotationMirrors.getAnnotatedAnnotations(element, DEEP_LINK_SPEC_CLASS); for (AnnotationMirror customAnnotation : annotationMirrors) { List<? extends AnnotationValue> suffixes = asAnnotationValues(AnnotationMirrors.getAnnotationValue(customAnnotation, "value")); String[] prefixesArray = prefixesMap.get(customAnnotation.getAnnotationType().asElement()); try { for (AnnotationValue suffix : suffixes) { deepLinkElements.add(new DeepLinkAnnotatedElement(suffix.getValue().toString(), element, type, prefixesArray)); } } catch (MalformedURLException e) { <START> e.printStackTrace(); <END> } } return deepLinkElements; }</code><technical_language>want throw annotation processing error instead of printing stack trace</technical_language>

Target:
private List<DeepLinkAnnotatedElement> generateCustomDeepLinkAnnotatedElements(Element element, DeepLinkEntry.Type type, Map<Element, String[]> prefixesMap) { List<DeepLinkAnnotatedElement> deepLinkElements = new ArrayList<>(); Set<? extends AnnotationMirror> annotationMirrors = AnnotationMirrors.getAnnotatedAnnotations(element, DEEP_LINK_SPEC_CLASS); for (AnnotationMirror customAnnotation : annotationMirrors) { List<? extends AnnotationValue> suffixes = asAnnotationValues(AnnotationMirrors.getAnnotationValue(customAnnotation, "value")); String[] prefixesArray = prefixesMap.get(customAnnotation.getAnnotationType().asElement()); for (AnnotationValue suffix : suffixes) { try { deepLinkElements.add(new DeepLinkAnnotatedElement(suffix.getValue().toString(), element, type, prefixesArray)); } catch (MalformedURLException e) { messager.printMessage(Diagnostic.Kind.ERROR, "Malformed Deep Link URL " + suffix.getValue()); } } } return deepLinkElements; }
Source:
<code>private String getYearFromStudy(final int studyIdentifier) { <START> return this.studyDataManager.getProjectStartDateByProjectId(studyIdentifier).substring(0, 4); <END> }</code><technical_language>@mderamos, Add code check if is null substring</technical_language>

Target:
String getYearFromStudy(final int studyIdentifier) { final String startDate = this.studyDataManager.getProjectStartDateByProjectId(studyIdentifier); if(startDate != null) { return startDate.substring(0, 4); } return startDate; }
Source:
<code>T get() { try { return this.future.get(); <START> } catch (Exception e) { <END> e.printStackTrace(); Assert.fail("Exception occured in operation: " + getOperationName() + ", exception: " + e); return null; } }</code><technical_language>@vgkholla a good practice is unexpected exception, simply throw cooking it</technical_language>

Target:
T get() throws Exception { try { return future.get(AWAIT_TIMEOUT, TimeUnit.SECONDS); } catch (Exception e) { throw new Exception("Exception occured in operation: " + getOperationName(), e); } }
Source:
<code>public void testListenInvalidPort() { final int port = 9090; final HttpServer httpServer = vertx.createHttpServer(); <START> httpServer.requestHandler(r -> {}).listen(port, httpResult -> { <END> server.close(); server = vertx.createNetServer(new NetServerOptions().setPort(port)); server.connectHandler((netSocket) -> { }).listen(ar -> { if(httpResult.succeeded()) { httpServer.close(); } assertTrue(ar.failed()); assertFalse(ar.succeeded()); assertNotNull(ar.cause()); testComplete(); }); }); await(); }</code><technical_language>onSuccess / onFailure lambdas improve test</technical_language>

Target:
public void testListenInvalidPort() { final int port = 9090; final HttpServer httpServer = vertx.createHttpServer(); try { httpServer.requestHandler(ignore -> {}) .listen(port, onSuccess(s -> vertx.createNetServer() .connectHandler(ignore -> {}) .listen(port, onFailure(error -> { assertNotNull(error); testComplete(); })))); await(); } finally { httpServer.close(); } }
Source:
<code>public void close() throws IOException { <START> LOG.info("Processing remaining requests [docs = " + bulkDocs <END> + ", length = " + bulkLength + ", total docs = " + indexedDocs + "]"); createNewBulk = false; commit(); LOG.info("Processing to finalize last execute"); createNewBulk = false; commit(); client.shutdownClient(); }</code><technical_language>Patametrrized logging please</technical_language>

Target:
public void close() throws IOException { LOG.info( "Processing remaining requests [docs = {}, length = {}, total docs = {}]", bulkDocs, bulkLength, indexedDocs); createNewBulk = false; commit(); LOG.info("Processing to finalize last execute"); createNewBulk = false; commit(); client.shutdownClient(); }
Source:
<code><START> public String toString() { <END> return "bytes=" + start + "-" + end; }</code><technical_language>end is optional this need update I</technical_language>

Target:
public String toString() { String endString = Objects.toString(end); return "bytes=" + String.valueOf(start) + "-" + endString; }
Source:
<code>public void preprocess(DataSetLookup lookup) { if (identityProvider == null) { return; } boolean hasBusinessAdminRights = identityProvider.getRoles().stream().filter(s -> s.equals(ADMIN_GROUP)).findFirst().isPresent(); if (!hasBusinessAdminRights) { hasBusinessAdminRights = ADMIN_USER.equals(identityProvider.getName()); } <START> if (hasBusinessAdminRights) { <END> return; } final ColumnFilter columnFilter = equalsTo(COLUMN_TASKID, -1); LOGGER.debug("Adding column filter: {}", columnFilter); if (lookup.getFirstFilterOp() != null) { lookup.getFirstFilterOp().addFilterColumn(columnFilter); } else { DataSetFilter filter = new DataSetFilter(); filter.addFilterColumn(columnFilter); lookup.addOperation(filter); } }</code><technical_language>replacing this logic a simple OR? lines of: java if (ADMIN_USER.equals(identityProvider.getName() || identityProvider.getRoles().stream().anyMatch(s -> s.equals(ADMIN_GROUP))) { return; }</technical_language>

Target:
public void preprocess(DataSetLookup lookup) { if (identityProvider == null) { return; } if (ADMIN_USER.equals(identityProvider.getName()) || identityProvider.getRoles().stream().filter(s -> s.equals(ADMIN_GROUP)).findFirst().isPresent()) { return; } final ColumnFilter columnFilter = equalsTo(COLUMN_TASKID, -1); LOGGER.debug("Adding column filter: {}", columnFilter); if (lookup.getFirstFilterOp() != null) { lookup.getFirstFilterOp().addFilterColumn(columnFilter); } else { DataSetFilter filter = new DataSetFilter(); filter.addFilterColumn(columnFilter); lookup.addOperation(filter); } }
Source:
<code>public int hashCode() { <START> return toString().hashCode(); <END> }</code><technical_language>slow of computing a hash code, important for Line</technical_language>

Target:
public int hashCode() { return commit.hashCode() ^ blob.hashCode(); }
Source:
<code>private void configureMappingRouter(AbstractMappingMessageRouter router) { if (this.channelMappings != null) { router.setChannelMappings(this.channelMappings); } if (this.resolutionRequired != null) { router.setResolutionRequired(this.resolutionRequired); } else { <START> router.setResolutionRequired(true); <END> } if (this.channelResolver != null) { logger.warn("'channel-resolver' attribute has been deprecated in favor of using SpEL via 'expression' attribute"); router.setChannelResolver(this.channelResolver); } }</code><technical_language>curious this call needed added AbstractMappingMessageRouter has: private volatile boolean resolutionRequired = true;</technical_language>

Target:
private void configureMappingRouter(AbstractMappingMessageRouter router) { if (this.channelMappings != null) { router.setChannelMappings(this.channelMappings); } if (this.resolutionRequired != null) { router.setResolutionRequired(this.resolutionRequired); } if (this.channelResolver != null) { logger.warn("'channel-resolver' attribute has been deprecated in favor of using SpEL via 'expression' attribute"); router.setChannelResolver(this.channelResolver); } }
Source:
<code>protected void onCreate(final Bundle savedInstanceState) { assureCorrectAppLanguage(this); super.onCreate(savedInstanceState); ThemeHelper.setTheme(this); this.setTitle(getString(R.string.title_activity_about)); setContentView(R.layout.activity_about); Toolbar toolbar = findViewById(R.id.toolbar); setSupportActionBar(toolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true); mViewPager = findViewById(R.id.container); Configuration config = getResources().getConfiguration(); <START> boolean isRTL = config.getLayoutDirection() == View.LAYOUT_DIRECTION_RTL; <END> mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager(), isRTL); mViewPager.setAdapter(mSectionsPagerAdapter); TabLayout tabLayout = findViewById(R.id.tabs); tabLayout.setupWithViewPager(mViewPager); if (isRTL) { tabLayout.getTabAt(mSectionsPagerAdapter.getCount() - 1).select(); } }</code><technical_language>this method is duplicated thrice, a static util method boolean isRTL(Context context) context.getResources()</technical_language>

Target:
protected void onCreate(final Bundle savedInstanceState) { assureCorrectAppLanguage(this); super.onCreate(savedInstanceState); ThemeHelper.setTheme(this); this.setTitle(getString(R.string.title_activity_about)); setContentView(R.layout.activity_about); Toolbar toolbar = findViewById(R.id.toolbar); setSupportActionBar(toolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true); mViewPager = findViewById(R.id.container); boolean isRTL = LocalizeLayoutUtils.isRTL(this); mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager(), isRTL); mViewPager.setAdapter(mSectionsPagerAdapter); TabLayout tabLayout = findViewById(R.id.tabs); tabLayout.setupWithViewPager(mViewPager); if (isRTL) { tabLayout.getTabAt(mSectionsPagerAdapter.getCount() - 1).select(); } }
Source:
<code>private Table getTable(String eventName, String className) throws Exception { Table tmp; try { tmp = client.getTable(database, eventName); } catch (HiveException e) { <START> tmp = createTable(eventName, className); <END> } return tmp; }</code><technical_language>I a tableexists check instead of catching HiveException. HiveException other reason metastore is</technical_language>

Target:
private Table getTable(String eventName, String className) throws Exception { Table tmp = null; try { tmp = client.getTable(database, eventName, false); if(tmp == null) { tmp = createTable(eventName, className); } } catch (HiveException e) { LOG.warn("Exception thrown while creating the table", e); } return tmp; }
Source:
<code>public final void visitBinaryExpression(BinaryExpressionTree tree) { if (tree.is(Tree.Kind.CONDITIONAL_AND)) { evaluateConditionalAnd(tree); } else if (tree.is(Tree.Kind.CONDITIONAL_OR)) { evaluateConditionalOr(tree); } else if (tree.is(Tree.Kind.EQUAL_TO)) { evaluateRelationalOperator(tree, SymbolicRelation.EQUAL_TO); } else if (tree.is(Tree.Kind.GREATER_THAN)) { evaluateRelationalOperator(tree, SymbolicRelation.GREATER_THAN); } else if (tree.is(Tree.Kind.GREATER_THAN_OR_EQUAL_TO)) { evaluateRelationalOperator(tree, SymbolicRelation.GREATER_EQUAL); } else if (tree.is(Tree.Kind.LESS_THAN)) { evaluateRelationalOperator(tree, SymbolicRelation.LESS_THAN); } else if (tree.is(Tree.Kind.LESS_THAN_OR_EQUAL_TO)) { evaluateRelationalOperator(tree, SymbolicRelation.LESS_EQUAL); <START> } else if (tree.is(Tree.Kind.NOT_EQUAL_TO)) { <END> evaluateRelationalOperator(tree, SymbolicRelation.NOT_EQUAL); } else { super.visitBinaryExpression(tree); for (ExecutionState executionState : currentStates) { executionState.pop(); executionState.pop(); executionState.push(createSymbolicInstanceValue()); } } }</code><technical_language>@merciesa if values dense, switch enum faster sequence of if-else-if</technical_language>

Target:
public final void visitBinaryExpression(BinaryExpressionTree tree) { Tree.Kind kind = ((JavaTree) tree).getKind(); SymbolicRelation relation = OPERATOR_TO_RELATION.get(kind); if (relation != null) { evaluateRelationalOperator(tree, relation); } else { switch (kind) { case CONDITIONAL_AND: evaluateConditionalAnd(tree); break; case CONDITIONAL_OR: evaluateConditionalOr(tree); break; default: evaluateBinaryExpressionOther(tree); break; } } }
Source:
<code>public void treatFailedCachedActionAsCacheMiss_remote() throws Exception { options.remoteAcceptCached = true; options.remoteLocalFallback = false; options.remoteUploadLocalResults = true; options.remoteResultCachePriority = 1; <START> options.remoteExecutionPriority = 2; <END> ActionResult failedAction = ActionResult.newBuilder().setExitCode(1).build(); when(cache.getCachedActionResult(any(ActionKey.class))).thenReturn(failedAction); RemoteSpawnRunner runner = new RemoteSpawnRunner( execRoot, options, Options.getDefaults(ExecutionOptions.class), new AtomicReference<>(localRunner), true, null, "build-req-id", "command-id", cache, executor, retrier, digestUtil, logDir); ExecuteResponse succeeded = ExecuteResponse.newBuilder().setResult( ActionResult.newBuilder().setExitCode(0).build()).build(); when(executor.executeRemotely(any(ExecuteRequest.class))).thenReturn(succeeded); Spawn spawn = new SimpleSpawn( new FakeOwner("foo", "bar"), ImmutableList.of(), ImmutableMap.of(), NO_CACHE, ImmutableList.of(), ImmutableList.<ActionInput>of(), ResourceSet.ZERO); SpawnExecutionContext policy = new FakeSpawnExecutionContext(spawn); runner.exec(spawn, policy); ArgumentCaptor<ExecuteRequest> requestCaptor = ArgumentCaptor.forClass(ExecuteRequest.class); verify(executor).executeRemotely(requestCaptor.capture()); assertThat(requestCaptor.getValue().getSkipCacheLookup()).isTrue(); assertThat(requestCaptor.getValue().getResultsCachePolicy().getPriority()).isEqualTo(1); assertThat(requestCaptor.getValue().getExecutionPolicy().getPriority()).isEqualTo(2); }</code><technical_language>I cache execution priority important for this test, no</technical_language>

Target:
public void treatFailedCachedActionAsCacheMiss_remote() throws Exception { ActionResult failedAction = ActionResult.newBuilder().setExitCode(1).build(); when(cache.getCachedActionResult(any(ActionKey.class))).thenReturn(failedAction); RemoteSpawnRunner runner = new RemoteSpawnRunner( execRoot, options, Options.getDefaults(ExecutionOptions.class), new AtomicReference<>(localRunner), true, null, "build-req-id", "command-id", cache, executor, retrier, digestUtil, logDir); ExecuteResponse succeeded = ExecuteResponse.newBuilder().setResult( ActionResult.newBuilder().setExitCode(0).build()).build(); when(executor.executeRemotely(any(ExecuteRequest.class))).thenReturn(succeeded); Spawn spawn = newSimpleSpawn(); SpawnExecutionContext policy = new FakeSpawnExecutionContext(spawn); runner.exec(spawn, policy); ArgumentCaptor<ExecuteRequest> requestCaptor = ArgumentCaptor.forClass(ExecuteRequest.class); verify(executor).executeRemotely(requestCaptor.capture()); assertThat(requestCaptor.getValue().getSkipCacheLookup()).isTrue(); }
Source:
<code>private void configureManagementNetwork() { final NetworkConfigurator networkConfigurator = new NetworkConfigurator(getVds()); <START> if (networkConfigurator.awaitVdsmResponse()) { <END> try { networkConfigurator.refreshNetworkConfiguration(); networkConfigurator.createManagementNetworkIfRequired(); } catch (VDSNetworkException e) { throw new VdsInstallException(VDSStatus.NonResponsive, "Network error during communication with the host"); } catch (VdsInstallException e) { throw new VdsInstallException(VDSStatus.NonOperational, "Failed to configure manamgent network on the host"); } } else { throw new VdsInstallException(VDSStatus.NonResponsive, "Network error during communication with the host"); } }</code><technical_language>Structural of exceptional parameters: if (failure) { throw exception } continue usual In this case: if (!networkConfigurator.awaitVdsmResponse()) { throw new VdsInstallException(VDSStatus.NonResponsive, "Network error communication host"); } try { ..</technical_language>

Target:
private void configureManagementNetwork() { final NetworkConfigurator networkConfigurator = new NetworkConfigurator(getVds()); if (!networkConfigurator.awaitVdsmResponse()) { throw new VdsInstallException(VDSStatus.NonResponsive, "Network error during communication with the host"); } try { networkConfigurator.refreshNetworkConfiguration(); networkConfigurator.createManagementNetworkIfRequired(); } catch (VDSNetworkException e) { throw new VdsInstallException(VDSStatus.NonResponsive, "Network error during communication with the host", e); } catch (Exception e) { throw new VdsInstallException(VDSStatus.NonOperational, "Failed to configure manamgent network on the host", e); } }
Source:
<code>public static Collection<Object[]> data() { return Arrays.asList(new Object[][]{ <START> {LocalDateTime.now().truncatedTo(ChronoUnit.MICROS), "timestamp_without_time_zone_column", "'2003-01-01'::TIMESTAMP"}, <END> {OffsetDateTime.now().withOffsetSameInstant(ZoneOffset.UTC).truncatedTo(ChronoUnit.MICROS), "timestamp_with_time_zone_column", "'2007-06-03'::TIMESTAMP"}, {LocalDate.now(), "date_column", "'2003-01-01'::DATE"}, {LocalTime.now().truncatedTo(ChronoUnit.MICROS), "time_without_time_zone_column", "'07:23'::TIME WITHOUT TIME ZONE"} }); }</code><technical_language>Avoid .now() in unit tests. tests unstable for good reason</technical_language>

Target:
public static Collection<Object[]> data() { return Arrays.asList(new Object[][]{ {LocalDateTime.of(2017, 1, 2, 3, 4, 5, 6000).truncatedTo(ChronoUnit.MICROS), LocalDateTime.class, "timestamp_without_time_zone_column", "'2003-01-01'::TIMESTAMP"}, {OffsetDateTime.of(2017, 1, 2, 3, 4, 5, 6000, ZoneOffset.UTC).truncatedTo(ChronoUnit.MICROS), OffsetDateTime.class, "timestamp_with_time_zone_column", "'2007-06-03'::TIMESTAMP"}, {LocalDate.of(2017, 1, 2), LocalDate.class, "date_column", "'2003-01-01'::DATE"}, {LocalTime.of(11, 12, 13).truncatedTo(ChronoUnit.MICROS), LocalTime.class, "time_without_time_zone_column", "'07:23'::TIME WITHOUT TIME ZONE"}, {null, LocalDateTime.class, "timestamp_without_time_zone_column", "'2003-01-01'::TIMESTAMP"}, {null, OffsetDateTime.class, "timestamp_with_time_zone_column", "'2007-06-03'::TIMESTAMP"}, {null, LocalDate.class, "date_column", "'2003-01-01'::DATE"}, {null, LocalTime.class, "time_without_time_zone_column", "'07:23'::TIME WITHOUT TIME ZONE"} }); }
Source:
<code>public void shouldCreate_withItemWithNullProperty() { final ItemId itemId = new ItemId(randomId()); final StubItem stubItem = generateRandomStubItem(itemId); stubItem.setStringProperty2(null); final ItemConfiguration itemConfiguration = new ItemConfiguration(StubItem.class, tableName); final Collection<ItemConfiguration> itemConfigurations = Arrays.asList(itemConfiguration); when(mockDatabaseSchemaHolder.itemConfigurations()).thenReturn(itemConfigurations); final Table mockTable = mock(Table.class); when(mockDynamoDBClient.getTable(any(String.class))).thenReturn(mockTable); final DynamoDocumentStoreTemplate dynamoDocumentStoreTemplate = new DynamoDocumentStoreTemplate( mockDatabaseSchemaHolder); dynamoDocumentStoreTemplate.initialize(mockAmazonDynamoDbClient); final Item mockTableItem = mock(Item.class); when(mockTableItem.toJSON()).thenReturn(dynamoDocumentStoreTemplate.itemToString(stubItem)); dynamoDocumentStoreTemplate.create(stubItem); final ArgumentCaptor<PutItemSpec> getItemRequestCaptor = ArgumentCaptor.forClass(PutItemSpec.class); verify(mockTable).putItem(getItemRequestCaptor.capture()); final PutItemSpec spec = getItemRequestCaptor.getValue(); <START> assertFalse(spec.getItem().isNull("stringProperty2")); <END> }</code><technical_language>assertion lines of "property exist"</technical_language>

Target:
public void shouldCreate_withItemWithNullProperty() { final ItemId itemId = new ItemId(randomId()); final StubItem stubItem = generateRandomStubItem(itemId); stubItem.setStringProperty2(null); final ItemConfiguration itemConfiguration = new ItemConfiguration(StubItem.class, tableName); final Collection<ItemConfiguration> itemConfigurations = Arrays.asList(itemConfiguration); when(mockDatabaseSchemaHolder.itemConfigurations()).thenReturn(itemConfigurations); final Table mockTable = mock(Table.class); when(mockDynamoDBClient.getTable(any(String.class))).thenReturn(mockTable); final DynamoDocumentStoreTemplate dynamoDocumentStoreTemplate = new DynamoDocumentStoreTemplate( mockDatabaseSchemaHolder); dynamoDocumentStoreTemplate.initialize(mockAmazonDynamoDbClient); final Item mockTableItem = mock(Item.class); when(mockTableItem.toJSON()).thenReturn(dynamoDocumentStoreTemplate.itemToString(stubItem)); dynamoDocumentStoreTemplate.create(stubItem); final ArgumentCaptor<PutItemSpec> getItemRequestCaptor = ArgumentCaptor.forClass(PutItemSpec.class); verify(mockTable).putItem(getItemRequestCaptor.capture()); final PutItemSpec spec = getItemRequestCaptor.getValue(); assertFalse(spec.getItem().hasAttribute("stringProperty2")); }
Source:
<code>public void clickCollapseExpandButtonAndWaitForPanelsToExpand() { click(collapseExpandButton); <START> <END> }</code><technical_language>this method do named..</technical_language>

Target:
public void clickCollapseExpandButtonAndWaitForPanelsToExpand() { click(collapseExpandButton); waitForPanelsToExpand(); }
Source:
<code>public IdfParserOutput parse(String experimentAccession) { try (TsvStreamer idfStreamer = idfReaderFactory.create(experimentAccession)) { parsedIdf = idfStreamer.get() .filter(line -> line.length > 1) .filter(line -> LINE_IDS.contains(line[0].trim().toUpperCase())) .collect(Collectors.toMap( <START> line -> line[0].trim().toUpperCase(), <END> line -> Arrays.stream(line) .skip(1) .filter(item -> !item.isEmpty()) .collect(Collectors.toList()))); String title = getParsedOutputByKey(AE_EXPERIMENT_DISPLAY_NAME_ID, getParsedOutputByKey(INVESTIGATION_TITLE_ID, Collections.emptyList())) .stream() .findFirst() .orElse(""); Map<String, String> publications = createPubMedIdToTitleMap( getParsedOutputByKey(PUBMED_ID, Collections.emptyList()), getParsedOutputByKey(PUBLICATION_TITLE_ID, Collections.emptyList())); int expectedClusters = NumberUtils.toInt(getParsedOutputByKey(EXPECTED_CLUSTERS_ID, Collections.emptyList()) .stream() .findFirst() .orElse(""), 0); return new IdfParserOutput( title, publications, expectedClusters ); } }</code><technical_language>map(line -> line[0].toUpperCase().trim()) filter/collect</technical_language>

Target:
public IdfParserOutput parse(String experimentAccession) { try (TsvStreamer idfStreamer = idfReaderFactory.create(experimentAccession)) { parsedIdf = idfStreamer.get() .filter(line -> line.length > 1) .filter(line -> LINE_IDS.contains(line[0].trim().toUpperCase())) .collect(Collectors.toMap( line -> line[0].trim().toUpperCase(), line -> Arrays.stream(line) .skip(1) .filter(item -> !item.isEmpty()) .collect(Collectors.toList()))); String title = getParsedOutputByKey(AE_EXPERIMENT_DISPLAY_NAME_ID, getParsedOutputByKey(INVESTIGATION_TITLE_ID, Collections.emptyList())) .stream() .findFirst() .orElse(""); List<Publication> publications = createListOfPublications( getParsedOutputByKey(PUBMED_ID, Collections.emptyList()), getParsedOutputByKey(PUBLICATION_TITLE_ID, Collections.emptyList()), getParsedOutputByKey(PUBLICATION_DOI_ID, Collections.emptyList())); int expectedClusters = NumberUtils.toInt(getParsedOutputByKey(EXPECTED_CLUSTERS_ID, Collections.emptyList()) .stream() .findFirst() .orElse(""), 0); return new IdfParserOutput( title, publications, expectedClusters ); } }
Source:
<code>private void glusterHostRemove() { boolean forceAction = false; if (isGlusterEnabled() && getVdsDAO().getAll().size() > 1 && !hasVolumeOnServer()) { <START> String hostName = getVdsDAO().get(getParameters().getVdsId()).gethost_name(); <END> VDSReturnValue returnValue = runVdsCommand( VDSCommandType.GlusterHostRemove, new GlusterHostRemoveVDSParameters((ClusterUtils.getInstance().getUpServer(getVdsGroupId())).getId(), hostName, forceAction)); setSucceeded(returnValue.getSucceeded()); if (!returnValue.getSucceeded()) { errorType = AuditLogType.GLUSTER_HOST_REMOVE_FAILED; } } }</code><technical_language>need get vds db, use: getVds().gethost_name()</technical_language>

Target:
private void glusterHostRemove() { boolean forceAction = false; if (isGlusterEnabled() && getVdsDAO().getAll().size() > 1 && !hasVolumeOnServer()) { VDSReturnValue returnValue = runVdsCommand( VDSCommandType.GlusterHostRemove, new GlusterHostRemoveVDSParameters((ClusterUtils.getInstance().getUpServer(getVdsGroupId())).getId(), getVds().gethost_name(), forceAction)); setSucceeded(returnValue.getSucceeded()); if (!returnValue.getSucceeded()) { errorType = AuditLogType.GLUSTER_HOST_REMOVE_FAILED; } } }
Source:
<code>private PreviewWebViewClient loadWebview() { <START> Assert.assertNotNull("Arguments can't be null at this point!", getArguments()); <END> String siteAddress = getArguments().getString(ARG_SITE_ADDRESS); Assert.assertNotNull("Site address must be provided in the arguments!", siteAddress); String url = (siteAddress.contains("wordpress.com") ? "https://" : "http://") + siteAddress; PreviewWebViewClient client = new PreviewWebViewClient(url); mWebView.setWebViewClient(client); mWebView.loadUrl(url); return client; }</code><technical_language>I feel lint warnings. pretty, a couple ways avoid warnings. java private PreviewWebViewClient loadWebview() { String siteAddress = getArguments() != null ? getArguments().getString(ARG_SITE_ADDRESS, "") : ""; if (siteAddress.isEmpty()) { return null; } java private PreviewWebViewClient loadWebview() { if (getArguments() == null) { return null; } String siteAddress = getArguments().getString(ARG_SITE_ADDRESS); if (siteAddress == null) { return null; }</technical_language>

Target:
private @Nullable PreviewWebViewClient loadWebview() { String siteAddress = getArguments() != null ? getArguments().getString(ARG_SITE_ADDRESS, "") : ""; if (siteAddress.isEmpty()) { if (BuildConfig.DEBUG) { throw new IllegalStateException("The newly created site address should not be null!"); } return null; } String url = (siteAddress.contains("wordpress.com") ? "https://" : "http://") + siteAddress; PreviewWebViewClient client = new PreviewWebViewClient(url); mWebView.setWebViewClient(client); mWebView.loadUrl(url); return client; }
Source:
<code>static void installService(OperationContext context, PathAddress pathAddress, ModelNode model) throws OperationFailedException { final String className = CODE.resolveModelAttribute(context, model).asString(); final ModuleIdentifier module = ModuleIdentifier.fromString(MODULE.resolveModelAttribute(context, model).asString()); final ServiceName serviceName = getServiceName(pathAddress); final ModelNode propsNode = model.get(PROPERTIES.getName()); final Map<String, String> properties; if (!propsNode.isDefined()) { properties = Collections.emptyMap(); } else { properties = new HashMap<>(); for (String key : propsNode.keys()) { String value = propsNode.hasDefined(key) ? propsNode.get(key).asString() : null; properties.put(key, value); } <START> } <END> NotificationRegistrarService.install( context.getServiceTarget(), serviceName, className, module, context.getProcessType(), context.getRunningMode(), properties); }</code><technical_language>I fix <LINK_0> in a minute PROPERTIES.unwrap(context, model) replace L109-119</technical_language>

Target:
static void installService(OperationContext context, PathAddress pathAddress, ModelNode model) throws OperationFailedException { final String className = CODE.resolveModelAttribute(context, model).asString(); final ModuleIdentifier module = ModuleIdentifier.fromString(MODULE.resolveModelAttribute(context, model).asString()); final ServiceName serviceName = getServiceName(pathAddress); final Map<String, String> properties = PROPERTIES.unwrap(context, model); NotificationRegistrarService.install( context.getServiceTarget(), serviceName, className, module, context.getProcessType(), context.getRunningMode(), properties); }
Source:
<code>public AsyncQueryForwardingServlet( @Json ObjectMapper jsonMapper, @Smile ObjectMapper smileMapper, QueryHostFinder hostFinder, @Router Provider<HttpClient> httpClientProvider, DruidHttpClientConfig httpClientConfig, ServiceEmitter emitter, RequestLogger requestLogger ) { this.jsonMapper = jsonMapper; this.smileMapper = smileMapper; this.hostFinder = hostFinder; this.httpClientProvider = httpClientProvider; this.httpClientConfig = httpClientConfig; this.emitter = emitter; this.requestLogger = requestLogger; this.broadcastClient = httpClientProvider.get(); broadcastClient.setConnectTimeout(CANCELLATION_TIMEOUT); <START> broadcastClient.setMaxRequestsQueuedPerDestination(MAX_QUEUED_CANCELLATIONS); <END> }</code><technical_language>maxConnectionsPerDestination</technical_language>

Target:
public AsyncQueryForwardingServlet( @Json ObjectMapper jsonMapper, @Smile ObjectMapper smileMapper, QueryHostFinder hostFinder, @Router Provider<HttpClient> httpClientProvider, DruidHttpClientConfig httpClientConfig, ServiceEmitter emitter, RequestLogger requestLogger ) { this.jsonMapper = jsonMapper; this.smileMapper = smileMapper; this.hostFinder = hostFinder; this.httpClientProvider = httpClientProvider; this.httpClientConfig = httpClientConfig; this.emitter = emitter; this.requestLogger = requestLogger; }
Source:
<code><START> public PullFilter(String filterName, Map<String, String> parameters) { <END> this.name = filterName; Map<String,Object> newMap =new HashMap<String,Object>(); for (Map.Entry<String, String> entry : parameters.entrySet()) { newMap.put(entry.getKey(),entry.getValue()); } setParameters(newMap); }</code><technical_language>This constructor needs deprecated a new constructor PullFilter(String filterName, Map<String, String> parameters) needs added allow users create PullFilters complex arguments in POST body</technical_language>

Target:
public PullFilter(String filterName, Map<String, String> parameters) { this.name = filterName; Map<String, String> internalParams = new HashMap<String, String>(); internalParams.putAll(parameters); this.parameters = Collections.unmodifiableMap(internalParams); }
Source:
<code>public Iterable<Instance> listNodesByIds(final Iterable<String> ids) { <START> return filter(listNodes(), new Predicate<Instance>() { <END> @Override public boolean apply(Instance instance) { return contains(ids, String.valueOf(instance.instanceId())); } }); }</code><technical_language>API method pass ids ListInstancesOptions</technical_language>

Target:
public Iterable<Instance> listNodesByIds(final Iterable<String> ids) { final ImmutableList.Builder<Instance> instancesBuilder = ImmutableList.builder(); for (String regionId : getAvailableLocationNames()) { instancesBuilder.addAll(api.instanceApi().list(regionId, ListInstancesOptions.Builder.instanceIds(Iterables.toArray(ids, String.class)))); } return instancesBuilder.build(); }
Source:
<code>public void deleteDeprecatedRuleKeys() { <START> db.executeUpdateSql("delete from deprecated_rule_keys"); <END> DeprecatedRuleKeyDto deprecatedRuleKeyDto1 = new DeprecatedRuleKeyDto() .setUuid(uuidFactory.create()) .setOldRepositoryKey(randomAlphanumeric(50)) .setOldRuleKey(randomAlphanumeric(50)) .setRuleId(1) .setCreatedAt(1_500_000_000_000L); DeprecatedRuleKeyDto deprecatedRuleKeyDto2 = new DeprecatedRuleKeyDto() .setUuid(uuidFactory.create()) .setOldRepositoryKey(randomAlphanumeric(50)) .setOldRuleKey(randomAlphanumeric(50)) .setRuleId(2) .setCreatedAt(1_500_000_000_000L); underTest.insert(db.getSession(), deprecatedRuleKeyDto1); underTest.insert(db.getSession(), deprecatedRuleKeyDto2); assertThat(underTest.selectAllDeprecatedRuleKeys(db.getSession())).hasSize(2); underTest.deleteDeprecatedRuleKeys(db.getSession(), Arrays.asList(deprecatedRuleKeyDto1.getUuid())); assertThat(underTest.selectAllDeprecatedRuleKeys(db.getSession())).hasSize(1); }</code><technical_language>if "deprecated_rule_keys" SqTables.TABLES, need do in test</technical_language>

Target:
public void deleteDeprecatedRuleKeys() { DeprecatedRuleKeyDto deprecatedRuleKeyDto1 = db.rules().insertDeprecatedKey(); db.rules().insertDeprecatedKey();; assertThat(underTest.selectAllDeprecatedRuleKeys(db.getSession())).hasSize(2); underTest.deleteDeprecatedRuleKeys(db.getSession(), singletonList(deprecatedRuleKeyDto1.getUuid())); assertThat(underTest.selectAllDeprecatedRuleKeys(db.getSession())).hasSize(1); }