This is an automated email from the ASF dual-hosted git repository.
ahuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git
The following commit(s) were added to refs/heads/master by this push:
new 9f6aacb331 ISIS-3280: fixes RepositoryService bounded uniqueMatch
9f6aacb331 is described below
commit 9f6aacb331797562c15d72c9b5767a7f333976d4
Author: Andi Huber <[email protected]>
AuthorDate: Thu Nov 17 13:04:20 2022 +0100
ISIS-3280: fixes RepositoryService bounded uniqueMatch
- also fixes misleading java-doc
---
.../apache/causeway/applib/services/repository/RepositoryService.java | 4 ++--
.../core/runtimeservices/repository/RepositoryServiceDefault.java | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git
a/api/applib/src/main/java/org/apache/causeway/applib/services/repository/RepositoryService.java
b/api/applib/src/main/java/org/apache/causeway/applib/services/repository/RepositoryService.java
index b11ab33144..cbac55beb0 100644
---
a/api/applib/src/main/java/org/apache/causeway/applib/services/repository/RepositoryService.java
+++
b/api/applib/src/main/java/org/apache/causeway/applib/services/repository/RepositoryService.java
@@ -245,8 +245,8 @@ public interface RepositoryService {
* of persisted instances of specified type (including subtypes).
*
* <p>
- * If the optional range parameters are used, the dataset returned starts
- * from (0 based) index, and consists of only up to count items.
+ * If the optional range parameters are used, the dataset considered
(before filtering) starts
+ * from (0 based) index, runs through up to count items.
* </p>
*
* @param ofType
diff --git
a/core/runtimeservices/src/main/java/org/apache/causeway/core/runtimeservices/repository/RepositoryServiceDefault.java
b/core/runtimeservices/src/main/java/org/apache/causeway/core/runtimeservices/repository/RepositoryServiceDefault.java
index efe2d4f42f..b9af3d05a4 100644
---
a/core/runtimeservices/src/main/java/org/apache/causeway/core/runtimeservices/repository/RepositoryServiceDefault.java
+++
b/core/runtimeservices/src/main/java/org/apache/causeway/core/runtimeservices/repository/RepositoryServiceDefault.java
@@ -190,7 +190,7 @@ implements RepositoryService, HasMetaModelContext {
@Override
public <T> Optional<T> uniqueMatch(final Class<T> type, final Predicate<T>
predicate) {
- final List<T> instances = allMatches(type, predicate, 0, 2); // No
need to fetch more than 2.
+ final List<T> instances = allMatches(type, predicate);
if (instances.size() > 1) {
throw new RepositoryException("Found more than one instance of " +
type + " matching filter " + predicate);
}