This is an automated email from the ASF dual-hosted git repository.
duanzhengqiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new 315524588ea Fix judgment logic errors (#18833)
315524588ea is described below
commit 315524588ea465567687d42c5d4ef111587538bf
Author: zhaojinchao <[email protected]>
AuthorDate: Mon Jul 4 20:38:49 2022 +0800
Fix judgment logic errors (#18833)
---
.../apache/shardingsphere/infra/database/type/DatabaseTypeEngine.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git
a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/database/type/DatabaseTypeEngine.java
b/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/database/type/DatabaseTypeEngine.java
index 2d2245742b2..839f11e8a65 100644
---
a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/database/type/DatabaseTypeEngine.java
+++
b/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/database/type/DatabaseTypeEngine.java
@@ -69,7 +69,7 @@ public final class DatabaseTypeEngine {
return configuredDatabaseType.get();
}
Collection<DataSource> dataSources = databaseConfigs.values().stream()
- .filter(each ->
each.getDataSources().isEmpty()).findFirst().map(optional ->
optional.getDataSources().values()).orElseGet(Collections::emptyList);
+ .filter(each ->
!each.getDataSources().isEmpty()).findFirst().map(optional ->
optional.getDataSources().values()).orElseGet(Collections::emptyList);
return getDatabaseType(dataSources);
}
@@ -81,7 +81,7 @@ public final class DatabaseTypeEngine {
*/
public static DatabaseType getStorageType(final Map<String, ? extends
DatabaseConfiguration> databaseConfigs) {
return getDatabaseType(
- databaseConfigs.values().stream().filter(each ->
each.getDataSources().isEmpty()).findFirst().map(optional ->
optional.getDataSources().values()).orElseGet(Collections::emptyList));
+ databaseConfigs.values().stream().filter(each ->
!each.getDataSources().isEmpty()).findFirst().map(optional ->
optional.getDataSources().values()).orElseGet(Collections::emptyList));
}
/**