From 0dc4500a5c58e7cbee8bfc39cadf202ecad07f37 Mon Sep 17 00:00:00 2001 From: Gabriel Roldan Date: Tue, 7 Jan 2025 02:30:30 -0300 Subject: [PATCH] qa: replace lambdas with method references --- .../catalog/backend/jdbcconfig/JdbcConfigDataSourceTest.java | 2 +- .../org/geoserver/catalog/plugin/XmlCatalogInfoLookup.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/catalog/backends/jdbcconfig/src/test/java/org/geoserver/cloud/autoconfigure/catalog/backend/jdbcconfig/JdbcConfigDataSourceTest.java b/src/catalog/backends/jdbcconfig/src/test/java/org/geoserver/cloud/autoconfigure/catalog/backend/jdbcconfig/JdbcConfigDataSourceTest.java index 820a469d0..50db8ce59 100644 --- a/src/catalog/backends/jdbcconfig/src/test/java/org/geoserver/cloud/autoconfigure/catalog/backend/jdbcconfig/JdbcConfigDataSourceTest.java +++ b/src/catalog/backends/jdbcconfig/src/test/java/org/geoserver/cloud/autoconfigure/catalog/backend/jdbcconfig/JdbcConfigDataSourceTest.java @@ -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); } } } diff --git a/src/catalog/plugin/src/test/java/org/geoserver/catalog/plugin/XmlCatalogInfoLookup.java b/src/catalog/plugin/src/test/java/org/geoserver/catalog/plugin/XmlCatalogInfoLookup.java index ff175d1da..23701674c 100644 --- a/src/catalog/plugin/src/test/java/org/geoserver/catalog/plugin/XmlCatalogInfoLookup.java +++ b/src/catalog/plugin/src/test/java/org/geoserver/catalog/plugin/XmlCatalogInfoLookup.java @@ -188,7 +188,7 @@ private static Comparator providedOrder() { } protected Predicate toPredicate(Filter filter) { - return o -> filter.evaluate(o); + return filter::evaluate; } private static Comparator comparator(final SortBy sortOrder) { @@ -537,7 +537,7 @@ public Stream findAllByDefaultStyleOrStyles(StyleInfo style) { String id = style.getId(); Predicate 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); }