felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pde...@apache.org
Subject svn commit: r1632191 [3/4] - in /felix/sandbox/pderop/dependencymanager-prototype: org.apache.felix.dependencymanager.annotation/src/org/apache/felix/dm/annotation/plugin/bnd/ org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/ org....
Date Wed, 15 Oct 2014 22:09:13 GMT
Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/BundleAdapterImpl.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/BundleAdapterImpl.java?rev=1632191&r1=1632190&r2=1632191&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/BundleAdapterImpl.java (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/BundleAdapterImpl.java Wed Oct 15 22:09:11 2014
@@ -19,8 +19,8 @@
 package org.apache.felix.dm.impl;
 
 import java.util.Enumeration;
+import java.util.Hashtable;
 import java.util.List;
-import java.util.Properties;
 
 import org.apache.felix.dm.Component;
 import org.apache.felix.dm.ComponentStateListener;
@@ -43,7 +43,7 @@ public class BundleAdapterImpl extends F
     public BundleAdapterImpl(DependencyManager dm, int bundleStateMask, String bundleFilter, boolean propagate)
     {
         super(dm.createComponent()); // This service will be filtered by our super class, allowing us to take control.
-        m_component.setImplementation(new BundleAdapterDecorator(bundleStateMask, bundleFilter, propagate))
+        m_component.setImplementation(new BundleAdapterDecorator(bundleStateMask, propagate))
                  .add(dm.createBundleDependency()
                       .setFilter(bundleFilter)
                       .setStateMask(bundleStateMask)
@@ -54,21 +54,19 @@ public class BundleAdapterImpl extends F
     public class BundleAdapterDecorator extends AbstractDecorator {
         private final boolean m_propagate;
         private final int m_bundleStateMask;
-        private final String m_bundleFilter;
 
-        public BundleAdapterDecorator(int bundleStateMask, String bundleFilter, boolean propagate) {
+        public BundleAdapterDecorator(int bundleStateMask, boolean propagate) {
             m_bundleStateMask = bundleStateMask;
-            m_bundleFilter = bundleFilter;
             m_propagate = propagate;
         }
         
         public Component createService(Object[] properties) {
             Bundle bundle = (Bundle) properties[0];
-            Properties props = new Properties();
+            Hashtable<String, Object> props = new Hashtable<>();
             if (m_serviceProperties != null) {
-                Enumeration e = m_serviceProperties.keys();
+                Enumeration<String> e = m_serviceProperties.keys();
                 while (e.hasMoreElements()) {
-                    Object key = e.nextElement();
+                    String key = e.nextElement();
                     props.put(key, m_serviceProperties.get(key));
                 }
             }

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=1632191&r1=1632190&r2=1632191&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 Wed Oct 15 22:09:11 2014
@@ -21,12 +21,11 @@ package org.apache.felix.dm.impl;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Proxy;
 import java.util.Dictionary;
-import java.util.Set;
 
 import org.apache.felix.dm.BundleDependency;
 import org.apache.felix.dm.ComponentDependencyDeclaration;
-import org.apache.felix.dm.context.DependencyContext;
 import org.apache.felix.dm.context.AbstractDependency;
+import org.apache.felix.dm.context.DependencyContext;
 import org.apache.felix.dm.context.Event;
 import org.apache.felix.dm.tracker.BundleTracker;
 import org.apache.felix.dm.tracker.BundleTrackerCustomizer;
@@ -177,14 +176,15 @@ public class BundleDependencyImpl extend
         return Bundle.class;
     }
         
+    @SuppressWarnings("unchecked")
     @Override
-    public Dictionary<?,?> getProperties() {
+    public Dictionary<String, Object> getProperties() {
         Event event = getService();
         if (event != null) {
             Bundle bundle = (Bundle) event.getEvent();
             if (m_propagateCallbackInstance != null && m_propagateCallbackMethod != null) {
                 try {
-                    return (Dictionary<?,?>) InvocationUtil.invokeCallbackMethod(m_propagateCallbackInstance, m_propagateCallbackMethod, new Class[][] {{ Bundle.class }}, new Object[][] {{ bundle }});
+                    return (Dictionary<String, Object>) InvocationUtil.invokeCallbackMethod(m_propagateCallbackInstance, m_propagateCallbackMethod, new Class[][] {{ Bundle.class }}, new Object[][] {{ bundle }});
                 }
                 catch (InvocationTargetException e) {
                     m_logger.log(LogService.LOG_WARNING, "Exception while invoking callback method", e.getCause());
@@ -195,7 +195,7 @@ public class BundleDependencyImpl extend
                 throw new IllegalStateException("Could not invoke callback");
             }
             else {
-                return bundle.getHeaders();
+                return (Dictionary<String, Object>) bundle.getHeaders();
             }
         }
         else {

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/BundleEventImpl.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/BundleEventImpl.java?rev=1632191&r1=1632190&r2=1632191&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/BundleEventImpl.java (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/BundleEventImpl.java Wed Oct 15 22:09:11 2014
@@ -20,10 +20,11 @@ package org.apache.felix.dm.impl;
 
 import java.util.Dictionary;
 
+import org.apache.felix.dm.context.Event;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleEvent;
 
-public class BundleEventImpl extends EventImpl implements Comparable {
+public class BundleEventImpl implements Event {
     final Bundle m_bundle;
     final BundleEvent m_event;
     
@@ -37,11 +38,16 @@ public class BundleEventImpl extends Eve
         return getBundle();
     }
     
+    @SuppressWarnings("unchecked")
     @Override
-    public Dictionary getProperties() {
+    public Dictionary<String, Object> getProperties() {
         return m_bundle.getHeaders();
     }
     
+    @Override
+    public void close() {
+    }
+
     public Bundle getBundle() {
         return m_bundle;
     }
@@ -64,7 +70,7 @@ public class BundleEventImpl extends Eve
     }
 
     @Override
-    public int compareTo(Object b) {
+    public int compareTo(Event b) {
         return Long.compare(getBundle().getBundleId(), ((BundleEventImpl) b).getBundle().getBundleId());
     }
 }

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ComponentImpl.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ComponentImpl.java?rev=1632191&r1=1632190&r2=1632191&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ComponentImpl.java (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ComponentImpl.java Wed Oct 15 22:09:11 2014
@@ -34,7 +34,6 @@ import java.util.HashMap;
 import java.util.Hashtable;
 import java.util.List;
 import java.util.Map;
-import java.util.Properties;
 import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentSkipListSet;
@@ -227,7 +226,7 @@ public class ComponentImpl implements Co
 	}
 
 	@Override
-	public Component setInterface(String serviceName, Dictionary properties) {
+	public Component setInterface(String serviceName, Dictionary<String, ?> properties) {
 		ensureNotActive();
 	    m_serviceName = serviceName;
 	    m_serviceProperties = properties;
@@ -235,7 +234,7 @@ public class ComponentImpl implements Co
 	}
 
 	@Override
-	public Component setInterface(String[] serviceName, Dictionary properties) {
+	public Component setInterface(String[] serviceName, Dictionary<String, ?> properties) {
 	    ensureNotActive();
 	    m_serviceName = serviceName;
 	    m_serviceProperties = properties;
@@ -314,6 +313,8 @@ public class ComponentImpl implements Co
                     updateInstance(dc, e, true, false);
                 }
                 break;
+            default:
+                // noop
             }
         }
     }
@@ -668,22 +669,12 @@ public class ComponentImpl implements Co
         }
     }
     
-    private boolean hasSomePropagateDependencies() {
-		for (int i = 0; i < m_dependencies.size(); i++) {
-			DependencyContext d = (DependencyContext) m_dependencies.get(i);
-			if (d.isPropagated()) {
-				return true;
-			}
-		}
-		return false;
-    }
-
-    private Dictionary calculateServiceProperties() {
-		Dictionary properties = new Properties();
+    private Dictionary<String, Object> calculateServiceProperties() {
+		Dictionary<String, Object> properties = new Hashtable<>();
 		for (int i = 0; i < m_dependencies.size(); i++) {
 			DependencyContext d = (DependencyContext) m_dependencies.get(i);
 			if (d.isPropagated() && d.isAvailable()) {
-				Dictionary dict = d.getProperties();
+				Dictionary<String, Object> dict = d.getProperties();
 				addTo(properties, dict);
 			}
 		}
@@ -696,14 +687,14 @@ public class ComponentImpl implements Co
 		return properties;
 	}
 
-	private void addTo(Dictionary properties, Dictionary additional) {
+	private void addTo(Dictionary<String, Object> properties, Dictionary<String, ?> additional) {
 		if (properties == null) {
 			throw new IllegalArgumentException("Dictionary to add to cannot be null.");
 		}
 		if (additional != null) {
-			Enumeration e = additional.keys();
+			Enumeration<String> e = additional.keys();
 			while (e.hasMoreElements()) {
-				Object key = e.nextElement();
+				String key = e.nextElement();
 				properties.put(key, additional.get(key));
 			}
 		}
@@ -714,7 +705,7 @@ public class ComponentImpl implements Co
 	    if (m_componentInstance == null) {
             if (m_componentDefinition instanceof Class) {
                 try {
-                    m_componentInstance = createInstance((Class) m_componentDefinition);
+                    m_componentInstance = createInstance((Class<?>) m_componentDefinition);
                 }
                 catch (Exception e) {
                     m_logger.log(Logger.LOG_ERROR, "Could not instantiate class " + m_componentDefinition, e);
@@ -726,7 +717,7 @@ public class ComponentImpl implements Co
 		        	if (m_instanceFactory != null) {
 		        		if (m_instanceFactory instanceof Class) {
 		        			try {
-								factory = createInstance((Class) m_instanceFactory);
+								factory = createInstance((Class<?>) m_instanceFactory);
 							}
 		                    catch (Exception e) {
 		                        m_logger.log(Logger.LOG_ERROR, "Could not create factory instance of class " + m_instanceFactory + ".", e);
@@ -904,7 +895,7 @@ public class ComponentImpl implements Co
     private Object createInstance(Class<?> clazz) throws SecurityException, NoSuchMethodException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
 		Constructor<?> constructor = clazz.getConstructor(VOID);
 		constructor.setAccessible(true);
-        return constructor.newInstance(null);
+        return constructor.newInstance();
     }
 
 	private void notifyListeners(ComponentState state) {
@@ -989,10 +980,10 @@ public class ComponentImpl implements Co
 	}
 
 	@Override
-	public Dictionary getServiceProperties() {
+	public Dictionary<String, Object> getServiceProperties() {
 		if (m_serviceProperties != null) {
 			// Applied patch from FELIX-4304
-			Hashtable serviceProperties = new Hashtable();
+			Hashtable<String, Object> serviceProperties = new Hashtable<>();
 			addTo(serviceProperties, m_serviceProperties);
 			return serviceProperties;
 		}
@@ -1000,11 +991,11 @@ public class ComponentImpl implements Co
 	}
 
 	@Override
-	public Component setServiceProperties(final Dictionary serviceProperties) {
+	public Component setServiceProperties(final Dictionary<String, ?> serviceProperties) {
 	    getExecutor().execute(new Runnable() {
 			@Override
 			public void run() {
-			    Dictionary properties = null;
+			    Dictionary<String, Object> properties = null;
 		        m_serviceProperties = serviceProperties;
 		        if ((m_registration != null) && (m_serviceName != null)) {
 		            properties = calculateServiceProperties();
@@ -1151,7 +1142,7 @@ public class ComponentImpl implements Co
     }
     
     private void appendProperties(StringBuffer result) {
-        Dictionary properties = calculateServiceProperties();
+        Dictionary<String, Object> properties = calculateServiceProperties();
         if (properties != null) {
             result.append("(");
             Enumeration<?> enumeration = properties.keys();

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ConfigurationDependencyImpl.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ConfigurationDependencyImpl.java?rev=1632191&r1=1632190&r2=1632191&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ConfigurationDependencyImpl.java (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ConfigurationDependencyImpl.java Wed Oct 15 22:09:11 2014
@@ -36,7 +36,7 @@ import org.osgi.service.cm.Configuration
 import org.osgi.service.cm.ManagedService;
 
 public class ConfigurationDependencyImpl extends AbstractDependency<ConfigurationDependency> implements ConfigurationDependency, ManagedService {
-    private Dictionary<?,?> m_settings;
+    private Dictionary<String, Object> m_settings;
     private String m_callback = "updated";
 	private final Logger m_logger;
 	private String m_pid;
@@ -101,7 +101,7 @@ public class ConfigurationDependencyImpl
     }
     
 	public ConfigurationDependency setPid(String pid) {
-		// ensureNotActive(); TODO
+		ensureNotActive();
 		m_pid = pid;
 		return this;
 	}
@@ -147,17 +147,18 @@ public class ConfigurationDependencyImpl
     }
     
 	@Override
-	public Dictionary getProperties() {
+	public Dictionary<String, Object> getProperties() {
 		if (m_settings == null) {
             throw new IllegalStateException("cannot find configuration");
 		}
 		return m_settings;
 	}
     
+    @SuppressWarnings({"unchecked", "rawtypes"})
     @Override
     public void updated(Dictionary settings) throws ConfigurationException {
     	m_updateInvokedCache.set(false);
-        Dictionary<?,?> oldSettings = null;
+        Dictionary<String, Object> oldSettings = null;
         synchronized (this) {
             oldSettings = m_settings;
         }

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ConfigurationEventImpl.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ConfigurationEventImpl.java?rev=1632191&r1=1632190&r2=1632191&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ConfigurationEventImpl.java (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ConfigurationEventImpl.java Wed Oct 15 22:09:11 2014
@@ -2,11 +2,13 @@ package org.apache.felix.dm.impl;
 
 import java.util.Dictionary;
 
-public class ConfigurationEventImpl extends EventImpl {
-    private final Dictionary<?,?> m_conf;
+import org.apache.felix.dm.context.Event;
+
+public class ConfigurationEventImpl implements Event {
+    private final Dictionary<String, Object> m_conf;
     private final String m_pid;
     
-    public ConfigurationEventImpl(String pid, Dictionary<?,?> conf) {
+    public ConfigurationEventImpl(String pid, Dictionary<String, Object> conf) {
         m_pid = pid;
         m_conf = conf;
     }
@@ -14,13 +16,23 @@ public class ConfigurationEventImpl exte
     public String getPid() {
         return m_pid;
     }
-    
-    public Dictionary<?,?> getConf() {
+        
+    @Override
+    public Object getEvent() {
         return m_conf;
     }
-    
+
     @Override
-    public Object getEvent() {
+    public int compareTo(Event other) {
+        return m_pid.compareTo(((ConfigurationEventImpl) other).m_pid);
+    }
+
+    @Override
+    public Dictionary<String, Object> getProperties() {
         return m_conf;
     }
+
+    @Override
+    public void close() {
+    }
 }

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/DefaultNullObject.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/DefaultNullObject.java?rev=1632191&r1=1632190&r2=1632191&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/DefaultNullObject.java (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/DefaultNullObject.java Wed Oct 15 22:09:11 2014
@@ -42,7 +42,7 @@ public final class DefaultNullObject imp
      * value without doing anything.
      */
     public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
-        Class returnType = method.getReturnType();
+        Class<?> returnType = method.getReturnType();
         if (returnType.equals(Boolean.class) || returnType.equals(Boolean.TYPE)) {
             return DEFAULT_BOOLEAN;
         }

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/EventImpl.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/EventImpl.java?rev=1632191&r1=1632190&r2=1632191&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/EventImpl.java (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/EventImpl.java Wed Oct 15 22:09:11 2014
@@ -19,7 +19,6 @@
 package org.apache.felix.dm.impl;
 
 import java.util.Dictionary;
-import java.util.Hashtable;
 
 import org.apache.felix.dm.context.Event;
 
@@ -29,7 +28,6 @@ import org.apache.felix.dm.context.Event
 public class EventImpl implements Event {
 	private final int m_id;
 	private final Object m_event;    // the actual event object (a Service, a Bundle, a Configuration, etc ...)
-	private final static Dictionary m_emptyProperties = new Hashtable();
 
 	public EventImpl() {
 		this(1);
@@ -61,7 +59,7 @@ public class EventImpl implements Event 
 	}
 	
     @Override
-    public int compareTo(Object o) {
+    public int compareTo(Event o) {
         EventImpl a = this, b = (EventImpl) o;
         if (a.m_id < b.m_id) {
             return -1;
@@ -82,7 +80,7 @@ public class EventImpl implements Event 
     }
     
     @Override
-    public Dictionary getProperties() {
-        return m_emptyProperties;
+    public Dictionary<String, Object> getProperties() {
+        return ServiceUtil.EMPTY_PROPERTIES;
     }
 }

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/FactoryConfigurationAdapterImpl.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/FactoryConfigurationAdapterImpl.java?rev=1632191&r1=1632190&r2=1632191&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/FactoryConfigurationAdapterImpl.java (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/FactoryConfigurationAdapterImpl.java Wed Oct 15 22:09:11 2014
@@ -54,7 +54,7 @@ public class FactoryConfigurationAdapter
         m_factoryPid = factoryPid;
         m_logger = ((ComponentImpl) m_component).getLogger();
 
-        Hashtable props = new Hashtable();
+        Hashtable<String, Object> props = new Hashtable<>();
         props.put(Constants.SERVICE_PID, factoryPid);
         m_component
             .setInterface(ManagedServiceFactory.class.getName(), props)
@@ -67,7 +67,7 @@ public class FactoryConfigurationAdapter
         super(dm.createComponent()); // This service will be filtered by our super class, allowing us to take control.
         m_factoryPid = factoryPid;
         m_logger = logger;
-        Hashtable props = new Hashtable();
+        Hashtable<String, Object> props = new Hashtable<>();
         props.put(Constants.SERVICE_PID, factoryPid);
         m_component
             .setInterface(ManagedServiceFactory.class.getName(), props)
@@ -116,14 +116,15 @@ public class FactoryConfigurationAdapter
         /**
          * Method called from our superclass, when we need to create a service.
          */
+        @SuppressWarnings("unchecked")
         public Component createService(Object[] properties) {
-            Dictionary settings = (Dictionary) properties[0];     
+            Dictionary<String, ?> settings = (Dictionary<String, ?>) properties[0];     
             Component newService = m_manager.createComponent();        
             Object impl = null;
             
             try {
                 if (m_serviceImpl != null) {
-                    impl = (m_serviceImpl instanceof Class) ? ((Class) m_serviceImpl).newInstance() : m_serviceImpl;
+                    impl = (m_serviceImpl instanceof Class) ? ((Class<?>) m_serviceImpl).newInstance() : m_serviceImpl;
                 }
                 else {
                     impl = instantiateFromFactory(m_factory, m_factoryCreateMethod);
@@ -138,7 +139,7 @@ public class FactoryConfigurationAdapter
             }
 
             // Merge adapter service properties, with CM settings 
-            Dictionary serviceProperties = getServiceProperties(settings);
+            Dictionary<String, Object> serviceProperties = getServiceProperties(settings);
             newService.setInterface(m_serviceInterfaces, serviceProperties);
             newService.setImplementation(impl);
             newService.setComposition(m_compositionInstance, m_compositionMethod); // if not set, no effect
@@ -160,8 +161,9 @@ public class FactoryConfigurationAdapter
          * Method called from our superclass, when we need to update a Service, because 
          * the configuration has changed.
          */
+        @SuppressWarnings("unchecked")
         public void updateService(Object[] properties) {
-            Dictionary cmSettings = (Dictionary) properties[0];
+            Dictionary<String, ?> cmSettings = (Dictionary<String, ?>) properties[0];
             Component service = (Component) properties[1];
             Object impl = service.getInstances()[0];
 
@@ -170,7 +172,7 @@ public class FactoryConfigurationAdapter
                     new Class[][] {{ Dictionary.class }, {}}, 
                     new Object[][] {{ cmSettings }, {}});
                 if (m_serviceInterfaces != null && m_propagate == true) {
-                    Dictionary serviceProperties = getServiceProperties(cmSettings);
+                    Dictionary<String, ?> serviceProperties = getServiceProperties(cmSettings);
                     service.setServiceProperties(serviceProperties);
                 }
             }
@@ -188,14 +190,14 @@ public class FactoryConfigurationAdapter
          * @param settings
          * @return
          */
-        private Dictionary getServiceProperties(Dictionary settings) {
-            Dictionary props = new Hashtable();
+        private Dictionary<String, Object> getServiceProperties(Dictionary<String, ?> settings) {
+            Dictionary<String, Object> props = new Hashtable<>();
             
             // Add adapter Service Properties
             if (m_serviceProperties != null) {
-                Enumeration keys = m_serviceProperties.keys();
+                Enumeration<String> keys = m_serviceProperties.keys();
                 while (keys.hasMoreElements()) {
-                    Object key = keys.nextElement();
+                    String key = keys.nextElement();
                     Object val = m_serviceProperties.get(key);
                     props.put(key, val);
                 }
@@ -204,9 +206,9 @@ public class FactoryConfigurationAdapter
             if (m_propagate) {
                 // Add CM setting into adapter service properties.
                 // (CM setting will override existing adapter service properties).
-                Enumeration keys = settings.keys();
+                Enumeration<String> keys = settings.keys();
                 while (keys.hasMoreElements()) {
-                    Object key = keys.nextElement();
+                    String key = keys.nextElement();
                     if (! key.toString().startsWith(".")) {
                         // public properties are propagated
                         Object val = settings.get(key);
@@ -223,7 +225,7 @@ public class FactoryConfigurationAdapter
             Object factory = null;
             if (m_factory instanceof Class) {
                 try {
-                    factory = createInstance((Class) m_factory);
+                    factory = createInstance((Class<?>) m_factory);
                 }
                 catch (Throwable t) {
                     handleException(t);
@@ -242,8 +244,8 @@ public class FactoryConfigurationAdapter
             }
         }
 
-        private Object createInstance(Class clazz) throws SecurityException, NoSuchMethodException, InstantiationException, IllegalAccessException {
-            Constructor constructor = clazz.getConstructor(new Class[] {});
+        private Object createInstance(Class<?> clazz) throws SecurityException, NoSuchMethodException, InstantiationException, IllegalAccessException {
+            Constructor<?> constructor = clazz.getConstructor(new Class[] {});
             constructor.setAccessible(true);
             return clazz.newInstance();
         }

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/FieldUtil.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/FieldUtil.java?rev=1632191&r1=1632190&r2=1632191&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/FieldUtil.java (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/FieldUtil.java Wed Oct 15 22:09:11 2014
@@ -93,9 +93,9 @@ public class FieldUtil {
                 }
             }
 
+            @SuppressWarnings("unchecked")
             public void injectIterableField(Field f, Object target) {
                 f.setAccessible(true);
-                Class<?> type = f.getType();
 
                 try {
                     Iterable<Object> iter = (Iterable<Object>) f.get(target);
@@ -110,11 +110,12 @@ public class FieldUtil {
                 }
             }
 
+            @SuppressWarnings({ "unchecked", "rawtypes" })
             @Override
             public void injectMapField(Field f, Object target) {
                 f.setAccessible(true);
                 try {
-                    Map<Object, Dictionary> map = (Map) f.get(target);
+                    Map<Object, Dictionary<String, ?>> map = (Map) f.get(target);
                     if (map == null) {
                         map = new ConcurrentHashMap<>();
                         f.set(target, map);
@@ -154,16 +155,16 @@ public class FieldUtil {
                 }
             }
 
+            @SuppressWarnings("unchecked")
             public void injectIterableField(Field f, Object target) {
                 if (update) {
                     return;
                 }
 
                 f.setAccessible(true);
-                Class<?> type = f.getType();
 
                 try {
-                    Collection coll = (Collection) f.get(target);
+                    Collection<Object> coll = (Collection<Object>) f.get(target);
                     if (add) {
                         coll.add(event.getEvent());
                     } else {
@@ -175,13 +176,13 @@ public class FieldUtil {
                 }
             }
 
+            @SuppressWarnings({ "rawtypes", "unchecked" })
             @Override
             public void injectMapField(Field f, Object target) {
                 f.setAccessible(true);
-                Class<?> type = f.getType();
 
                 try {
-                    Map<Object, Dictionary> map = (Map) f.get(target);
+                    Map<Object, Dictionary<String, ?>> map = (Map) f.get(target);
                     if (add) {
                         map.put(event.getEvent(), event.getProperties());
                     } else {

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/FilterComponent.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/FilterComponent.java?rev=1632191&r1=1632190&r2=1632191&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/FilterComponent.java (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/FilterComponent.java Wed Oct 15 22:09:11 2014
@@ -24,7 +24,6 @@ import java.util.Map;
 import java.util.Set;
 import java.util.concurrent.CopyOnWriteArrayList;
 import java.util.concurrent.Executor;
-import java.util.concurrent.ExecutorService;
 
 import org.apache.felix.dm.Component;
 import org.apache.felix.dm.ComponentDeclaration;
@@ -46,7 +45,7 @@ import org.osgi.framework.ServiceRegistr
  */
 public class FilterComponent implements Component, ComponentContext, ComponentDeclaration {
     protected volatile ComponentImpl m_component;
-    protected volatile List<ComponentStateListener> m_stateListeners = new CopyOnWriteArrayList();
+    protected volatile List<ComponentStateListener> m_stateListeners = new CopyOnWriteArrayList<>();
     protected volatile String m_init = "init";
     protected volatile String m_start = "start";
     protected volatile String m_stop = "stop";
@@ -58,7 +57,7 @@ public class FilterComponent implements 
     protected volatile Object m_serviceImpl;
     protected volatile Object m_factory;
     protected volatile String m_factoryCreateMethod;
-    protected volatile Dictionary<?,?> m_serviceProperties;
+    protected volatile Dictionary<String, Object> m_serviceProperties;
 
     public FilterComponent(Component service) {
         m_component = (ComponentImpl) service;
@@ -106,7 +105,7 @@ public class FilterComponent implements 
         return m_component.getClassName();
     }
     
-    public  Dictionary<?,?> getServiceProperties() {
+    public  Dictionary<String, Object> getServiceProperties() {
         return m_serviceProperties;
     }
 
@@ -190,24 +189,24 @@ public class FilterComponent implements 
         return this;
     }
 
-    public Component setInterface(String serviceName, Dictionary<?,?> properties) {
+    public Component setInterface(String serviceName, Dictionary<String, ?> properties) {
         return setInterface(new String[] { serviceName }, properties);
     }
 
-    public synchronized Component setInterface(String[] serviceInterfaces, Dictionary<?,?> properties) {
+    @SuppressWarnings("unchecked")
+    public synchronized Component setInterface(String[] serviceInterfaces, Dictionary<String, ?> properties) {
         m_component.ensureNotActive();
         if (serviceInterfaces != null) {
             m_serviceInterfaces = new String[serviceInterfaces.length];
             System.arraycopy(serviceInterfaces, 0, m_serviceInterfaces, 0, serviceInterfaces.length);
-            m_serviceProperties = properties;
+            m_serviceProperties = (Dictionary<String, Object>) properties;
         }
         return this;
     }
 
-    public Component setServiceProperties(Dictionary<?,?> serviceProperties) {
-        synchronized (this) {
-            m_serviceProperties = serviceProperties;
-        }
+    @SuppressWarnings("unchecked")
+    public Component setServiceProperties(Dictionary<String, ?> serviceProperties) {
+        m_serviceProperties = (Dictionary<String, Object>) serviceProperties;
         // Set the properties to all already instantiated services.
         if (serviceProperties != null) {
             Object[] instances = m_component.getInstances();

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/InvocationUtil.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/InvocationUtil.java?rev=1632191&r1=1632190&r2=1632191&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/InvocationUtil.java (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/InvocationUtil.java Wed Oct 15 22:09:11 2014
@@ -32,7 +32,7 @@ import java.util.Map;
  * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */
 public class InvocationUtil {
-    private static final Map /* <Key, Method> */ m_methodCache;
+    private static final Map<Key, Method> m_methodCache;
     static {
         int size = 2048;
         // TODO enable this again
@@ -60,8 +60,8 @@ public class InvocationUtil {
      * @throws IllegalAccessException when the method cannot be accessed
      * @throws InvocationTargetException when the method that was invoked throws an exception
      */
-    public static Object invokeCallbackMethod(Object instance, String methodName, Class[][] signatures, Object[][] parameters) throws NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException {
-        Class currentClazz = instance.getClass();
+    public static Object invokeCallbackMethod(Object instance, String methodName, Class<?>[][] signatures, Object[][] parameters) throws NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException {
+        Class<?> currentClazz = instance.getClass();
         while (currentClazz != null && currentClazz != Object.class) {
             try {
                 return invokeMethod(instance, currentClazz, methodName, signatures, parameters, false);
@@ -89,7 +89,7 @@ public class InvocationUtil {
      * @throws IllegalAccessException when the method cannot be accessed
      * @throws InvocationTargetException when the method that was invoked throws an exception
      */
-    public static Object invokeMethod(Object object, Class clazz, String name, Class[][] signatures, Object[][] parameters, boolean isSuper) throws NoSuchMethodException, InvocationTargetException, IllegalArgumentException, IllegalAccessException {
+    public static Object invokeMethod(Object object, Class<?> clazz, String name, Class<?>[][] signatures, Object[][] parameters, boolean isSuper) throws NoSuchMethodException, InvocationTargetException, IllegalArgumentException, IllegalAccessException {
         if (object == null) {
             throw new IllegalArgumentException("Instance cannot be null");
         }
@@ -106,7 +106,7 @@ public class InvocationUtil {
         
         Method m = null;
         for (int i = 0; i < signatures.length; i++) {
-            Class[] signature = signatures[i];
+            Class<?>[] signature = signatures[i];
             m = getDeclaredMethod(clazz, name, signature, isSuper);
             if (m != null) {
                 return m.invoke(object, parameters[i]);
@@ -115,7 +115,7 @@ public class InvocationUtil {
         throw new NoSuchMethodException(name);
     }
     
-    private static Method getDeclaredMethod(Class clazz, String name, Class[] signature, boolean isSuper) {
+    private static Method getDeclaredMethod(Class<?> clazz, String name, Class<?>[] signature, boolean isSuper) {
         // first check our cache
         Key key = new Key(clazz, name, signature);
         Method m = null;
@@ -137,7 +137,6 @@ public class InvocationUtil {
             }
         }
         catch (NoSuchMethodException e) {
-            // ignore
         }
         synchronized (m_methodCache) {
             m_methodCache.put(key, m);
@@ -146,11 +145,11 @@ public class InvocationUtil {
     }
     
     public static class Key {
-        private final Class m_clazz;
+        private final Class<?> m_clazz;
         private final String m_name;
-        private final Class[] m_signature;
+        private final Class<?>[] m_signature;
 
-        public Key(Class clazz, String name, Class[] signature) {
+        public Key(Class<?> clazz, String name, Class<?>[] signature) {
             m_clazz = clazz;
             m_name = name;
             m_signature = signature;
@@ -191,14 +190,15 @@ public class InvocationUtil {
         }
     }
     
-    public static class LRUMap extends LinkedHashMap {
+    @SuppressWarnings("serial")
+    public static class LRUMap extends LinkedHashMap<Key, Method> {
         private final int m_size;
         
         public LRUMap(int size) {
             m_size = size;
         }
         
-        protected boolean removeEldestEntry(java.util.Map.Entry eldest) {
+        protected boolean removeEldestEntry(java.util.Map.Entry<Key, Method> eldest) {
             return size() > m_size;
         }
     }

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/Logger.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/Logger.java?rev=1632191&r1=1632190&r2=1632191&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/Logger.java (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/Logger.java Wed Oct 15 22:09:11 2014
@@ -219,7 +219,7 @@ public class Logger implements ServiceLi
             m_logger = null;
         }
         else {
-            Class[] formalParams = { ServiceReference.class, Integer.TYPE, String.class, Throwable.class };
+            Class<?>[] formalParams = { ServiceReference.class, Integer.TYPE, String.class, Throwable.class };
             try {
                 Method logMethod = logObj.getClass().getMethod("log", formalParams);
                 logMethod.setAccessible(true);

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ResourceAdapterImpl.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ResourceAdapterImpl.java?rev=1632191&r1=1632190&r2=1632191&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ResourceAdapterImpl.java (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ResourceAdapterImpl.java Wed Oct 15 22:09:11 2014
@@ -20,8 +20,8 @@ package org.apache.felix.dm.impl;
 
 import java.net.URL;
 import java.util.Enumeration;
+import java.util.Hashtable;
 import java.util.List;
-import java.util.Properties;
 
 import org.apache.felix.dm.Component;
 import org.apache.felix.dm.ComponentStateListener;
@@ -99,11 +99,11 @@ public class ResourceAdapterImpl extends
 
         public Component createService(Object[] properties) {
             URL resource = (URL) properties[0]; 
-            Properties props = new Properties();
+            Hashtable<String, Object> props = new Hashtable<>();
             if (m_serviceProperties != null) {
-                Enumeration e = m_serviceProperties.keys();
+                Enumeration<String> e = m_serviceProperties.keys();
                 while (e.hasMoreElements()) {
-                    Object key = e.nextElement();
+                    String key = e.nextElement();
                     props.put(key, m_serviceProperties.get(key));
                 }
             }

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ResourceDependencyImpl.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ResourceDependencyImpl.java?rev=1632191&r1=1632190&r2=1632191&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ResourceDependencyImpl.java (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ResourceDependencyImpl.java Wed Oct 15 22:09:11 2014
@@ -22,15 +22,14 @@ import java.lang.reflect.InvocationTarge
 import java.net.URL;
 import java.util.Dictionary;
 import java.util.Enumeration;
-import java.util.Properties;
-import java.util.Set;
+import java.util.Hashtable;
 
 import org.apache.felix.dm.Component;
 import org.apache.felix.dm.ComponentDependencyDeclaration;
 import org.apache.felix.dm.ResourceDependency;
 import org.apache.felix.dm.ResourceHandler;
-import org.apache.felix.dm.context.DependencyContext;
 import org.apache.felix.dm.context.AbstractDependency;
+import org.apache.felix.dm.context.DependencyContext;
 import org.apache.felix.dm.context.Event;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceRegistration;
@@ -64,13 +63,13 @@ public class ResourceDependencyImpl exte
     
     @Override
     protected void startTracking() {
-        Dictionary props = null;
+        Dictionary<String, Object> props = null;
         if (m_trackedResource != null) {
-            props = new Properties();
+            props = new Hashtable<>();
             props.put(ResourceHandler.URL, m_trackedResource);
         } else {
             if (m_resourceFilter != null) {
-                props = new Properties();
+                props = new Hashtable<>();
                 props.put(ResourceHandler.FILTER, m_resourceFilter);
             }
         }
@@ -89,7 +88,7 @@ public class ResourceDependencyImpl exte
         }
     }
     
-    public void added(URL resource, Dictionary resourceProperties) {
+    public void added(URL resource, Dictionary<String, ?> resourceProperties) {
         if (m_trackedResource == null || m_trackedResource.equals(resource)) {
             add(new ResourceEventImpl(resource, resourceProperties));
         }
@@ -101,7 +100,7 @@ public class ResourceDependencyImpl exte
         }
     }
     
-    public void changed(URL resource, Dictionary resourceProperties) {
+    public void changed(URL resource, Dictionary<String, ?> resourceProperties) {
         if (m_trackedResource == null || m_trackedResource.equals(resource)) {
             change(new ResourceEventImpl(resource, resourceProperties));
         }
@@ -113,7 +112,7 @@ public class ResourceDependencyImpl exte
         }
     }
     
-    public void removed(URL resource, Dictionary resourceProperties) {
+    public void removed(URL resource, Dictionary<String, ?> resourceProperties) {
         if (m_trackedResource == null || m_trackedResource.equals(resource)) {
             remove(new ResourceEventImpl(resource, resourceProperties));
         }
@@ -168,14 +167,15 @@ public class ResourceDependencyImpl exte
         return URL.class;
     }
         
-    public Dictionary<?,?> getProperties() {
+    @SuppressWarnings("unchecked")
+    public Dictionary<String, Object> getProperties() {
         ResourceEventImpl re = (ResourceEventImpl) m_component.getDependencyEvent(this);
         if (re != null) {
             URL resource = re.getResource();
-            Dictionary<?,?> resourceProperties = re.getProperties();
+            Dictionary<String, Object> resourceProperties = re.getProperties();
             if (m_propagateCallbackInstance != null && m_propagateCallbackMethod != null) {
                 try {
-                    return (Dictionary<?,?>) InvocationUtil.invokeCallbackMethod(m_propagateCallbackInstance, m_propagateCallbackMethod, new Class[][] {{ URL.class }}, new Object[][] {{ resource }});
+                    return (Dictionary<String, Object>) InvocationUtil.invokeCallbackMethod(m_propagateCallbackInstance, m_propagateCallbackMethod, new Class[][] {{ URL.class }}, new Object[][] {{ resource }});
                 }
                 catch (InvocationTargetException e) {
                     m_logger.log(LogService.LOG_WARNING, "Exception while invoking callback method", e.getCause());
@@ -186,21 +186,21 @@ public class ResourceDependencyImpl exte
                 throw new IllegalStateException("Could not invoke callback");
             }
             else {
-                Properties props = new Properties();
-                props.setProperty(ResourceHandler.HOST, resource.getHost());
-                props.setProperty(ResourceHandler.PATH, resource.getPath());
-                props.setProperty(ResourceHandler.PROTOCOL, resource.getProtocol());
-                props.setProperty(ResourceHandler.PORT, Integer.toString(resource.getPort()));
+                Hashtable<String, Object> props = new Hashtable<>();
+                props.put(ResourceHandler.HOST, resource.getHost());
+                props.put(ResourceHandler.PATH, resource.getPath());
+                props.put(ResourceHandler.PROTOCOL, resource.getProtocol());
+                props.put(ResourceHandler.PORT, Integer.toString(resource.getPort()));
                 // add the custom resource properties
                 if (resourceProperties != null) {
-                    Enumeration properyKeysEnum = resourceProperties.keys(); 
+                    Enumeration<String> properyKeysEnum = resourceProperties.keys(); 
                     while (properyKeysEnum.hasMoreElements()) {
-                        String key = (String) properyKeysEnum.nextElement();
+                        String key = properyKeysEnum.nextElement();
                         if (!key.equals(ResourceHandler.HOST) &&
                                 !key.equals(ResourceHandler.PATH) &&
                                 !key.equals(ResourceHandler.PROTOCOL) &&
                                 !key.equals(ResourceHandler.PORT)) {
-                            props.setProperty(key, resourceProperties.get(key).toString());
+                            props.put(key, resourceProperties.get(key).toString());
                         } else {
                             m_logger.log(LogService.LOG_WARNING, "Custom resource property is overlapping with the default resource property for key: " + key);
                         }

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ResourceEventImpl.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ResourceEventImpl.java?rev=1632191&r1=1632190&r2=1632191&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ResourceEventImpl.java (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ResourceEventImpl.java Wed Oct 15 22:09:11 2014
@@ -21,13 +21,16 @@ package org.apache.felix.dm.impl;
 import java.net.URL;
 import java.util.Dictionary;
 
-public class ResourceEventImpl extends EventImpl implements Comparable {
+import org.apache.felix.dm.context.Event;
+
+public class ResourceEventImpl implements Event {
     final URL m_resource;
-    final Dictionary<?, ?> m_resourceProperties;
+    final Dictionary<String, Object> m_resourceProperties;
     
-    public ResourceEventImpl(URL resource, Dictionary<?,?> resourceProperties) {
+    @SuppressWarnings("unchecked")
+    public ResourceEventImpl(URL resource, Dictionary<String, ?> resourceProperties) {
         m_resource = resource;
-        m_resourceProperties = resourceProperties;
+        m_resourceProperties = (Dictionary<String, Object>) resourceProperties;
     }
     
     @Override
@@ -36,8 +39,12 @@ public class ResourceEventImpl extends E
     }
 
     @Override
-    public Dictionary getProperties() {
-        return m_resourceProperties;
+    public Dictionary<String, Object> getProperties() {
+        return m_resourceProperties == null ? ServiceUtil.EMPTY_PROPERTIES : m_resourceProperties;
+    }
+
+    @Override
+    public void close() {
     }
 
     public URL getResource() {
@@ -75,7 +82,7 @@ public class ResourceEventImpl extends E
     }
 
     @Override
-    public int compareTo(Object that) {
+    public int compareTo(Event that) {
         if (this.equals(that)) {
             return 0;
         }

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ServiceDependencyImpl.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ServiceDependencyImpl.java?rev=1632191&r1=1632190&r2=1632191&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ServiceDependencyImpl.java (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ServiceDependencyImpl.java Wed Oct 15 22:09:11 2014
@@ -24,8 +24,8 @@ import java.util.AbstractMap;
 import java.util.Arrays;
 import java.util.Dictionary;
 import java.util.HashSet;
+import java.util.Hashtable;
 import java.util.Map;
-import java.util.Properties;
 import java.util.Set;
 
 import org.apache.felix.dm.Component;
@@ -64,7 +64,7 @@ public class ServiceDependencyImpl exten
     /**
      * Entry to wrap service properties behind a Map.
      */
-    private static final class ServicePropertiesMapEntry implements Map.Entry {
+    private static final class ServicePropertiesMapEntry implements Map.Entry<String, Object> {
         private final String m_key;
         private Object m_value;
 
@@ -73,7 +73,7 @@ public class ServiceDependencyImpl exten
             m_value = value;
         }
 
-        public Object getKey() {
+        public String getKey() {
             return m_key;
         }
 
@@ -91,11 +91,12 @@ public class ServiceDependencyImpl exten
             return oldValue;
         }
 
+        @SuppressWarnings("unchecked")
         public boolean equals(Object o) {
             if (!(o instanceof Map.Entry)) {
                 return false;
             }
-            Map.Entry e = (Map.Entry) o;
+            Map.Entry<String, Object> e = (Map.Entry<String, Object>) o;
             return eq(m_key, e.getKey()) && eq(m_value, e.getValue());
         }
 
@@ -111,7 +112,7 @@ public class ServiceDependencyImpl exten
     /**
      * Wraps service properties behind a Map.
      */
-    private final static class ServicePropertiesMap extends AbstractMap {
+    private final static class ServicePropertiesMap extends AbstractMap<String, Object> {
         private final ServiceReference m_ref;
 
         public ServicePropertiesMap(ServiceReference ref) {
@@ -126,8 +127,8 @@ public class ServiceDependencyImpl exten
             return m_ref.getPropertyKeys().length;
         }
 
-        public Set entrySet() {
-            Set set = new HashSet();
+        public Set<Map.Entry<String, Object>> entrySet() {
+            Set<Map.Entry<String, Object>> set = new HashSet<>();
             String[] keys = m_ref.getPropertyKeys();
             for (int i = 0; i < keys.length; i++) {
                 set.add(new ServicePropertiesMapEntry(keys[i], m_ref.getProperty(keys[i])));
@@ -176,12 +177,12 @@ public class ServiceDependencyImpl exten
     }   
 
     @Override
-   	public ServiceDependency setService(Class serviceName) {
+   	public ServiceDependency setService(Class<?> serviceName) {
         setService(serviceName, null, null);
         return this;
     }
 
-    public ServiceDependency setService(Class serviceName, String serviceFilter) {
+    public ServiceDependency setService(Class<?> serviceName, String serviceFilter) {
         setService(serviceName, null, serviceFilter);
         return this;
     }
@@ -194,7 +195,7 @@ public class ServiceDependencyImpl exten
         return this;
     }
 
-    public ServiceDependency setService(Class serviceName, ServiceReference serviceReference) {
+    public ServiceDependency setService(Class<?> serviceName, ServiceReference serviceReference) {
         setService(serviceName, serviceReference, null);
         return this;
     }
@@ -326,14 +327,14 @@ public class ServiceDependencyImpl exten
         return "service";
     }
 
-	@Override
-    public Dictionary getProperties() {
-        Object service = null;
+	@SuppressWarnings("unchecked")
+    @Override
+    public Dictionary<String, Object> getProperties() {
         ServiceEventImpl se = (ServiceEventImpl) m_component.getDependencyEvent(this);
         if (se != null) {
             if (m_propagateCallbackInstance != null && m_propagateCallbackMethod != null) {
                 try {
-                    return (Dictionary) InvocationUtil.invokeCallbackMethod(m_propagateCallbackInstance, m_propagateCallbackMethod,
+                    return (Dictionary<String, Object>) InvocationUtil.invokeCallbackMethod(m_propagateCallbackInstance, m_propagateCallbackMethod,
                             new Class[][]{{ServiceReference.class, Object.class}, {ServiceReference.class}}, new Object[][]{
                                     {se.getReference(), se.getEvent()}, {se.getReference()}});
                 } catch (InvocationTargetException e) {
@@ -343,7 +344,7 @@ public class ServiceDependencyImpl exten
                 }
                 throw new IllegalStateException("Could not invoke callback");
             } else {
-                Properties props = new Properties();
+                Hashtable<String, Object> props = new Hashtable<>();
                 String[] keys = se.getReference().getPropertyKeys();
                 for (int i = 0; i < keys.length; i++) {
                     if (!(keys[i].equals(Constants.SERVICE_ID) || keys[i].equals(Constants.SERVICE_PID))) {
@@ -362,7 +363,7 @@ public class ServiceDependencyImpl exten
     }
     
     /** Internal method to set the name, service reference and/or filter. */
-    private void setService(Class serviceName, ServiceReference serviceReference, String serviceFilter) {
+    private void setService(Class<?> serviceName, ServiceReference serviceReference, String serviceFilter) {
         ensureNotActive();
         if (serviceName == null) {
             m_trackedServiceName = Object.class;
@@ -409,7 +410,7 @@ public class ServiceDependencyImpl exten
         
     private Object getNullObject() {
         if (m_nullObject == null) {
-            Class trackedServiceName;
+            Class<?> trackedServiceName;
             synchronized (this) {
                 trackedServiceName = m_trackedServiceName;
             }
@@ -428,7 +429,7 @@ public class ServiceDependencyImpl exten
         if (m_defaultImplementation != null) {
             if (m_defaultImplementation instanceof Class) {
                 try {
-                    m_defaultImplementationInstance = ((Class) m_defaultImplementation).newInstance();
+                    m_defaultImplementationInstance = ((Class<?>) m_defaultImplementation).newInstance();
                 }
                 catch (Exception e) {
                     m_logger.log(Logger.LOG_ERROR, "Could not create default implementation instance of class "

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ServiceEventImpl.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ServiceEventImpl.java?rev=1632191&r1=1632190&r2=1632191&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ServiceEventImpl.java (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ServiceEventImpl.java Wed Oct 15 22:09:11 2014
@@ -20,11 +20,12 @@ package org.apache.felix.dm.impl;
 
 import java.util.Dictionary;
 
+import org.apache.felix.dm.context.Event;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceReference;
 
-public class ServiceEventImpl extends EventImpl implements Comparable {
+public class ServiceEventImpl implements Event {
     /**
      * The service reference on which a service dependency depends on
      */
@@ -86,7 +87,7 @@ public class ServiceEventImpl extends Ev
     }
     
     @Override
-    public Dictionary getProperties() {
+    public Dictionary<String, Object> getProperties() {
         return ServiceUtil.propertiesToDictionary(m_reference);
     }
 	
@@ -104,7 +105,7 @@ public class ServiceEventImpl extends Ev
 	}
 
     @Override
-    public int compareTo(Object b) {
+    public int compareTo(Event b) {
     	return getReference().compareTo(((ServiceEventImpl) b).getReference());
     }
         

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ServiceRegistrationImpl.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ServiceRegistrationImpl.java?rev=1632191&r1=1632190&r2=1632191&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ServiceRegistrationImpl.java (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ServiceRegistrationImpl.java Wed Oct 15 22:09:11 2014
@@ -41,6 +41,7 @@ public final class ServiceRegistrationIm
         return ensureRegistration().getReference();
     }
 
+    @SuppressWarnings("rawtypes")
     public void setProperties(Dictionary dictionary) {
         ensureRegistration().setProperties(dictionary);
     }

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ServiceUtil.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ServiceUtil.java?rev=1632191&r1=1632190&r2=1632191&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ServiceUtil.java (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ServiceUtil.java Wed Oct 15 22:09:11 2014
@@ -21,9 +21,7 @@ package org.apache.felix.dm.impl;
 import java.util.Dictionary;
 import java.util.Enumeration;
 import java.util.Hashtable;
-import java.util.Iterator;
 import java.util.List;
-import java.util.Map;
 
 import org.apache.felix.dm.DependencyManager;
 import org.osgi.framework.Bundle;
@@ -37,6 +35,11 @@ import org.osgi.framework.ServiceReferen
  */
 public class ServiceUtil {
     /**
+     * Useful when needing to provide empty service properties.
+     */
+    public final static Dictionary<String, Object> EMPTY_PROPERTIES = new Hashtable<>();
+
+    /**
      * Returns the service ranking of a service, based on its service reference. If
      * the service has a property specifying its ranking, that will be returned. If
      * not, the default ranking of zero will be returned.
@@ -147,7 +150,7 @@ public class ServiceUtil {
      * @param exclude a list of properties to exclude, or <code>null</code> to show everything
      * @return a string representation of the service properties
      */
-    public static String propertiesToString(ServiceReference ref, List /* <String> */ exclude) {
+    public static String propertiesToString(ServiceReference ref, List<String> exclude) {
         StringBuffer buf = new StringBuffer();
         String[] keys = ref.getPropertyKeys();
         for (int i = 0; i < keys.length; i++) {
@@ -184,7 +187,7 @@ public class ServiceUtil {
      * @param ref the ServiceReference to wrap
      * @return a new Dictionary used to wrap the ServiceReference properties
      */
-    public static Dictionary<String, ?> propertiesToDictionary(final ServiceReference ref) {
+    public static Dictionary<String, Object> propertiesToDictionary(final ServiceReference ref) {
         return new Dictionary<String, Object>() {
             private Dictionary<String, Object> m_wrapper;
             

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/metatype/MetaTypeProviderImpl.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/metatype/MetaTypeProviderImpl.java?rev=1632191&r1=1632190&r2=1632191&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/metatype/MetaTypeProviderImpl.java (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/metatype/MetaTypeProviderImpl.java Wed Oct 15 22:09:11 2014
@@ -51,11 +51,11 @@ import org.osgi.service.metatype.ObjectC
 public class MetaTypeProviderImpl implements MetaTypeProvider, ManagedService, ManagedServiceFactory {
     private ManagedService m_managedServiceDelegate;
     private ManagedServiceFactory m_managedServiceFactoryDelegate;
-    private ArrayList m_propertiesMetaData = new ArrayList();
+    private ArrayList<PropertyMetaData> m_propertiesMetaData = new ArrayList<>();
     private String m_description;
     private String m_heading;
     private String m_localization;
-    private HashMap m_localesProperties = new HashMap();
+    private HashMap<String, Properties> m_localesProperties = new HashMap<>();
     private Logger m_logger;
     private BundleContext m_bctx;
     private String m_pid;
@@ -76,16 +76,17 @@ public class MetaTypeProviderImpl implem
         }
     }
     
+    @SuppressWarnings("unchecked")
     public MetaTypeProviderImpl(MetaTypeProviderImpl prototype, ManagedService msDelegate, ManagedServiceFactory msfDelegate) {
         m_pid = prototype.m_pid;
         m_bctx = prototype.m_bctx;
         m_logger = prototype.m_logger;
         m_localization = prototype.m_localization;
-        m_propertiesMetaData = prototype.m_propertiesMetaData != null ? (ArrayList) prototype.m_propertiesMetaData.clone() : null;
+        m_propertiesMetaData = prototype.m_propertiesMetaData != null ? (ArrayList<PropertyMetaData>) prototype.m_propertiesMetaData.clone() : null;
         m_description = prototype.m_description;
         m_heading = prototype.m_heading;
         m_localization = prototype.m_localization;
-        m_localesProperties = prototype.m_localesProperties != null ? (HashMap) prototype.m_localesProperties.clone() : null;
+        m_localesProperties = prototype.m_localesProperties != null ? (HashMap<String, Properties>) prototype.m_localesProperties.clone() : null;
         m_managedServiceDelegate = msDelegate;
         m_managedServiceFactoryDelegate = msfDelegate;
     }
@@ -139,6 +140,7 @@ public class MetaTypeProviderImpl implem
      * "en_GB", "en_GB_welsh" ...
      * @return the list of Locale supported by our bundle.
      */
+    @SuppressWarnings("rawtypes")
     public String[] getLocales() {
         int lastSlash = m_localization.lastIndexOf("/");
         String path = (lastSlash == -1) ? "/" : ("/" + m_localization.substring(0, lastSlash - 1));
@@ -149,7 +151,7 @@ public class MetaTypeProviderImpl implem
             return null;
         }
         
-        TreeSet set = new TreeSet();
+        TreeSet<String> set = new TreeSet<>();
         while (e.hasMoreElements()) {
             // We have found a locale property file in the form of "path/file[_language[_ country[_variation]].properties"
             // And now, we have to get the "language[_country[_variation]]" part ...
@@ -198,6 +200,7 @@ public class MetaTypeProviderImpl implem
      * We also implements the ManagedService and we just delegates the configuration handling to
      * our associated ConfigurationDependency.
      */
+    @SuppressWarnings("rawtypes")
     public void updated(Dictionary properties) throws ConfigurationException {
         m_managedServiceDelegate.updated(properties);
     }
@@ -265,6 +268,7 @@ public class MetaTypeProviderImpl implem
         return m_pid;
     }
 
+    @SuppressWarnings("rawtypes")
     public void updated(String pid, Dictionary properties) throws ConfigurationException {
         m_managedServiceFactoryDelegate.updated(pid, properties);
     }

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/metatype/ObjectClassDefinitionImpl.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/metatype/ObjectClassDefinitionImpl.java?rev=1632191&r1=1632190&r2=1632191&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/metatype/ObjectClassDefinitionImpl.java (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/metatype/ObjectClassDefinitionImpl.java Wed Oct 15 22:09:11 2014
@@ -23,6 +23,7 @@ import java.io.InputStream;
 import java.util.ArrayList;
 import java.util.List;
 
+import org.apache.felix.dm.PropertyMetaData;
 import org.osgi.service.metatype.AttributeDefinition;
 import org.osgi.service.metatype.ObjectClassDefinition;
 
@@ -42,12 +43,12 @@ public class ObjectClassDefinitionImpl i
     private String m_id;
     
     // The list of Properties MetaData objects (from DependencyManager API)
-    private List m_propertiesMetaData;
+    private final List<PropertyMetaData> m_propertiesMetaData;
     
     // The localized resource that can be used when localizing some parameters
     private Resource m_resource;
 
-    public ObjectClassDefinitionImpl(String id, String name, String description, List propertiesMetaData, Resource resource) {
+    public ObjectClassDefinitionImpl(String id, String name, String description, List<PropertyMetaData> propertiesMetaData, Resource resource) {
         m_id = id;
         m_name = name;
         m_description = description;
@@ -58,7 +59,7 @@ public class ObjectClassDefinitionImpl i
     // --------------------- ObjectClassDefinition ----------------------------------------
 
     public AttributeDefinition[] getAttributeDefinitions(int filter) {
-        List attrs = new ArrayList();
+        List<AttributeDefinition> attrs = new ArrayList<>();
         for (int i = 0; i < m_propertiesMetaData.size(); i++) {
             PropertyMetaDataImpl metaData = (PropertyMetaDataImpl) m_propertiesMetaData.get(i);
             switch (filter) {
@@ -75,11 +76,12 @@ public class ObjectClassDefinitionImpl i
                         attrs.add(new AttributeDefinitionImpl(metaData, m_resource));
                     }
                     break;
+                default:
             }
         }
 
         AttributeDefinition[] array = new AttributeDefinitionImpl[attrs.size()];
-        return (AttributeDefinition[]) attrs.toArray(array);
+        return attrs.toArray(array);
     }
 
     public String getDescription() {

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/metatype/PropertyMetaDataImpl.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/metatype/PropertyMetaDataImpl.java?rev=1632191&r1=1632190&r2=1632191&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/metatype/PropertyMetaDataImpl.java (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/metatype/PropertyMetaDataImpl.java Wed Oct 15 22:09:11 2014
@@ -36,12 +36,12 @@ public class PropertyMetaDataImpl implem
     /**
      * List of option labels (may be localized)
      */
-    List m_optionsLabels = new ArrayList();
+    List<String> m_optionsLabels = new ArrayList<>();
     
     /**
      * List of option values
      */
-    List m_optionsValues = new ArrayList();
+    List<String> m_optionsValues = new ArrayList<>();
     
     /**
      * Property cardinality.
@@ -84,7 +84,8 @@ public class PropertyMetaDataImpl implem
      * Mapping between java types and valid MetaType types.
      * @see {@link AttributeDefinition#getType()}
      */
-    private final static Map m_typeMapping = new HashMap() {{
+    @SuppressWarnings({ "unchecked", "serial", "rawtypes" })
+    private final static Map<Class<?>, Integer> m_typeMapping = new HashMap() {{
         put(Boolean.class, new Integer(AttributeDefinition.BOOLEAN));
         put(Byte.class, new Integer(AttributeDefinition.BYTE));
         put(Character.class, new Integer(AttributeDefinition.CHARACTER));
@@ -131,7 +132,7 @@ public class PropertyMetaDataImpl implem
         return this;
     }
 
-    public PropertyMetaData setType(Class classType) {
+    public PropertyMetaData setType(Class<?> classType) {
         Integer type = (Integer) m_typeMapping.get(classType);
         if (type == null) {
             throw new IllegalArgumentException("Invalid type: " + classType + ". Valid types are "

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/tracker/AbstractCustomizerActionSet.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/tracker/AbstractCustomizerActionSet.java?rev=1632191&r1=1632190&r2=1632191&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/tracker/AbstractCustomizerActionSet.java (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/tracker/AbstractCustomizerActionSet.java Wed Oct 15 22:09:11 2014
@@ -28,7 +28,7 @@ import java.util.List;
  */
 public abstract class AbstractCustomizerActionSet {
 
-	enum Type { ADDED, MODIFIED, REMOVED };
+	enum Type { ADDED, MODIFIED, REMOVED }
 
 	final List<CustomizerAction> m_actions = new ArrayList<>();
 

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/tracker/AbstractTracked.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/tracker/AbstractTracked.java?rev=1632191&r1=1632190&r2=1632191&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/tracker/AbstractTracked.java (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/tracker/AbstractTracked.java Wed Oct 15 22:09:11 2014
@@ -35,6 +35,7 @@ import org.apache.felix.dm.impl.SerialEx
  * @version $Revision: 5871 $
  * @since 1.4
  */
+@SuppressWarnings({"rawtypes", "unchecked"})
 abstract class AbstractTracked {
 	/* set this to true to compile in debug messages */
 	private static final boolean		DEBUG	= false;
@@ -102,7 +103,7 @@ abstract class AbstractTracked {
 	/**
 	 * AbstractTracked constructor.
 	 */
-	AbstractTracked() {
+    AbstractTracked() {
 	    this.tracked = new HashMap();
 	    trackingCount = 0;
 	    adding = new ArrayList(6);
@@ -125,7 +126,7 @@ abstract class AbstractTracked {
 	 *        entries in the list are ignored.
 	 * @GuardedBy this
 	 */
-	void setInitial(Object[] list) {
+    void setInitial(Object[] list) {
 		if (list == null) {
 			return;
 		}

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/test/test/ComponentTest.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/test/test/ComponentTest.java?rev=1632191&r1=1632190&r2=1632191&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/test/test/ComponentTest.java (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/test/test/ComponentTest.java Wed Oct 15 22:09:11 2014
@@ -28,6 +28,7 @@ import org.apache.felix.dm.impl.EventImp
 import org.junit.Assert;
 import org.junit.Test;
 
+@SuppressWarnings("unused")
 public class ComponentTest {
 	static class MyComponent {
 		public MyComponent() {
@@ -53,7 +54,7 @@ public class ComponentTest {
 			void init() {
 				e.step(2);
 			}
-			void start() {
+            void start() {
 				e.step(3);
 			}
 			void stop() {
@@ -73,7 +74,7 @@ public class ComponentTest {
 	@Test
 	public void testAddDependencyFromInitCallback() {
 		final Ensure e = new Ensure();
-		final AbstractDependency d = new SimpleServiceDependency();
+		final SimpleServiceDependency d = new SimpleServiceDependency();
 		d.setRequired(true);
 		ComponentImpl c = new ComponentImpl();
 		c.setImplementation(new Object() {
@@ -104,9 +105,9 @@ public class ComponentTest {
     @Test
     public void testAddAvailableDependencyFromInitCallback() {
         final Ensure e = new Ensure();
-        final AbstractDependency d = new SimpleServiceDependency();
+        final SimpleServiceDependency d = new SimpleServiceDependency();
         d.setRequired(true);
-        final AbstractDependency d2 = new SimpleServiceDependency();
+        final SimpleServiceDependency d2 = new SimpleServiceDependency();
         d2.setRequired(true);
         ComponentImpl c = new ComponentImpl();
         c.setImplementation(new Object() {
@@ -143,10 +144,10 @@ public class ComponentTest {
 	@Test
 	public void testAtomicallyAddMultipleDependenciesFromInitCallback() {
 		final Ensure e = new Ensure();
-		final AbstractDependency d = new SimpleServiceDependency();
+		final SimpleServiceDependency d = new SimpleServiceDependency();
 		d.setRequired(true);
 
-		final AbstractDependency d2 = new SimpleServiceDependency();
+		final SimpleServiceDependency d2 = new SimpleServiceDependency();
 		d2.setRequired(true);
 
 		ComponentImpl c = new ComponentImpl();
@@ -184,7 +185,7 @@ public class ComponentTest {
 	public void createComponentAddDependencyAndStartComponent() {
 		ComponentImpl c = new ComponentImpl();
 		c.setImplementation(MyComponent.class);
-		AbstractDependency d = new SimpleServiceDependency();
+		SimpleServiceDependency d = new SimpleServiceDependency();
 		d.setRequired(true);
 		c.add(d);
 		c.start();
@@ -197,7 +198,7 @@ public class ComponentTest {
 	public void createComponentStartItAndAddDependency() {
 		ComponentImpl c = new ComponentImpl();
 		c.setImplementation(MyComponent.class);
-		AbstractDependency d = new SimpleServiceDependency();
+		SimpleServiceDependency d = new SimpleServiceDependency();
 		d.setRequired(true);
 		c.start();
 		Assert.assertEquals("should be available when started", true, c.isAvailable());
@@ -212,7 +213,7 @@ public class ComponentTest {
 	public void createComponentStartItAddDependencyAndMakeDependencyAvailable() {
 		ComponentImpl c = new ComponentImpl();
 		c.setImplementation(MyComponent.class);
-		AbstractDependency d = new SimpleServiceDependency();
+		SimpleServiceDependency d = new SimpleServiceDependency();
 		d.setRequired(true);
 		c.start();
 		c.add(d);
@@ -231,7 +232,7 @@ public class ComponentTest {
 	public void createComponentStartItAddDependencyAndListenerMakeDependencyAvailableAndUnavailableImmediately() {
 		ComponentImpl c = new ComponentImpl();
 		c.setImplementation(MyComponent.class);
-		final AbstractDependency d = new SimpleServiceDependency();
+		final SimpleServiceDependency d = new SimpleServiceDependency();
 		d.setRequired(true);
 		ComponentStateListener l = new ComponentStateListener() {
 			@Override
@@ -262,9 +263,9 @@ public class ComponentTest {
 	public void createComponentAddTwoDependenciesMakeBothAvailableAndUnavailable() {
 		ComponentImpl c = new ComponentImpl();
 		c.setImplementation(MyComponent.class);
-		AbstractDependency d1 = new SimpleServiceDependency();
+		SimpleServiceDependency d1 = new SimpleServiceDependency();
 		d1.setRequired(true);
-		AbstractDependency d2 = new SimpleServiceDependency();
+		SimpleServiceDependency d2 = new SimpleServiceDependency();
 		d2.setRequired(true);
 		c.start();
 		c.add(d1);
@@ -291,14 +292,14 @@ public class ComponentTest {
 		final Ensure e = new Ensure();
 		ComponentImpl c = new ComponentImpl();
 		c.setImplementation(new Object() {
-			public void add() {
+            public void add() {
 				e.step(1);
 			}
-			public void remove() {
+            public void remove() {
 				e.step(3);
 			}
 		});
-		AbstractDependency d1 = new SimpleServiceDependency();
+		SimpleServiceDependency d1 = new SimpleServiceDependency();
 		d1.setCallbacks("add", "remove");
 		d1.setRequired(true);
 		// add the dependency to the component
@@ -329,7 +330,7 @@ public class ComponentTest {
 				e.step(3);
 			}
 		});
-		AbstractDependency d1 = new SimpleServiceDependency();
+		SimpleServiceDependency d1 = new SimpleServiceDependency();
 		d1.setCallbacks("add", "remove");
 		d1.setRequired(true);
 		// start the ComponentImpl (it should become available)
@@ -361,10 +362,10 @@ public class ComponentTest {
 				e.step();
 			}
 		});
-		AbstractDependency d1 = new SimpleServiceDependency();
+		SimpleServiceDependency d1 = new SimpleServiceDependency();
 		d1.setCallbacks("add", "remove");
 		d1.setRequired(true);
-		AbstractDependency d2 = new SimpleServiceDependency();
+		SimpleServiceDependency d2 = new SimpleServiceDependency();
 		d2.setCallbacks("add", "remove");
 		d2.setRequired(true);
 		// start the component, which should become active because there are no
@@ -409,10 +410,10 @@ public class ComponentTest {
 		});
 		// start the component, it should become available
 		c.start();
-		AbstractDependency d1 = new SimpleServiceDependency();
+		SimpleServiceDependency d1 = new SimpleServiceDependency();
 		d1.setCallbacks("add", "remove");
 		d1.setRequired(true);
-		AbstractDependency d2 = new SimpleServiceDependency();
+		SimpleServiceDependency d2 = new SimpleServiceDependency();
 		d2.setCallbacks("add", "remove");
 		d2.setRequired(true);
 		// add the first dependency, ComponentImpl should be unavailable
@@ -452,10 +453,10 @@ public class ComponentTest {
 		});
 		// start component
 		c.start();
-		AbstractDependency d1 = new SimpleServiceDependency();
+		SimpleServiceDependency d1 = new SimpleServiceDependency();
 		d1.setCallbacks("add", "remove");
 		d1.setRequired(true);
-		AbstractDependency d2 = new SimpleServiceDependency();
+		SimpleServiceDependency d2 = new SimpleServiceDependency();
 		d2.setCallbacks("add", "remove");
 		d2.setRequired(true);
 		c.add(d1);
@@ -506,7 +507,7 @@ public class ComponentTest {
 				e.step(5);
 			}
 		});
-		AbstractDependency d1 = new SimpleServiceDependency();
+		SimpleServiceDependency d1 = new SimpleServiceDependency();
 		d1.setCallbacks("add", "change", "remove");
 		d1.setRequired(true);
 		// add the dependency to the component
@@ -543,7 +544,7 @@ public class ComponentTest {
 				e.step(5);
 			}
 		});
-		AbstractDependency d1 = new SimpleServiceDependency();
+		SimpleServiceDependency d1 = new SimpleServiceDependency();
 		d1.setCallbacks("add", "change", "remove");
 		d1.setRequired(false);
 		// add the dependency to the component
@@ -581,10 +582,10 @@ public class ComponentTest {
 				e.step();
 			}
 		});
-		AbstractDependency d1 = new SimpleServiceDependency();
+		SimpleServiceDependency d1 = new SimpleServiceDependency();
 		d1.setCallbacks("add", "remove");
 		d1.setRequired(false);
-		AbstractDependency d2 = new SimpleServiceDependency();
+		SimpleServiceDependency d2 = new SimpleServiceDependency();
 		d2.setCallbacks("add", "remove");
 		d2.setRequired(true);
 		// add the dependencies to the component
@@ -632,7 +633,7 @@ public class ComponentTest {
 				e.step(5);
 			}
 		});
-		AbstractDependency d = new SimpleServiceDependency();
+		SimpleServiceDependency d = new SimpleServiceDependency();
 		d.setCallbacks("add", "remove");
 		d.setRequired(true);
 		// add the dependency to the component
@@ -675,7 +676,7 @@ public class ComponentTest {
 			}
 		};		
 		
-		AbstractDependency d = new SimpleServiceDependency();
+		SimpleServiceDependency d = new SimpleServiceDependency();
 		d.setCallbacks(callbackInstance, "add", "remove");
 		d.setRequired(true);
 		// add the dependency to the component

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/test/test/ConcurrencyTest.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/test/test/ConcurrencyTest.java?rev=1632191&r1=1632190&r2=1632191&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/test/test/ConcurrencyTest.java (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/test/test/ConcurrencyTest.java Wed Oct 15 22:09:11 2014
@@ -26,8 +26,6 @@ import java.util.concurrent.TimeUnit;
 import org.apache.felix.dm.Component;
 import org.apache.felix.dm.ComponentState;
 import org.apache.felix.dm.ComponentStateListener;
-import org.apache.felix.dm.Dependency;
-import org.apache.felix.dm.context.AbstractDependency;
 import org.apache.felix.dm.impl.ComponentImpl;
 import org.apache.felix.dm.impl.EventImpl;
 import org.junit.Assert;
@@ -43,9 +41,9 @@ public class ConcurrencyTest {
 	public void createComponentAddDependencyAndListenerAndAddAnotherDependencyInAParallelThread() {
 		final Semaphore s = new Semaphore(0);
 		final ComponentImpl c = new ComponentImpl();
-		final AbstractDependency d = new SimpleServiceDependency();
+		final SimpleServiceDependency d = new SimpleServiceDependency();
 		d.setRequired(true);
-		final AbstractDependency d2 = new SimpleServiceDependency();
+		final SimpleServiceDependency d2 = new SimpleServiceDependency();
 		d2.setRequired(true);
 		final Thread t = new Thread() {
 			public void run() {
@@ -103,7 +101,7 @@ public class ConcurrencyTest {
 			e.execute(new Runnable() {
 				@Override
 				public void run() {
-				    AbstractDependency d = new SimpleServiceDependency();
+				    SimpleServiceDependency d = new SimpleServiceDependency();
 					d.setRequired(true);
 					c.add(d);
 //					d.changed(new EventImpl(true));

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/test/test/ConfigurationTest.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/test/test/ConfigurationTest.java?rev=1632191&r1=1632190&r2=1632191&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/test/test/ConfigurationTest.java (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/test/test/ConfigurationTest.java Wed Oct 15 22:09:11 2014
@@ -22,14 +22,13 @@ import java.util.Dictionary;
 import java.util.Hashtable;
 
 import org.apache.felix.dm.Component;
-import org.apache.felix.dm.Dependency;
-import org.apache.felix.dm.context.AbstractDependency;
 import org.apache.felix.dm.impl.ComponentImpl;
 import org.apache.felix.dm.impl.ConfigurationDependencyImpl;
 import org.apache.felix.dm.impl.EventImpl;
 import org.junit.Test;
 import org.osgi.service.cm.ConfigurationException;
 
+@SuppressWarnings({"unchecked", "rawtypes", "unused"})
 public class ConfigurationTest extends TestBase {
     @Test
     public void testConfigurationFailure() throws Throwable {
@@ -39,7 +38,7 @@ public class ConfigurationTest extends T
         final ConfigurationDependencyImpl conf = new ConfigurationDependencyImpl();
 
         // Create another required dependency
-        final AbstractDependency requiredDependency = new SimpleServiceDependency();
+        final SimpleServiceDependency requiredDependency = new SimpleServiceDependency();
         requiredDependency.setRequired(true);
         requiredDependency.setCallbacks("addDep", null);
 



Mime
View raw message