geronimo-xbean-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ke...@apache.org
Subject svn commit: r997178 - /geronimo/xbean/trunk/xbean-bundleutils/src/main/java/org/apache/xbean/osgi/bundle/util/BundleClassLoader.java
Date Wed, 15 Sep 2010 03:27:06 GMT
Author: kevan
Date: Wed Sep 15 03:27:06 2010
New Revision: 997178

URL: http://svn.apache.org/viewvc?rev=997178&view=rev
Log:
XBEAN-156 only compute wiredBundles the first time.

Modified:
    geronimo/xbean/trunk/xbean-bundleutils/src/main/java/org/apache/xbean/osgi/bundle/util/BundleClassLoader.java

Modified: geronimo/xbean/trunk/xbean-bundleutils/src/main/java/org/apache/xbean/osgi/bundle/util/BundleClassLoader.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-bundleutils/src/main/java/org/apache/xbean/osgi/bundle/util/BundleClassLoader.java?rev=997178&r1=997177&r2=997178&view=diff
==============================================================================
--- geronimo/xbean/trunk/xbean-bundleutils/src/main/java/org/apache/xbean/osgi/bundle/util/BundleClassLoader.java
(original)
+++ geronimo/xbean/trunk/xbean-bundleutils/src/main/java/org/apache/xbean/osgi/bundle/util/BundleClassLoader.java
Wed Sep 15 03:27:06 2010
@@ -48,6 +48,7 @@ public class BundleClassLoader extends C
     private final static String META_INF_2 = "/META-INF/";
     
     protected final Bundle bundle;
+    private LinkedHashSet<Bundle> wiredBundles = null;
     private boolean searchWiredBundles;
 
     public BundleClassLoader(Bundle bundle) {
@@ -121,8 +122,11 @@ public class BundleClassLoader extends C
         return searchWiredBundles;
     }
     
-    protected LinkedHashSet<Bundle> getWiredBundles() {
-        return BundleUtils.getWiredBundles(bundle);
+    protected synchronized LinkedHashSet<Bundle> getWiredBundles() {
+        if (wiredBundles == null) {
+            wiredBundles = BundleUtils.getWiredBundles(bundle);
+        }
+        return wiredBundles;
     }
     
     protected boolean isMetaInfResource(String name) {



Mime
View raw message