From commits-return-2399-archive-asf-public=cust-asf.ponee.io@bval.apache.org Tue Oct 16 19:31:16 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id BFCD31807A3 for ; Tue, 16 Oct 2018 19:31:15 +0200 (CEST) Received: (qmail 68841 invoked by uid 500); 16 Oct 2018 17:31:06 -0000 Mailing-List: contact commits-help@bval.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@bval.apache.org Delivered-To: mailing list commits@bval.apache.org Received: (qmail 68196 invoked by uid 99); 16 Oct 2018 17:31:06 -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, 16 Oct 2018 17:31:06 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 00426E1125; Tue, 16 Oct 2018 17:31:05 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: mbenson@apache.org To: commits@bval.apache.org Date: Tue, 16 Oct 2018 17:31:44 -0000 Message-Id: <7a2649aca5ec499aa1d87c5b30041789@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [40/50] bval git commit: ensure TCCL is preferred over bval loader (OSGi+EE) ensure TCCL is preferred over bval loader (OSGi+EE) Project: http://git-wip-us.apache.org/repos/asf/bval/repo Commit: http://git-wip-us.apache.org/repos/asf/bval/commit/137910ff Tree: http://git-wip-us.apache.org/repos/asf/bval/tree/137910ff Diff: http://git-wip-us.apache.org/repos/asf/bval/diff/137910ff Branch: refs/heads/bv2 Commit: 137910ffa92ed94ca0911bf114010f36fc7e71ae Parents: 8cd26a8 Author: Romain Manni-Bucau Authored: Thu Aug 16 09:51:12 2018 +0200 Committer: Matt Benson Committed: Tue Oct 16 12:28:20 2018 -0500 ---------------------------------------------------------------------- .../main/java/org/apache/bval/jsr/ConfigurationImpl.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/bval/blob/137910ff/bval-jsr/src/main/java/org/apache/bval/jsr/ConfigurationImpl.java ---------------------------------------------------------------------- diff --git a/bval-jsr/src/main/java/org/apache/bval/jsr/ConfigurationImpl.java b/bval-jsr/src/main/java/org/apache/bval/jsr/ConfigurationImpl.java index 20ac2f8..aac4824 100644 --- a/bval-jsr/src/main/java/org/apache/bval/jsr/ConfigurationImpl.java +++ b/bval-jsr/src/main/java/org/apache/bval/jsr/ConfigurationImpl.java @@ -411,14 +411,20 @@ public class ConfigurationImpl implements ApacheValidatorConfiguration, Configur private BootstrapConfiguration createBootstrapConfiguration() { try { if (!ignoreXmlConfiguration) { - loader = ValidationParser.class.getClassLoader(); + loader = Thread.currentThread().getContextClassLoader(); + if (loader == null) { + loader = ValidationParser.class.getClassLoader(); + } final BootstrapConfiguration xmlBootstrap = ValidationParser.processValidationConfig(getProperties().get(Properties.VALIDATION_XML_PATH), this); if (xmlBootstrap != null) { return xmlBootstrap; } } - loader = ApacheValidatorFactory.class.getClassLoader(); + loader = Thread.currentThread().getContextClassLoader(); + if (loader == null) { + loader = ApacheValidatorFactory.class.getClassLoader(); + } return BootstrapConfigurationImpl.DEFAULT; } finally { participantFactory = new ParticipantFactory(loader);