wuwen5 commented on code in PR #20197:
URL: https://github.com/apache/shardingsphere/pull/20197#discussion_r946455780
##########
shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/jdbc/core/driver/DriverDataSourceCache.java:
##########
@@ -44,23 +43,17 @@ public DataSource get(final String url) throws SQLException
{
if (dataSourceMap.containsKey(url)) {
return dataSourceMap.get(url);
}
- DataSource dataSource;
+ return dataSourceMap.computeIfAbsent(url,
DriverDataSourceCache::createDataSource);
Review Comment:
Generally, we don't need this code ``` if (dataSourceMap.containsKey(url))
```, but because of this problem
[JDK-8161372](https://bugs.openjdk.org/browse/JDK-8161372), we keep it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]