Skip to content

Commit

Permalink
qa: replace lambdas with method references
Browse files Browse the repository at this point in the history
  • Loading branch information
groldan committed Jan 8, 2025
1 parent 7a0bfcf commit 10d76dd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ void testDataSource() throws SQLException {
assertEquals(250, hds.getConnectionTimeout());
try (Connection c1 = hds.getConnection();
Connection c2 = hds.getConnection()) {
assertThrows(SQLTransientConnectionException.class, () -> hds.getConnection());
assertThrows(SQLTransientConnectionException.class, hds::getConnection);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ private static <U extends CatalogInfo> Comparator<U> providedOrder() {
}

protected <V> Predicate<V> toPredicate(Filter filter) {
return o -> filter.evaluate(o);
return filter::evaluate;
}

private static <U extends CatalogInfo> Comparator<U> comparator(final SortBy sortOrder) {
Expand Down Expand Up @@ -537,7 +537,7 @@ public Stream<LayerInfo> findAllByDefaultStyleOrStyles(StyleInfo style) {
String id = style.getId();
Predicate<? super LayerInfo> predicate = li -> (li.getDefaultStyle() != null
&& id.equals(li.getDefaultStyle().getId()))
|| li.getStyles().stream().map(s -> s.getId()).anyMatch(id::equals);
|| li.getStyles().stream().map(Info::getId).anyMatch(id::equals);
return all().filter(predicate);
}

Expand Down

0 comments on commit 10d76dd

Please sign in to comment.