commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r1719586 - in /commons/proper/weaver/trunk/processor/src/main/java/org/apache/commons/weaver: CleanProcessor.java WeaveProcessor.java
Date Fri, 11 Dec 2015 22:52:27 GMT
Author: mbenson
Date: Fri Dec 11 22:52:27 2015
New Revision: 1719586

URL: http://svn.apache.org/viewvc?rev=1719586&view=rev
Log:
[WEAVER-7] support non-TCCL for Cleaner

Modified:
    commons/proper/weaver/trunk/processor/src/main/java/org/apache/commons/weaver/CleanProcessor.java
    commons/proper/weaver/trunk/processor/src/main/java/org/apache/commons/weaver/WeaveProcessor.java

Modified: commons/proper/weaver/trunk/processor/src/main/java/org/apache/commons/weaver/CleanProcessor.java
URL: http://svn.apache.org/viewvc/commons/proper/weaver/trunk/processor/src/main/java/org/apache/commons/weaver/CleanProcessor.java?rev=1719586&r1=1719585&r2=1719586&view=diff
==============================================================================
--- commons/proper/weaver/trunk/processor/src/main/java/org/apache/commons/weaver/CleanProcessor.java
(original)
+++ commons/proper/weaver/trunk/processor/src/main/java/org/apache/commons/weaver/CleanProcessor.java
Fri Dec 11 22:52:27 2015
@@ -32,6 +32,7 @@ import java.util.logging.Logger;
 import org.apache.commons.lang3.Validate;
 import org.apache.commons.weaver.model.WeaveEnvironment;
 import org.apache.commons.weaver.spi.Cleaner;
+import org.apache.commons.weaver.spi.Weaver;
 import org.apache.commons.weaver.utils.URLArray;
 import org.apache.xbean.finder.archive.FileArchive;
 
@@ -48,6 +49,12 @@ public class CleanProcessor {
 
     static {
         final List<Cleaner> cleaners = new ArrayList<Cleaner>();
+        final ClassLoader cleanerLoader = Cleaner.class.getClassLoader();
+        if (!Thread.currentThread().getContextClassLoader().equals(cleanerLoader)) {
+            for (final Cleaner cleaner : ServiceLoader.load(Cleaner.class, cleanerLoader))
{
+                cleaners.add(cleaner);
+            }
+        }
         for (final Cleaner cleaner : ServiceLoader.load(Cleaner.class)) {
             cleaners.add(cleaner);
         }

Modified: commons/proper/weaver/trunk/processor/src/main/java/org/apache/commons/weaver/WeaveProcessor.java
URL: http://svn.apache.org/viewvc/commons/proper/weaver/trunk/processor/src/main/java/org/apache/commons/weaver/WeaveProcessor.java?rev=1719586&r1=1719585&r2=1719586&view=diff
==============================================================================
--- commons/proper/weaver/trunk/processor/src/main/java/org/apache/commons/weaver/WeaveProcessor.java
(original)
+++ commons/proper/weaver/trunk/processor/src/main/java/org/apache/commons/weaver/WeaveProcessor.java
Fri Dec 11 22:52:27 2015
@@ -49,8 +49,9 @@ public class WeaveProcessor {
 
     static {
         final List<Weaver> weavers = new ArrayList<Weaver>();
-        if (!Thread.currentThread().getContextClassLoader().equals(Weaver.class.getClassLoader()))
{
-            for (final Weaver weaver : ServiceLoader.load(Weaver.class, Weaver.class.getClassLoader()))
{
+        final ClassLoader weaverLoader = Weaver.class.getClassLoader();
+        if (!Thread.currentThread().getContextClassLoader().equals(weaverLoader)) {
+            for (final Weaver weaver : ServiceLoader.load(Weaver.class, weaverLoader)) {
                 weavers.add(weaver);
             }
         }



Mime
View raw message