Skip to content

Commit d5761c7

Browse files
committed
DATACMNS-1389 - Reorder repository candidate check.
We now check whether to use the repository configuration as last check to clarify store module responsibility first. This allows to place store-specific checks in RepositoryConfigurationExtensionSupport.useRepositoryConfiguration(…) such as rejecting reactive repositories for a store module that does not support reactive repositories Previously, we called useRepositoryConfiguration(…) before checking whether the actual repository interface is handled by the store module. This resulted in rejection of reactive repositories by store modules that do not provide reactive support whereas the repository did not belong to the actual store module. Related ticket: DATACMNS-1174.
1 parent 78a35ea commit d5761c7

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/main/java/org/springframework/data/repository/config/RepositoryConfigurationExtensionSupport.java

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -98,16 +98,10 @@ public <T extends RepositoryConfigurationSource> Collection<RepositoryConfigurat
9898

9999
RepositoryMetadata metadata = AbstractRepositoryMetadata.getMetadata(repositoryInterface);
100100

101-
if (!useRepositoryConfiguration(metadata)) {
102-
continue;
103-
}
104-
105-
if (!strictMatchesOnly || configSource.usesExplicitFilters()) {
106-
result.add(configuration);
107-
continue;
108-
}
101+
boolean qualifiedForImplementation = !strictMatchesOnly || configSource.usesExplicitFilters()
102+
|| isStrictRepositoryCandidate(metadata);
109103

110-
if (isStrictRepositoryCandidate(metadata)) {
104+
if (qualifiedForImplementation && useRepositoryConfiguration(metadata)) {
111105
result.add(configuration);
112106
}
113107
}

0 commit comments

Comments
 (0)