Return-Path: X-Original-To: apmail-directory-commits-archive@www.apache.org Delivered-To: apmail-directory-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C7BC3FB99 for ; Wed, 5 Nov 2014 09:59:24 +0000 (UTC) Received: (qmail 99540 invoked by uid 500); 5 Nov 2014 09:59:24 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 99499 invoked by uid 500); 5 Nov 2014 09:59:24 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 99490 invoked by uid 99); 5 Nov 2014 09:59:24 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Nov 2014 09:59:24 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Nov 2014 09:59:02 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id AAD5C23888E4; Wed, 5 Nov 2014 09:57:26 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1636843 - /directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/DefaultLdapConnectionFactory.java Date: Wed, 05 Nov 2014 09:57:26 -0000 To: commits@directory.apache.org From: elecharny@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20141105095726.AAD5C23888E4@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: elecharny Date: Wed Nov 5 09:57:26 2014 New Revision: 1636843 URL: http://svn.apache.org/r1636843 Log: Removed the ?: syntax Modified: directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/DefaultLdapConnectionFactory.java Modified: directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/DefaultLdapConnectionFactory.java URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/DefaultLdapConnectionFactory.java?rev=1636843&r1=1636842&r2=1636843&view=diff ============================================================================== --- directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/DefaultLdapConnectionFactory.java (original) +++ directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/DefaultLdapConnectionFactory.java Wed Nov 5 09:57:26 2014 @@ -67,6 +67,7 @@ public class DefaultLdapConnectionFactor { LOG.error( "unable to bind connection: {}", e.getMessage() ); LOG.debug( "unable to bind connection:", e ); + try { connection.close(); @@ -76,8 +77,10 @@ public class DefaultLdapConnectionFactor LOG.error( "unable to close failed bind connection: {}", e.getMessage() ); LOG.debug( "unable to close failed bind connection:", e ); } + throw e; } + return connection; } @@ -106,12 +109,16 @@ public class DefaultLdapConnectionFactor @Override - @SuppressWarnings("resource") public LdapConnection newUnboundLdapConnection() { - return configureConnection( apiService == null - ? new LdapNetworkConnection( connectionConfig ) - : new LdapNetworkConnection( connectionConfig, apiService ) ); + if ( apiService == null ) + { + return configureConnection( new LdapNetworkConnection( connectionConfig ) ); + } + else + { + return configureConnection( new LdapNetworkConnection( connectionConfig, apiService ) ); + } }