Return-Path: Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: (qmail 65287 invoked from network); 27 Oct 2010 11:59:47 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 27 Oct 2010 11:59:47 -0000 Received: (qmail 77988 invoked by uid 500); 27 Oct 2010 11:59:47 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 77616 invoked by uid 500); 27 Oct 2010 11:59:45 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 77138 invoked by uid 99); 27 Oct 2010 11:59:44 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Oct 2010 11:59:44 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Oct 2010 11:59:42 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o9RBxKYZ010075 for ; Wed, 27 Oct 2010 11:59:20 GMT Message-ID: <22256535.98131288180760618.JavaMail.jira@thor> Date: Wed, 27 Oct 2010 07:59:20 -0400 (EDT) From: "Gary Gregory (JIRA)" To: issues@commons.apache.org Subject: [jira] Commented: (DBCP-347) DelegatingStatement class has incomplete isWrapperFor method In-Reply-To: <14871154.97811288179322334.JavaMail.jira@thor> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/DBCP-347?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12925341#action_12925341 ] Gary Gregory commented on DBCP-347: ----------------------------------- Would you be willing to provide a patch that includes a unit test to prove what is broken? > 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 > 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 is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.