bval-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject [40/50] bval git commit: ensure TCCL is preferred over bval loader (OSGi+EE)
Date Tue, 16 Oct 2018 17:35:41 GMT
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/master
Commit: 137910ffa92ed94ca0911bf114010f36fc7e71ae
Parents: 8cd26a8
Author: Romain Manni-Bucau <rmannibucau@gmail.com>
Authored: Thu Aug 16 09:51:12 2018 +0200
Committer: Matt Benson <mbenson@apache.org>
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);


Mime
View raw message