Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id ECFEC200B8B for ; Tue, 4 Oct 2016 23:07:08 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id EB752160ACC; Tue, 4 Oct 2016 21:07:08 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 34A37160AC7 for ; Tue, 4 Oct 2016 23:07:08 +0200 (CEST) Received: (qmail 51331 invoked by uid 500); 4 Oct 2016 21:07:07 -0000 Mailing-List: contact commits-help@archiva.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@archiva.apache.org Delivered-To: mailing list commits@archiva.apache.org Received: (qmail 51322 invoked by uid 99); 4 Oct 2016 21:07:07 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Oct 2016 21:07:07 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 228D1DFC55; Tue, 4 Oct 2016 21:07:07 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: olamy@apache.org To: commits@archiva.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: archiva-redback-core git commit: Use NamingManager instead of LdapCtxFactory Date: Tue, 4 Oct 2016 21:07:07 +0000 (UTC) archived-at: Tue, 04 Oct 2016 21:07:09 -0000 Repository: archiva-redback-core Updated Branches: refs/heads/master c49cb230e -> c9ca73b94 Use NamingManager instead of LdapCtxFactory Fixes deprecation warnings on LdapCtxFactory Project: http://git-wip-us.apache.org/repos/asf/archiva-redback-core/repo Commit: http://git-wip-us.apache.org/repos/asf/archiva-redback-core/commit/c9ca73b9 Tree: http://git-wip-us.apache.org/repos/asf/archiva-redback-core/tree/c9ca73b9 Diff: http://git-wip-us.apache.org/repos/asf/archiva-redback-core/diff/c9ca73b9 Branch: refs/heads/master Commit: c9ca73b94cb294a6d87bbaf75560293744f5e7fe Parents: c49cb23 Author: Ciprian Ciubotariu Authored: Mon Oct 3 18:32:52 2016 +0300 Committer: Ciprian Ciubotariu Committed: Mon Oct 3 18:32:52 2016 +0300 ---------------------------------------------------------------------- .../ldap/connection/DefaultLdapConnection.java | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/archiva-redback-core/blob/c9ca73b9/redback-common/redback-common-ldap/src/main/java/org/apache/archiva/redback/common/ldap/connection/DefaultLdapConnection.java ---------------------------------------------------------------------- diff --git a/redback-common/redback-common-ldap/src/main/java/org/apache/archiva/redback/common/ldap/connection/DefaultLdapConnection.java b/redback-common/redback-common-ldap/src/main/java/org/apache/archiva/redback/common/ldap/connection/DefaultLdapConnection.java index 83f0126..1a6c555 100644 --- a/redback-common/redback-common-ldap/src/main/java/org/apache/archiva/redback/common/ldap/connection/DefaultLdapConnection.java +++ b/redback-common/redback-common-ldap/src/main/java/org/apache/archiva/redback/common/ldap/connection/DefaultLdapConnection.java @@ -19,7 +19,6 @@ package org.apache.archiva.redback.common.ldap.connection; * under the License. */ -import com.sun.jndi.ldap.LdapCtxFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -32,6 +31,7 @@ import java.util.Collections; import java.util.Hashtable; import java.util.List; import java.util.Properties; +import javax.naming.spi.NamingManager; /** * The configuration for a connection will not change. @@ -43,15 +43,6 @@ public class DefaultLdapConnection implements LdapConnection { - private static LdapCtxFactory ctxFactory;// = new LdapCtxFactory(); - - - static - { - initCtxFactory(); - } - - private Logger log = LoggerFactory.getLogger( getClass() ); private LdapConnectionConfiguration config; @@ -60,11 +51,6 @@ public class DefaultLdapConnection private List baseDnRdns; - private static void initCtxFactory() - { - ctxFactory = new LdapCtxFactory(); - } - public DefaultLdapConnection( LdapConnectionConfiguration config, Rdn subRdn ) throws LdapException { @@ -92,7 +78,7 @@ public class DefaultLdapConnection try { - context = (DirContext) ctxFactory.getInitialContext( e ); + context = (DirContext) NamingManager.getInitialContext( e ); } catch ( NamingException ex ) { @@ -121,7 +107,7 @@ public class DefaultLdapConnection try { - context = (DirContext) ctxFactory.getInitialContext( e ); + context = (DirContext) NamingManager.getInitialContext( e ); } catch ( NamingException ex ) {