mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-09-17 12:09:16 +00:00
Polish "Honor a wrapper's unwrap when resolving the root DataSource"
See gh-51410
This commit is contained in:
+4
-3
@@ -94,9 +94,10 @@ public final class DataSourceUnwrapper {
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the root {@link DataSource} by recursively unwrapping all
|
||||
* {@link org.springframework.jdbc.datasource.DelegatingDataSource delegating}, proxy,
|
||||
* and {@link java.sql.Wrapper} layers until no further unwrapping is possible.
|
||||
* Return the root {@link DataSource} by recursively unwrapping
|
||||
* {@link java.sql.Wrapper},
|
||||
* {@link org.springframework.jdbc.datasource.DelegatingDataSource delegating}, and
|
||||
* proxy layers until no further unwrapping is possible.
|
||||
* @param dataSource the datasource to unwrap
|
||||
* @return the root {@link DataSource}
|
||||
* @since 4.1.0
|
||||
|
||||
+2
-2
@@ -181,12 +181,12 @@ class DataSourceUnwrapperTests {
|
||||
private static final class SelfReturningDataSource extends AbstractDataSource {
|
||||
|
||||
@Override
|
||||
public Connection getConnection() throws SQLException {
|
||||
public Connection getConnection() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Connection getConnection(String username, String password) throws SQLException {
|
||||
public Connection getConnection(String username, String password) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user