incubator-aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n..@apache.org
Subject svn commit: r918571 - /incubator/aries/trunk/jndi/jndi-url/src/main/java/org/apache/aries/jndi/services/ServiceHelper.java
Date Wed, 03 Mar 2010 17:01:21 GMT
Author: not
Date: Wed Mar  3 17:01:20 2010
New Revision: 918571

URL: http://svn.apache.org/viewvc?rev=918571&view=rev
Log:
ARIES-128 Fix the fallback mechanism to find the BundleContext by looking at the stack (currently
it gets it very very very wrong).

Modified:
    incubator/aries/trunk/jndi/jndi-url/src/main/java/org/apache/aries/jndi/services/ServiceHelper.java

Modified: incubator/aries/trunk/jndi/jndi-url/src/main/java/org/apache/aries/jndi/services/ServiceHelper.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/jndi/jndi-url/src/main/java/org/apache/aries/jndi/services/ServiceHelper.java?rev=918571&r1=918570&r2=918571&view=diff
==============================================================================
--- incubator/aries/trunk/jndi/jndi-url/src/main/java/org/apache/aries/jndi/services/ServiceHelper.java
(original)
+++ incubator/aries/trunk/jndi/jndi-url/src/main/java/org/apache/aries/jndi/services/ServiceHelper.java
Wed Mar  3 17:01:20 2010
@@ -129,12 +129,7 @@
     }
     
     if (result == null) {
-      StackTraceElement[] stackTrace = AccessController.doPrivileged(new PrivilegedAction<StackTraceElement[]>()
{
-        public StackTraceElement[] run()
-        {
-          return Thread.currentThread().getStackTrace();
-        }
-      });
+      StackTraceElement[] stackTrace =  Thread.currentThread().getStackTrace();
       
       StackFinder finder = new StackFinder();
       Class<?>[] classStack = finder.getClassContext();
@@ -152,6 +147,7 @@
       }
       
       if (found) {
+        i--; // we need to move back an item because the previous loop leaves us one after
where we wanted to be
         Set<Integer> classLoadersChecked = new HashSet<Integer>();
         for (; i < classStack.length && result == null; i++) {
           ClassLoader cl = classStack[i].getClassLoader();



Mime
View raw message