commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Thomas (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (DBCP-347) DelegatingStatement class has incomplete isWrapperFor method
Date Mon, 09 Dec 2013 21:22:07 GMT

     [ https://issues.apache.org/jira/browse/DBCP-347?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Mark Thomas resolved DBCP-347.
------------------------------

       Resolution: Fixed
    Fix Version/s: 2.0
                   1.5.1

Thanks for the report, patch and test case.

Similar issues in DelegatingDatabaseMetaData.isWrapperFor() and DelegatingResultSet.isWrapperFor()
were also fixed.

> DelegatingStatement class has incomplete isWrapperFor method
> ------------------------------------------------------------
>
>                 Key: DBCP-347
>                 URL: https://issues.apache.org/jira/browse/DBCP-347
>             Project: Commons Dbcp
>          Issue Type: Bug
>         Environment: Windows 7. java version "1.6.0_21". Dell Latitude E6410.
>            Reporter: Robert Poskrobek
>             Fix For: 1.3.1, 1.4.1, 1.5.1, 2.0
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> Currently org.apache.commons.dbcp.DelegatingStatement#isWrapperFor checks only if:
> 1. Requested class is assignable from the DelegatingStatement instance:        iface.isAssignableFrom(getClass())
> 2. Wrapped object is a wrapper for the requested class:            _stmt.isWrapperFor(iface)
> I think there should be another option checked i.e. requested class is assignable from
the wrapped object's class. For example:   iface.isAssignableFrom(_stmt.getClass())
> This is especially that in fact unwrap method properly assumes this possiblity i.e.:
    return iface.cast(_stmt);
> The whole method should be:
>     public boolean isWrapperFor(Class<?> iface) throws SQLException {
>         return iface.isAssignableFrom(getClass()) || iface.isAssignableFrom(_stmt.getClass())
|| _stmt.isWrapperFor(iface);
>     }



--
This message was sent by Atlassian JIRA
(v6.1.4#6159)

Mime
View raw message