felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pde...@apache.org
Subject svn commit: r1794788 - in /felix/trunk/dependencymanager/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl: AspectServiceImpl.java ComponentImpl.java
Date Thu, 11 May 2017 06:17:34 GMT
Author: pderop
Date: Thu May 11 06:17:34 2017
New Revision: 1794788

URL: http://svn.apache.org/viewvc?rev=1794788&view=rev
Log:
FELIX-5636: ComponentImpl.getServiceProperties() must always calculate the service properties.
Renamed AspectServiceImpl.getServiceProperties() method to getAspectServiceProperties()

Modified:
    felix/trunk/dependencymanager/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/AspectServiceImpl.java
    felix/trunk/dependencymanager/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ComponentImpl.java

Modified: felix/trunk/dependencymanager/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/AspectServiceImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/AspectServiceImpl.java?rev=1794788&r1=1794787&r2=1794788&view=diff
==============================================================================
--- felix/trunk/dependencymanager/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/AspectServiceImpl.java
(original)
+++ felix/trunk/dependencymanager/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/AspectServiceImpl.java
Thu May 11 06:17:34 2017
@@ -71,7 +71,12 @@ public class AspectServiceImpl extends F
         }  
 	}
 	
-    private Hashtable<String, Object> getServiceProperties(ServiceReference<?>
originalServiceRef) {
+	/**
+	 * Returns the aspect service properties (not the inherited properties from the lower ranked
aspect or from the original service).
+	 * @param originalServiceRef
+	 * @return
+	 */
+    private Hashtable<String, Object> getAspectServiceProperties(ServiceReference<?>
originalServiceRef) {
         Hashtable<String, Object> props = new Hashtable<>();
         if (m_serviceProperties != null) {
             Enumeration<String> e = m_serviceProperties.keys();
@@ -104,7 +109,7 @@ public class AspectServiceImpl extends F
             List<DependencyContext> dependencies = m_component.getDependencies();
             // Remove our internal dependency, replace it with one that points to the specific
service that just was passed in.
             dependencies.remove(0);
-            Hashtable<String, Object> serviceProperties = getServiceProperties(originalServiceRef);
+            Hashtable<String, Object> serviceProperties = getAspectServiceProperties(originalServiceRef);
             String[] serviceInterfaces = getServiceInterfaces();
             
             ServiceDependency aspectDependency = (ServiceDependencyImpl) m_manager.createServiceDependency()

Modified: felix/trunk/dependencymanager/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ComponentImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ComponentImpl.java?rev=1794788&r1=1794787&r2=1794788&view=diff
==============================================================================
--- felix/trunk/dependencymanager/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ComponentImpl.java
(original)
+++ felix/trunk/dependencymanager/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ComponentImpl.java
Thu May 11 06:17:34 2017
@@ -679,13 +679,7 @@ public class ComponentImpl implements Co
     @SuppressWarnings("unchecked")
     @Override
     public <K,V> Dictionary<K, V> getServiceProperties() {
-        if (m_serviceProperties != null) {
-            // Applied patch from FELIX-4304
-            Hashtable<String, Object> serviceProperties = new Hashtable<>();
-            addTo(serviceProperties, m_serviceProperties);
-            return (Dictionary<K, V>) serviceProperties;
-        }
-        return null;
+    	return (Dictionary<K, V>) calculateServiceProperties();
     }
 
     @Override



Mime
View raw message