1
0
mirror of synced 2026-08-05 17:57:15 +00:00

Use parenthesis with single-arg lambdas

Use regular expression search/replace to ensure all single-arg
lambdas have parenthesis. This aligns with the style used in Spring
Boot and ensure that single-arg and multi-arg lambdas are consistent.

Issue gh-8945
This commit is contained in:
Phillip Webb
2020-07-29 18:18:05 -07:00
committed by Rob Winch
parent 01d90c9881
commit 52f20b5281
426 changed files with 1668 additions and 1617 deletions
@@ -66,19 +66,19 @@ public class ContactsPage {
}
Predicate<WebElement> byEmail(final String val) {
return e -> e.findElements(By.xpath("td[position()=3 and normalize-space()='" + val + "']")).size() == 1;
return (e) -> e.findElements(By.xpath("td[position()=3 and normalize-space()='" + val + "']")).size() == 1;
}
Predicate<WebElement> byName(final String val) {
return e -> e.findElements(By.xpath("td[position()=2 and normalize-space()='" + val + "']")).size() == 1;
return (e) -> e.findElements(By.xpath("td[position()=2 and normalize-space()='" + val + "']")).size() == 1;
}
public DeleteContactLink andHasContact(final String name, final String email) {
return this.contacts.stream()
.filter(byEmail(email).and(byName(name)))
.map(e -> e.findElement(By.cssSelector("td:nth-child(4) > a")))
.map((e) -> e.findElement(By.cssSelector("td:nth-child(4) > a")))
.findFirst()
.map(e -> new DeleteContactLink(webDriver, e))
.map((e) -> new DeleteContactLink(webDriver, e))
.get();
}
@@ -33,7 +33,7 @@ public class ContactDaoSpring extends JdbcDaoSupport implements ContactDao {
public void create(final Contact contact) {
getJdbcTemplate().update("insert into contacts values (?, ?, ?)",
ps -> {
(ps) -> {
ps.setLong(1, contact.getId());
ps.setString(2, contact.getName());
ps.setString(3, contact.getEmail());
@@ -42,13 +42,13 @@ public class ContactDaoSpring extends JdbcDaoSupport implements ContactDao {
public void delete(final Long contactId) {
getJdbcTemplate().update("delete from contacts where id = ?",
ps -> ps.setLong(1, contactId));
(ps) -> ps.setLong(1, contactId));
}
public void update(final Contact contact) {
getJdbcTemplate().update(
"update contacts set contact_name = ?, address = ? where id = ?",
ps -> {
(ps) -> {
ps.setString(1, contact.getName());
ps.setString(2, contact.getEmail());
ps.setLong(3, contact.getId());
@@ -162,7 +162,7 @@ public class DataSourcePopulator implements InitializingBean {
for (int i = 1; i < createEntities; i++) {
final ObjectIdentity objectIdentity = new ObjectIdentityImpl(Contact.class,
(long) i);
tt.execute(arg0 -> {
tt.execute((arg0) -> {
mutableAclService.createAcl(objectIdentity);
return null;
@@ -267,7 +267,7 @@ public class DataSourcePopulator implements InitializingBean {
}
private void updateAclInTransaction(final MutableAcl acl) {
tt.execute(arg0 -> {
tt.execute((arg0) -> {
mutableAclService.updateAcl(acl);
return null;