Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 32580 invoked from network); 18 Jun 2007 07:04:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 18 Jun 2007 07:04:13 -0000 Received: (qmail 57016 invoked by uid 500); 18 Jun 2007 07:04:16 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 56996 invoked by uid 500); 18 Jun 2007 07:04:16 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 56987 invoked by uid 99); 18 Jun 2007 07:04:16 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Jun 2007 00:04:16 -0700 Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Jun 2007 00:04:12 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 3D0F5714062 for ; Mon, 18 Jun 2007 00:03:51 -0700 (PDT) Message-ID: <19525038.1182150231240.JavaMail.jira@brutus> Date: Mon, 18 Jun 2007 00:03:51 -0700 (PDT) From: "Ruth Cao (JIRA)" To: commits@harmony.apache.org Subject: [jira] Created: (HARMONY-4205) [classlib][sql] java.sql.DriverManager cannot deregister a driver as many times a registering it MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [classlib][sql] java.sql.DriverManager cannot deregister a driver as many times a registering it ------------------------------------------------------------------------------------------------ Key: HARMONY-4205 URL: https://issues.apache.org/jira/browse/HARMONY-4205 Project: Harmony Issue Type: Bug Components: Classlib Environment: Windows XP / Linux Reporter: Ruth Cao The following test case shows the bug: public void test_registerDriver_MultiTimes() throws SQLException { int register_count = 10; int deregister_count = 1; Driver dummy = new DummyDriver(); DriverManager.registerDriver(new BadDummyDriver()); for (int i = 0; i < register_count; i++) { DriverManager.registerDriver(dummy); } DriverManager.registerDriver(new BadDummyDriver()); for (int i = 0; i < deregister_count; i++) { DriverManager.deregisterDriver(dummy); } Driver d = DriverManager.getDriver("jdbc:dummy_protocol:dummy_subname"); assertNotNull(d); } private static class BadDummyDriver extends DummyDriver { public boolean acceptsURL(String url) { return false; } } private static class DummyDriver implements Driver { String goodurl = "jdbc:dummy_protocol:dummy_subname"; public boolean acceptsURL(String url) { return url.equals(goodurl); } public Connection connect(String url, Properties info) { return null; } public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) { return null; } public int getMajorVersion() { return 0; } public int getMinorVersion() { return 0; } public boolean jdbcCompliant() { return true; } } It seems that this happens due to Harmony uses HashSet as the data structure to store the driver list, which does not allow duplications. I'll create a patch for this soon, thanks. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.