felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pde...@apache.org
Subject svn commit: r1636186 - /felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/BundleDependencyImpl.java
Date Sun, 02 Nov 2014 20:44:29 GMT
Author: pderop
Date: Sun Nov  2 20:44:29 2014
New Revision: 1636186

URL: http://svn.apache.org/r1636186
Log:
FELIX-4158: Added getSimpleName() method which only returns the bundle state mask

Modified:
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/BundleDependencyImpl.java

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/BundleDependencyImpl.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/BundleDependencyImpl.java?rev=1636186&r1=1636185&r2=1636186&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/BundleDependencyImpl.java
(original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/BundleDependencyImpl.java
Sun Nov  2 20:44:29 2014
@@ -86,16 +86,9 @@ public class BundleDependencyImpl extend
     @Override
     public String getName() {
         StringBuilder sb = new StringBuilder();
-        if ((m_stateMask & Bundle.ACTIVE) != 0) {
-            sb.append("active ");
-        }
-        if ((m_stateMask & Bundle.INSTALLED) != 0) {
-            sb.append("installed ");
-        }
-        if ((m_stateMask & Bundle.RESOLVED) != 0) {
-            sb.append("resolved ");
-        }
+        getSimpleName(sb);
         if (m_filter != null) {
+            sb.append(" ");
             sb.append(m_filter.toString());
         }
         if (m_bundleId != -1) {
@@ -105,6 +98,28 @@ public class BundleDependencyImpl extend
     }
 
     @Override
+    public String getSimpleName() {
+        // Return the state mask, but don't include the filter or bundle id.
+        StringBuilder sb = new StringBuilder();
+        if ((m_stateMask & Bundle.ACTIVE) != 0) {
+            sb.append("active");
+        }
+        if ((m_stateMask & Bundle.INSTALLED) != 0) {
+            if (sb.length() > 0) {
+                sb.append(" ");
+            }
+            sb.append("installed");
+        }
+        if ((m_stateMask & Bundle.RESOLVED) != 0) {
+            if (sb.length() > 0) {
+                sb.append(" ");
+            }
+            sb.append("resolved");
+        }
+        return sb.toString();
+    }
+    
+    @Override
     public String getFilter() {
         if (m_filter != null || m_bundleId != -1) {
             StringBuilder sb = new StringBuilder();
@@ -239,5 +254,23 @@ public class BundleDependencyImpl extend
         }
         return (Bundle) m_nullObject;
     }
+    
+    private void getSimpleName(StringBuilder sb) {
+        if ((m_stateMask & Bundle.ACTIVE) != 0) {
+            sb.append("active");
+        }
+        if ((m_stateMask & Bundle.INSTALLED) != 0) {
+            if (sb.length() > 0) {
+                sb.append(" ");
+            }
+            sb.append("installed");
+        }
+        if ((m_stateMask & Bundle.RESOLVED) != 0) {
+            if (sb.length() > 0) {
+                sb.append(" ");
+            }
+            sb.append("resolved");
+        }
+    }
 }
 



Mime
View raw message