Return-Path: Delivered-To: apmail-jackrabbit-commits-archive@www.apache.org Received: (qmail 13564 invoked from network); 21 Jan 2008 14:03:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 Jan 2008 14:03:28 -0000 Received: (qmail 82184 invoked by uid 500); 21 Jan 2008 14:03:18 -0000 Delivered-To: apmail-jackrabbit-commits-archive@jackrabbit.apache.org Received: (qmail 82163 invoked by uid 500); 21 Jan 2008 14:03:18 -0000 Mailing-List: contact commits-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list commits@jackrabbit.apache.org Received: (qmail 82151 invoked by uid 99); 21 Jan 2008 14:03:18 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Jan 2008 06:03:17 -0800 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Jan 2008 14:03:12 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 1FEC81A9832; Mon, 21 Jan 2008 06:03:05 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r613892 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/ConnectionFactory.java Date: Mon, 21 Jan 2008 14:03:04 -0000 To: commits@jackrabbit.apache.org From: thomasm@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080121140305.1FEC81A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: thomasm Date: Mon Jan 21 06:03:04 2008 New Revision: 613892 URL: http://svn.apache.org/viewvc?rev=613892&view=rev Log: JCR-1305 JNDI data sources with BundleDbPersistenceManager: UnsupportedOperationException Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/ConnectionFactory.java Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/ConnectionFactory.java URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/ConnectionFactory.java?rev=613892&r1=613891&r2=613892&view=diff ============================================================================== --- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/ConnectionFactory.java (original) +++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/ConnectionFactory.java Mon Jan 21 06:03:04 2008 @@ -57,7 +57,7 @@ // JNDI context Context context = (Context) d.newInstance(); DataSource ds = (DataSource) context.lookup(url); - if (isNullOrEmpty(user) && isNullOrEmpty(password)) { + if (user == null && password == null) { return ds.getConnection(); } else { return ds.getConnection(user, password); @@ -84,15 +84,6 @@ } } return DriverManager.getConnection(url, user, password); - } - - /** - * Check if a String is null or empty (the length is null). - * - * @return true if it is null or empty - */ - private static boolean isNullOrEmpty(String s) { - return s == null || s.length() == 0; } }