Réda Housni Alaoui created DBCP-573:
---------------------------------------

             Summary: DataSource implementations do not implement Wrapper 
interface correctly
                 Key: DBCP-573
                 URL: https://issues.apache.org/jira/browse/DBCP-573
             Project: Commons DBCP
          Issue Type: Bug
    Affects Versions: 2.8.0
            Reporter: Réda Housni Alaoui


Let's take {{BasicDataSource}} as an example. Its code is currently:
{code:java}
@Override
public boolean isWrapperFor(final Class<?> iface) throws SQLException {
    return false;
}

@Override
public <T> T unwrap(final Class<T> iface) throws SQLException {
    throw new SQLException("BasicDataSource is not a wrapper.");
}{code}
This breaks consumers relying on Wrapper being correctly implemented.

The DataSource should at least check if *this* is an instance of iface and 
return it from {{unwrap}} if it is.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to