felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickh...@apache.org
Subject svn commit: r760200 - in /felix/trunk/framework/src/main/java/org/apache/felix/framework: ExportedPackageImpl.java RequiredBundleImpl.java
Date Mon, 30 Mar 2009 22:17:42 GMT
Author: rickhall
Date: Mon Mar 30 22:17:42 2009
New Revision: 760200

URL: http://svn.apache.org/viewvc?rev=760200&view=rev
Log:
Improvements for new shell commands. (FELIX-1006, FELIX-1009)

Modified:
    felix/trunk/framework/src/main/java/org/apache/felix/framework/ExportedPackageImpl.java
    felix/trunk/framework/src/main/java/org/apache/felix/framework/RequiredBundleImpl.java

Modified: felix/trunk/framework/src/main/java/org/apache/felix/framework/ExportedPackageImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/ExportedPackageImpl.java?rev=760200&r1=760199&r2=760200&view=diff
==============================================================================
--- felix/trunk/framework/src/main/java/org/apache/felix/framework/ExportedPackageImpl.java
(original)
+++ felix/trunk/framework/src/main/java/org/apache/felix/framework/ExportedPackageImpl.java
Mon Mar 30 22:17:42 2009
@@ -30,8 +30,8 @@
     private final BundleImpl m_exportingBundle;
     private final IModule m_exportingModule;
     private final Capability m_export;
-    private String m_toString = null;
-    private String m_versionString = null;
+    private volatile String m_toString = null;
+    private volatile String m_versionString = null;
 
     public ExportedPackageImpl(
         Felix felix, BundleImpl exporter, IModule module, Capability export)

Modified: felix/trunk/framework/src/main/java/org/apache/felix/framework/RequiredBundleImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/RequiredBundleImpl.java?rev=760200&r1=760199&r2=760200&view=diff
==============================================================================
--- felix/trunk/framework/src/main/java/org/apache/felix/framework/RequiredBundleImpl.java
(original)
+++ felix/trunk/framework/src/main/java/org/apache/felix/framework/RequiredBundleImpl.java
Mon Mar 30 22:17:42 2009
@@ -35,6 +35,8 @@
 {
     private final Felix m_felix;
     private final BundleImpl m_bundle;
+    private volatile String m_toString = null;
+    private volatile String m_versionString = null;
 
     public RequiredBundleImpl(Felix felix, BundleImpl bundle)
     {
@@ -91,18 +93,21 @@
 
     public Version getVersion()
     {
-        ICapability[] caps = 
-            Util.getCapabilityByNamespace(
-                m_bundle.getCurrentModule(), ICapability.MODULE_NAMESPACE);
-        if ((caps != null) && (caps.length > 0))
-        {
-            return (Version) caps[0].getProperties().get(Constants.BUNDLE_VERSION_ATTRIBUTE);
-        }
-        return null;
+        return m_bundle.getCurrentModule().getVersion();
     }
 
     public boolean isRemovalPending()
     {
         return m_bundle.isRemovalPending();
     }
+
+    public String toString()
+    {
+        if (m_toString == null)
+        {
+            m_toString = m_bundle.getSymbolicName()
+                + "; version=" + m_bundle.getCurrentModule().getVersion();
+        }
+        return m_toString;
+    }
 }
\ No newline at end of file



Mime
View raw message