You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by tj...@apache.org on 2020/11/05 15:56:23 UTC

[felix-dev] branch scrR8 updated (35c51c7 -> 44c33f3)

This is an automated email from the ASF dual-hosted git repository.

tjwatson pushed a change to branch scrR8
in repository https://gitbox.apache.org/repos/asf/felix-dev.git.


    from 35c51c7  OSGi R8 - Add support for satisfying condition
     add ca021fd  Formatting (removed tabs for consistency)
     add 2f6e1e6  Update changelog for next release of gogo jline
     add 1ed349c  [maven-release-plugin] prepare release org.apache.felix.gogo.jline-1.1.8
     add 0055d50  [maven-release-plugin] prepare for next development iteration
     add 2c698f8  Update Gogo BOM to jline release 1.1.8
     add 6e50754  [maven-release-plugin] prepare release org.apache.felix.gogo.bom-1.0.6
     add 1ef312d  [maven-release-plugin] prepare for next development iteration
     add ecad95c  FELIX-6349 - Fix NullPointerException in DependencyManager
     new 6afbad6  Merge branch 'master' into scrR8
     new 7898ad9  Add DS namespace version 1.5.0 for OSGi R8
     new 7723726  Move satisfying condition tests to integration tests
     new 5b25fb8  Add support for AnyService
     new ce11b7a  Fix compile warnings in SCR
     add 36f7c12  FELIX-6308 : Bad File Descriptor while persisting service configuration. Potential fix
     add 58a21ae  FELIX-5690 : ConfigurationHandler should support ignoring whitespace between property key/equal sign & equal sign/property value. Apply modified patch from Joshua Mack
     add d844cfd  FELIX-6351 - Ignore IllegalStateException on unregister
     add 0245baa  FELIX-6354 : IllegalStateException on shutdown
     add d9236c8  FELIX-6353 - Fix cardinality 0..1 references for constructor injection
     new 44c33f3  Merge branch 'master' into scrR8

The 6 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 configadmin/changelog.txt                          |   8 +
 .../apache/felix/cm/file/ConfigurationHandler.java |  56 ++---
 .../felix/cm/file/FilePersistenceManager.java      |  26 +--
 .../apache/felix/cm/impl/ConfigurationManager.java |   9 +-
 .../felix/cm/file/ConfigurationHandlerTest.java    |  32 ++-
 gogo/bom/pom.xml                                   |   4 +-
 gogo/jline/doc/changelog.txt                       |   5 +
 gogo/jline/pom.xml                                 |   2 +-
 .../hc/core/impl/executor/HealthCheckFuture.java   |   7 +-
 scr/pom.xml                                        |   2 -
 .../scr/impl/config/ScrConfigurationImpl.java      |   1 -
 .../apache/felix/scr/impl/helper/Coercions.java    |   2 +
 .../impl/helper/ComponentServiceObjectsHelper.java |  85 +++----
 .../felix/scr/impl/inject/ScrComponentContext.java |   2 +
 .../felix/scr/impl/inject/field/FieldHandler.java  |   1 -
 .../felix/scr/impl/inject/internal/ClassUtils.java |   3 +-
 .../inject/internal/ComponentConstructorImpl.java  |   6 +-
 .../scr/impl/inject/methods/ActivateMethod.java    |   3 +-
 .../felix/scr/impl/inject/methods/BaseMethod.java  |   8 +-
 .../SuitableMethodNotAccessibleException.java      |   1 +
 .../scr/impl/manager/AbstractComponentManager.java |   9 +-
 .../scr/impl/manager/AbstractPrototypeRefPair.java |   1 -
 .../scr/impl/manager/ComponentContextImpl.java     |   6 +
 .../scr/impl/manager/ComponentFactoryImpl.java     |   2 +-
 .../impl/manager/ConfigurableComponentHolder.java  |  12 +-
 .../felix/scr/impl/manager/DependencyManager.java  | 159 ++++++++-----
 .../scr/impl/manager/ExtendedServiceEvent.java     |   3 +-
 .../PrototypeServiceFactoryComponentManager.java   |   2 +-
 .../impl/manager/RegionConfigurationSupport.java   |   9 +-
 .../manager/ServiceFactoryComponentManager.java    |   2 +-
 .../felix/scr/impl/manager/ServiceTracker.java     |  21 +-
 .../scr/impl/manager/SingleComponentManager.java   |   6 +-
 .../apache/felix/scr/impl/metadata/DSVersion.java  |   8 +-
 .../apache/felix/scr/impl/xml/XmlConstants.java    |   4 +
 .../org/apache/felix/scr/impl/xml/XmlHandler.java  |   2 -
 .../scr/impl/BundleComponentActivatorTest.java     |   8 +-
 .../felix/scr/impl/ComponentRegistryKeyTest.java   |   2 +-
 .../java/org/apache/felix/scr/impl/MockBundle.java |  45 +++-
 .../scr/impl/inject/internal/AnnotationTest.java   |   1 -
 .../impl/inject/methods/ActivateMethodTest.java    |  43 ++--
 .../scr/impl/inject/methods/BindMethodTest.java    |  26 +--
 .../manager/ConfiguredComponentHolderTest.java     |  67 +++---
 .../scr/impl/manager/RegistrationManagerTest.java  |   3 +-
 .../impl/manager/SingleComponentManagerTest.java   |  21 +-
 .../felix/scr/impl/manager/components/T1.java      |  37 +--
 .../felix/scr/impl/manager/components/T1MapSR.java |   2 +-
 .../felix/scr/impl/manager/components2/T2.java     |  19 +-
 .../felix/scr/impl/metadata/ComponentBase.java     |  18 +-
 .../scr/impl/metadata/ComponentMetadataTest.java   |   3 +-
 .../felix/scr/impl/metadata/XmlHandlerTest.java    |  97 ++++----
 .../scr/impl/metadata/instances/AcceptMethod.java  |   2 +
 .../scr/impl/metadata/instances/BaseObject.java    |   7 +-
 .../scr/impl/metadata/instances/Level1Object.java  |   3 +-
 .../scr/impl/metadata/instances/Level3Object.java  |   7 +-
 .../scr/impl/metadata/instances2/Level2Object.java |  11 +-
 .../scr/impl/truecondition/TrueConditionTest.java  | 213 -----------------
 .../scr/integration/AnyServiceReferenceTest.java   | 254 +++++++++++++++++++++
 .../scr/integration/CircularReferenceTest.java     |   4 +-
 .../scr/integration/ComponentConstructorTest.java  | 130 ++++++++++-
 .../scr/integration/ComponentDisposeTest.java      |   2 +-
 .../scr/integration/ComponentFactoryTest.java      |  27 ++-
 .../felix/scr/integration/ComponentTestBase.java   |  36 +--
 .../scr/integration/ConfigurationChangeTest.java   |   8 +-
 .../ConfigurationComponentFactoryTest.java         |   3 +-
 .../felix/scr/integration/Felix3680_2Test.java     |   4 +-
 .../felix/scr/integration/Felix4188Test.java       |   2 +-
 .../felix/scr/integration/Felix4350Test.java       |  18 +-
 .../felix/scr/integration/Felix4984Test.java       |  16 +-
 .../felix/scr/integration/Felix5248Test.java       |   2 +
 .../felix/scr/integration/Felix5276Test.java       |   1 +
 .../felix/scr/integration/Felix5356Test.java       |   4 +-
 .../felix/scr/integration/Felix6274Test.java       |   1 +
 .../apache/felix/scr/integration/LocateTest.java   |   2 +-
 .../apache/felix/scr/integration/LocationTest.java |   1 +
 .../scr/integration/MutablePropertiesTest.java     |  32 ++-
 .../PersistentComponentFactoryTest.java            |  31 ++-
 .../scr/integration/SatisfyingConditionTest.java   | 160 +++++++++++++
 .../scr/integration/ServiceBindGreedyTest.java     |  15 +-
 .../felix/scr/integration/ServiceBindTest.java     |  13 +-
 .../scr/integration/ServiceComponentTest.java      |  15 +-
 .../integration/components/ActivatorComponent.java |   7 +-
 .../components/AnyServiceComponent.java            | 108 +++++++++
 ...ervice.java => AnyServiceComponentInvalid.java} |  13 +-
 ...ngService.java => AnyServiceComponentList.java} |  13 +-
 ...ingService.java => AnyServiceComponentMap.java} |  13 +-
 .../components/ConstructorComponent.java           |   2 +-
 .../integration/components/Felix4350Component.java |   2 +
 .../integration/components/MutatingService.java    |   2 +-
 .../components/MutatingServiceImpl.java            |  33 ++-
 .../SatisfyingConditionComponentClass.java}        |   4 +-
 .../integration/components/SimpleService2Impl.java |  14 +-
 .../integration/components/SimpleServiceImpl.java  |   1 +
 .../activatesignature/Signature_Package_Map.java   |   4 +-
 .../activatesignature/Signature_Private_Map.java   |   4 +-
 .../activatesignature/Signature_Protected_Map.java |   3 +-
 .../activatesignature/Signature_Public_Map.java    |   3 +-
 .../scr/integration/components/circular/A.java     |   4 +
 .../scr/integration/components/circular/B.java     |   4 +
 .../components/circularFactory/FactoryClient.java  |   4 +-
 .../components/concurrency/AFactory.java           |   8 +-
 .../components/concurrency/CFactory.java           |   8 +-
 .../integration/components/deadlock/Consumer.java  |   2 +-
 .../components/deadlock/TestComponent.java         |   6 +-
 .../scr/integration/components/felix3680/Main.java |  12 +-
 .../integration/components/felix3680_2/Main.java   |  18 +-
 .../scr/integration/components/felix4984/A.java    |   7 +-
 .../scr/integration/components/felix4984/B.java    |   2 +
 .../scr/integration/components/felix5276/B.java    |   2 +
 .../scr/integration/components/felix5276/C.java    |   2 +
 .../components/felix6274_2/Component.java          |   1 +
 .../components/felix6274_hook/Activator.java       |   1 -
 .../resources/integration_test_any_service.xml     | 211 +++++++++++++++++
 .../resources/integration_test_constructor.xml     |  45 +++-
 ...l => integration_test_satisfying_condition.xml} |  26 ++-
 .../test/resources/satisfying_condition_test1.xml  |  27 ---
 .../test/resources/satisfying_condition_test2.xml  |  28 ---
 116 files changed, 1770 insertions(+), 799 deletions(-)
 delete mode 100644 scr/src/test/java/org/apache/felix/scr/impl/truecondition/TrueConditionTest.java
 create mode 100644 scr/src/test/java/org/apache/felix/scr/integration/AnyServiceReferenceTest.java
 create mode 100644 scr/src/test/java/org/apache/felix/scr/integration/SatisfyingConditionTest.java
 create mode 100644 scr/src/test/java/org/apache/felix/scr/integration/components/AnyServiceComponent.java
 copy scr/src/test/java/org/apache/felix/scr/integration/components/{MutatingService.java => AnyServiceComponentInvalid.java} (84%)
 copy scr/src/test/java/org/apache/felix/scr/integration/components/{MutatingService.java => AnyServiceComponentList.java} (80%)
 copy scr/src/test/java/org/apache/felix/scr/integration/components/{MutatingService.java => AnyServiceComponentMap.java} (80%)
 rename scr/src/test/java/org/apache/felix/scr/{impl/truecondition/ComponentTestClass.java => integration/components/SatisfyingConditionComponentClass.java} (92%)
 create mode 100644 scr/src/test/resources/integration_test_any_service.xml
 copy scr/src/test/resources/{integration_test_simple_components_location.xml => integration_test_satisfying_condition.xml} (54%)
 delete mode 100755 scr/src/test/resources/satisfying_condition_test1.xml
 delete mode 100755 scr/src/test/resources/satisfying_condition_test2.xml


[felix-dev] 06/06: Merge branch 'master' into scrR8

Posted by tj...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tjwatson pushed a commit to branch scrR8
in repository https://gitbox.apache.org/repos/asf/felix-dev.git

commit 44c33f33356d5c25eb050ae0c518eb39b9bc863f
Merge: ce11b7a d9236c8
Author: Thomas Watson <tj...@us.ibm.com>
AuthorDate: Thu Nov 5 09:55:06 2020 -0600

    Merge branch 'master' into scrR8

 configadmin/changelog.txt                          |   8 ++
 .../apache/felix/cm/file/ConfigurationHandler.java |  56 ++++-----
 .../felix/cm/file/FilePersistenceManager.java      |  26 ++---
 .../apache/felix/cm/impl/ConfigurationManager.java |   9 +-
 .../felix/cm/file/ConfigurationHandlerTest.java    |  32 +++++-
 .../inject/internal/ComponentConstructorImpl.java  |   6 +-
 .../impl/manager/RegionConfigurationSupport.java   |   9 +-
 .../scr/integration/ComponentConstructorTest.java  | 128 ++++++++++++++++++++-
 .../components/ConstructorComponent.java           |   2 +-
 .../resources/integration_test_constructor.xml     |  45 +++++++-
 10 files changed, 263 insertions(+), 58 deletions(-)



[felix-dev] 04/06: Add support for AnyService

Posted by tj...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tjwatson pushed a commit to branch scrR8
in repository https://gitbox.apache.org/repos/asf/felix-dev.git

commit 5b25fb86601b8f30cec2b1d6c4a2bf5d862f8c57
Author: Thomas Watson <tj...@us.ibm.com>
AuthorDate: Wed Oct 28 16:33:27 2020 -0500

    Add support for AnyService
---
 .../felix/scr/impl/manager/DependencyManager.java  |  94 +++++---
 .../scr/integration/AnyServiceReferenceTest.java   | 254 +++++++++++++++++++++
 .../components/AnyServiceComponent.java            | 108 +++++++++
 .../components/AnyServiceComponentInvalid.java     |  28 +++
 .../components/AnyServiceComponentList.java        |  30 +++
 .../components/AnyServiceComponentMap.java         |  30 +++
 .../resources/integration_test_any_service.xml     | 211 +++++++++++++++++
 7 files changed, 723 insertions(+), 32 deletions(-)

diff --git a/scr/src/main/java/org/apache/felix/scr/impl/manager/DependencyManager.java b/scr/src/main/java/org/apache/felix/scr/impl/manager/DependencyManager.java
index cddedda..b6473b7 100644
--- a/scr/src/main/java/org/apache/felix/scr/impl/manager/DependencyManager.java
+++ b/scr/src/main/java/org/apache/felix/scr/impl/manager/DependencyManager.java
@@ -58,6 +58,9 @@ import org.osgi.service.component.ComponentException;
  */
 public class DependencyManager<S, T> implements ReferenceManager<S, T>
 {
+    public static final String ANY_SERVICE_CLASS = "org.osgi.service.component.AnyService";
+
+    public static final String NEVER_SATIFIED_FILTER = "(&(invalid.target.cannot.resolve=*)(!(invalid.target.cannot.resolve=*)))";
 
     // the component to which this dependency belongs
     private final AbstractComponentManager<S> m_componentManager;
@@ -2383,7 +2386,7 @@ public class DependencyManager<S, T> implements ReferenceManager<S, T>
                         getName(), target);
 
                 //create a filter that will never be satisfied
-                target = "(&(invalid.target.cannot.resolve=*)(!(invalid.target.cannot.resolve=*)))";
+                target = DependencyManager.NEVER_SATIFIED_FILTER;
             }
         }
         m_target = target;
@@ -2394,39 +2397,11 @@ public class DependencyManager<S, T> implements ReferenceManager<S, T>
 
         // classFilter
         // "(" + Constants.OBJECTCLASS + "=" + m_dependencyMetadata.getInterface() + ")"
-        final StringBuilder classFilterSB = new StringBuilder();
-        classFilterSB.append(OBJECTCLASS_CLAUSE);
-        classFilterSB.append(m_dependencyMetadata.getInterface());
-        classFilterSB.append(')');
-        final String classFilterString = classFilterSB.toString();
+        final String classFilterString = getClassFilter();
 
         // initialReferenceFilter
-        final boolean multipleExpr = m_target != null
-                || m_dependencyMetadata.getScope() == ReferenceScope.prototype_required;
-        final StringBuilder initialReferenceFilterSB = new StringBuilder();
-        if (multipleExpr)
-        {
-            initialReferenceFilterSB.append("(&");
-        }
-        initialReferenceFilterSB.append(classFilterString);
-
-        // if reference scope is prototype_required, we simply add
-        // (service.scope=prototype) to the filter
-        if (m_dependencyMetadata.getScope() == ReferenceScope.prototype_required)
-        {
-            initialReferenceFilterSB.append(PROTOTYPE_SCOPE_CLAUSE);
-        }
-
-        // append target
-        if (m_target != null)
-        {
-            initialReferenceFilterSB.append(m_target);
-        }
-        if (multipleExpr)
-        {
-            initialReferenceFilterSB.append(')');
-        }
-        String initialReferenceFilterString = initialReferenceFilterSB.toString();
+        final String initialReferenceFilterString = getInitialReferenceFilter(
+            classFilterString, target);
 
         final ServiceTracker<T, RefPair<S, T>, ExtendedServiceEvent> oldTracker = m_tracker;
         AtomicInteger trackingCount = new AtomicInteger();
@@ -2466,6 +2441,61 @@ public class DependencyManager<S, T> implements ReferenceManager<S, T>
                 null, getName());
     }
 
+    private String getClassFilter()
+    {
+        String objectClass = m_dependencyMetadata.getInterface();
+        if (DependencyManager.ANY_SERVICE_CLASS.equals(objectClass))
+        {
+            objectClass = "*";
+        }
+        final StringBuilder classFilterSB = new StringBuilder();
+        classFilterSB.append(OBJECTCLASS_CLAUSE);
+        classFilterSB.append(objectClass);
+        classFilterSB.append(')');
+        return classFilterSB.toString();
+    }
+
+    private String getInitialReferenceFilter(String classFilterString, String target)
+    {
+        if (target == null)
+        {
+            if (DependencyManager.ANY_SERVICE_CLASS.equals(
+                m_dependencyMetadata.getInterface()))
+            {
+                m_componentManager.getLogger().log(Level.ERROR,
+                    "The dependency reference {0} is an AnyService reference with no target specified.",
+                    null, getName());
+                target = DependencyManager.NEVER_SATIFIED_FILTER;
+            }
+        }
+        final boolean multipleExpr = target != null
+            || m_dependencyMetadata.getScope() == ReferenceScope.prototype_required;
+        final StringBuilder initialReferenceFilterSB = new StringBuilder();
+        if (multipleExpr)
+        {
+            initialReferenceFilterSB.append("(&");
+        }
+        initialReferenceFilterSB.append(classFilterString);
+
+        // if reference scope is prototype_required, we simply add
+        // (service.scope=prototype) to the filter
+        if (m_dependencyMetadata.getScope() == ReferenceScope.prototype_required)
+        {
+            initialReferenceFilterSB.append(PROTOTYPE_SCOPE_CLAUSE);
+        }
+
+        // append target
+        if (target != null)
+        {
+            initialReferenceFilterSB.append(m_target);
+        }
+        if (multipleExpr)
+        {
+            initialReferenceFilterSB.append(')');
+        }
+        return initialReferenceFilterSB.toString();
+    }
+
     @SuppressWarnings("unchecked")
     private ServiceReference<T> getTrueConditionRef()
     {
diff --git a/scr/src/test/java/org/apache/felix/scr/integration/AnyServiceReferenceTest.java b/scr/src/test/java/org/apache/felix/scr/integration/AnyServiceReferenceTest.java
new file mode 100644
index 0000000..2354d0d
--- /dev/null
+++ b/scr/src/test/java/org/apache/felix/scr/integration/AnyServiceReferenceTest.java
@@ -0,0 +1,254 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.scr.integration;
+
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.Collections;
+import java.util.Dictionary;
+import java.util.Hashtable;
+
+import org.apache.felix.scr.integration.components.AnyServiceComponent;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.junit.PaxExam;
+import org.osgi.service.component.runtime.dto.ComponentConfigurationDTO;
+import org.osgi.service.component.runtime.dto.UnsatisfiedReferenceDTO;
+
+
+@RunWith(PaxExam.class)
+public class AnyServiceReferenceTest extends ComponentTestBase
+{
+    static
+    {
+        // uncomment to enable debugging of this test class
+        //paxRunnerVmOption = DEBUG_VM_OPTION;
+        descriptorFile = "/integration_test_any_service.xml";
+    }
+    static final String anyServiceObject = "anyServiceObject";
+
+    @Test
+    public void test_any_service_bind() throws Exception
+    {
+        final String componentName = "any.service.bind";
+        final String serviceProp = "bind";
+
+        checkUnsatisfiedAnyReference(componentName, serviceProp);
+
+        registerAnyService(serviceProp);
+
+        AnyServiceComponent anyServiceComponent = checkSatisfiedAnyServiceComponent(
+            componentName);
+
+        assertEquals("Should call bind method.", anyServiceObject,
+            anyServiceComponent.bindMethodInject);
+    }
+
+    @Test
+    public void test_any_service_bind_map() throws Exception
+    {
+        final String componentName = "any.service.bind.map";
+        final String serviceProp = "bind";
+
+        checkUnsatisfiedAnyReference(componentName, serviceProp);
+
+        registerAnyService(serviceProp);
+
+        AnyServiceComponent anyServiceComponent = checkSatisfiedAnyServiceComponent(
+            componentName);
+
+        assertNotNull("Should call bind method.",
+            anyServiceComponent.bindMethodInjectMap);
+    }
+
+    @Test
+    public void test_any_service_bind_invalid() throws Exception
+    {
+        final String componentName = "any.service.bind.invalid";
+        final String serviceProp = "bind";
+
+        checkUnsatisfiedAnyReference(componentName, serviceProp);
+        registerAnyService(serviceProp);
+
+        AnyServiceComponent anyServiceComponent = checkSatisfiedAnyServiceComponent(
+            componentName);
+
+        assertNull("Should not call invalid bind method.",
+            anyServiceComponent.bindMethodInject);
+    }
+
+    @Test
+    public void test_any_service_constructor_object() throws Exception
+    {
+        final String componentName = "any.service.constructor.object";
+        final String serviceProp = "constructor";
+
+        checkUnsatisfiedAnyReference(componentName, serviceProp);
+
+        registerAnyService(serviceProp);
+
+        AnyServiceComponent anyServiceComponent = checkSatisfiedAnyServiceComponent(
+            componentName);
+
+        assertEquals("Should call constructor", anyServiceObject,
+            anyServiceComponent.constructorInject);
+    }
+
+    @Test
+    public void test_any_service_constructor_map() throws Exception
+    {
+        final String componentName = "any.service.constructor.map";
+        final String serviceProp = "constructor";
+
+        checkUnsatisfiedAnyReference(componentName, serviceProp);
+
+        registerAnyService(serviceProp);
+
+        AnyServiceComponent anyServiceComponent = checkSatisfiedAnyServiceComponent(
+            componentName);
+
+        assertNotNull("Should call constructor",
+            anyServiceComponent.constructorInjectMap);
+    }
+
+    @Test
+    public void test_any_service_constructor_list() throws Exception
+    {
+        final String componentName = "any.service.constructor.list";
+        final String serviceProp = "constructor";
+
+        checkUnsatisfiedAnyReference(componentName, serviceProp);
+
+        registerAnyService(serviceProp);
+
+        AnyServiceComponent anyServiceComponent = checkSatisfiedAnyServiceComponent(
+            componentName);
+
+        assertNotNull("Should call constructor",
+            anyServiceComponent.constructorInjectList);
+    }
+
+    @Test
+    public void test_any_service_constructor_invalid() throws Exception
+    {
+        final String componentName = "any.service.constructor.invalid";
+        final String serviceProp = "constructor";
+
+        checkUnsatisfiedAnyReference(componentName, serviceProp);
+
+        registerAnyService(serviceProp);
+
+        findComponentConfigurationByName(componentName,
+            ComponentConfigurationDTO.FAILED_ACTIVATION);
+    }
+
+    @Test
+    public void test_any_service_field() throws Exception
+    {
+        final String componentName = "any.service.field";
+        final String serviceProp = "field";
+
+        checkUnsatisfiedAnyReference(componentName, serviceProp);
+
+        registerAnyService(serviceProp);
+
+        AnyServiceComponent anyServiceComponent = checkSatisfiedAnyServiceComponent(
+            componentName);
+
+        assertEquals("Should set field.", anyServiceObject,
+            anyServiceComponent.fieldInject);
+    }
+
+    @Test
+    public void test_any_service_field_map() throws Exception
+    {
+        final String componentName = "any.service.field.map";
+        final String serviceProp = "field";
+
+        checkUnsatisfiedAnyReference(componentName, serviceProp);
+
+        registerAnyService(serviceProp);
+
+        AnyServiceComponent anyServiceComponent = checkSatisfiedAnyServiceComponent(
+            componentName);
+
+        assertNotNull("Should call constructor", anyServiceComponent.fieldInjectMap);
+    }
+
+    @Test
+    public void test_any_service_field_List() throws Exception
+    {
+        final String componentName = "any.service.field.list";
+        final String serviceProp = "field";
+
+        checkUnsatisfiedAnyReference(componentName, serviceProp);
+
+        registerAnyService(serviceProp);
+
+        AnyServiceComponent anyServiceComponent = checkSatisfiedAnyServiceComponent(
+            componentName);
+
+        assertNotNull("Should call constructor", anyServiceComponent.fieldInjectList);
+    }
+
+    @Test
+    public void test_any_service_field_invalid() throws Exception
+    {
+        final String componentName = "any.service.field.invalid";
+        final String serviceProp = "field";
+
+        checkUnsatisfiedAnyReference(componentName, serviceProp);
+
+        registerAnyService(serviceProp);
+
+        AnyServiceComponent anyServiceComponent = checkSatisfiedAnyServiceComponent(
+            componentName);
+
+        assertNull("Should not set field.", anyServiceComponent.fieldInjectInvalid);
+    }
+
+    private void checkUnsatisfiedAnyReference(String componentName, String serviceProp)
+        throws InvocationTargetException, InterruptedException
+    {
+        ComponentConfigurationDTO configDTO = getDisabledConfigurationAndEnable(
+            componentName, ComponentConfigurationDTO.UNSATISFIED_REFERENCE);
+        UnsatisfiedReferenceDTO unsatisfiedDTO = configDTO.unsatisfiedReferences[0];
+        assertEquals("Wrong target.", "(test.any.service=" + serviceProp + ")",
+            unsatisfiedDTO.target);
+    }
+
+    private void registerAnyService(String serviceProp)
+    {
+        Dictionary<String, Object> serviceProps = new Hashtable<>(
+            Collections.singletonMap("test.any.service", (Object) serviceProp));
+        bundleContext.registerService(String.class, anyServiceObject, serviceProps);
+    }
+
+    private AnyServiceComponent checkSatisfiedAnyServiceComponent(String componentName)
+    {
+        ComponentConfigurationDTO configDTO = findComponentConfigurationByName(
+            componentName, ComponentConfigurationDTO.ACTIVE);
+
+        return getServiceFromConfiguration(configDTO, AnyServiceComponent.class);
+    }
+}
diff --git a/scr/src/test/java/org/apache/felix/scr/integration/components/AnyServiceComponent.java b/scr/src/test/java/org/apache/felix/scr/integration/components/AnyServiceComponent.java
new file mode 100644
index 0000000..bbeb1d9
--- /dev/null
+++ b/scr/src/test/java/org/apache/felix/scr/integration/components/AnyServiceComponent.java
@@ -0,0 +1,108 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.scr.integration.components;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+public class AnyServiceComponent
+{
+    public final Object constructorInject;
+    public volatile Object activateInject = null;
+    public volatile Object bindMethodInject = null;
+    public volatile Object fieldInject = null;
+
+    public final List<Object> constructorInjectList;
+    public volatile List<Object> activateInjectList = null;
+    public final List<Object> fieldInjectList = new ArrayList<>();
+
+    public final Map<String, Object> constructorInjectMap;
+    public volatile Map<String, Object> activateInjectMap = null;
+    public volatile Map<String, Object> bindMethodInjectMap = null;
+    public volatile Map<String, Object> fieldInjectMap = null;
+
+    public volatile String fieldInjectInvalid = null;
+
+    public AnyServiceComponent()
+    {
+        this(null);
+    }
+
+    public AnyServiceComponent(Object anyService)
+    {
+        this(anyService, null, null);
+    }
+
+    protected AnyServiceComponent(Object anyService, List<Object> anyServices, Map<String, Object> anyServiceMap)
+    {
+        constructorInject = anyService;
+        constructorInjectList = anyServices;
+        constructorInjectMap = anyServiceMap;
+    }
+
+    void simpleActivate()
+    {
+    }
+
+    void injectAnyServiceActivate(Object anyService)
+    {
+        this.activateInject = anyService;
+    }
+
+    void setAnyService(Object anyService)
+    {
+        this.bindMethodInject = anyService;
+    }
+
+    void unsetAnyService(Object anyService)
+    {
+        if (this.bindMethodInject == anyService)
+        {
+            this.bindMethodInject = null;
+        }
+    }
+
+    void setAnyServiceInvalid(String anyService)
+    {
+        this.bindMethodInject = anyService;
+    }
+
+    void unsetAnyServiceInvalid(String anyService)
+    {
+        if (this.bindMethodInject == anyService)
+        {
+            this.bindMethodInject = null;
+        }
+    }
+
+    void setAnyServiceMap(Map<String, Object> anyService)
+    {
+        this.bindMethodInjectMap = anyService;
+    }
+
+    void unsetAnyServiceMap(Map<String, Object> anyService)
+    {
+        if (this.bindMethodInjectMap == anyService)
+        {
+            this.bindMethodInjectMap = null;
+        }
+    }
+}
+
diff --git a/scr/src/test/java/org/apache/felix/scr/integration/components/AnyServiceComponentInvalid.java b/scr/src/test/java/org/apache/felix/scr/integration/components/AnyServiceComponentInvalid.java
new file mode 100644
index 0000000..0a5f4d8
--- /dev/null
+++ b/scr/src/test/java/org/apache/felix/scr/integration/components/AnyServiceComponentInvalid.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.scr.integration.components;
+
+public class AnyServiceComponentInvalid extends AnyServiceComponent
+{
+    public AnyServiceComponentInvalid(String anyService)
+    {
+        super(anyService);
+    }
+}
+
diff --git a/scr/src/test/java/org/apache/felix/scr/integration/components/AnyServiceComponentList.java b/scr/src/test/java/org/apache/felix/scr/integration/components/AnyServiceComponentList.java
new file mode 100644
index 0000000..676f0fc
--- /dev/null
+++ b/scr/src/test/java/org/apache/felix/scr/integration/components/AnyServiceComponentList.java
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.scr.integration.components;
+
+import java.util.List;
+
+public class AnyServiceComponentList extends AnyServiceComponent
+{
+    public AnyServiceComponentList(List<Object> anyServiceList)
+    {
+        super(null, anyServiceList, null);
+    }
+}
+
diff --git a/scr/src/test/java/org/apache/felix/scr/integration/components/AnyServiceComponentMap.java b/scr/src/test/java/org/apache/felix/scr/integration/components/AnyServiceComponentMap.java
new file mode 100644
index 0000000..d7cff1b
--- /dev/null
+++ b/scr/src/test/java/org/apache/felix/scr/integration/components/AnyServiceComponentMap.java
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.scr.integration.components;
+
+import java.util.Map;
+
+public class AnyServiceComponentMap extends AnyServiceComponent
+{
+    public AnyServiceComponentMap(Map<String, Object> anyServiceMap)
+    {
+        super(null, null, anyServiceMap);
+    }
+}
+
diff --git a/scr/src/test/resources/integration_test_any_service.xml b/scr/src/test/resources/integration_test_any_service.xml
new file mode 100644
index 0000000..9c6c00c
--- /dev/null
+++ b/scr/src/test/resources/integration_test_any_service.xml
@@ -0,0 +1,211 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+        http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+<components xmlns:scr="http://www.osgi.org/xmlns/scr/v1.5.0">
+
+    <!-- 
+        Components used in this test use the any service reference
+    -->
+    
+    <!-- valid bind target -->
+    <scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.5.0"
+        name="any.service.bind"
+        immediate="true"
+        enabled="false">
+        <implementation class="org.apache.felix.scr.integration.components.AnyServiceComponent"/>
+        <service>
+            <provide interface='org.apache.felix.scr.integration.components.AnyServiceComponent' />
+        </service>
+        <reference
+            name="bind.ref"
+            target="(test.any.service=bind)"
+            interface="org.osgi.service.component.AnyService"
+            bind="setAnyService"
+            unbind="unsetAnyService"
+        />
+    </scr:component>
+
+    <scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.5.0"
+        name="any.service.bind.map"
+        immediate="true"
+        enabled="false">
+        <implementation class="org.apache.felix.scr.integration.components.AnyServiceComponent"/>
+        <service>
+            <provide interface='org.apache.felix.scr.integration.components.AnyServiceComponent' />
+        </service>
+        <reference
+            name="bind.ref"
+            target="(test.any.service=bind)"
+            interface="org.osgi.service.component.AnyService"
+            bind="setAnyServiceMap"
+            unbind="unsetAnyServiceMap"
+        />
+    </scr:component>
+
+    <!-- invalid bind target -->
+    <scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.5.0"
+        name="any.service.bind.invalid"
+        immediate="true"
+        enabled="false">
+        <implementation class="org.apache.felix.scr.integration.components.AnyServiceComponent"/>
+        <service>
+            <provide interface='org.apache.felix.scr.integration.components.AnyServiceComponent' />
+        </service>
+        <reference
+            name="bind.ref"
+            target="(test.any.service=bind)"
+            interface="org.osgi.service.component.AnyService"
+            bind="setAnyServiceInvalid"
+            unbind="unsetAnyServiceInvalid"
+        />
+    </scr:component>
+
+    <!-- constructor target object -->
+    <scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.5.0"
+        name="any.service.constructor.object"
+        immediate="true"
+        enabled="false"
+        init="1">
+        <implementation class="org.apache.felix.scr.integration.components.AnyServiceComponent"/>
+        <service>
+            <provide interface='org.apache.felix.scr.integration.components.AnyServiceComponent' />
+        </service>
+        <reference
+            name="constructor.ref"
+            target="(test.any.service=constructor)"
+            interface="org.osgi.service.component.AnyService"
+            parameter="0"
+        />
+    </scr:component>
+
+    <scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.5.0"
+        name="any.service.constructor.map"
+        immediate="true"
+        enabled="false"
+        init="1">
+        <implementation class="org.apache.felix.scr.integration.components.AnyServiceComponentMap"/>
+        <service>
+            <provide interface='org.apache.felix.scr.integration.components.AnyServiceComponent' />
+        </service>
+        <reference
+            name="constructor.ref"
+            target="(test.any.service=constructor)"
+            interface="org.osgi.service.component.AnyService"
+            parameter="0"
+        />
+    </scr:component>
+
+    <scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.5.0"
+        name="any.service.constructor.list"
+        immediate="true"
+        enabled="false"
+        init="1">
+        <implementation class="org.apache.felix.scr.integration.components.AnyServiceComponentList"/>
+        <service>
+            <provide interface='org.apache.felix.scr.integration.components.AnyServiceComponent' />
+        </service>
+        <reference
+            name="constructor.ref"
+            target="(test.any.service=constructor)"
+            interface="org.osgi.service.component.AnyService"
+            parameter="0"
+            cardinality="1..n"
+        />
+    </scr:component>
+
+    <scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.5.0"
+        name="any.service.constructor.invalid"
+        immediate="true"
+        enabled="false"
+        init="1">
+        <implementation class="org.apache.felix.scr.integration.components.AnyServiceComponentInvalid"/>
+        <service>
+            <provide interface='org.apache.felix.scr.integration.components.AnyServiceComponent' />
+        </service>
+        <reference
+            name="constructor.ref"
+            target="(test.any.service=constructor)"
+            interface="org.osgi.service.component.AnyService"
+            parameter="0"
+        />
+    </scr:component>
+
+    <scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.5.0"
+        name="any.service.field"
+        immediate="true"
+        enabled="false">
+        <implementation class="org.apache.felix.scr.integration.components.AnyServiceComponent"/>
+        <service>
+            <provide interface='org.apache.felix.scr.integration.components.AnyServiceComponent' />
+        </service>
+        <reference
+            name="field.ref"
+            target="(test.any.service=field)"
+            interface="org.osgi.service.component.AnyService"
+            field="fieldInject"
+        />
+    </scr:component>
+
+    <scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.5.0"
+        name="any.service.field.map"
+        immediate="true"
+        enabled="false">
+        <implementation class="org.apache.felix.scr.integration.components.AnyServiceComponent"/>
+        <service>
+            <provide interface='org.apache.felix.scr.integration.components.AnyServiceComponent' />
+        </service>
+        <reference
+            name="field.ref"
+            target="(test.any.service=field)"
+            interface="org.osgi.service.component.AnyService"
+            field="fieldInjectMap"
+        />
+    </scr:component>
+    <scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.5.0"
+        name="any.service.field.list"
+        immediate="true"
+        enabled="false">
+        <implementation class="org.apache.felix.scr.integration.components.AnyServiceComponent"/>
+        <service>
+            <provide interface='org.apache.felix.scr.integration.components.AnyServiceComponent' />
+        </service>
+        <reference
+            name="field.ref"
+            target="(test.any.service=field)"
+            interface="org.osgi.service.component.AnyService"
+            field="fieldInjectList"
+            cardinality="1..n"
+        />
+    </scr:component>
+    <scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.5.0"
+        name="any.service.field.invalid"
+        immediate="true"
+        enabled="false">
+        <implementation class="org.apache.felix.scr.integration.components.AnyServiceComponent"/>
+        <service>
+            <provide interface='org.apache.felix.scr.integration.components.AnyServiceComponent' />
+        </service>
+        <reference
+            name="field.ref"
+            target="(test.any.service=field)"
+            interface="org.osgi.service.component.AnyService"
+            field="fieldInjectInvalid"
+        />
+    </scr:component>
+</components>


[felix-dev] 03/06: Move satisfying condition tests to integration tests

Posted by tj...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tjwatson pushed a commit to branch scrR8
in repository https://gitbox.apache.org/repos/asf/felix-dev.git

commit 7723726bac2546ccba9ad165ded9ac744571463c
Author: Thomas Watson <tj...@us.ibm.com>
AuthorDate: Wed Oct 28 10:05:50 2020 -0500

    Move satisfying condition tests to integration tests
---
 .../scr/impl/truecondition/TrueConditionTest.java  | 213 ---------------------
 .../scr/integration/SatisfyingConditionTest.java   | 160 ++++++++++++++++
 .../SatisfyingConditionComponentClass.java}        |   4 +-
 .../integration_test_satisfying_condition.xml      |  41 ++++
 .../test/resources/satisfying_condition_test1.xml  |  27 ---
 .../test/resources/satisfying_condition_test2.xml  |  28 ---
 6 files changed, 203 insertions(+), 270 deletions(-)

diff --git a/scr/src/test/java/org/apache/felix/scr/impl/truecondition/TrueConditionTest.java b/scr/src/test/java/org/apache/felix/scr/impl/truecondition/TrueConditionTest.java
deleted file mode 100644
index 5d58777..0000000
--- a/scr/src/test/java/org/apache/felix/scr/impl/truecondition/TrueConditionTest.java
+++ /dev/null
@@ -1,213 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.scr.impl.truecondition;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.ops4j.pax.tinybundles.core.TinyBundles.bundle;
-import static org.ops4j.pax.tinybundles.core.TinyBundles.withClassicBuilder;
-
-import java.io.File;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.Map;
-import java.util.ServiceLoader;
-
-import org.apache.felix.scr.impl.Activator;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.ops4j.pax.tinybundles.core.TinyBundle;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleException;
-import org.osgi.framework.Constants;
-import org.osgi.framework.ServiceReference;
-import org.osgi.framework.launch.Framework;
-import org.osgi.service.component.runtime.ServiceComponentRuntime;
-import org.osgi.service.component.runtime.dto.ComponentConfigurationDTO;
-import org.osgi.service.component.runtime.dto.ComponentDescriptionDTO;
-import org.osgi.service.component.runtime.dto.ReferenceDTO;
-import org.osgi.service.component.runtime.dto.SatisfiedReferenceDTO;
-import org.osgi.service.component.runtime.dto.UnsatisfiedReferenceDTO;
-import org.osgi.service.condition.Condition;
-
-import aQute.bnd.osgi.Builder;
-import aQute.bnd.osgi.Jar;
-import aQute.bnd.osgi.JarResource;
-import aQute.lib.io.IO;
-
-public class TrueConditionTest
-{
-
-    private static Framework framework;
-    private static Bundle scr;
-    private BundleActivator scrActivator;
-    private ServiceComponentRuntime scRuntime;
-    private Collection<Bundle> installed = new ArrayList<>();
-
-    @BeforeClass
-    public static void setup() throws Exception
-    {
-        File tmp = IO.getFile("target/tmp/loggertest");
-        Map<String, String> configuration = new HashMap<>();
-        configuration.put(Constants.FRAMEWORK_STORAGE,
-            tmp.getAbsolutePath());
-        configuration.put(Constants.FRAMEWORK_STORAGE_CLEAN,
-            Constants.FRAMEWORK_STORAGE_CLEAN_ONFIRSTINIT);
-        configuration.put(Constants.FRAMEWORK_BUNDLE_PARENT,
-            Constants.FRAMEWORK_BUNDLE_PARENT_FRAMEWORK);
-        configuration.put(Constants.FRAMEWORK_BOOTDELEGATION, "*");
-        framework = ServiceLoader.load(
-            org.osgi.framework.launch.FrameworkFactory.class).iterator().next().newFramework(
-                configuration);
-        framework.init();
-        framework.start();
-
-        // fake out a true condition for an R8 framework impl
-        Hashtable<String, String> trueConditionProps = new Hashtable<>();
-        trueConditionProps.put(Condition.CONDITION_ID, Condition.CONDITION_ID_TRUE);
-        framework.getBundleContext().registerService(Condition.class, Condition.INSTANCE,
-            trueConditionProps);
-
-        scr = framework.getBundleContext().installBundle("scr",
-            makeBundle("scr").openInputStream());
-        scr.start();
-    }
-
-    @AfterClass
-    public static void after() throws Exception
-    {
-        framework.stop();
-        framework.waitForStop(100000);
-    }
-
-    @Before
-    public void startScr() throws Exception
-    {
-        scrActivator = new Activator();
-        scrActivator.start(scr.getBundleContext());
-        scRuntime = getServiceComponentRuntime();
-    }
-
-    @After
-    public void cleanup() throws Exception
-    {
-        for (Bundle b : installed)
-        {
-            b.uninstall();
-        }
-        scrActivator.stop(scr.getBundleContext());
-    }
-
-    private static JarResource makeBundle(String bsn) throws Exception
-    {
-        @SuppressWarnings("resource")
-        Builder b = new Builder();
-        b.setBundleSymbolicName(bsn);
-        Jar jar = b.build();
-        b.removeClose(jar);
-        return new JarResource(jar);
-    }
-
-    private Bundle installComponentBundle(String bsn,
-        String componentXML) throws BundleException, Exception
-    {
-        Bundle b = framework.getBundleContext().installBundle(bsn,
-            makeComponent(bsn, componentXML));
-        installed.add(b);
-        return b;
-    }
-
-    private InputStream makeComponent(String bsn, String componentXML) throws Exception
-    {
-
-
-        TinyBundle bundle = bundle() //
-            .add("OSGI-INF/components.xml", getClass().getResource("/" + componentXML)) //
-            .set(Constants.BUNDLE_MANIFESTVERSION, "2") //
-            .set(Constants.BUNDLE_SYMBOLICNAME, bsn) //
-            .set(Constants.BUNDLE_VERSION, "1.0.0") //
-            .set("Service-Component", "OSGI-INF/components.xml");
-        return bundle.build(withClassicBuilder());
-    }
-
-    @Test
-    public void testDefaultSatisfyingCondition() throws BundleException, Exception
-    {
-        Bundle componentBundle = installComponentBundle("component.test.bundle", //
-            "satisfying_condition_test1.xml");
-        componentBundle.start();
-        ComponentDescriptionDTO descriptionDTO = scRuntime.getComponentDescriptionDTO(
-            componentBundle, "satisfying-condition-test1");
-        assertNotNull("No component DTO found.", descriptionDTO);
-        assertEquals("Wrong number of references.", 1, descriptionDTO.references.length);
-
-        ReferenceDTO trueReference = descriptionDTO.references[0];
-        assertEquals("Wrong name.", "osgi.ds.satisfying.condition", trueReference.name);
-        assertEquals("Wrong interface.", "org.osgi.service.condition.Condition",
-            trueReference.interfaceName);
-        assertEquals("Wrong policy.", "dynamic", trueReference.policy);
-        assertEquals("Wrong target.", "(osgi.condition.id=true)", trueReference.target);
-
-        ComponentConfigurationDTO configDTO = scRuntime.getComponentConfigurationDTOs(
-            descriptionDTO).iterator().next();
-        SatisfiedReferenceDTO satisfiedDTO = configDTO.satisfiedReferences[0];
-        assertEquals("Wrong target.", "(osgi.condition.id=true)", satisfiedDTO.target);
-    }
-
-    @Test
-    public void testTargetPropSatisfyingCondition() throws BundleException, Exception
-    {
-        Bundle componentBundle = installComponentBundle("component.test.bundle", //
-            "satisfying_condition_test2.xml");
-        componentBundle.start();
-        ComponentDescriptionDTO descriptionDTO = scRuntime.getComponentDescriptionDTO(
-            componentBundle, "satisfying-condition-test2");
-        assertNotNull("No component DTO found.", descriptionDTO);
-        assertEquals("Wrong number of references.", 1, descriptionDTO.references.length);
-
-        ReferenceDTO trueReference = descriptionDTO.references[0];
-        assertEquals("Wrong name.", "osgi.ds.satisfying.condition", trueReference.name);
-        assertEquals("Wrong interface.", "org.osgi.service.condition.Condition",
-            trueReference.interfaceName);
-        assertEquals("Wrong policy.", "dynamic", trueReference.policy);
-        assertEquals("Wrong target.", "(osgi.condition.id=true)", trueReference.target);
-
-        ComponentConfigurationDTO configDTO = scRuntime.getComponentConfigurationDTOs(
-            descriptionDTO).iterator().next();
-        UnsatisfiedReferenceDTO unsatisfiedDTO = configDTO.unsatisfiedReferences[0];
-        assertEquals("Wrong target.", "(foo=bar)", unsatisfiedDTO.target);
-    }
-
-    private ServiceComponentRuntime getServiceComponentRuntime()
-    {
-        ServiceReference<ServiceComponentRuntime> ref = framework.getBundleContext().getServiceReference(
-            ServiceComponentRuntime.class);
-        assertNotNull("No registered ServiceComponentRuntime.", ref);
-        ServiceComponentRuntime scRuntime = framework.getBundleContext().getService(ref);
-        assertNotNull("No registered SerivceComponentRuntime.", scRuntime);
-        return scRuntime;
-    }
-}
diff --git a/scr/src/test/java/org/apache/felix/scr/integration/SatisfyingConditionTest.java b/scr/src/test/java/org/apache/felix/scr/integration/SatisfyingConditionTest.java
new file mode 100644
index 0000000..58c589c
--- /dev/null
+++ b/scr/src/test/java/org/apache/felix/scr/integration/SatisfyingConditionTest.java
@@ -0,0 +1,160 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.scr.integration;
+
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+
+import java.io.File;
+import java.util.Dictionary;
+import java.util.Hashtable;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.junit.PaxExam;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.Constants;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.component.runtime.ServiceComponentRuntime;
+import org.osgi.service.component.runtime.dto.ComponentConfigurationDTO;
+import org.osgi.service.component.runtime.dto.ComponentDescriptionDTO;
+import org.osgi.service.component.runtime.dto.ReferenceDTO;
+import org.osgi.service.component.runtime.dto.SatisfiedReferenceDTO;
+import org.osgi.service.component.runtime.dto.UnsatisfiedReferenceDTO;
+import org.osgi.service.condition.Condition;
+
+
+@RunWith(PaxExam.class)
+public class SatisfyingConditionTest extends ComponentTestBase
+{
+    static
+    {
+        // uncomment to enable debugging of this test class
+        // paxRunnerVmOption = DEBUG_VM_OPTION;
+        descriptorFile = "/integration_test_satisfying_condition.xml";
+    }
+
+    @Before
+    public void registerTrueCondition() throws BundleException, InvalidSyntaxException
+    {
+        ServiceReference<ServiceComponentRuntime> ref = scrTracker.getServiceReference();
+        Bundle scrBundle = ref.getBundle();
+        File f = scrBundle.getDataFile("componentMetadataStore");
+        assertFalse("Cache " + f.getAbsolutePath() + " should not exist", f.exists());
+
+        // fake out a true condition for an R8 framework impl
+        if (bundleContext.getServiceReferences(Condition.class,
+            "(&(service.bundleid=0)(osgi.condition.id=true))").isEmpty())
+        {
+            // stop SCR first
+            scrBundle.stop();
+            // register true condition
+            Hashtable<String, String> trueConditionProps = new Hashtable<>();
+            trueConditionProps.put(Condition.CONDITION_ID, Condition.CONDITION_ID_TRUE);
+            // use system bundle to register true condition
+            bundleContext.getBundle(
+                Constants.SYSTEM_BUNDLE_LOCATION).getBundleContext().registerService(
+                    Condition.class, Condition.INSTANCE,
+                trueConditionProps);
+            // restart SCR to have it recognize the true condition
+            scrBundle.start();
+
+        }
+    }
+
+    @Test
+    public void test_default_satisfying_condition() throws Exception
+    {
+        final String componentname = "satisfying.condition.default";
+
+        ComponentConfigurationDTO configDTO = getDisabledConfigurationAndEnable(
+            componentname,
+            ComponentConfigurationDTO.ACTIVE);
+
+        assertEquals("Wrong number of references.", 1,
+            configDTO.satisfiedReferences.length);
+        SatisfiedReferenceDTO satisfiedDTO = configDTO.satisfiedReferences[0];
+        assertEquals("Wrong target.", "(osgi.condition.id=true)", satisfiedDTO.target);
+
+        ComponentDescriptionDTO descriptionDTO = configDTO.description;
+        assertEquals("Wrong number of references.", 1, descriptionDTO.references.length);
+
+        ReferenceDTO trueReference = descriptionDTO.references[0];
+        assertEquals("Wrong name.", "osgi.ds.satisfying.condition", trueReference.name);
+        assertEquals("Wrong interface.", "org.osgi.service.condition.Condition",
+            trueReference.interfaceName);
+        assertEquals("Wrong policy.", "dynamic", trueReference.policy);
+        assertEquals("Wrong target.", "(osgi.condition.id=true)", trueReference.target);
+
+        Dictionary<String, Object> configProps = new Hashtable<>();
+        configProps.put("osgi.ds.satisfying.condition.target", "(foo=baz)");
+        configure(componentname, null, configProps);
+        delay();
+
+        configDTO = findComponentConfigurationByName(componentname,
+            ComponentConfigurationDTO.UNSATISFIED_REFERENCE);
+
+        UnsatisfiedReferenceDTO unsatisfiedDTO = configDTO.unsatisfiedReferences[0];
+        assertEquals("Wrong target.", "(foo=baz)", unsatisfiedDTO.target);
+    }
+
+    @Test
+    public void test_specified_satisfying_condition() throws Exception
+    {
+        final String componentname = "satisfying.condition.target.specified";
+
+        ComponentConfigurationDTO configDTO = getDisabledConfigurationAndEnable(
+            componentname, ComponentConfigurationDTO.UNSATISFIED_REFERENCE);
+        ComponentDescriptionDTO descriptionDTO = configDTO.description;
+
+        UnsatisfiedReferenceDTO unsatisfiedDTO = configDTO.unsatisfiedReferences[0];
+        assertEquals("Wrong target.", "(foo=bar)", unsatisfiedDTO.target);
+
+        assertNotNull("No component DTO found.", descriptionDTO);
+        assertEquals("Wrong number of references.", 1, descriptionDTO.references.length);
+
+        ReferenceDTO trueReference = descriptionDTO.references[0];
+        assertEquals("Wrong name.", "osgi.ds.satisfying.condition", trueReference.name);
+        assertEquals("Wrong interface.", "org.osgi.service.condition.Condition",
+            trueReference.interfaceName);
+        assertEquals("Wrong policy.", "dynamic", trueReference.policy);
+        assertEquals("Wrong target.", "(osgi.condition.id=true)", trueReference.target);
+
+        // register condition to satisfy component
+        Hashtable<String, String> testConditionProps = new Hashtable<>();
+        testConditionProps.put(Condition.CONDITION_ID, "test");
+        testConditionProps.put("foo", "bar");
+        // use system bundle to register true condition
+        bundleContext.registerService(Condition.class, Condition.INSTANCE,
+            testConditionProps);
+
+        configDTO = findComponentConfigurationByName(componentname,
+            ComponentConfigurationDTO.ACTIVE);
+        assertEquals("Wrong number of references.", 1,
+            configDTO.satisfiedReferences.length);
+        SatisfiedReferenceDTO satisfiedDTO = configDTO.satisfiedReferences[0];
+        assertEquals("Wrong target.", "(foo=bar)", satisfiedDTO.target);
+    }
+
+}
diff --git a/scr/src/test/java/org/apache/felix/scr/impl/truecondition/ComponentTestClass.java b/scr/src/test/java/org/apache/felix/scr/integration/components/SatisfyingConditionComponentClass.java
similarity index 92%
rename from scr/src/test/java/org/apache/felix/scr/impl/truecondition/ComponentTestClass.java
rename to scr/src/test/java/org/apache/felix/scr/integration/components/SatisfyingConditionComponentClass.java
index 1f78e54..e68eb29 100644
--- a/scr/src/test/java/org/apache/felix/scr/impl/truecondition/ComponentTestClass.java
+++ b/scr/src/test/java/org/apache/felix/scr/integration/components/SatisfyingConditionComponentClass.java
@@ -16,12 +16,12 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.felix.scr.impl.truecondition;
+package org.apache.felix.scr.integration.components;
 
 import org.apache.felix.scr.impl.metadata.ReferenceMetadata;
 import org.osgi.service.component.ComponentContext;
 
-public class ComponentTestClass
+public class SatisfyingConditionComponentClass
 {
 
     void activate(ComponentContext cc)
diff --git a/scr/src/test/resources/integration_test_satisfying_condition.xml b/scr/src/test/resources/integration_test_satisfying_condition.xml
new file mode 100644
index 0000000..addeaca
--- /dev/null
+++ b/scr/src/test/resources/integration_test_satisfying_condition.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+        http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+<components xmlns:scr="http://www.osgi.org/xmlns/scr/v1.5.0">
+
+    <!-- 
+        Components used in this test use the satisfying condition
+    -->
+    
+    <!-- no declaration of satisfying condition -->
+    <scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.5.0"
+        name="satisfying.condition.default"
+        immediate="true"
+        enabled="false">
+        <implementation class="org.apache.felix.scr.integration.components.SatisfyingConditionComponentClass"/>
+    </scr:component>
+
+    <scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.4.0"
+        name="satisfying.condition.target.specified"
+        immediate="true"
+        enabled="false">
+        <property name="osgi.ds.satisfying.condition.target" value="(foo=bar)"/>
+        <implementation class="org.apache.felix.scr.integration.components.SatisfyingConditionComponentClass"/>
+    </scr:component>
+</components>
diff --git a/scr/src/test/resources/satisfying_condition_test1.xml b/scr/src/test/resources/satisfying_condition_test1.xml
deleted file mode 100755
index 2d1b763..0000000
--- a/scr/src/test/resources/satisfying_condition_test1.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-    Licensed to the Apache Software Foundation (ASF) under one
-    or more contributor license agreements.  See the NOTICE file
-    distributed with this work for additional information
-    regarding copyright ownership.  The ASF licenses this file
-    to you under the Apache License, Version 2.0 (the
-    "License"); you may not use this file except in compliance
-    with the License.  You may obtain a copy of the License at
-    
-        http://www.apache.org/licenses/LICENSE-2.0
-    
-    Unless required by applicable law or agreed to in writing,
-    software distributed under the License is distributed on an
-    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-    KIND, either express or implied.  See the License for the
-    specific language governing permissions and limitations
-    under the License.
--->
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.4.0"
- name="satisfying-condition-test1"
- immediate="true">
-    <implementation class="org.apache.felix.scr.impl.truecondition.ComponentTestClass"/>
-    <service>
-        <provide interface="org.apache.felix.scr.impl.truecondition.ComponentTestClass" />
-    </service>
-</scr:component>
\ No newline at end of file
diff --git a/scr/src/test/resources/satisfying_condition_test2.xml b/scr/src/test/resources/satisfying_condition_test2.xml
deleted file mode 100755
index 20c1d3c..0000000
--- a/scr/src/test/resources/satisfying_condition_test2.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-    Licensed to the Apache Software Foundation (ASF) under one
-    or more contributor license agreements.  See the NOTICE file
-    distributed with this work for additional information
-    regarding copyright ownership.  The ASF licenses this file
-    to you under the Apache License, Version 2.0 (the
-    "License"); you may not use this file except in compliance
-    with the License.  You may obtain a copy of the License at
-    
-        http://www.apache.org/licenses/LICENSE-2.0
-    
-    Unless required by applicable law or agreed to in writing,
-    software distributed under the License is distributed on an
-    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-    KIND, either express or implied.  See the License for the
-    specific language governing permissions and limitations
-    under the License.
--->
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.4.0"
- name="satisfying-condition-test2"
- immediate="true">
-    <implementation class="org.apache.felix.scr.impl.truecondition.ComponentTestClass"/>
-    <property name="osgi.ds.satisfying.condition.target" value="(foo=bar)"/>
-    <service>
-        <provide interface="org.apache.felix.scr.impl.truecondition.ComponentTestClass" />
-    </service>
-</scr:component>
\ No newline at end of file


[felix-dev] 05/06: Fix compile warnings in SCR

Posted by tj...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tjwatson pushed a commit to branch scrR8
in repository https://gitbox.apache.org/repos/asf/felix-dev.git

commit ce11b7a9f2f9f6fa12075597567a3da1495b0971
Author: Thomas Watson <tj...@us.ibm.com>
AuthorDate: Fri Oct 30 10:10:54 2020 -0500

    Fix compile warnings in SCR
---
 scr/pom.xml                                        |  2 -
 .../scr/impl/config/ScrConfigurationImpl.java      |  1 -
 .../apache/felix/scr/impl/helper/Coercions.java    |  2 +
 .../impl/helper/ComponentServiceObjectsHelper.java | 85 ++++++++++---------
 .../felix/scr/impl/inject/ScrComponentContext.java |  2 +
 .../felix/scr/impl/inject/field/FieldHandler.java  |  1 -
 .../felix/scr/impl/inject/internal/ClassUtils.java |  3 +-
 .../scr/impl/inject/methods/ActivateMethod.java    |  3 +-
 .../felix/scr/impl/inject/methods/BaseMethod.java  |  8 +-
 .../SuitableMethodNotAccessibleException.java      |  1 +
 .../scr/impl/manager/AbstractComponentManager.java |  9 +-
 .../scr/impl/manager/AbstractPrototypeRefPair.java |  1 -
 .../scr/impl/manager/ComponentContextImpl.java     |  6 ++
 .../scr/impl/manager/ComponentFactoryImpl.java     |  2 +-
 .../impl/manager/ConfigurableComponentHolder.java  | 12 ++-
 .../felix/scr/impl/manager/DependencyManager.java  | 10 +--
 .../scr/impl/manager/ExtendedServiceEvent.java     |  3 +-
 .../PrototypeServiceFactoryComponentManager.java   |  2 +-
 .../manager/ServiceFactoryComponentManager.java    |  2 +-
 .../felix/scr/impl/manager/ServiceTracker.java     | 21 +++--
 .../scr/impl/manager/SingleComponentManager.java   |  6 +-
 .../scr/impl/BundleComponentActivatorTest.java     |  8 +-
 .../felix/scr/impl/ComponentRegistryKeyTest.java   |  2 +-
 .../java/org/apache/felix/scr/impl/MockBundle.java | 45 ++++++++--
 .../scr/impl/inject/internal/AnnotationTest.java   |  1 -
 .../impl/inject/methods/ActivateMethodTest.java    | 43 ++++++----
 .../scr/impl/inject/methods/BindMethodTest.java    | 26 +++---
 .../manager/ConfiguredComponentHolderTest.java     | 67 ++++++++-------
 .../scr/impl/manager/RegistrationManagerTest.java  |  3 +-
 .../impl/manager/SingleComponentManagerTest.java   | 21 +++--
 .../felix/scr/impl/manager/components/T1.java      | 37 +++++----
 .../felix/scr/impl/manager/components/T1MapSR.java |  2 +-
 .../felix/scr/impl/manager/components2/T2.java     | 19 +++--
 .../felix/scr/impl/metadata/ComponentBase.java     | 18 ++--
 .../scr/impl/metadata/ComponentMetadataTest.java   |  3 +-
 .../felix/scr/impl/metadata/XmlHandlerTest.java    | 97 +++++++++++++---------
 .../scr/impl/metadata/instances/AcceptMethod.java  |  2 +
 .../scr/impl/metadata/instances/BaseObject.java    |  7 +-
 .../scr/impl/metadata/instances/Level1Object.java  |  3 +-
 .../scr/impl/metadata/instances/Level3Object.java  |  7 +-
 .../scr/impl/metadata/instances2/Level2Object.java | 11 ++-
 .../scr/integration/CircularReferenceTest.java     |  4 +-
 .../scr/integration/ComponentConstructorTest.java  |  2 +-
 .../scr/integration/ComponentDisposeTest.java      |  2 +-
 .../scr/integration/ComponentFactoryTest.java      | 27 +++---
 .../felix/scr/integration/ComponentTestBase.java   | 36 +++++---
 .../scr/integration/ConfigurationChangeTest.java   |  8 +-
 .../ConfigurationComponentFactoryTest.java         |  3 +-
 .../felix/scr/integration/Felix3680_2Test.java     |  4 +-
 .../felix/scr/integration/Felix4188Test.java       |  2 +-
 .../felix/scr/integration/Felix4350Test.java       | 18 ++--
 .../felix/scr/integration/Felix4984Test.java       | 16 ++--
 .../felix/scr/integration/Felix5248Test.java       |  2 +
 .../felix/scr/integration/Felix5276Test.java       |  1 +
 .../felix/scr/integration/Felix5356Test.java       |  4 +-
 .../felix/scr/integration/Felix6274Test.java       |  1 +
 .../apache/felix/scr/integration/LocateTest.java   |  2 +-
 .../apache/felix/scr/integration/LocationTest.java |  1 +
 .../scr/integration/MutablePropertiesTest.java     | 32 ++++---
 .../PersistentComponentFactoryTest.java            | 31 ++++---
 .../scr/integration/ServiceBindGreedyTest.java     | 15 +++-
 .../felix/scr/integration/ServiceBindTest.java     | 13 ++-
 .../scr/integration/ServiceComponentTest.java      | 15 ++--
 .../integration/components/ActivatorComponent.java |  7 +-
 .../integration/components/Felix4350Component.java |  2 +
 .../integration/components/MutatingService.java    |  2 +-
 .../components/MutatingServiceImpl.java            | 33 ++++++--
 .../integration/components/SimpleService2Impl.java | 14 ++--
 .../integration/components/SimpleServiceImpl.java  |  1 +
 .../activatesignature/Signature_Package_Map.java   |  4 +-
 .../activatesignature/Signature_Private_Map.java   |  4 +-
 .../activatesignature/Signature_Protected_Map.java |  3 +-
 .../activatesignature/Signature_Public_Map.java    |  3 +-
 .../scr/integration/components/circular/A.java     |  4 +
 .../scr/integration/components/circular/B.java     |  4 +
 .../components/circularFactory/FactoryClient.java  |  4 +-
 .../components/concurrency/AFactory.java           |  8 +-
 .../components/concurrency/CFactory.java           |  8 +-
 .../integration/components/deadlock/Consumer.java  |  2 +-
 .../components/deadlock/TestComponent.java         |  6 +-
 .../scr/integration/components/felix3680/Main.java | 12 ++-
 .../integration/components/felix3680_2/Main.java   | 18 ++--
 .../scr/integration/components/felix4984/A.java    |  7 +-
 .../scr/integration/components/felix4984/B.java    |  2 +
 .../scr/integration/components/felix5276/B.java    |  2 +
 .../scr/integration/components/felix5276/C.java    |  2 +
 .../components/felix6274_2/Component.java          |  1 +
 .../components/felix6274_hook/Activator.java       |  1 -
 88 files changed, 617 insertions(+), 380 deletions(-)

diff --git a/scr/pom.xml b/scr/pom.xml
index 753dc23..729cd7e 100644
--- a/scr/pom.xml
+++ b/scr/pom.xml
@@ -301,7 +301,6 @@
             <!-- integration tests run with pax-exam -->
             <plugin>
                 <artifactId>maven-failsafe-plugin</artifactId>
-                <version>2.12</version>
                 <executions>
                   <execution>
                     <goals>
@@ -326,7 +325,6 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-release-plugin</artifactId>
-                <version>2.5.2</version>
             </plugin>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
diff --git a/scr/src/main/java/org/apache/felix/scr/impl/config/ScrConfigurationImpl.java b/scr/src/main/java/org/apache/felix/scr/impl/config/ScrConfigurationImpl.java
index 6d6fd20..b2752a3 100644
--- a/scr/src/main/java/org/apache/felix/scr/impl/config/ScrConfigurationImpl.java
+++ b/scr/src/main/java/org/apache/felix/scr/impl/config/ScrConfigurationImpl.java
@@ -254,7 +254,6 @@ public class ScrConfigurationImpl implements ScrConfiguration
         return keepInstances;
     }
 
-    @SuppressWarnings("deprecation")
 	@Override
     public boolean infoAsService()
     {
diff --git a/scr/src/main/java/org/apache/felix/scr/impl/helper/Coercions.java b/scr/src/main/java/org/apache/felix/scr/impl/helper/Coercions.java
index 839e042..211c072 100644
--- a/scr/src/main/java/org/apache/felix/scr/impl/helper/Coercions.java
+++ b/scr/src/main/java/org/apache/felix/scr/impl/helper/Coercions.java
@@ -44,6 +44,7 @@ public class Coercions
     private static final long long0 = 0;
     private static final short short0 = 0;
 
+    @SuppressWarnings("unchecked")
     public static Object coerce(Class<?> type, Object raw, Bundle bundle)
     {
         if ( type == Byte.class || type == byte.class )
@@ -68,6 +69,7 @@ public class Coercions
         }
         if ( type.isEnum() )
         {
+            @SuppressWarnings("rawtypes")
             final Class clazz = type;
             return coerceToEnum( raw, clazz );
         }
diff --git a/scr/src/main/java/org/apache/felix/scr/impl/helper/ComponentServiceObjectsHelper.java b/scr/src/main/java/org/apache/felix/scr/impl/helper/ComponentServiceObjectsHelper.java
index 5f11b92..cf5fea7 100644
--- a/scr/src/main/java/org/apache/felix/scr/impl/helper/ComponentServiceObjectsHelper.java
+++ b/scr/src/main/java/org/apache/felix/scr/impl/helper/ComponentServiceObjectsHelper.java
@@ -37,9 +37,9 @@ public class ComponentServiceObjectsHelper
 {
     private final BundleContext bundleContext;
 
-    private final ConcurrentMap<ServiceReference<?>, ComponentServiceObjectsImpl> services = new ConcurrentHashMap<ServiceReference<?>, ComponentServiceObjectsImpl>();
+    private final ConcurrentMap<ServiceReference<?>, ComponentServiceObjectsImpl<?>> services = new ConcurrentHashMap<>();
 
-    private final List<ComponentServiceObjectsImpl> closedServices = new ArrayList<ComponentServiceObjectsImpl>();
+    private final List<ComponentServiceObjectsImpl<?>> closedServices = new ArrayList<>();
 
     private final ConcurrentMap<ServiceReference<?>, Object> prototypeInstances = new ConcurrentHashMap<ServiceReference<?>, Object>();
 
@@ -50,34 +50,39 @@ public class ComponentServiceObjectsHelper
 
     public void cleanup()
     {
-    	Collection<ComponentServiceObjectsImpl> csos = services.values();
+        Collection<ComponentServiceObjectsImpl<?>> csos = services.values();
         services.clear();
-        for(final ComponentServiceObjectsImpl cso : csos)
+        for (final ComponentServiceObjectsImpl<?> cso : csos)
         {
         	cso.deactivate();
         }
         synchronized ( this.closedServices )
         {
-        	csos = new ArrayList<ComponentServiceObjectsImpl>(this.closedServices);
+            csos = new ArrayList<ComponentServiceObjectsImpl<?>>(this.closedServices);
         	this.closedServices.clear();
         }
-        for(final ComponentServiceObjectsImpl cso : csos)
+        for (final ComponentServiceObjectsImpl<?> cso : csos)
         {
         	cso.deactivate();
         }
         prototypeInstances.clear();
     }
 
-    public ComponentServiceObjects getServiceObjects(final ServiceReference<?> ref)
+    public <T> ComponentServiceObjects<T> getServiceObjects(final ServiceReference<T> ref)
     {
-        ComponentServiceObjectsImpl cso = this.services.get(ref);
+        @SuppressWarnings("unchecked")
+        ComponentServiceObjectsImpl<T> cso = (ComponentServiceObjectsImpl<T>) this.services.get(
+            ref);
         if ( cso == null )
         {
-            final ServiceObjects serviceObjects = this.bundleContext.getServiceObjects(ref);
+            final ServiceObjects<T> serviceObjects = this.bundleContext.getServiceObjects(
+                ref);
             if ( serviceObjects != null )
             {
-                cso = new ComponentServiceObjectsImpl(serviceObjects);
-                final ComponentServiceObjectsImpl oldCSO = this.services.putIfAbsent(ref, cso);
+                cso = new ComponentServiceObjectsImpl<T>(serviceObjects);
+                @SuppressWarnings("unchecked")
+                final ComponentServiceObjectsImpl<T> oldCSO = (ComponentServiceObjectsImpl<T>) this.services.putIfAbsent(
+                    ref, cso);
                 if ( oldCSO != null )
                 {
                 	cso = oldCSO;
@@ -88,7 +93,7 @@ public class ComponentServiceObjectsHelper
     }
 
     public void closeServiceObjects(final ServiceReference<?> ref) {
-        ComponentServiceObjectsImpl cso = this.services.remove(ref);
+        ComponentServiceObjectsImpl<?> cso = this.services.remove(ref);
         if ( cso != null )
         {
         	synchronized ( closedServices )
@@ -101,30 +106,32 @@ public class ComponentServiceObjectsHelper
 
     public <T> T getPrototypeRefInstance(final ServiceReference<T> ref)
     {
-    	T service = (T) prototypeInstances.get(ref);
-    	if ( service == null )
-    	{
-    		service = (T) getServiceObjects(ref).getService();
-    		T oldService = (T)prototypeInstances.putIfAbsent(ref, service);
-    		if ( oldService != null )
-    		{
-    			// another thread created the instance already
-    			getServiceObjects(ref).ungetService(service);
-    			service = oldService;
-    		}
-    	}
-    	return service;
+        @SuppressWarnings("unchecked")
+        T service = (T) prototypeInstances.get(ref);
+        if (service == null)
+        {
+            service = (T) getServiceObjects(ref).getService();
+            @SuppressWarnings("unchecked")
+            T oldService = (T) prototypeInstances.putIfAbsent(ref, service);
+            if (oldService != null)
+            {
+                // another thread created the instance already
+                getServiceObjects(ref).ungetService(service);
+                service = oldService;
+            }
+        }
+        return service;
     }
 
-    private static final class ComponentServiceObjectsImpl implements ComponentServiceObjects
+    private static final class ComponentServiceObjectsImpl<T> implements ComponentServiceObjects<T>
     {
-        private final List<Object> instances = new ArrayList<Object>();
+        private final List<T> instances = new ArrayList<>();
 
-        private volatile ServiceObjects serviceObjects;
+        private volatile ServiceObjects<T> serviceObjects;
 
         private volatile boolean deactivated = false;
 
-        public ComponentServiceObjectsImpl(final ServiceObjects so)
+        public ComponentServiceObjectsImpl(final ServiceObjects<T> so)
         {
             this.serviceObjects = so;
         }
@@ -140,17 +147,17 @@ public class ComponentServiceObjectsHelper
          */
         public void close()
         {
-            final ServiceObjects so = this.serviceObjects;
+            final ServiceObjects<T> so = this.serviceObjects;
             this.serviceObjects = null;
             if ( so != null )
             {
-            	final List<Object> localInstances = new ArrayList<Object>();
+                final List<T> localInstances = new ArrayList<>();
                 synchronized ( this.instances )
                 {
                 	localInstances.addAll(this.instances);
                 	this.instances.clear();
                 }
-                for(final Object obj : localInstances)
+                for (final T obj : localInstances)
                 {
                     try
                     {
@@ -168,14 +175,14 @@ public class ComponentServiceObjectsHelper
             }
         }
 
-        public Object getService()
+        public T getService()
         {
         	if ( this.deactivated )
         	{
         		throw new IllegalStateException();
         	}
-            final ServiceObjects so = this.serviceObjects;
-            Object service = null;
+            final ServiceObjects<T> so = this.serviceObjects;
+            T service = null;
             if ( so != null )
             {
                 service = so.getService();
@@ -190,13 +197,13 @@ public class ComponentServiceObjectsHelper
             return service;
         }
 
-        public void ungetService(final Object service)
+        public void ungetService(final T service)
         {
         	if ( this.deactivated )
         	{
         		throw new IllegalStateException();
         	}
-            final ServiceObjects so = this.serviceObjects;
+            final ServiceObjects<T> so = this.serviceObjects;
             if ( so != null )
             {
                 boolean remove;
@@ -210,9 +217,9 @@ public class ComponentServiceObjectsHelper
             }
         }
 
-        public ServiceReference<?> getServiceReference()
+        public ServiceReference<T> getServiceReference()
         {
-            final ServiceObjects so = this.serviceObjects;
+            final ServiceObjects<T> so = this.serviceObjects;
             if ( so != null )
             {
                 return so.getServiceReference();
diff --git a/scr/src/main/java/org/apache/felix/scr/impl/inject/ScrComponentContext.java b/scr/src/main/java/org/apache/felix/scr/impl/inject/ScrComponentContext.java
index da880bc..94b4345 100755
--- a/scr/src/main/java/org/apache/felix/scr/impl/inject/ScrComponentContext.java
+++ b/scr/src/main/java/org/apache/felix/scr/impl/inject/ScrComponentContext.java
@@ -36,4 +36,6 @@ public interface ScrComponentContext extends ExtComponentContext {
     ComponentServiceObjectsHelper getComponentServiceObjectsHelper();
 
     Map<RefPair<?, ?>, Object> getBoundValues(final String key);
+
+    Map<String, Object> getPropertiesMap();
 }
diff --git a/scr/src/main/java/org/apache/felix/scr/impl/inject/field/FieldHandler.java b/scr/src/main/java/org/apache/felix/scr/impl/inject/field/FieldHandler.java
index 49f4964..ce6f926 100644
--- a/scr/src/main/java/org/apache/felix/scr/impl/inject/field/FieldHandler.java
+++ b/scr/src/main/java/org/apache/felix/scr/impl/inject/field/FieldHandler.java
@@ -42,7 +42,6 @@ import org.apache.felix.scr.impl.logger.ComponentLogger;
 import org.apache.felix.scr.impl.logger.InternalLogger.Level;
 import org.apache.felix.scr.impl.metadata.ReferenceMetadata;
 import org.osgi.framework.BundleContext;
-import org.osgi.service.log.LogLevel;
 
 /**
  * Handler for field references
diff --git a/scr/src/main/java/org/apache/felix/scr/impl/inject/internal/ClassUtils.java b/scr/src/main/java/org/apache/felix/scr/impl/inject/internal/ClassUtils.java
index 28a9a3a..dcdd6b7 100755
--- a/scr/src/main/java/org/apache/felix/scr/impl/inject/internal/ClassUtils.java
+++ b/scr/src/main/java/org/apache/felix/scr/impl/inject/internal/ClassUtils.java
@@ -36,6 +36,7 @@ import org.osgi.util.tracker.ServiceTracker;
 /**
  * Utility methods for class handling used by method and field references.
  */
+@SuppressWarnings("deprecation")
 public class ClassUtils
 {
 
@@ -193,7 +194,7 @@ public class ClassUtils
             {
                 if (m_packageAdmin == null)
                 {
-                    m_packageAdmin = new ServiceTracker(m_context, PACKAGEADMIN_CLASS,
+                    m_packageAdmin = new ServiceTracker<>(m_context, PACKAGEADMIN_CLASS,
                         null);
                     m_packageAdmin.open();
                 }
diff --git a/scr/src/main/java/org/apache/felix/scr/impl/inject/methods/ActivateMethod.java b/scr/src/main/java/org/apache/felix/scr/impl/inject/methods/ActivateMethod.java
index 30e2d49..7d6408b 100644
--- a/scr/src/main/java/org/apache/felix/scr/impl/inject/methods/ActivateMethod.java
+++ b/scr/src/main/java/org/apache/felix/scr/impl/inject/methods/ActivateMethod.java
@@ -25,7 +25,6 @@ import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Comparator;
 import java.util.List;
-import java.util.Map;
 
 import org.apache.felix.scr.impl.inject.ActivatorParameter;
 import org.apache.felix.scr.impl.inject.LifecycleMethod;
@@ -281,7 +280,7 @@ public class ActivateMethod extends BaseMethod<ActivatorParameter, Object> imple
             else
             {
                 param[i] = Annotations.toObject(parameterTypes[i],
-                    (Map<String, Object>) ap.getComponentContext().getProperties(),
+                    ap.getComponentContext().getPropertiesMap(),
                     ap.getComponentContext().getBundleContext().getBundle(), m_supportsInterfaces);
             }
         }
diff --git a/scr/src/main/java/org/apache/felix/scr/impl/inject/methods/BaseMethod.java b/scr/src/main/java/org/apache/felix/scr/impl/inject/methods/BaseMethod.java
index 556df82..0309d25 100644
--- a/scr/src/main/java/org/apache/felix/scr/impl/inject/methods/BaseMethod.java
+++ b/scr/src/main/java/org/apache/felix/scr/impl/inject/methods/BaseMethod.java
@@ -241,10 +241,12 @@ public abstract class BaseMethod<P extends BaseParameter, T>
                         getMethodNamePrefix(),
                             getMethodName(), Arrays.asList(getParametersForLogging(params)));
                 }
-                final Object result = m_method.invoke(componentInstance, params);
+                @SuppressWarnings("unchecked")
+                final Map<String, Object> result = (Map<String, Object>) m_method.invoke(
+                    componentInstance, params);
                 logger.log(Level.DEBUG, "invoked {0}: {1}", null,
                         getMethodNamePrefix(), getMethodName() );
-                return new MethodResult((m_method.getReturnType() != Void.TYPE), (Map<String, Object>) result);
+                return new MethodResult((m_method.getReturnType() != Void.TYPE), result);
             }
             else
             {
@@ -333,7 +335,7 @@ public abstract class BaseMethod<P extends BaseParameter, T>
      */
     public /* static */ Method getMethod( Class<?> clazz,
             String name,
-            Class[] parameterTypes,
+            Class<?>[] parameterTypes,
             boolean acceptPrivate,
             boolean acceptPackage,
             ComponentLogger logger ) throws SuitableMethodNotAccessibleException,
diff --git a/scr/src/main/java/org/apache/felix/scr/impl/inject/methods/SuitableMethodNotAccessibleException.java b/scr/src/main/java/org/apache/felix/scr/impl/inject/methods/SuitableMethodNotAccessibleException.java
index f48d69d..150a315 100644
--- a/scr/src/main/java/org/apache/felix/scr/impl/inject/methods/SuitableMethodNotAccessibleException.java
+++ b/scr/src/main/java/org/apache/felix/scr/impl/inject/methods/SuitableMethodNotAccessibleException.java
@@ -19,6 +19,7 @@
 package org.apache.felix.scr.impl.inject.methods;
 
 
+@SuppressWarnings("serial")
 public class SuitableMethodNotAccessibleException extends Exception
 {
 }
\ No newline at end of file
diff --git a/scr/src/main/java/org/apache/felix/scr/impl/manager/AbstractComponentManager.java b/scr/src/main/java/org/apache/felix/scr/impl/manager/AbstractComponentManager.java
index 8f51ad9..979051a 100644
--- a/scr/src/main/java/org/apache/felix/scr/impl/manager/AbstractComponentManager.java
+++ b/scr/src/main/java/org/apache/felix/scr/impl/manager/AbstractComponentManager.java
@@ -1020,10 +1020,14 @@ public abstract class AbstractComponentManager<S> implements ComponentManager<S>
                 null);
             throw new IllegalStateException("bundle shut down while trying to load implementation object class");
         }
-        Class<S> implementationObjectClass;
+
         try
         {
-            implementationObjectClass = (Class<S>) bundle.loadClass(getComponentMetadata().getImplementationClassName());
+            @SuppressWarnings("unchecked")
+            Class<S> implementationObjectClass = (Class<S>) bundle.loadClass(
+                getComponentMetadata().getImplementationClassName());
+            m_componentMethods.initComponentMethods(getComponentMetadata(),
+                implementationObjectClass, componentContext.getLogger());
         }
         catch (ClassNotFoundException e)
         {
@@ -1033,7 +1037,6 @@ public abstract class AbstractComponentManager<S> implements ComponentManager<S>
             throw new IllegalStateException(
                     "Could not load implementation object class " + getComponentMetadata().getImplementationClassName());
         }
-        m_componentMethods.initComponentMethods(getComponentMetadata(), implementationObjectClass, componentContext.getLogger());
 
         for (DependencyManager<S, ?> dependencyManager : m_dependencyManagers)
         {
diff --git a/scr/src/main/java/org/apache/felix/scr/impl/manager/AbstractPrototypeRefPair.java b/scr/src/main/java/org/apache/felix/scr/impl/manager/AbstractPrototypeRefPair.java
index 73bb82f..362242d 100644
--- a/scr/src/main/java/org/apache/felix/scr/impl/manager/AbstractPrototypeRefPair.java
+++ b/scr/src/main/java/org/apache/felix/scr/impl/manager/AbstractPrototypeRefPair.java
@@ -97,7 +97,6 @@ public abstract class AbstractPrototypeRefPair<S, T> extends RefPair<S, T>
         return true;
     }
 
-	@SuppressWarnings("unchecked")
     private void doUngetService(ScrComponentContext key, final T service) {
 		try
 		{
diff --git a/scr/src/main/java/org/apache/felix/scr/impl/manager/ComponentContextImpl.java b/scr/src/main/java/org/apache/felix/scr/impl/manager/ComponentContextImpl.java
index 3204e18..4db83e2 100644
--- a/scr/src/main/java/org/apache/felix/scr/impl/manager/ComponentContextImpl.java
+++ b/scr/src/main/java/org/apache/felix/scr/impl/manager/ComponentContextImpl.java
@@ -142,6 +142,12 @@ public class ComponentContextImpl<S> implements ScrComponentContext {
         return new ReadOnlyDictionary( m_componentManager.getProperties() );
     }
 
+    @SuppressWarnings("unchecked")
+    @Override
+    public Map<String, Object> getPropertiesMap()
+    {
+        return (Map<String, Object>) getProperties();
+    }
 
     @SuppressWarnings("unchecked")
     @Override
diff --git a/scr/src/main/java/org/apache/felix/scr/impl/manager/ComponentFactoryImpl.java b/scr/src/main/java/org/apache/felix/scr/impl/manager/ComponentFactoryImpl.java
index 6e8a85c..ea34c6e 100644
--- a/scr/src/main/java/org/apache/felix/scr/impl/manager/ComponentFactoryImpl.java
+++ b/scr/src/main/java/org/apache/felix/scr/impl/manager/ComponentFactoryImpl.java
@@ -91,7 +91,7 @@ public class ComponentFactoryImpl<S> extends AbstractComponentManager<S> impleme
 
     protected TargetedPID m_targetedPID;
 
-    public ComponentFactoryImpl( ComponentContainer<S> container, ComponentMethods componentMethods )
+    public ComponentFactoryImpl(ComponentContainer<S> container, ComponentMethods<S> componentMethods)
     {
         super( container, componentMethods );
         m_componentInstances = new IdentityHashMap<>();
diff --git a/scr/src/main/java/org/apache/felix/scr/impl/manager/ConfigurableComponentHolder.java b/scr/src/main/java/org/apache/felix/scr/impl/manager/ConfigurableComponentHolder.java
index 8fcbbdc..7751375 100644
--- a/scr/src/main/java/org/apache/felix/scr/impl/manager/ConfigurableComponentHolder.java
+++ b/scr/src/main/java/org/apache/felix/scr/impl/manager/ConfigurableComponentHolder.java
@@ -152,7 +152,9 @@ public abstract class ConfigurableComponentHolder<S> implements ComponentHolder<
         this.m_componentMetadata = metadata;
         final int pidCount = metadata.getConfigurationPid().size();
         this.m_targetedPids = new TargetedPID[pidCount];
-        this.m_configurations = new Dictionary[pidCount];
+        @SuppressWarnings("unchecked")
+        Dictionary<String, Object>[] c = new Dictionary[pidCount];
+        this.m_configurations = c;
         this.m_changeCount = new Long[pidCount];
         this.m_components = new HashMap<>();
         this.m_componentMethods = createComponentMethods();
@@ -202,9 +204,10 @@ public abstract class ConfigurableComponentHolder<S> implements ComponentHolder<
 
     private static class PSFLoader
     {
-        static <S> AbstractComponentManager<S> newPSFComponentManager(ConfigurableComponentHolder<S> holder, ComponentMethods methods)
+        static <S> AbstractComponentManager<S> newPSFComponentManager(
+            ConfigurableComponentHolder<S> holder, ComponentMethods<S> methods)
         {
-            return new PrototypeServiceFactoryComponentManager<>( holder, methods );
+            return new PrototypeServiceFactoryComponentManager<S>(holder, methods);
         }
     }
 
@@ -530,7 +533,8 @@ public abstract class ConfigurableComponentHolder<S> implements ComponentHolder<
             throw new IllegalArgumentException(
                 "Unrecognized factory pid " + factoryPid);
         }
-        if (m_configurations[index] != null) {
+        if (m_configurations[index] != null)
+        {
             logger.log(Level.ERROR,
                 "factory pid {0}, but this pid is already supplied as a singleton: {1} at index {2}", null,
                 factoryPid, Arrays.asList(m_targetedPids), index);
diff --git a/scr/src/main/java/org/apache/felix/scr/impl/manager/DependencyManager.java b/scr/src/main/java/org/apache/felix/scr/impl/manager/DependencyManager.java
index b6473b7..10917d0 100644
--- a/scr/src/main/java/org/apache/felix/scr/impl/manager/DependencyManager.java
+++ b/scr/src/main/java/org/apache/felix/scr/impl/manager/DependencyManager.java
@@ -1589,7 +1589,7 @@ public class DependencyManager<S, T> implements ReferenceManager<S, T>
         return m_tracker.getTracked(null, trackingCount).size();
     }
 
-    private ServiceReference<T>[] getFrameworkServiceReferences(String targetFilter)
+    private ServiceReference<?>[] getFrameworkServiceReferences(String targetFilter)
     {
         if (hasGetPermission())
         {
@@ -1602,7 +1602,7 @@ public class DependencyManager<S, T> implements ReferenceManager<S, T>
 
             try
             {
-                return (ServiceReference<T>[]) bc.getServiceReferences(m_dependencyMetadata.getInterface(),
+                return bc.getServiceReferences(m_dependencyMetadata.getInterface(),
                     targetFilter);
             }
             catch (IllegalStateException ise)
@@ -1666,7 +1666,7 @@ public class DependencyManager<S, T> implements ReferenceManager<S, T>
      * after this method returns.
      * @param key TODO
      */
-    T[] getServices(ComponentContextImpl<S> key)
+    Object[] getServices(ComponentContextImpl<S> key)
     {
         Collection<RefPair<S, T>> refs = m_customizer.getRefs(new AtomicInteger());
         List<T> services = new ArrayList<>(refs.size());
@@ -1678,7 +1678,7 @@ public class DependencyManager<S, T> implements ReferenceManager<S, T>
                 services.add(service);
             }
         }
-        return services.isEmpty() ? null : (T[]) services.toArray(new Object[services.size()]);
+        return services.isEmpty() ? null : services.toArray(new Object[services.size()]);
     }
 
     //---------- bound services maintenance -----------------------------------
@@ -2285,7 +2285,7 @@ public class DependencyManager<S, T> implements ReferenceManager<S, T>
         // invariant: target filter change + mandatory + dynamic policy
 
         // 4. check target services matching the new filter
-        ServiceReference<T>[] refs = getFrameworkServiceReferences(newTarget);
+        ServiceReference<?>[] refs = getFrameworkServiceReferences(newTarget);
         if (refs != null)
         {
             // Return whether there are enough target services
diff --git a/scr/src/main/java/org/apache/felix/scr/impl/manager/ExtendedServiceEvent.java b/scr/src/main/java/org/apache/felix/scr/impl/manager/ExtendedServiceEvent.java
index f06345a..9c2188a 100644
--- a/scr/src/main/java/org/apache/felix/scr/impl/manager/ExtendedServiceEvent.java
+++ b/scr/src/main/java/org/apache/felix/scr/impl/manager/ExtendedServiceEvent.java
@@ -25,6 +25,7 @@ import java.util.List;
 import org.osgi.framework.ServiceEvent;
 import org.osgi.framework.ServiceReference;
 
+@SuppressWarnings("serial")
 public class ExtendedServiceEvent extends ServiceEvent
 {
     private List<AbstractComponentManager<?>> managers;
@@ -34,7 +35,7 @@ public class ExtendedServiceEvent extends ServiceEvent
         super(source.getType(), source.getServiceReference());
     }
 
-    public ExtendedServiceEvent(int type, ServiceReference ref)
+    public ExtendedServiceEvent(int type, ServiceReference<?> ref)
     {
         super(type, ref);
     }
diff --git a/scr/src/main/java/org/apache/felix/scr/impl/manager/PrototypeServiceFactoryComponentManager.java b/scr/src/main/java/org/apache/felix/scr/impl/manager/PrototypeServiceFactoryComponentManager.java
index 6fd5f7f..18a5131 100644
--- a/scr/src/main/java/org/apache/felix/scr/impl/manager/PrototypeServiceFactoryComponentManager.java
+++ b/scr/src/main/java/org/apache/felix/scr/impl/manager/PrototypeServiceFactoryComponentManager.java
@@ -24,7 +24,7 @@ import org.osgi.framework.PrototypeServiceFactory;
 public class PrototypeServiceFactoryComponentManager<S> extends ServiceFactoryComponentManager<S> implements PrototypeServiceFactory<S>
 {
 
-    public PrototypeServiceFactoryComponentManager(ComponentContainer<S> container, ComponentMethods componentMethods)
+    public PrototypeServiceFactoryComponentManager(ComponentContainer<S> container, ComponentMethods<S> componentMethods)
     {
         super(container, componentMethods);
     }
diff --git a/scr/src/main/java/org/apache/felix/scr/impl/manager/ServiceFactoryComponentManager.java b/scr/src/main/java/org/apache/felix/scr/impl/manager/ServiceFactoryComponentManager.java
index 1520ff9..b2ab128 100644
--- a/scr/src/main/java/org/apache/felix/scr/impl/manager/ServiceFactoryComponentManager.java
+++ b/scr/src/main/java/org/apache/felix/scr/impl/manager/ServiceFactoryComponentManager.java
@@ -250,7 +250,7 @@ public class ServiceFactoryComponentManager<S> extends SingleComponentManager<S>
     //---------- Component interface
 
     @Override
-    public ComponentInstance getComponentInstance()
+    public ComponentInstance<S> getComponentInstance()
     {
         // TODO: should return the component instance corresponding to the
         // bundle owning ScrService
diff --git a/scr/src/main/java/org/apache/felix/scr/impl/manager/ServiceTracker.java b/scr/src/main/java/org/apache/felix/scr/impl/manager/ServiceTracker.java
index 57e0c25..91d2be7 100644
--- a/scr/src/main/java/org/apache/felix/scr/impl/manager/ServiceTracker.java
+++ b/scr/src/main/java/org/apache/felix/scr/impl/manager/ServiceTracker.java
@@ -244,7 +244,9 @@ public class ServiceTracker<S, T, U extends ServiceEvent> {
 	 *         invalid syntax.
 	 */
 	private ServiceReference<S>[] getInitialReferences(String className, String filterString) throws InvalidSyntaxException {
-		ServiceReference<S>[] result = (ServiceReference<S>[]) context.getServiceReferences(className, filterString);
+        @SuppressWarnings("unchecked")
+        ServiceReference<S>[] result = (ServiceReference<S>[]) context.getServiceReferences(
+            className, filterString);
 		return result;
 	}
 
@@ -344,7 +346,9 @@ public class ServiceTracker<S, T, U extends ServiceEvent> {
 	 * @see ServiceTrackerCustomizer#addingService(org.osgi.framework.ServiceReference
 	 */
 	public T addingService(ServiceReference<S> reference, int trackingCount) {
-		T result = (T) context.getService(reference);
+        @SuppressWarnings("unchecked")
+        // TODO this seems wrong; why not cast to S?
+        T result = (T) context.getService(reference);
 		return result;
 	}
 
@@ -409,7 +413,8 @@ public class ServiceTracker<S, T, U extends ServiceEvent> {
 			if (length == 0) {
 				return null;
 			}
-			ServiceReference<S>[] result = new ServiceReference[length];
+            @SuppressWarnings("unchecked")
+            ServiceReference<S>[] result = new ServiceReference[length];
 			return t.copyKeys(result);
 		}
 	}
@@ -645,7 +650,9 @@ public class ServiceTracker<S, T, U extends ServiceEvent> {
 	 *         to hold the result, a new array is created and returned.
 	 * @since 1.5
 	 */
-	public T[] getServices(T[] array) {
+    @SuppressWarnings("unchecked")
+    public T[] getServices(T[] array)
+    {
 		final Tracked t = tracked();
 		if (t == null) { /* if ServiceTracker is not open */
 			if (array.length > 0) {
@@ -690,7 +697,8 @@ public class ServiceTracker<S, T, U extends ServiceEvent> {
      * @version $Id: 16340086b98d308c2d12f13bcd87fc6467a5a367 $
      * @since 1.4
      */
-    abstract class AbstractTracked<S, T, R> {
+    static abstract class AbstractTracked<S, T, R>
+    {
         /* set this to true to compile in debug messages */
         static final boolean		DEBUG	= false;
 
@@ -1164,7 +1172,8 @@ public class ServiceTracker<S, T, U extends ServiceEvent> {
 			if (closed) {
 				return;
 			}
-			final ServiceReference<S> reference = (ServiceReference<S>) event.getServiceReference();
+            @SuppressWarnings("unchecked")
+            final ServiceReference<S> reference = (ServiceReference<S>) event.getServiceReference();
 			if (DEBUG) {
 				System.out.println("ServiceTracker.Tracked.serviceChanged[" + event.getType() + "]: " + reference);
 			}
diff --git a/scr/src/main/java/org/apache/felix/scr/impl/manager/SingleComponentManager.java b/scr/src/main/java/org/apache/felix/scr/impl/manager/SingleComponentManager.java
index 7a4ea36..f98601f 100644
--- a/scr/src/main/java/org/apache/felix/scr/impl/manager/SingleComponentManager.java
+++ b/scr/src/main/java/org/apache/felix/scr/impl/manager/SingleComponentManager.java
@@ -225,7 +225,7 @@ public class SingleComponentManager<S> extends AbstractComponentManager<S> imple
     }
 
 
-    @SuppressWarnings("unchecked")
+    @SuppressWarnings({ "unchecked", "rawtypes" })
     protected S createImplementationObject( Bundle usingBundle, SetImplementationObject<S> setter, ComponentContextImpl<S> componentContext )
     {
         S implementationObject = null;
@@ -518,7 +518,9 @@ public class SingleComponentManager<S> extends AbstractComponentManager<S> imple
                     final Object configPropServicePids = m_configurationProperties.get(Constants.SERVICE_PID);
                     if ( configPropServicePids instanceof List )
                     {
-                        servicePids.addAll((List)configPropServicePids);
+                        @SuppressWarnings("unchecked")
+                        List<String> l = (List<String>) configPropServicePids;
+                        servicePids.addAll(l);
                     }
                     else
                     {
diff --git a/scr/src/test/java/org/apache/felix/scr/impl/BundleComponentActivatorTest.java b/scr/src/test/java/org/apache/felix/scr/impl/BundleComponentActivatorTest.java
index 0972d98..73548a1 100644
--- a/scr/src/test/java/org/apache/felix/scr/impl/BundleComponentActivatorTest.java
+++ b/scr/src/test/java/org/apache/felix/scr/impl/BundleComponentActivatorTest.java
@@ -82,7 +82,8 @@ public class BundleComponentActivatorTest extends TestCase
     {
         final URL[] descriptors = new URL[]
             { new URL( "file:foo.xml" ) };
-        final Enumeration de = new Vector( Arrays.asList( descriptors ) ).elements();
+            final Enumeration<URL> de = new Vector<>(
+                Arrays.asList(descriptors)).elements();
         final Bundle bundle = Mockito.mock( Bundle.class );
         Mockito.when( bundle.findEntries( "/some/location", "foo.xml", false ) ).thenReturn( de );
 
@@ -105,7 +106,7 @@ public class BundleComponentActivatorTest extends TestCase
                 new URL( "file:foo1.xml" ),
                 new URL( "file:foo2.xml" )
             };
-        final Enumeration de = new Vector( Arrays.asList( urls ) ).elements();
+            final Enumeration<URL> de = new Vector<>(Arrays.asList(urls)).elements();
         final Bundle bundle = Mockito.mock( Bundle.class );
         Mockito.when( bundle.findEntries( path, filePattern, false ) ).thenReturn( de );
 
@@ -169,7 +170,8 @@ public class BundleComponentActivatorTest extends TestCase
         throws MalformedURLException
     {
         final Bundle bundle = Mockito.mock( Bundle.class );
-        Mockito.when( bundle.findEntries( "/", "*.xml", false ) ).thenReturn( new Vector().elements() );
+        Mockito.when(bundle.findEntries("/", "*.xml", false)).thenReturn(
+            new Vector<URL>().elements());
 
         final URL[] actualUrls = BundleComponentActivator.findDescriptors( bundle, "*.xml" );
         Mockito.verify( bundle ).findEntries( "/", "*.xml", false );
diff --git a/scr/src/test/java/org/apache/felix/scr/impl/ComponentRegistryKeyTest.java b/scr/src/test/java/org/apache/felix/scr/impl/ComponentRegistryKeyTest.java
index df4877f..1b5bf34 100644
--- a/scr/src/test/java/org/apache/felix/scr/impl/ComponentRegistryKeyTest.java
+++ b/scr/src/test/java/org/apache/felix/scr/impl/ComponentRegistryKeyTest.java
@@ -29,7 +29,6 @@ public class ComponentRegistryKeyTest extends TestCase
     private final ComponentRegistryKey b2_a_0 = key( 2, "a" );
 
     private final ComponentRegistryKey b1_a_1 = key( 1, "a" );
-    private final ComponentRegistryKey b2_a_1 = key( 2, "a" );
 
     private final ComponentRegistryKey b1_b = key( 1, "b" );
     private final ComponentRegistryKey b2_b = key( 2, "b" );
@@ -63,6 +62,7 @@ public class ComponentRegistryKeyTest extends TestCase
         return new ComponentRegistryKey( new MockBundle()
         {
 //            @Override
+            @Override
             public long getBundleId()
             {
                 return bundleId;
diff --git a/scr/src/test/java/org/apache/felix/scr/impl/MockBundle.java b/scr/src/test/java/org/apache/felix/scr/impl/MockBundle.java
index 3f23f37..2066e1a 100644
--- a/scr/src/test/java/org/apache/felix/scr/impl/MockBundle.java
+++ b/scr/src/test/java/org/apache/felix/scr/impl/MockBundle.java
@@ -37,169 +37,198 @@ import org.osgi.framework.Version;
 public class MockBundle implements Bundle
 {
 
-    public Enumeration findEntries( String arg0, String arg1, boolean arg2 )
+    @Override
+    public Enumeration<URL> findEntries(String arg0, String arg1, boolean arg2)
     {
         return null;
     }
 
 
+    @Override
     public BundleContext getBundleContext()
     {
         return null;
     }
 
+    @Override
     public Map<X509Certificate, List<X509Certificate>> getSignerCertificates( int i )
     {
         return null;
     }
 
+    @Override
     public Version getVersion()
     {
         return null;
     }
 
+    @Override
     public <A> A adapt( Class<A> aClass )
     {
         return null;
     }
 
+    @Override
     public File getDataFile( String s )
     {
         return null;
     }
 
 
+    @Override
     public long getBundleId()
     {
         return 0;
     }
 
 
+    @Override
     public URL getEntry( String name )
     {
         return getClass().getClassLoader().getResource( name );
     }
 
 
-    public Enumeration getEntryPaths( String arg0 )
+    @Override
+    public Enumeration<String> getEntryPaths(String arg0)
     {
         return null;
     }
 
 
-    public Dictionary getHeaders()
+    @Override
+    public Dictionary<String, String> getHeaders()
     {
         return null;
     }
 
 
-    public Dictionary getHeaders( String arg0 )
+    @Override
+    public Dictionary<String, String> getHeaders(String arg0)
     {
         return null;
     }
 
 
+    @Override
     public long getLastModified()
     {
         return 0;
     }
 
 
+    @Override
     public String getLocation()
     {
         return "test:mockbundle";
     }
 
 
-    public ServiceReference[] getRegisteredServices()
+    @Override
+    public ServiceReference<?>[] getRegisteredServices()
     {
         return null;
     }
 
 
+    @Override
     public URL getResource( String arg0 )
     {
         return null;
     }
 
 
-    public Enumeration getResources( String arg0 )
+    @Override
+    public Enumeration<URL> getResources(String arg0)
     {
         return null;
     }
 
 
-    public ServiceReference[] getServicesInUse()
+    @Override
+    public ServiceReference<?>[] getServicesInUse()
     {
         return null;
     }
 
 
+    @Override
     public int getState()
     {
         return 0;
     }
 
 
+    @Override
     public String getSymbolicName()
     {
         return null;
     }
 
 
+    @Override
     public boolean hasPermission( Object arg0 )
     {
         return false;
     }
 
 
-    public Class loadClass( String arg0 )
+    @Override
+    public Class<?> loadClass(String arg0)
     {
         return null;
     }
 
 
+    @Override
     public void start()
     {
 
     }
 
 
+    @Override
     public void start( int options )
     {
 
     }
 
 
+    @Override
     public void stop()
     {
 
     }
 
 
+    @Override
     public void stop( int options )
     {
 
     }
 
 
+    @Override
     public void uninstall()
     {
 
     }
 
 
+    @Override
     public void update()
     {
 
     }
 
 
+    @Override
     public void update( InputStream arg0 )
     {
 
     }
 
+    @Override
     public int compareTo( Bundle bundle )
     {
         return 0;
diff --git a/scr/src/test/java/org/apache/felix/scr/impl/inject/internal/AnnotationTest.java b/scr/src/test/java/org/apache/felix/scr/impl/inject/internal/AnnotationTest.java
index 4d7608d..3d055ba 100755
--- a/scr/src/test/java/org/apache/felix/scr/impl/inject/internal/AnnotationTest.java
+++ b/scr/src/test/java/org/apache/felix/scr/impl/inject/internal/AnnotationTest.java
@@ -25,7 +25,6 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-import org.apache.felix.scr.impl.inject.internal.Annotations;
 import org.mockito.Mockito;
 import org.osgi.framework.Bundle;
 
diff --git a/scr/src/test/java/org/apache/felix/scr/impl/inject/methods/ActivateMethodTest.java b/scr/src/test/java/org/apache/felix/scr/impl/inject/methods/ActivateMethodTest.java
index 7daa3f6..e430f83 100644
--- a/scr/src/test/java/org/apache/felix/scr/impl/inject/methods/ActivateMethodTest.java
+++ b/scr/src/test/java/org/apache/felix/scr/impl/inject/methods/ActivateMethodTest.java
@@ -50,7 +50,7 @@ import junit.framework.TestCase;
 public class ActivateMethodTest extends TestCase
 {
 
-    private static final Class ACCEPT_METHOD_CLASS = AcceptMethod.class;
+    private static final Class<AcceptMethod> ACCEPT_METHOD_CLASS = AcceptMethod.class;
 
     private Bundle m_bundle;
 
@@ -156,7 +156,7 @@ public class ActivateMethodTest extends TestCase
 
     public void test_getPackage() throws Exception
     {
-        Class dpc = getClass().getClassLoader().loadClass( "DefaultPackageClass" );
+        Class<?> dpc = getClass().getClassLoader().loadClass("DefaultPackageClass");
         assertEquals( "", BaseMethod.getPackageName( dpc ) );
 
         assertEquals( "org.apache.felix.scr.impl.metadata.instances", BaseMethod.getPackageName( base.getClass() ) );
@@ -288,11 +288,14 @@ public class ActivateMethodTest extends TestCase
      */
     private void checkMethod( BaseObject obj, String methodName, String methodDesc, DSVersion version )
     {
-        ComponentContainer<?> container = newContainer();
-        SingleComponentManager<?> icm = new SingleComponentManager( container, new ComponentMethodsImpl() );
+        ComponentContainer<Object> container = newContainer();
+        SingleComponentManager<?> icm = new SingleComponentManager<>(container,
+            new ComponentMethodsImpl<>());
         ActivateMethod am = new ActivateMethod( methodName, methodName != null, obj.getClass(), version, false, false );
 
-        am.invoke( obj, new ActivatorParameter( new ComponentContextImpl(icm, m_bundle, null), -1 ), null );
+        am.invoke(obj,
+            new ActivatorParameter(new ComponentContextImpl<>(icm, m_bundle, null), -1),
+            null);
         Method m = am.getMethod();
         assertNotNull( m );
         assertEquals( methodName, m.getName() );
@@ -300,10 +303,11 @@ public class ActivateMethodTest extends TestCase
     }
 
 
-    private ComponentContainer newContainer()
+    private ComponentContainer<Object> newContainer()
     {
         final ComponentMetadata metadata = newMetadata();
-        ComponentContainer container = new ComponentContainer() {
+        ComponentContainer<Object> container = new ComponentContainer<Object>()
+        {
 
             @Override
             public ComponentActivator getActivator()
@@ -320,15 +324,10 @@ public class ActivateMethodTest extends TestCase
             }
 
             @Override
-            public void disposed(SingleComponentManager component)
+            public void disposed(SingleComponentManager<Object> component)
             {
             }
 
-            public boolean isEnabled()
-            {
-                return false;
-            }
-
             @Override
             public ComponentLogger getLogger() {
                 return new MockComponentLogger();
@@ -374,10 +373,13 @@ public class ActivateMethodTest extends TestCase
      */
     private void ensureMethodNotFoundMethod( BaseObject obj, String methodName, DSVersion version )
     {
-        ComponentContainer container = newContainer();
-        SingleComponentManager icm = new SingleComponentManager( container, new ComponentMethodsImpl() );
+        ComponentContainer<Object> container = newContainer();
+        SingleComponentManager<Object> icm = new SingleComponentManager<>(container,
+            new ComponentMethodsImpl<>());
         ActivateMethod am = new ActivateMethod( methodName, methodName != null, obj.getClass(), version, false, false );
-        am.invoke( obj, new ActivatorParameter( new ComponentContextImpl(icm, m_bundle, null), -1 ), null );
+        am.invoke(obj,
+            new ActivatorParameter(new ComponentContextImpl<>(icm, m_bundle, null), -1),
+            null);
         Method m = am.getMethod();
         assertNull( m );
         assertNull( obj.getCalledMethod() );
@@ -387,19 +389,24 @@ public class ActivateMethodTest extends TestCase
     private void assertMethod( boolean expected, String methodName, boolean acceptPrivate, boolean acceptPackage )
         throws NoSuchMethodException
     {
-        Method method = ACCEPT_METHOD_CLASS.getDeclaredMethod( methodName, null );
+        Method method = ACCEPT_METHOD_CLASS.getDeclaredMethod(methodName);
         boolean accepted = BaseMethod.accept( method, acceptPrivate, acceptPackage, false );
         assertEquals( expected, accepted );
     }
 
     private static @interface Ann{}
+
+    @SuppressWarnings("unused")
     private static class Sort
     {
         public void a(Ann ann) {};
         public void a(int c) {};
         public void a(Integer c) {};
         public void a(BundleContext c) {};
-        public void a(Map m) {};
+
+        public void a(Map<?, ?> m)
+        {
+        };
         public void a() {};
         public void a(ComponentContext cc) {};
         public void a(ComponentContext cc, BundleContext c) {};
diff --git a/scr/src/test/java/org/apache/felix/scr/impl/inject/methods/BindMethodTest.java b/scr/src/test/java/org/apache/felix/scr/impl/inject/methods/BindMethodTest.java
index 80bf28b..c610615 100755
--- a/scr/src/test/java/org/apache/felix/scr/impl/inject/methods/BindMethodTest.java
+++ b/scr/src/test/java/org/apache/felix/scr/impl/inject/methods/BindMethodTest.java
@@ -23,7 +23,6 @@ import org.apache.felix.scr.impl.MockBundle;
 import org.apache.felix.scr.impl.inject.BindParameters;
 import org.apache.felix.scr.impl.inject.RefPair;
 import org.apache.felix.scr.impl.inject.internal.ComponentMethodsImpl;
-import org.apache.felix.scr.impl.inject.methods.BindMethod;
 import org.apache.felix.scr.impl.logger.ComponentLogger;
 import org.apache.felix.scr.impl.logger.MockComponentLogger;
 import org.apache.felix.scr.impl.manager.ComponentActivator;
@@ -50,11 +49,12 @@ import junit.framework.TestCase;
 public class BindMethodTest extends TestCase
 {
 
-    private ServiceReference m_serviceReference;
+    private ServiceReference<FakeService> m_serviceReference;
     private FakeService m_serviceInstance;
     private BundleContext m_context;
 
 
+    @SuppressWarnings("unchecked")
     @Override
     public void setUp()
     {
@@ -447,23 +447,26 @@ public class BindMethodTest extends TestCase
     private void testMethod( final String methodName, final T1 component, final DSVersion dsVersion,
         final String expectCallPerformed )
     {
-        ComponentContainer container = newContainer();
-        SingleComponentManager icm = new SingleComponentManager( container, new ComponentMethodsImpl() );
+        ComponentContainer<Object> container = newContainer();
+        SingleComponentManager<Object> icm = new SingleComponentManager<>(container,
+            new ComponentMethodsImpl<>());
         BindMethod bm = new BindMethod( methodName, component.getClass(),
                 FakeService.class.getName(), dsVersion, false );
-        RefPair refPair = new SingleRefPair( m_serviceReference );
-        ComponentContextImpl<T1> cc = new ComponentContextImpl(icm, new MockBundle(), null);
+        RefPair<Object, FakeService> refPair = new SingleRefPair<>(m_serviceReference);
+        ComponentContextImpl<Object> cc = new ComponentContextImpl<>(icm,
+            new MockBundle(), null);
         assertTrue( bm.getServiceObject( new BindParameters(cc, refPair), m_context ) );
         BindParameters bp = new BindParameters(cc, refPair);
         bm.invoke( component, bp, null );
         assertEquals( expectCallPerformed, component.callPerformed );
     }
 
-    private ComponentContainer newContainer()
+    private ComponentContainer<Object> newContainer()
     {
         final ComponentActivator activator = Mockito.mock(ComponentActivator.class);
         final ComponentMetadata metadata = newMetadata();
-        ComponentContainer container = new ComponentContainer() {
+        ComponentContainer<Object> container = new ComponentContainer<Object>()
+        {
 
             @Override
             public ComponentActivator getActivator()
@@ -478,15 +481,10 @@ public class BindMethodTest extends TestCase
             }
 
             @Override
-            public void disposed(SingleComponentManager component)
+            public void disposed(SingleComponentManager<Object> component)
             {
             }
 
-            public boolean isEnabled()
-            {
-                return false;
-            }
-
             @Override
             public ComponentLogger getLogger() {
                 return new MockComponentLogger();
diff --git a/scr/src/test/java/org/apache/felix/scr/impl/manager/ConfiguredComponentHolderTest.java b/scr/src/test/java/org/apache/felix/scr/impl/manager/ConfiguredComponentHolderTest.java
index 94982fd..ab27de5 100644
--- a/scr/src/test/java/org/apache/felix/scr/impl/manager/ConfiguredComponentHolderTest.java
+++ b/scr/src/test/java/org/apache/felix/scr/impl/manager/ConfiguredComponentHolderTest.java
@@ -47,7 +47,7 @@ public class ConfiguredComponentHolderTest extends TestCase
 
         holder.enableComponents(false);
         // assert single component and no map
-        final SingleComponentManager cmgr = getSingleManager( holder );
+        final SingleComponentManager<Object> cmgr = getSingleManager(holder);
         assertNotNull( "Expect single component manager", cmgr );
         assertEquals( "Expect no other component manager list", 1, getComponentManagers( holder ).size());
     }
@@ -62,30 +62,30 @@ public class ConfiguredComponentHolderTest extends TestCase
 
         holder.enableComponents(false);
         // assert single component and no map
-        final SingleComponentManager cmgr = getSingleManager( holder );
+        final SingleComponentManager<Object> cmgr = getSingleManager(holder);
         assertNotNull( "Expect single component manager", cmgr );
         assertEquals( "Expect no other component manager list", 1, getComponentManagers( holder ).size());
 
         // configure with the singleton configuration
-        final Dictionary config = new Hashtable();
+        final Dictionary<String, Object> config = new Hashtable<>();
         config.put( "value", name );
         TargetedPID targetedPid = new TargetedPID(name);
 		holder.configurationUpdated( targetedPid, null, config, 0 );
 
         // assert single component and no map
-        final SingleComponentManager cmgrAfterConfig = getSingleManager( holder );
+        final SingleComponentManager<Object> cmgrAfterConfig = getSingleManager(holder);
         assertNotNull( "Expect single component manager", cmgrAfterConfig );
         assertEquals( "Expect no other component manager list", 1, getComponentManagers( holder ).size());
 
 //        // assert configuration of single component
-        final Map componentConfig = ( ( MockImmediateComponentManager ) cmgrAfterConfig ).getConfiguration();
+final Map<String, Object> componentConfig = ((MockImmediateComponentManager<Object>) cmgrAfterConfig).getConfiguration();
         assertEquals( "Expect exact configuration set", config, componentConfig );
 
         // unconfigure singleton
         holder.configurationDeleted( targetedPid, null );
 
         // assert single component and no map
-        final SingleComponentManager cmgrAfterUnconfig = getSingleManager( holder );
+        final SingleComponentManager<Object> cmgrAfterUnconfig = getSingleManager(holder);
         assertNotNull( "Expect single component manager", cmgrAfterUnconfig );
         assertEquals( "Expect no other component manager list", 1, getComponentManagers( holder ).size());
 
@@ -104,40 +104,43 @@ public class ConfiguredComponentHolderTest extends TestCase
         holder.enableComponents(false);
 
         // assert single component and no map
-        final SingleComponentManager cmgr = getSingleManager( holder );
+        final SingleComponentManager<Object> cmgr = getSingleManager(holder);
         assertNotNull( "Expect single component manager", cmgr );
         assertEquals( "Expect no other component manager list", 1, getComponentManagers( holder ).size());
 
         // configure with configuration
         final String pid1 = "test.factory.0001";
-        final Dictionary config1 = new Hashtable();
+        final Dictionary<String, Object> config1 = new Hashtable<>();
         config1.put( "value", pid1 );
         TargetedPID targetedFactoryPid = new TargetedPID(name);
 		TargetedPID targetedPid1 = new TargetedPID(pid1);
 		holder.configurationUpdated( targetedPid1, targetedFactoryPid, config1, 0 );
 
         // assert single component and single-entry map
-        final SingleComponentManager cmgrAfterConfig = getSingleManager( holder );
-        final List<SingleComponentManager> cmgrsAfterConfig = getComponentManagers( holder );
+        final SingleComponentManager<Object> cmgrAfterConfig = getSingleManager(holder);
+        final List<AbstractComponentManager<Object>> cmgrsAfterConfig = getComponentManagers(
+            holder);
         assertNotNull( "Expect single component manager", cmgrAfterConfig );
         assertNotNull( "Expect component manager list", cmgrsAfterConfig );
         assertEquals( "Expect one component manager in list", 1, cmgrsAfterConfig.size() );
 
         // add another configuration
         final String pid2 = "test.factory.0002";
-        final Dictionary config2 = new Hashtable();
+        final Dictionary<String, Object> config2 = new Hashtable<>();
         config1.put( "value", pid2 );
         TargetedPID targetedPid2 = new TargetedPID(pid2);
 		holder.configurationUpdated( targetedPid2, targetedFactoryPid, config2, 1 );
 
-        final List<SingleComponentManager> cmgrsAfterConfig2 = getComponentManagers( holder );
+        final List<AbstractComponentManager<Object>> cmgrsAfterConfig2 = getComponentManagers(
+            holder);
         assertNotNull( "Expect component manager list", cmgrsAfterConfig2 );
         assertEquals( "Expect two component manager in list", 2, cmgrsAfterConfig2.size() );
 
         // remove second configuration
         holder.configurationDeleted( targetedPid2, targetedFactoryPid );
 
-        final List<SingleComponentManager> cmgrsAfterUnConfig2 = getComponentManagers( holder );
+        final List<AbstractComponentManager<Object>> cmgrsAfterUnConfig2 = getComponentManagers(
+            holder);
         assertNotNull( "Expect component manager list", cmgrsAfterUnConfig2 );
 //TODO Multipids fix correct assertion        assertEquals( "Expect one component manager in list", 1, cmgrsAfterUnConfig2.size() );
 
@@ -146,7 +149,8 @@ public class ConfiguredComponentHolderTest extends TestCase
         holder.configurationDeleted( targetedPid1, targetedFactoryPid );
 
         // assert single component and single-entry map
-        final List<SingleComponentManager> cmgrsAfterConfigUnconfig = getComponentManagers( holder );
+        final List<AbstractComponentManager<Object>> cmgrsAfterConfigUnconfig = getComponentManagers(
+            holder);
         assertNotNull( "Expect component manager list", cmgrsAfterConfigUnconfig );
 //TODO Multipids fix correct assertion        assertEquals( "Expect one component manager in list", 1, cmgrsAfterConfigUnconfig.size() );
 
@@ -154,7 +158,8 @@ public class ConfiguredComponentHolderTest extends TestCase
         holder.configurationDeleted( targetedPid2, targetedFactoryPid );
 
         // assert single component and single-entry map
-        final List<SingleComponentManager> cmgrsAfterAllUnconfig = getComponentManagers( holder );
+        final List<AbstractComponentManager<Object>> cmgrsAfterAllUnconfig = getComponentManagers(
+            holder);
         assertNotNull( "Expect single component manager", cmgrsAfterAllUnconfig );
 //TODO Multipids fix correct assertion        assertEquals( "Expect no component manager list", 1, cmgrsAfterAllUnconfig.size() );
 
@@ -172,20 +177,22 @@ public class ConfiguredComponentHolderTest extends TestCase
     }
 
 
-    private static SingleComponentManager getSingleManager( ConfigurableComponentHolder holder )
+    private static SingleComponentManager<Object> getSingleManager(
+        ConfigurableComponentHolder<Object> holder)
     {
-    	List<SingleComponentManager> managers = getComponentManagers(holder);
+        List<AbstractComponentManager<Object>> managers = getComponentManagers(holder);
     	assertEquals(1, managers.size());
-    	return managers.get(0);
+        return (SingleComponentManager<Object>) managers.get(0);
     }
 
 
-    private static List<SingleComponentManager> getComponentManagers( ConfigurableComponentHolder holder )
+    private static List<AbstractComponentManager<Object>> getComponentManagers(
+        ConfigurableComponentHolder<Object> holder)
     {
     	return holder.getComponentManagers();
     }
 
-    private static class TestingConfiguredComponentHolder extends ConfigurableComponentHolder
+    private static class TestingConfiguredComponentHolder extends ConfigurableComponentHolder<Object>
     {
         TestingConfiguredComponentHolder( ComponentMetadata metadata )
         {
@@ -194,14 +201,16 @@ public class ConfiguredComponentHolderTest extends TestCase
 
 
         @Override
-        protected SingleComponentManager createComponentManager(boolean factoryConfiguration)
+        protected SingleComponentManager<Object> createComponentManager(
+            boolean factoryConfiguration)
         {
-            return new MockImmediateComponentManager( this );
+            return new MockImmediateComponentManager<Object>(this);
         }
 
         @Override
-        protected ComponentMethods createComponentMethods() {
-            return new ComponentMethodsImpl();
+        protected ComponentMethods<Object> createComponentMethods()
+        {
+            return new ComponentMethodsImpl<Object>();
         }
     }
 
@@ -211,9 +220,9 @@ public class ConfiguredComponentHolderTest extends TestCase
         private Map<String, Object> m_configuration;
 
 
-        public MockImmediateComponentManager( ComponentContainer container )
+        public MockImmediateComponentManager(ComponentContainer<S> container)
         {
-            super( container, new ComponentMethodsImpl() );
+            super(container, new ComponentMethodsImpl<S>());
         }
 
 
@@ -222,12 +231,6 @@ public class ConfiguredComponentHolderTest extends TestCase
             return m_configuration;
         }
 
-
-        public boolean hasConfiguration()
-        {
-            return m_configuration != null;
-        }
-
         @Override
         public void reconfigure( Map<String, Object> configuration, boolean configurationDeleted, TargetedPID factoryPid)
         {
diff --git a/scr/src/test/java/org/apache/felix/scr/impl/manager/RegistrationManagerTest.java b/scr/src/test/java/org/apache/felix/scr/impl/manager/RegistrationManagerTest.java
index 3b3381b..58b4650 100644
--- a/scr/src/test/java/org/apache/felix/scr/impl/manager/RegistrationManagerTest.java
+++ b/scr/src/test/java/org/apache/felix/scr/impl/manager/RegistrationManagerTest.java
@@ -34,7 +34,6 @@ public class RegistrationManagerTest
     private volatile boolean fail;
 
     private int n = 10;
-    private ArrayList<Thread> threads = new ArrayList<>();
 
     private TRM trm = new TRM();
 
@@ -117,7 +116,7 @@ public class RegistrationManagerTest
         {
             if ( arguments != null && arguments.length == 1 && (arguments[0] instanceof ArrayList))
             {
-                ArrayList<RegState> opqueue = ( ArrayList<org.apache.felix.scr.impl.manager.RegistrationManager.RegState> ) arguments[0];
+                ArrayList<?> opqueue = (ArrayList<?>) arguments[0];
 //                System.out.println("opqueue: " + opqueue);
                 if (opqueue.size() > 1)
                 {
diff --git a/scr/src/test/java/org/apache/felix/scr/impl/manager/SingleComponentManagerTest.java b/scr/src/test/java/org/apache/felix/scr/impl/manager/SingleComponentManagerTest.java
index 413778b..bfaacf6 100644
--- a/scr/src/test/java/org/apache/felix/scr/impl/manager/SingleComponentManagerTest.java
+++ b/scr/src/test/java/org/apache/felix/scr/impl/manager/SingleComponentManagerTest.java
@@ -41,9 +41,9 @@ import org.osgi.service.cm.ConfigurationAdmin;
 
 public class SingleComponentManagerTest
 {
+    private ServiceRegistration<?> serviceRegistration = Mockito.mock(
+        ServiceRegistration.class);
 
-    private ServiceRegistration serviceRegistration = Mockito.mock(ServiceRegistration.class);
-    private ServiceReference serviceReference = Mockito.mock(ServiceReference.class);
     private BundleLogger bundleLogger = Mockito.mock(BundleLogger.class);
     private ComponentLogger componentLogger = Mockito.mock(ComponentLogger.class);
 
@@ -179,19 +179,21 @@ public class SingleComponentManagerTest
         }
     };
 
+    @SuppressWarnings("unchecked")
     @Test
     public void testGetService() throws Exception {
         ComponentMetadata cm = new ComponentMetadata(DSVersion.DS13);
         cm.setImplementationClassName("foo.bar.SomeClass");
         cm.validate();
 
-        @SuppressWarnings("unchecked")
         ComponentContainer<Object> cc = Mockito.mock(ComponentContainer.class);
         Mockito.when(cc.getComponentMetadata()).thenReturn(cm);
         Mockito.when(cc.getActivator()).thenReturn(componentActivator);
         Mockito.when(cc.getLogger()).thenReturn(componentLogger);
 
-        SingleComponentManager<Object> scm = new SingleComponentManager<Object>(cc, new ComponentMethodsImpl()) {
+        SingleComponentManager<Object> scm = new SingleComponentManager<Object>(cc,
+            new ComponentMethodsImpl<>())
+        {
             @Override
             boolean getServiceInternal(ServiceRegistration<Object> serviceRegistration)
             {
@@ -213,7 +215,8 @@ public class SingleComponentManagerTest
         f.set(scm, cci);
 
         scm.setState(scm.getState(), State.unsatisfiedReference);
-        assertSame(implObj, scm.getService(b, serviceRegistration));
+        assertSame(implObj,
+            scm.getService(b, (ServiceRegistration<Object>) serviceRegistration));
 
         Field u = SingleComponentManager.class.getDeclaredField("m_useCount");
         u.setAccessible(true);
@@ -221,6 +224,7 @@ public class SingleComponentManagerTest
         assertEquals(1, use.get());
     }
 
+    @SuppressWarnings("unchecked")
     @Test
     public void testGetServiceWithNullComponentContext() throws Exception
     {
@@ -228,13 +232,14 @@ public class SingleComponentManagerTest
         cm.setImplementationClassName("foo.bar.SomeClass");
         cm.validate();
 
-        @SuppressWarnings("unchecked")
         ComponentContainer<Object> cc = Mockito.mock(ComponentContainer.class);
         Mockito.when(cc.getComponentMetadata()).thenReturn(cm);
         Mockito.when(cc.getActivator()).thenReturn(componentActivator);
         Mockito.when(cc.getLogger()).thenReturn(componentLogger);
 
-        SingleComponentManager<?> scm = new SingleComponentManager<Object>(cc, new ComponentMethodsImpl()) {
+        SingleComponentManager<Object> scm = new SingleComponentManager<Object>(cc,
+            new ComponentMethodsImpl<>())
+        {
             @Override
             boolean getServiceInternal(ServiceRegistration<Object> serviceRegistration)
             {
@@ -247,7 +252,7 @@ public class SingleComponentManagerTest
 
         scm.setState(scm.getState(), State.unsatisfiedReference);
         assertNull("m_componentContext is null, this should not cause an NPE",
-                scm.getService(b, serviceRegistration));
+            scm.getService(b, (ServiceRegistration<Object>) serviceRegistration));
 
         Field u = SingleComponentManager.class.getDeclaredField("m_useCount");
         u.setAccessible(true);
diff --git a/scr/src/test/java/org/apache/felix/scr/impl/manager/components/T1.java b/scr/src/test/java/org/apache/felix/scr/impl/manager/components/T1.java
index 2800d6d..0779b2b 100644
--- a/scr/src/test/java/org/apache/felix/scr/impl/manager/components/T1.java
+++ b/scr/src/test/java/org/apache/felix/scr/impl/manager/components/T1.java
@@ -30,13 +30,14 @@ public class T1
     public String callPerformed = null;
 
 
+    @SuppressWarnings("unused")
     private void privateT1()
     {
         callPerformed = "privateT1";
     }
 
-
-    private void privateT1SR( ServiceReference sr )
+    @SuppressWarnings("unused")
+    private void privateT1SR(ServiceReference<?> sr)
     {
         if ( sr != null )
         {
@@ -48,7 +49,7 @@ public class T1
         }
     }
 
-
+    @SuppressWarnings("unused")
     private void privateT1SI( FakeService si )
     {
         if ( si != null )
@@ -62,7 +63,8 @@ public class T1
     }
 
 
-    private void privateT1SIMap( FakeService si, Map props )
+    @SuppressWarnings("unused")
+    private void privateT1SIMap(FakeService si, Map<?, ?> props)
     {
         if ( si != null && props != null && props.size() > 0 )
         {
@@ -83,6 +85,7 @@ public class T1
     }
 
 
+    @SuppressWarnings("unused")
     private void privateT1SSI( SuperFakeService si )
     {
         if ( si != null )
@@ -95,8 +98,8 @@ public class T1
         }
     }
 
-
-    private void privateT1SSIMap( SuperFakeService si, Map props )
+    @SuppressWarnings("unused")
+    private void privateT1SSIMap(SuperFakeService si, Map<?, ?> props)
     {
         if ( si != null && props != null && props.size() > 0 )
         {
@@ -123,7 +126,7 @@ public class T1
     }
 
 
-    void packageT1SR( ServiceReference sr )
+    void packageT1SR(ServiceReference<?> sr)
     {
         if ( sr != null )
         {
@@ -149,7 +152,7 @@ public class T1
     }
 
 
-    void packageT1SIMap( FakeService si, Map props )
+    void packageT1SIMap(FakeService si, Map<?, ?> props)
     {
         if ( si != null && props != null && props.size() > 0 )
         {
@@ -183,7 +186,7 @@ public class T1
     }
 
 
-    void packageT1SSIMap( SuperFakeService si, Map props )
+    void packageT1SSIMap(SuperFakeService si, Map<?, ?> props)
     {
         if ( si != null && props != null && props.size() > 0 )
         {
@@ -210,7 +213,7 @@ public class T1
     }
 
 
-    protected void protectedT1SR( ServiceReference sr )
+    protected void protectedT1SR(ServiceReference<?> sr)
     {
         if ( sr != null )
         {
@@ -236,7 +239,7 @@ public class T1
     }
 
 
-    protected void protectedT1SIMap( FakeService si, Map props )
+    protected void protectedT1SIMap(FakeService si, Map<?, ?> props)
     {
         if ( si != null && props != null && props.size() > 0 )
         {
@@ -270,7 +273,7 @@ public class T1
     }
 
 
-    protected void protectedT1SSIMap( SuperFakeService si, Map props )
+    protected void protectedT1SSIMap(SuperFakeService si, Map<?, ?> props)
     {
         if ( si != null && props != null && props.size() > 0 )
         {
@@ -297,7 +300,7 @@ public class T1
     }
 
 
-    public void publicT1SR( ServiceReference sr )
+    public void publicT1SR(ServiceReference<?> sr)
     {
         if ( sr != null )
         {
@@ -323,7 +326,7 @@ public class T1
     }
 
 
-    public void publicT1SIMap( FakeService si, Map props )
+    public void publicT1SIMap(FakeService si, Map<?, ?> props)
     {
         if ( si != null && props != null && props.size() > 0 )
         {
@@ -357,7 +360,7 @@ public class T1
     }
 
 
-    public void publicT1SSIMap( SuperFakeService si, Map props )
+    public void publicT1SSIMap(SuperFakeService si, Map<?, ?> props)
     {
         if ( si != null && props != null && props.size() > 0 )
         {
@@ -378,12 +381,12 @@ public class T1
     }
 
 
-    public void suitable( ServiceReference sr )
+    public void suitable(ServiceReference<?> sr)
     {
         callPerformed = "suitableT1";
     }
     
-    void packageT1Map(Map props)
+    void packageT1Map(Map<?, ?> props)
     {
         if ( props != null && !props.isEmpty())
         {
diff --git a/scr/src/test/java/org/apache/felix/scr/impl/manager/components/T1MapSR.java b/scr/src/test/java/org/apache/felix/scr/impl/manager/components/T1MapSR.java
index e3f097f..194c009 100644
--- a/scr/src/test/java/org/apache/felix/scr/impl/manager/components/T1MapSR.java
+++ b/scr/src/test/java/org/apache/felix/scr/impl/manager/components/T1MapSR.java
@@ -25,7 +25,7 @@ import org.osgi.framework.ServiceReference;
 public class T1MapSR extends T1
 {
     
-    void packageT1MapSR( Map props, ServiceReference sr)
+    void packageT1MapSR(Map<?, ?> props, ServiceReference<?> sr)
     {
         if ( props != null && !props.isEmpty() && sr != null )
         {
diff --git a/scr/src/test/java/org/apache/felix/scr/impl/manager/components2/T2.java b/scr/src/test/java/org/apache/felix/scr/impl/manager/components2/T2.java
index a093af4..0df3dc0 100644
--- a/scr/src/test/java/org/apache/felix/scr/impl/manager/components2/T2.java
+++ b/scr/src/test/java/org/apache/felix/scr/impl/manager/components2/T2.java
@@ -29,13 +29,15 @@ import org.osgi.framework.ServiceReference;
 
 public class T2 extends T1
 {
+    @SuppressWarnings("unused")
     private void privateT2()
     {
         callPerformed = "privateT2";
     }
 
 
-    private void privateT2SR( ServiceReference sr )
+    @SuppressWarnings("unused")
+    private void privateT2SR(ServiceReference<?> sr)
     {
         if ( sr != null )
         {
@@ -48,6 +50,7 @@ public class T2 extends T1
     }
 
 
+    @SuppressWarnings("unused")
     private void privateT2SI( FakeService si )
     {
         if ( si != null )
@@ -61,7 +64,8 @@ public class T2 extends T1
     }
 
 
-    private void privateT2SIMap( FakeService si, Map props )
+    @SuppressWarnings("unused")
+    private void privateT2SIMap(FakeService si, Map<?, ?> props)
     {
         if ( si != null && props != null && props.size() > 0 )
         {
@@ -82,6 +86,7 @@ public class T2 extends T1
     }
 
 
+    @SuppressWarnings("unused")
     private void privateT2SSI( SuperFakeService si )
     {
         if ( si != null )
@@ -95,7 +100,8 @@ public class T2 extends T1
     }
 
 
-    private void privateT2SSIMap( SuperFakeService si, Map props )
+    @SuppressWarnings("unused")
+    private void privateT2SSIMap(SuperFakeService si, Map<?, ?> props)
     {
         if ( si != null && props != null && props.size() > 0 )
         {
@@ -122,7 +128,7 @@ public class T2 extends T1
     }
 
 
-    void packageT2SR( ServiceReference sr )
+    void packageT2SR(ServiceReference<?> sr)
     {
         if ( sr != null )
         {
@@ -148,7 +154,7 @@ public class T2 extends T1
     }
 
 
-    void packageT2SIMap( FakeService si, Map props )
+    void packageT2SIMap(FakeService si, Map<?, ?> props)
     {
         if ( si != null && props != null && props.size() > 0 )
         {
@@ -182,7 +188,7 @@ public class T2 extends T1
     }
 
 
-    void packageT2SSIMap( SuperFakeService si, Map props )
+    void packageT2SSIMap(SuperFakeService si, Map<?, ?> props)
     {
         if ( si != null && props != null && props.size() > 0 )
         {
@@ -204,6 +210,7 @@ public class T2 extends T1
 
 
     // this method must hide the T1#suitable method !
+    @SuppressWarnings("unused")
     private void suitable( FakeService si )
     {
         callPerformed = "suitableT2";
diff --git a/scr/src/test/java/org/apache/felix/scr/impl/metadata/ComponentBase.java b/scr/src/test/java/org/apache/felix/scr/impl/metadata/ComponentBase.java
index 581728f..d57b4b5 100644
--- a/scr/src/test/java/org/apache/felix/scr/impl/metadata/ComponentBase.java
+++ b/scr/src/test/java/org/apache/felix/scr/impl/metadata/ComponentBase.java
@@ -47,7 +47,7 @@ public class ComponentBase extends TestCase
         logger = new MockBundleLogger();
     }
 
-    private List readMetadata(InputStream in)
+    private List<ComponentMetadata> readMetadata(InputStream in)
         throws IOException, ComponentException, SAXException, Exception
     {
         final SAXParserFactory factory = SAXParserFactory.newInstance();
@@ -60,7 +60,7 @@ public class ComponentBase extends TestCase
         return handler.getComponentMetadataList();
     }
 
-    protected List readMetadata(String filename)
+    protected List<ComponentMetadata> readMetadata(String filename)
         throws IOException, ComponentException, SAXException, Exception
     {
         try (InputStream in = getClass().getResourceAsStream(filename))
@@ -69,7 +69,7 @@ public class ComponentBase extends TestCase
         }
     }
 
-    protected List readMetadataFromString(final String source)
+    protected List<ComponentMetadata> readMetadataFromString(final String source)
         throws IOException, ComponentException, SAXException, Exception
     {
         return readMetadata(new ByteArrayInputStream(source.getBytes()));
@@ -78,10 +78,10 @@ public class ComponentBase extends TestCase
     protected ReferenceMetadata getReference(final ComponentMetadata cm,
         final String name)
     {
-        List rmlist = cm.getDependencies();
-        for (Iterator rmi = rmlist.iterator(); rmi.hasNext();)
+        List<ReferenceMetadata> rmlist = cm.getDependencies();
+        for (Iterator<ReferenceMetadata> rmi = rmlist.iterator(); rmi.hasNext();)
         {
-            ReferenceMetadata rm = (ReferenceMetadata) rmi.next();
+            ReferenceMetadata rm = rmi.next();
             if (name.equals(rm.getName()))
             {
                 return rm;
@@ -95,10 +95,10 @@ public class ComponentBase extends TestCase
     protected PropertyMetadata getPropertyMetadata(final ComponentMetadata cm,
         final String name)
     {
-        List pmlist = cm.getPropertyMetaData();
-        for (Iterator pmi = pmlist.iterator(); pmi.hasNext();)
+        List<PropertyMetadata> pmlist = cm.getPropertyMetaData();
+        for (Iterator<PropertyMetadata> pmi = pmlist.iterator(); pmi.hasNext();)
         {
-            PropertyMetadata pm = (PropertyMetadata) pmi.next();
+            PropertyMetadata pm = pmi.next();
             if (name.equals(pm.getName()))
             {
                 return pm;
diff --git a/scr/src/test/java/org/apache/felix/scr/impl/metadata/ComponentMetadataTest.java b/scr/src/test/java/org/apache/felix/scr/impl/metadata/ComponentMetadataTest.java
index d4a30b7..8c55450 100644
--- a/scr/src/test/java/org/apache/felix/scr/impl/metadata/ComponentMetadataTest.java
+++ b/scr/src/test/java/org/apache/felix/scr/impl/metadata/ComponentMetadataTest.java
@@ -946,7 +946,8 @@ public class ComponentMetadataTest extends TestCase
     }
 
 
-    private void assertPrimitiveType( final Class expectedBoxClass, final Class actualClass )
+    private void assertPrimitiveType(final Class<?> expectedBoxClass,
+        final Class<?> actualClass)
     {
         if ( expectedBoxClass == String.class )
         {
diff --git a/scr/src/test/java/org/apache/felix/scr/impl/metadata/XmlHandlerTest.java b/scr/src/test/java/org/apache/felix/scr/impl/metadata/XmlHandlerTest.java
index 6ee8992..6d2e798 100644
--- a/scr/src/test/java/org/apache/felix/scr/impl/metadata/XmlHandlerTest.java
+++ b/scr/src/test/java/org/apache/felix/scr/impl/metadata/XmlHandlerTest.java
@@ -72,59 +72,66 @@ public class XmlHandlerTest extends ComponentBase
 
     public void test_namespace_1_0_0() throws Exception
     {
-        final List metadataList = readMetadataFromString( "<scr:component xmlns:scr=\"http://www.osgi.org/xmlns/scr/v1.0.0\" name=\"n\" ><implementation class=\"n\"/></scr:component>" );
+        final List<ComponentMetadata> metadataList = readMetadataFromString(
+            "<scr:component xmlns:scr=\"http://www.osgi.org/xmlns/scr/v1.0.0\" name=\"n\" ><implementation class=\"n\"/></scr:component>");
         assertEquals( "1 Descriptor expected", 1, metadataList.size() );
-        final ComponentMetadata metadata = ( ComponentMetadata ) metadataList.get( 0 );
+        final ComponentMetadata metadata = metadataList.get(0);
         assertEquals( "Expect NS 1.0.0", DSVersion.DS10, metadata.getDSVersion() );
     }
 
 
     public void test_namespace_1_1_0() throws Exception
     {
-        final List metadataList = readMetadataFromString( "<scr:component xmlns:scr=\"http://www.osgi.org/xmlns/scr/v1.1.0\" name=\"n\" ><implementation class=\"n\"/></scr:component>" );
+        final List<ComponentMetadata> metadataList = readMetadataFromString(
+            "<scr:component xmlns:scr=\"http://www.osgi.org/xmlns/scr/v1.1.0\" name=\"n\" ><implementation class=\"n\"/></scr:component>");
         assertEquals( "1 Descriptor expected", 1, metadataList.size() );
-        final ComponentMetadata metadata = ( ComponentMetadata ) metadataList.get( 0 );
+        final ComponentMetadata metadata = metadataList.get(0);
         assertEquals( "Expect NS 1.1.0", DSVersion.DS11, metadata.getDSVersion() );
     }
 
 
     public void test_namespace_1_1_0_felix() throws Exception
     {
-        final List metadataList = readMetadataFromString( "<scr:component xmlns:scr=\"http://felix.apache.org/xmlns/scr/v1.1.0-felix\" name=\"n\" ><implementation class=\"n\"/></scr:component>" );
+        final List<ComponentMetadata> metadataList = readMetadataFromString(
+            "<scr:component xmlns:scr=\"http://felix.apache.org/xmlns/scr/v1.1.0-felix\" name=\"n\" ><implementation class=\"n\"/></scr:component>");
         assertEquals( "1 Descriptor expected", 1, metadataList.size() );
-        final ComponentMetadata metadata = ( ComponentMetadata ) metadataList.get( 0 );
+        final ComponentMetadata metadata = metadataList.get(0);
         assertEquals( "Expect NS 1.1.0-felix", DSVersion.DS11Felix, metadata.getDSVersion() );
     }
 
 
     public void test_namespace_1_2_0() throws Exception
     {
-        final List metadataList = readMetadataFromString( "<scr:component xmlns:scr=\"http://www.osgi.org/xmlns/scr/v1.2.0\" name=\"n\" ><implementation class=\"n\"/></scr:component>" );
+        final List<ComponentMetadata> metadataList = readMetadataFromString(
+            "<scr:component xmlns:scr=\"http://www.osgi.org/xmlns/scr/v1.2.0\" name=\"n\" ><implementation class=\"n\"/></scr:component>");
         assertEquals( "1 Descriptor expected", 1, metadataList.size() );
-        final ComponentMetadata metadata = ( ComponentMetadata ) metadataList.get( 0 );
+        final ComponentMetadata metadata = metadataList.get(0);
         assertEquals( "Expect NS 1.2.0", DSVersion.DS12, metadata.getDSVersion() );
     }
 
 
     public void test_namespace_1_2_0_felix() throws Exception
     {
-        final List metadataList = readMetadataFromString( "<scr:component xmlns:scr=\"http://felix.apache.org/xmlns/scr/v1.2.0-felix\" name=\"n\" ><implementation class=\"n\"/></scr:component>" );
+        final List<ComponentMetadata> metadataList = readMetadataFromString(
+            "<scr:component xmlns:scr=\"http://felix.apache.org/xmlns/scr/v1.2.0-felix\" name=\"n\" ><implementation class=\"n\"/></scr:component>");
         assertEquals( "1 Descriptor expected", 1, metadataList.size() );
-        final ComponentMetadata metadata = ( ComponentMetadata ) metadataList.get( 0 );
+        final ComponentMetadata metadata = metadataList.get(0);
         assertEquals( "Expect NS 1.2.0-felix", DSVersion.DS12Felix, metadata.getDSVersion() );
     }
 
 
     public void test_namespace_unknown() throws Exception
     {
-        final List metadataList = readMetadataFromString( "<components xmlns:scr=\"http://www.osgi.org/xmlns/scr/v1.1.0-felix\"><scr:component name=\"n\" ><implementation class=\"n\"/></scr:component></components>" );
+        final List<ComponentMetadata> metadataList = readMetadataFromString(
+            "<components xmlns:scr=\"http://www.osgi.org/xmlns/scr/v1.1.0-felix\"><scr:component name=\"n\" ><implementation class=\"n\"/></scr:component></components>");
         assertTrue( "No Descriptor expected", metadataList.isEmpty() );
     }
 
 
     public void test_no_namespace() throws Exception
     {
-        final List metadataList = readMetadata( "/components_no_namespace.xml" );
+        final List<ComponentMetadata> metadataList = readMetadata(
+            "/components_no_namespace.xml");
         assertEquals( "1 Descriptor expected", 1, metadataList.size() );
 
         final ComponentMetadata metadata = ( ComponentMetadata ) metadataList.get( 0 );
@@ -134,17 +141,19 @@ public class XmlHandlerTest extends ComponentBase
 
     public void test_component_attributes_11() throws Exception
     {
-        final List metadataList10 = readMetadata( "/components_activate_10.xml" );
+        final List<ComponentMetadata> metadataList10 = readMetadata(
+            "/components_activate_10.xml");
         assertEquals( "Component Descriptors", 4, metadataList10.size() );
-        ComponentMetadataTest.failDS10Validation( ( ComponentMetadata ) metadataList10.get( 0 ), "activate" );
-        ComponentMetadataTest.failDS10Validation( ( ComponentMetadata ) metadataList10.get( 1 ), "deactivate" );
-        ComponentMetadataTest.failDS10Validation( ( ComponentMetadata ) metadataList10.get( 2 ), "modified" );
-        ComponentMetadataTest.failDS10Validation( ( ComponentMetadata ) metadataList10.get( 3 ),
+        ComponentMetadataTest.failDS10Validation(metadataList10.get(0), "activate");
+        ComponentMetadataTest.failDS10Validation(metadataList10.get(1), "deactivate");
+        ComponentMetadataTest.failDS10Validation(metadataList10.get(2), "modified");
+        ComponentMetadataTest.failDS10Validation(metadataList10.get(3),
             "configuration-policy" );
 
-        final List metadataList11 = readMetadata( "/components_activate_11.xml" );
+        final List<ComponentMetadata> metadataList11 = readMetadata(
+            "/components_activate_11.xml");
         assertEquals( "Component Descriptors", 1, metadataList11.size() );
-        final ComponentMetadata cm11 = ( ComponentMetadata ) metadataList11.get( 0 );
+        final ComponentMetadata cm11 = metadataList11.get(0);
         cm11.validate( );
         assertEquals( "DS Version 1.1", DSVersion.DS11, cm11.getDSVersion() );
         assertEquals( "Expected Activate Method set", "myactivate", cm11.getActivate() );
@@ -159,9 +168,10 @@ public class XmlHandlerTest extends ComponentBase
 
     public void test_component_no_name() throws Exception
     {
-        final List metadataList10 = readMetadata( "/components_anonymous_10.xml" );
+        final List<ComponentMetadata> metadataList10 = readMetadata(
+            "/components_anonymous_10.xml");
         assertEquals( "Component Descriptors", 1, metadataList10.size() );
-        final ComponentMetadata cm10 = ( ComponentMetadata ) metadataList10.get( 0 );
+        final ComponentMetadata cm10 = metadataList10.get(0);
         try
         {
             cm10.validate( );
@@ -172,9 +182,10 @@ public class XmlHandlerTest extends ComponentBase
             // expected !!
         }
 
-        final List metadataList11 = readMetadata( "/components_anonymous_11.xml" );
+        final List<ComponentMetadata> metadataList11 = readMetadata(
+            "/components_anonymous_11.xml");
         assertEquals( "Component Descriptors", 1, metadataList11.size() );
-        final ComponentMetadata cm11 = ( ComponentMetadata ) metadataList11.get( 0 );
+        final ComponentMetadata cm11 = metadataList11.get(0);
         cm11.validate( );
         assertEquals( "Expected name equals class", cm11.getImplementationClassName(), cm11.getName() );
     }
@@ -182,9 +193,10 @@ public class XmlHandlerTest extends ComponentBase
 
     public void test_reference_no_name() throws Exception
     {
-        final List metadataList10 = readMetadata( "/components_anonymous_10.xml" );
+        final List<ComponentMetadata> metadataList10 = readMetadata(
+            "/components_anonymous_10.xml");
         assertEquals( "Component Descriptors", 1, metadataList10.size() );
-        final ComponentMetadata cm10 = ( ComponentMetadata ) metadataList10.get( 0 );
+        final ComponentMetadata cm10 = metadataList10.get(0);
         try
         {
             cm10.validate( );
@@ -195,9 +207,10 @@ public class XmlHandlerTest extends ComponentBase
             // expected !!
         }
 
-        final List metadataList11 = readMetadata( "/components_anonymous_11.xml" );
+        final List<ComponentMetadata> metadataList11 = readMetadata(
+            "/components_anonymous_11.xml");
         assertEquals( "Component Descriptors", 1, metadataList11.size() );
-        final ComponentMetadata cm11 = ( ComponentMetadata ) metadataList11.get( 0 );
+        final ComponentMetadata cm11 = metadataList11.get(0);
         cm11.validate( );
         assertEquals( "Expected name equals class", cm11.getImplementationClassName(), cm11.getName() );
     }
@@ -205,9 +218,10 @@ public class XmlHandlerTest extends ComponentBase
 
     public void test_all_elements_10() throws Exception
     {
-        final List metadataList10 = readMetadata( "/components_all_elements_10.xml" );
+        final List<ComponentMetadata> metadataList10 = readMetadata(
+            "/components_all_elements_10.xml");
         assertEquals( "Component Descriptors", 1, metadataList10.size() );
-        final ComponentMetadata cm10 = ( ComponentMetadata ) metadataList10.get( 0 );
+        final ComponentMetadata cm10 = metadataList10.get(0);
 
         // dont validate this, we test the raw reading
 
@@ -284,9 +298,10 @@ public class XmlHandlerTest extends ComponentBase
 
     public void test_duplicate_implementation_class_10() throws Exception
     {
-        final List metadataList10 = readMetadata( "/components_duplicate_implementation_10.xml" );
+        final List<ComponentMetadata> metadataList10 = readMetadata(
+            "/components_duplicate_implementation_10.xml");
         assertEquals( "Component Descriptors", 1, metadataList10.size() );
-        final ComponentMetadata cm10 = ( ComponentMetadata ) metadataList10.get( 0 );
+        final ComponentMetadata cm10 = metadataList10.get(0);
         try
         {
             cm10.validate( );
@@ -301,9 +316,10 @@ public class XmlHandlerTest extends ComponentBase
 
     public void test_duplicate_implementation_class_11() throws Exception
     {
-        final List metadataList11 = readMetadata( "/components_duplicate_implementation_11.xml" );
+        final List<ComponentMetadata> metadataList11 = readMetadata(
+            "/components_duplicate_implementation_11.xml");
         assertEquals( "Component Descriptors", 1, metadataList11.size() );
-        final ComponentMetadata cm11 = ( ComponentMetadata ) metadataList11.get( 0 );
+        final ComponentMetadata cm11 = metadataList11.get(0);
         try
         {
             cm11.validate( );
@@ -318,9 +334,10 @@ public class XmlHandlerTest extends ComponentBase
 
     public void test_duplicate_service_10() throws Exception
     {
-        final List metadataList10 = readMetadata( "/components_duplicate_service_10.xml" );
+        final List<ComponentMetadata> metadataList10 = readMetadata(
+            "/components_duplicate_service_10.xml");
         assertEquals( "Component Descriptors", 1, metadataList10.size() );
-        final ComponentMetadata cm10 = ( ComponentMetadata ) metadataList10.get( 0 );
+        final ComponentMetadata cm10 = metadataList10.get(0);
         try
         {
             cm10.validate( );
@@ -335,9 +352,10 @@ public class XmlHandlerTest extends ComponentBase
 
     public void test_duplicate_service_11() throws Exception
     {
-        final List metadataList11 = readMetadata( "/components_duplicate_service_11.xml" );
+        final List<ComponentMetadata> metadataList11 = readMetadata(
+            "/components_duplicate_service_11.xml");
         assertEquals( "Component Descriptors", 1, metadataList11.size() );
-        final ComponentMetadata cm11 = ( ComponentMetadata ) metadataList11.get( 0 );
+        final ComponentMetadata cm11 = metadataList11.get(0);
         try
         {
             cm11.validate( );
@@ -351,9 +369,10 @@ public class XmlHandlerTest extends ComponentBase
 
     public void test_properties_11() throws Exception
     {
-        final List metadataList11 = readMetadata( "/components_properties_11.xml" );
+        final List<ComponentMetadata> metadataList11 = readMetadata(
+            "/components_properties_11.xml");
         assertEquals( "Component Descriptors", 1, metadataList11.size() );
-        final ComponentMetadata cm11 = ( ComponentMetadata ) metadataList11.get( 0 );
+        final ComponentMetadata cm11 = metadataList11.get(0);
 
         // dont validate this, we test the raw reading
 
diff --git a/scr/src/test/java/org/apache/felix/scr/impl/metadata/instances/AcceptMethod.java b/scr/src/test/java/org/apache/felix/scr/impl/metadata/instances/AcceptMethod.java
index c7485a8..471a108 100644
--- a/scr/src/test/java/org/apache/felix/scr/impl/metadata/instances/AcceptMethod.java
+++ b/scr/src/test/java/org/apache/felix/scr/impl/metadata/instances/AcceptMethod.java
@@ -48,11 +48,13 @@ public class AcceptMethod
     }
 
 
+    @SuppressWarnings("unused")
     private void private_void()
     {
     }
 
 
+    @SuppressWarnings("unused")
     private String private_string()
     {
         return "";
diff --git a/scr/src/test/java/org/apache/felix/scr/impl/metadata/instances/BaseObject.java b/scr/src/test/java/org/apache/felix/scr/impl/metadata/instances/BaseObject.java
index 98fa63d..42bae23 100644
--- a/scr/src/test/java/org/apache/felix/scr/impl/metadata/instances/BaseObject.java
+++ b/scr/src/test/java/org/apache/felix/scr/impl/metadata/instances/BaseObject.java
@@ -48,6 +48,7 @@ public class BaseObject
         m_calledMethod = calledMethod;
     }
 
+    @SuppressWarnings("unused")
     private void activate_no_arg()
     {
         setCalledMethod( "activate_no_arg" );
@@ -73,6 +74,7 @@ public class BaseObject
 
     //precedence rules
 
+    @SuppressWarnings("unused")
     private void activate_precedence_1( ComponentContext ctx )
     {
         setCalledMethod("activate_precedence_1_comp");
@@ -83,12 +85,13 @@ public class BaseObject
         setCalledMethod("activate_precedence_1_bundleContext");
     }
 
-    protected void activate_precedence_1( Map map)
+    protected void activate_precedence_1(Map<?, ?> map)
     {
         setCalledMethod("activate_precedence_1_map");
     }
 
-    private void activate_precedence_2( Map map )
+    @SuppressWarnings("unused")
+    private void activate_precedence_2(Map<?, ?> map)
     {
         setCalledMethod("activate_precedence_2_map");
     }
diff --git a/scr/src/test/java/org/apache/felix/scr/impl/metadata/instances/Level1Object.java b/scr/src/test/java/org/apache/felix/scr/impl/metadata/instances/Level1Object.java
index 199ca7f..2a26f06 100644
--- a/scr/src/test/java/org/apache/felix/scr/impl/metadata/instances/Level1Object.java
+++ b/scr/src/test/java/org/apache/felix/scr/impl/metadata/instances/Level1Object.java
@@ -27,13 +27,14 @@ import org.osgi.framework.BundleContext;
 public class Level1Object extends BaseObject
 {
 
+    @SuppressWarnings("unused")
     private void activate_level1_bundle( BundleContext ctx )
     {
         setCalledMethod("activate_level1_bundle");
     }
 
 
-    protected void activate_level1_map( Map props )
+    protected void activate_level1_map(Map<?, ?> props)
     {
         setCalledMethod("activate_level1_map");
     }
diff --git a/scr/src/test/java/org/apache/felix/scr/impl/metadata/instances/Level3Object.java b/scr/src/test/java/org/apache/felix/scr/impl/metadata/instances/Level3Object.java
index 27efc6a..8ac02a4 100644
--- a/scr/src/test/java/org/apache/felix/scr/impl/metadata/instances/Level3Object.java
+++ b/scr/src/test/java/org/apache/felix/scr/impl/metadata/instances/Level3Object.java
@@ -28,7 +28,8 @@ import org.osgi.service.component.ComponentContext;
 public class Level3Object extends Level2Object
 {
 
-    private void activate_comp_map( ComponentContext ctx, Map map )
+    @SuppressWarnings("unused")
+    private void activate_comp_map(ComponentContext ctx, Map<?, ?> map)
     {
         setCalledMethod("activate_comp_map");
     }
@@ -36,13 +37,15 @@ public class Level3Object extends Level2Object
 
     // this method should not be found, since the method taking a
     // Map has higher precedence
+    @Override
     public void activate_collision()
     {
         setCalledMethod("not_expected_to_be_found");
     }
 
 
-    public void activate_collision( Map map )
+    @Override
+    public void activate_collision(Map<?, ?> map)
     {
         setCalledMethod("activate_collision");
     }
diff --git a/scr/src/test/java/org/apache/felix/scr/impl/metadata/instances2/Level2Object.java b/scr/src/test/java/org/apache/felix/scr/impl/metadata/instances2/Level2Object.java
index a8a63ca..385abcc 100644
--- a/scr/src/test/java/org/apache/felix/scr/impl/metadata/instances2/Level2Object.java
+++ b/scr/src/test/java/org/apache/felix/scr/impl/metadata/instances2/Level2Object.java
@@ -28,7 +28,8 @@ import org.osgi.service.component.ComponentContext;
 public class Level2Object extends Level1Object
 {
 
-    private void activate_comp_map( ComponentContext ctx, Map map )
+    @SuppressWarnings("unused")
+    private void activate_comp_map(ComponentContext ctx, Map<?, ?> map)
     {
         setCalledMethod( "activate_comp_map" );
     }
@@ -42,23 +43,25 @@ public class Level2Object extends Level1Object
     }
 
 
-    public void activate_collision( Map map )
+    public void activate_collision(Map<?, ?> map)
     {
         setCalledMethod( "activate_collision" );
     }
 
 
-    private void activate_suitable( Map map )
+    @SuppressWarnings("unused")
+    private void activate_suitable(Map<?, ?> map)
     {
         setCalledMethod( "activate_suitable" );
     }
 
+    @SuppressWarnings("unused")
     private void activate_comp_unsuitable( ComponentContext ctx )
     {
         setCalledMethod( "activate_comp_unsuitable" );
     }
 
-    protected void activate_comp_unsuitable( Map map )
+    protected void activate_comp_unsuitable(Map<?, ?> map)
     {
         setCalledMethod( "activate_comp_unsuitable" );
     }
diff --git a/scr/src/test/java/org/apache/felix/scr/integration/CircularReferenceTest.java b/scr/src/test/java/org/apache/felix/scr/integration/CircularReferenceTest.java
index 078c13a..f433e3c 100644
--- a/scr/src/test/java/org/apache/felix/scr/integration/CircularReferenceTest.java
+++ b/scr/src/test/java/org/apache/felix/scr/integration/CircularReferenceTest.java
@@ -20,8 +20,8 @@
 
 package org.apache.felix.scr.integration;
 
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertNotNull;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
 
 import java.lang.reflect.InvocationTargetException;
 
diff --git a/scr/src/test/java/org/apache/felix/scr/integration/ComponentConstructorTest.java b/scr/src/test/java/org/apache/felix/scr/integration/ComponentConstructorTest.java
index 1cba156..d9c8c31 100644
--- a/scr/src/test/java/org/apache/felix/scr/integration/ComponentConstructorTest.java
+++ b/scr/src/test/java/org/apache/felix/scr/integration/ComponentConstructorTest.java
@@ -25,6 +25,7 @@ import static org.junit.Assert.assertNull;
 import java.util.Collection;
 
 import org.apache.felix.scr.integration.components.ConstructorComponent;
+import org.junit.Assert;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.ops4j.pax.exam.junit.PaxExam;
@@ -32,7 +33,6 @@ import org.osgi.framework.InvalidSyntaxException;
 import org.osgi.framework.ServiceReference;
 import org.osgi.service.component.runtime.dto.ComponentConfigurationDTO;
 
-import junit.framework.Assert;
 import junit.framework.TestCase;
 
 
diff --git a/scr/src/test/java/org/apache/felix/scr/integration/ComponentDisposeTest.java b/scr/src/test/java/org/apache/felix/scr/integration/ComponentDisposeTest.java
index b31a8ff..635da2d 100644
--- a/scr/src/test/java/org/apache/felix/scr/integration/ComponentDisposeTest.java
+++ b/scr/src/test/java/org/apache/felix/scr/integration/ComponentDisposeTest.java
@@ -22,12 +22,12 @@ package org.apache.felix.scr.integration;
 import java.util.Collection;
 
 import org.apache.felix.scr.integration.components.SimpleComponent;
+import org.junit.Assert;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.ops4j.pax.exam.junit.PaxExam;
 import org.osgi.service.component.runtime.dto.ComponentConfigurationDTO;
 
-import junit.framework.Assert;
 import junit.framework.TestCase;
 
 
diff --git a/scr/src/test/java/org/apache/felix/scr/integration/ComponentFactoryTest.java b/scr/src/test/java/org/apache/felix/scr/integration/ComponentFactoryTest.java
index 7cca5ca..13610bf 100644
--- a/scr/src/test/java/org/apache/felix/scr/integration/ComponentFactoryTest.java
+++ b/scr/src/test/java/org/apache/felix/scr/integration/ComponentFactoryTest.java
@@ -59,7 +59,8 @@ public class ComponentFactoryTest extends ComponentTestBase
 
         TestCase.assertNull( SimpleComponent.INSTANCE );
 
-        final ComponentInstance instance = createFactoryComponentInstance( componentfactory );
+        final ComponentInstance<?> instance = createFactoryComponentInstance(
+            componentfactory);
 
         // check registered components
         checkConfigurationCount( componentname, 1, ComponentConfigurationDTO.ACTIVE );
@@ -84,7 +85,8 @@ public class ComponentFactoryTest extends ComponentTestBase
 
         TestCase.assertNull( SimpleComponent.INSTANCE );
 
-        final ComponentInstance instance = createFactoryComponentInstance( componentfactory );
+        final ComponentInstance<?> instance = createFactoryComponentInstance(
+            componentfactory);
 
         checkConfigurationCount( componentname, 1, ComponentConfigurationDTO.ACTIVE );
 
@@ -178,7 +180,8 @@ public class ComponentFactoryTest extends ComponentTestBase
 
     }
 
-    private ComponentInstance testConfiguredFactory(final String componentname, final String componentfactory,
+    private ComponentInstance<?> testConfiguredFactory(final String componentname,
+        final String componentfactory,
             boolean optional, boolean expectComponent)
                     throws InvocationTargetException, InterruptedException, InvalidSyntaxException
     {
@@ -202,7 +205,8 @@ public class ComponentFactoryTest extends ComponentTestBase
         TestCase.assertNull( SimpleComponent.INSTANCE );
 
         // get the component factory service
-        final ComponentInstance instance = createFactoryComponentInstance( componentfactory );
+        final ComponentInstance<?> instance = createFactoryComponentInstance(
+            componentfactory);
 
         final Object instanceObject = instance.getInstance();
         TestCase.assertNotNull( instanceObject );
@@ -256,7 +260,8 @@ public class ComponentFactoryTest extends ComponentTestBase
 
         TestCase.assertNull( SimpleComponent.INSTANCE );
 
-        final ComponentInstance instance = createFactoryComponentInstance( componentfactory );
+        final ComponentInstance<?> instance = createFactoryComponentInstance(
+            componentfactory);
         TestCase.assertEquals( 1, SimpleComponent.INSTANCE.m_multiRef.size() );
         TestCase.assertTrue( SimpleComponent.INSTANCE.m_multiRef.contains( match ) );
 
@@ -272,7 +277,7 @@ public class ComponentFactoryTest extends ComponentTestBase
         Hashtable<String, String> propsNonMatch = new Hashtable<String, String>();
         propsNonMatch.put( PROP_NAME_FACTORY, PROP_NAME_FACTORY );
         propsNonMatch.put( "ref.target", "(filterprop=nomatch)" );
-        ComponentFactory factory = getComponentFactory( componentfactory );
+        ComponentFactory<?> factory = getComponentFactory(componentfactory);
         try
         {
             factory.newInstance( propsNonMatch );
@@ -287,7 +292,7 @@ public class ComponentFactoryTest extends ComponentTestBase
                 "nomatch" );
         delay();
 
-        final ComponentInstance instanceNonMatch = factory.newInstance( propsNonMatch );
+        final ComponentInstance<?> instanceNonMatch = factory.newInstance(propsNonMatch);
 
         TestCase.assertNotNull( instanceNonMatch );
 
@@ -340,9 +345,9 @@ public class ComponentFactoryTest extends ComponentTestBase
 
         Hashtable<String, String> props = new Hashtable<String, String>();
         props.put( "service.pid", "myFactoryInstance" );
-        final ComponentFactory factory = getComponentFactory( componentfactory );
+        final ComponentFactory<?> factory = getComponentFactory(componentfactory);
 
-        final ComponentInstance instance = factory.newInstance( props );
+        final ComponentInstance<?> instance = factory.newInstance(props);
         TestCase.assertNotNull( instance );
 
         TestCase.assertNotNull( instance.getInstance() );
@@ -357,6 +362,7 @@ public class ComponentFactoryTest extends ComponentTestBase
         checkConfigurationCount( referringComponentName, 1, ComponentConfigurationDTO.UNSATISFIED_REFERENCE );
     }
 
+    @SuppressWarnings("deprecation")
     @Test
     public void test_component_factory_with_target_filters() throws Exception
     {
@@ -375,7 +381,8 @@ public class ComponentFactoryTest extends ComponentTestBase
         Hashtable<String, String> props = new Hashtable<String, String>();
         props.put( PROP_NAME_FACTORY, PROP_NAME_FACTORY );
         props.put( "ref.target", "(value=service2)" );
-        final ComponentInstance instance = createFactoryComponentInstance( componentfactory, props );
+        final ComponentInstance<?> instance = createFactoryComponentInstance(
+            componentfactory, props);
 
         log.log( LogService.LOG_WARNING, "Bound Services: " + SimpleComponent.INSTANCE.m_multiRef );
         TestCase.assertFalse( SimpleComponent.INSTANCE.m_multiRef.contains( s1 ) );
diff --git a/scr/src/test/java/org/apache/felix/scr/integration/ComponentTestBase.java b/scr/src/test/java/org/apache/felix/scr/integration/ComponentTestBase.java
index 0966c5b..4ed0629 100644
--- a/scr/src/test/java/org/apache/felix/scr/integration/ComponentTestBase.java
+++ b/scr/src/test/java/org/apache/felix/scr/integration/ComponentTestBase.java
@@ -39,7 +39,6 @@ import java.io.PrintWriter;
 import java.io.StringWriter;
 import java.lang.reflect.Field;
 import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -58,6 +57,7 @@ import org.apache.felix.scr.impl.ComponentCommands;
 import org.apache.felix.scr.integration.components.SimpleComponent;
 import org.apache.felix.service.command.Converter;
 import org.junit.After;
+import org.junit.Assert;
 import org.junit.Before;
 import org.ops4j.pax.exam.Configuration;
 import org.ops4j.pax.exam.CoreOptions;
@@ -87,7 +87,6 @@ import org.osgi.service.log.LoggerConsumer;
 import org.osgi.service.log.LoggerFactory;
 import org.osgi.util.tracker.ServiceTracker;
 
-import junit.framework.Assert;
 import junit.framework.TestCase;
 
 public abstract class ComponentTestBase
@@ -601,13 +600,16 @@ public abstract class ComponentTestBase
     }
 
     //component factory test helper methods
-    protected ComponentFactory getComponentFactory(final String componentfactory) throws InvalidSyntaxException
+    protected ComponentFactory<?> getComponentFactory(final String componentfactory)
+        throws InvalidSyntaxException
     {
-        final ServiceReference[] refs = bundleContext.getServiceReferences( ComponentFactory.class.getName(),
+        final ServiceReference<?>[] refs = bundleContext.getServiceReferences(
+            ComponentFactory.class.getName(),
                 "(" + ComponentConstants.COMPONENT_FACTORY + "=" + componentfactory + ")" );
         TestCase.assertNotNull( refs );
         TestCase.assertEquals( 1, refs.length );
-        final ComponentFactory factory = (ComponentFactory) bundleContext.getService( refs[0] );
+        final ComponentFactory<?> factory = (ComponentFactory<?>) bundleContext.getService(
+            refs[0]);
         TestCase.assertNotNull( factory );
         return factory;
     }
@@ -615,7 +617,8 @@ public abstract class ComponentTestBase
     protected void checkFactory(final String componentfactory, boolean expectFactoryPresent)
             throws InvalidSyntaxException
     {
-        ServiceReference[] refs = bundleContext.getServiceReferences( ComponentFactory.class.getName(),
+        ServiceReference<?>[] refs = bundleContext.getServiceReferences(
+            ComponentFactory.class.getName(),
                 "(" + ComponentConstants.COMPONENT_FACTORY + "=" + componentfactory + ")" );
         if ( expectFactoryPresent )
         {
@@ -629,7 +632,8 @@ public abstract class ComponentTestBase
         }
     }
 
-    protected ComponentInstance createFactoryComponentInstance(final String componentfactory)
+    protected ComponentInstance<?> createFactoryComponentInstance(
+        final String componentfactory)
             throws InvalidSyntaxException
     {
         Hashtable<String, String> props = new Hashtable<>();
@@ -638,12 +642,13 @@ public abstract class ComponentTestBase
         return createFactoryComponentInstance( componentfactory, props );
     }
 
-    protected ComponentInstance createFactoryComponentInstance(final String componentfactory,
+    protected ComponentInstance<?> createFactoryComponentInstance(
+        final String componentfactory,
             Hashtable<String, String> props) throws InvalidSyntaxException
     {
-        final ComponentFactory factory = getComponentFactory( componentfactory );
+        final ComponentFactory<?> factory = getComponentFactory(componentfactory);
 
-        final ComponentInstance instance = factory.newInstance( props );
+        final ComponentInstance<?> instance = factory.newInstance(props);
         TestCase.assertNotNull( instance );
 
         TestCase.assertNotNull( instance.getInstance() );
@@ -784,7 +789,7 @@ public abstract class ComponentTestBase
     {
         try
         {
-            Method m = org.osgi.service.cm.Configuration.class.getDeclaredMethod( "getChangeCount" );
+            org.osgi.service.cm.Configuration.class.getDeclaredMethod("getChangeCount");
             return true;
         }
         catch ( SecurityException e )
@@ -1016,6 +1021,7 @@ public abstract class ComponentTestBase
         {
             int eventType = event.getType();
             String msg = getFrameworkEventMessage( eventType );
+            @SuppressWarnings("deprecation")
             int level = ( eventType == FrameworkEvent.ERROR )? LogService.LOG_ERROR: LogService.LOG_WARNING;
             log( level, msg, event.getThrowable() );
             if ( event.getThrowable() != null && firstFrameworkThrowable == null )
@@ -1043,13 +1049,14 @@ public abstract class ComponentTestBase
         }
 
         @Override
-        public void log(ServiceReference sr, int osgiLevel, String message)
+        public void log(ServiceReference<?> sr, int osgiLevel, String message)
         {
             log( sr, osgiLevel, message, null );
         }
 
         @Override
-        public void log(ServiceReference sr, int level, String msg, Throwable exception)
+        public void log(ServiceReference<?> sr, int level, String msg,
+            Throwable exception)
         {
             if ( sr != null )
             {
@@ -1068,6 +1075,7 @@ public abstract class ComponentTestBase
             }
         }
 
+        @SuppressWarnings("deprecation")
         private int getEnabledLogLevel()
         {
             if ( DS_LOGLEVEL.regionMatches( true, 0, "err", 0, "err".length() ) )
@@ -1109,6 +1117,7 @@ public abstract class ComponentTestBase
             }
         }
 
+        @SuppressWarnings("unchecked")
         @Override
         public <L extends Logger> L getLogger(String name, Class<L> loggerType)
         {
@@ -1127,6 +1136,7 @@ public abstract class ComponentTestBase
             return this;
         }
 
+        @SuppressWarnings("unchecked")
         @Override
         public <L extends Logger> L getLogger(Class<?> clazz, Class<L> loggerType)
         {
diff --git a/scr/src/test/java/org/apache/felix/scr/integration/ConfigurationChangeTest.java b/scr/src/test/java/org/apache/felix/scr/integration/ConfigurationChangeTest.java
index 3b6161c..52d99c6 100644
--- a/scr/src/test/java/org/apache/felix/scr/integration/ConfigurationChangeTest.java
+++ b/scr/src/test/java/org/apache/felix/scr/integration/ConfigurationChangeTest.java
@@ -269,16 +269,18 @@ public class ConfigurationChangeTest extends ComponentTestBase
         getDisabledConfigurationAndEnable(pid, ComponentConfigurationDTO.ACTIVE); //?????? Not clear what should happen.
 
         // create a component instance
-        final ServiceReference[] refs = bundleContext.getServiceReferences( ComponentFactory.class.getName(), "("
+        final ServiceReference<?>[] refs = bundleContext.getServiceReferences(
+            ComponentFactory.class.getName(), "("
                 + ComponentConstants.COMPONENT_FACTORY + "=" + factoryPid + ")" );
         TestCase.assertNotNull( refs );
         TestCase.assertEquals( 1, refs.length );
-        final ComponentFactory factory = ( ComponentFactory ) bundleContext.getService( refs[0] );
+        final ComponentFactory<?> factory = (ComponentFactory<?>) bundleContext.getService(
+            refs[0]);
         TestCase.assertNotNull( factory );
 
         Hashtable<String, String> props = new Hashtable<String, String>();
         props.put( PROP_NAME_FACTORY, PROP_NAME_FACTORY );
-        final ComponentInstance instance = factory.newInstance( props );
+        final ComponentInstance<?> instance = factory.newInstance(props);
         TestCase.assertNotNull( instance );
         TestCase.assertNotNull( instance.getInstance() );
         TestCase.assertEquals( SimpleComponent.INSTANCE, instance.getInstance() );
diff --git a/scr/src/test/java/org/apache/felix/scr/integration/ConfigurationComponentFactoryTest.java b/scr/src/test/java/org/apache/felix/scr/integration/ConfigurationComponentFactoryTest.java
index 63337a9..19f38b2 100644
--- a/scr/src/test/java/org/apache/felix/scr/integration/ConfigurationComponentFactoryTest.java
+++ b/scr/src/test/java/org/apache/felix/scr/integration/ConfigurationComponentFactoryTest.java
@@ -60,7 +60,8 @@ public class ConfigurationComponentFactoryTest extends ComponentTestBase
 
         TestCase.assertNull( SimpleComponent.INSTANCE );
 
-        final ComponentFactory factory = getComponentFactory( componentfactory );
+        @SuppressWarnings("unused") // TODO not sure why this call is here
+        final ComponentFactory<?> factory = getComponentFactory(componentfactory);
 
         final String factoryConfigPid = createFactoryConfiguration( componentname, "?" );
         delay();
diff --git a/scr/src/test/java/org/apache/felix/scr/integration/Felix3680_2Test.java b/scr/src/test/java/org/apache/felix/scr/integration/Felix3680_2Test.java
index e411655..f48324b 100644
--- a/scr/src/test/java/org/apache/felix/scr/integration/Felix3680_2Test.java
+++ b/scr/src/test/java/org/apache/felix/scr/integration/Felix3680_2Test.java
@@ -77,9 +77,9 @@ public class Felix3680_2Test extends ComponentTestBase
             {
                 throw log.getFirstFrameworkThrowable();
             }
-            for ( Iterator it = log.foundWarnings().iterator(); it.hasNext(); )
+            for (Iterator<String> it = log.foundWarnings().iterator(); it.hasNext();)
             {
-                String message = ( String ) it.next();
+                String message = it.next();
                 TestCase.fail( "unexpected warning or error logged: " + message );
             }
         }
diff --git a/scr/src/test/java/org/apache/felix/scr/integration/Felix4188Test.java b/scr/src/test/java/org/apache/felix/scr/integration/Felix4188Test.java
index f12bd08..0fbe40b 100644
--- a/scr/src/test/java/org/apache/felix/scr/integration/Felix4188Test.java
+++ b/scr/src/test/java/org/apache/felix/scr/integration/Felix4188Test.java
@@ -29,6 +29,7 @@ import java.util.concurrent.CountDownLatch;
 import javax.inject.Inject;
 
 import org.apache.felix.scr.integration.components.felix4188.Felix4188Component;
+import org.junit.Assert;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.ops4j.pax.exam.junit.PaxExam;
@@ -40,7 +41,6 @@ import org.osgi.framework.InvalidSyntaxException;
 import org.osgi.framework.ServiceReference;
 import org.osgi.service.component.runtime.dto.ComponentConfigurationDTO;
 
-import junit.framework.Assert;
 import junit.framework.TestCase;
 
 /**
diff --git a/scr/src/test/java/org/apache/felix/scr/integration/Felix4350Test.java b/scr/src/test/java/org/apache/felix/scr/integration/Felix4350Test.java
index 47e964f..8a9b246 100644
--- a/scr/src/test/java/org/apache/felix/scr/integration/Felix4350Test.java
+++ b/scr/src/test/java/org/apache/felix/scr/integration/Felix4350Test.java
@@ -80,8 +80,9 @@ public class Felix4350Test extends ComponentTestBase
 
     protected void doTest(String componentName) throws Exception
     {
-        ServiceRegistration dep1Reg = register(new SimpleComponent(), 0);
-        ServiceRegistration dep2Reg = register(new SimpleComponent2(), 1000);
+        ServiceRegistration<SimpleComponent> dep1Reg = register(new SimpleComponent(), 0);
+        ServiceRegistration<SimpleComponent2> dep2Reg = register(new SimpleComponent2(),
+            1000);
 
         final ComponentDescriptionDTO main = findComponentDescriptorByName(componentName);
         TestCase.assertNotNull(main);
@@ -136,16 +137,21 @@ public class Felix4350Test extends ComponentTestBase
             }}).start();
     }
 
-    protected ServiceRegistration register(final Object service, final int delay) {
-        return bundleContext.registerService(service.getClass().getName(), new ServiceFactory() {
+    @SuppressWarnings("unchecked")
+    protected <T> ServiceRegistration<T> register(final T service, final int delay)
+    {
+        return bundleContext.registerService((Class<T>) service.getClass(),
+            new ServiceFactory<T>()
+            {
             @Override
-            public Object getService(Bundle bundle, ServiceRegistration registration)
+                public T getService(Bundle bundle, ServiceRegistration<T> registration)
             {
                 delay(delay);
                 return service;
             }
             @Override
-            public void ungetService(Bundle bundle, ServiceRegistration registration, Object service)
+                public void ungetService(Bundle bundle,
+                    ServiceRegistration<T> registration, T service)
             {
             }
         }, null);
diff --git a/scr/src/test/java/org/apache/felix/scr/integration/Felix4984Test.java b/scr/src/test/java/org/apache/felix/scr/integration/Felix4984Test.java
index ec60aa3..db2128f 100644
--- a/scr/src/test/java/org/apache/felix/scr/integration/Felix4984Test.java
+++ b/scr/src/test/java/org/apache/felix/scr/integration/Felix4984Test.java
@@ -18,8 +18,8 @@
  */
 package org.apache.felix.scr.integration;
 
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertNotNull;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
 
 import org.apache.felix.scr.integration.components.felix4984.A;
 import org.apache.felix.scr.integration.components.felix4984.B;
@@ -62,18 +62,21 @@ public class Felix4984Test extends ComponentTestBase
             ComponentConfigurationDTO componentA = findComponentConfigurationByName( componentNameA, ComponentConfigurationDTO.SATISFIED );
 
             String componentNameB = "felix4984.B.0.n.dynamic";
+            @SuppressWarnings("unused")
             final ComponentConfigurationDTO componentB = findComponentConfigurationByName( componentNameB, ComponentConfigurationDTO.SATISFIED);
 
-            ServiceReference[] serviceReferencesB = bundleContext.getServiceReferences( B.class.getName(), "(service.pid=" + componentNameB + ")" );
+            ServiceReference<?>[] serviceReferencesB = bundleContext.getServiceReferences(
+                B.class.getName(), "(service.pid=" + componentNameB + ")");
             assertNotNull( serviceReferencesB );
             TestCase.assertEquals( 1, serviceReferencesB.length );
-            ServiceReference serviceReferenceB = serviceReferencesB[0];
+            ServiceReference<?> serviceReferenceB = serviceReferencesB[0];
             Object serviceB = bundleContext.getService( serviceReferenceB );
             assertNotNull( serviceB );
 
-            ServiceReference[] serviceReferencesA = bundleContext.getServiceReferences( A.class.getName(), "(service.pid=" + componentNameA + ")" );
+            ServiceReference<?>[] serviceReferencesA = bundleContext.getServiceReferences(
+                A.class.getName(), "(service.pid=" + componentNameA + ")");
             TestCase.assertEquals( 1, serviceReferencesA.length );
-            ServiceReference serviceReferenceA = serviceReferencesA[0];
+            ServiceReference<?> serviceReferenceA = serviceReferencesA[0];
             Object serviceA = bundleContext.getService( serviceReferenceA );
             assertNotNull( serviceA );
 
@@ -93,6 +96,7 @@ public class Felix4984Test extends ComponentTestBase
         throw new IllegalStateException("bundle \"simplecomponent\" not found");
     }
 
+    @SuppressWarnings("deprecation")
     private void assertABoundToOneB(A a) {
         if (a.getBs().size() != 1) {
             log.log(LogService.LOG_WARNING, "detected problem ...");
diff --git a/scr/src/test/java/org/apache/felix/scr/integration/Felix5248Test.java b/scr/src/test/java/org/apache/felix/scr/integration/Felix5248Test.java
index 673cd5b..48e6308 100644
--- a/scr/src/test/java/org/apache/felix/scr/integration/Felix5248Test.java
+++ b/scr/src/test/java/org/apache/felix/scr/integration/Felix5248Test.java
@@ -38,6 +38,7 @@ public class Felix5248Test extends ComponentTestBase
     }
 
     @Test
+    @SuppressWarnings("deprecation")
     public void test_reconfigurationActivates() throws Exception
     {
         Hashtable<String, Object> props = new Hashtable<String, Object>();
@@ -47,6 +48,7 @@ public class Felix5248Test extends ComponentTestBase
         delay();
 
         String componentName = "Component";
+        @SuppressWarnings("unused")
         ComponentConfigurationDTO component = findComponentConfigurationByName( componentName,
                 ComponentConfigurationDTO.FAILED_ACTIVATION );
         log.log( LogService.LOG_INFO, "A checked satisfied (not active)" );
diff --git a/scr/src/test/java/org/apache/felix/scr/integration/Felix5276Test.java b/scr/src/test/java/org/apache/felix/scr/integration/Felix5276Test.java
index c4f0917..9b8b7bb 100644
--- a/scr/src/test/java/org/apache/felix/scr/integration/Felix5276Test.java
+++ b/scr/src/test/java/org/apache/felix/scr/integration/Felix5276Test.java
@@ -40,6 +40,7 @@ public class Felix5276Test extends ComponentTestBase
     }
 
     @Test
+    @SuppressWarnings("deprecation")
     public void test_servicePropsCauseDeactivation() throws Exception
     {
         Hashtable<String, Object> props = new Hashtable<String, Object>();
diff --git a/scr/src/test/java/org/apache/felix/scr/integration/Felix5356Test.java b/scr/src/test/java/org/apache/felix/scr/integration/Felix5356Test.java
index 9dad0e5..52b3638 100644
--- a/scr/src/test/java/org/apache/felix/scr/integration/Felix5356Test.java
+++ b/scr/src/test/java/org/apache/felix/scr/integration/Felix5356Test.java
@@ -74,9 +74,9 @@ public class Felix5356Test extends ComponentTestBase
 
         Hashtable<String, String> props = new Hashtable<String, String>();
         props.put( "service.pid", "myFactoryInstance" );
-        final ComponentFactory factory = getComponentFactory( componentfactory );
+        final ComponentFactory<?> factory = getComponentFactory(componentfactory);
 
-        final ComponentInstance instance = factory.newInstance( props );
+        final ComponentInstance<?> instance = factory.newInstance(props);
         TestCase.assertNotNull( instance );
 
         TestCase.assertNotNull( instance.getInstance() );
diff --git a/scr/src/test/java/org/apache/felix/scr/integration/Felix6274Test.java b/scr/src/test/java/org/apache/felix/scr/integration/Felix6274Test.java
index 879d09f..94a41e2 100644
--- a/scr/src/test/java/org/apache/felix/scr/integration/Felix6274Test.java
+++ b/scr/src/test/java/org/apache/felix/scr/integration/Felix6274Test.java
@@ -127,6 +127,7 @@ public class Felix6274Test extends ComponentTestBase
     }
 
     @Test
+    @SuppressWarnings("deprecation")
     public void test_incompatible_log_service_version() throws Exception
     {
         
diff --git a/scr/src/test/java/org/apache/felix/scr/integration/LocateTest.java b/scr/src/test/java/org/apache/felix/scr/integration/LocateTest.java
index 0ba0b7a..7df094f 100644
--- a/scr/src/test/java/org/apache/felix/scr/integration/LocateTest.java
+++ b/scr/src/test/java/org/apache/felix/scr/integration/LocateTest.java
@@ -50,7 +50,7 @@ public class LocateTest extends ComponentTestBase
 
         final String pid = "TestComponent";
         Configuration config = getConfigurationAdmin().getConfiguration( pid, null );
-        final Hashtable props = new Hashtable();
+        final Hashtable<String, String> props = new Hashtable<>();
         //wrong target property, will not bind
         props.put( "target", "bar" );
         config.update(props);
diff --git a/scr/src/test/java/org/apache/felix/scr/integration/LocationTest.java b/scr/src/test/java/org/apache/felix/scr/integration/LocationTest.java
index 06fcdf1..18d6917 100644
--- a/scr/src/test/java/org/apache/felix/scr/integration/LocationTest.java
+++ b/scr/src/test/java/org/apache/felix/scr/integration/LocationTest.java
@@ -170,6 +170,7 @@ public class LocationTest extends ComponentTestBase
         checkConfigurationCount( pid, 0, -1 );
         TestCase.assertNull( SimpleComponent.INSTANCE );
 
+        @SuppressWarnings("unused")
         Configuration config = configure( pid, REGION );
         delay();
 
diff --git a/scr/src/test/java/org/apache/felix/scr/integration/MutablePropertiesTest.java b/scr/src/test/java/org/apache/felix/scr/integration/MutablePropertiesTest.java
index 9be940f..bff6c90 100644
--- a/scr/src/test/java/org/apache/felix/scr/integration/MutablePropertiesTest.java
+++ b/scr/src/test/java/org/apache/felix/scr/integration/MutablePropertiesTest.java
@@ -27,6 +27,7 @@ import java.util.Hashtable;
 import org.apache.felix.scr.integration.components.MutatingService;
 import org.apache.felix.scr.integration.components.MutatingServiceConsumer;
 import org.apache.felix.scr.integration.components.SimpleServiceImpl;
+import org.junit.Assert;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.ops4j.pax.exam.junit.PaxExam;
@@ -35,7 +36,6 @@ import org.osgi.framework.ServiceReference;
 import org.osgi.service.component.runtime.dto.ComponentConfigurationDTO;
 import org.osgi.service.component.runtime.dto.ComponentDescriptionDTO;
 
-import junit.framework.Assert;
 import junit.framework.TestCase;
 
 
@@ -58,9 +58,10 @@ public class MutablePropertiesTest extends ComponentTestBase
         String componentName = "components.mutable.properties";
         findComponentConfigurationByName(componentName, ComponentConfigurationDTO.SATISFIED);
 
-        ServiceReference[] serviceReferences = bundleContext.getServiceReferences( MutatingService.class.getName(), "(service.pid=" + componentName + ")" );
+        ServiceReference<?>[] serviceReferences = bundleContext.getServiceReferences(
+            MutatingService.class.getName(), "(service.pid=" + componentName + ")");
         TestCase.assertEquals( 1, serviceReferences.length );
-        ServiceReference serviceReference = serviceReferences[0];
+        ServiceReference<?> serviceReference = serviceReferences[0];
         Assert.assertEquals("otherValue", serviceReference.getProperty(PROP_NAME));
         Assert.assertEquals("p1", serviceReference.getProperty("p1"));
         Assert.assertEquals("p2", serviceReference.getProperty("p2"));
@@ -69,7 +70,8 @@ public class MutablePropertiesTest extends ComponentTestBase
         MutatingService s = ( MutatingService ) bundleContext.getService(serviceReference );
         Assert.assertNotNull(s);
         findComponentConfigurationByName(componentName, ComponentConfigurationDTO.ACTIVE);
-        Dictionary d = new Hashtable(Collections.singletonMap( PROP_NAME, "anotherValue" ));
+        Dictionary<String, String> d = new Hashtable<>(
+            Collections.singletonMap(PROP_NAME, "anotherValue"));
         s.updateProperties(d);
         Assert.assertEquals("anotherValue", serviceReference.getProperty(PROP_NAME));
         checkPropertiesNotPresent(serviceReference, "p1", "p2");
@@ -96,9 +98,10 @@ public class MutablePropertiesTest extends ComponentTestBase
         String componentName = "components.mutable.properties.return";
         findComponentConfigurationByName(componentName, ComponentConfigurationDTO.SATISFIED);
 
-        ServiceReference[] serviceReferences = bundleContext.getServiceReferences( MutatingService.class.getName(), "(service.pid=" + componentName + ")" );
+        ServiceReference<?>[] serviceReferences = bundleContext.getServiceReferences(
+            MutatingService.class.getName(), "(service.pid=" + componentName + ")");
         TestCase.assertEquals( 1, serviceReferences.length );
-        ServiceReference serviceReference = serviceReferences[0];
+        ServiceReference<?> serviceReference = serviceReferences[0];
         Assert.assertEquals("otherValue", serviceReference.getProperty(PROP_NAME));
         Assert.assertEquals("p1", serviceReference.getProperty("p1"));
         Assert.assertEquals("p2", serviceReference.getProperty("p2"));
@@ -110,7 +113,8 @@ public class MutablePropertiesTest extends ComponentTestBase
         Assert.assertEquals("p1", serviceReference.getProperty("p1"));
         Assert.assertEquals("p2", serviceReference.getProperty("p2"));
         findComponentConfigurationByName(componentName, ComponentConfigurationDTO.ACTIVE);
-        Dictionary d = new Hashtable(Collections.singletonMap( PROP_NAME, "anotherValue" ));
+        Dictionary<String, String> d = new Hashtable<>(
+            Collections.singletonMap(PROP_NAME, "anotherValue"));
         s.updateProperties(d);
         Assert.assertEquals("anotherValue", serviceReference.getProperty(PROP_NAME));
         checkPropertiesNotPresent(serviceReference, "p1", "p2");
@@ -139,9 +143,10 @@ public class MutablePropertiesTest extends ComponentTestBase
         String componentName = "components.mutable.properties.return.public";
         findComponentConfigurationByName(componentName, ComponentConfigurationDTO.SATISFIED);
 
-        ServiceReference[] serviceReferences = bundleContext.getServiceReferences( MutatingService.class.getName(), "(service.pid=" + componentName + ")" );
+        ServiceReference<?>[] serviceReferences = bundleContext.getServiceReferences(
+            MutatingService.class.getName(), "(service.pid=" + componentName + ")");
         TestCase.assertEquals( 1, serviceReferences.length );
-        ServiceReference serviceReference = serviceReferences[0];
+        ServiceReference<?> serviceReference = serviceReferences[0];
         Assert.assertEquals("otherValue", serviceReference.getProperty(PROP_NAME));
         Assert.assertEquals("p1", serviceReference.getProperty("p1"));
         Assert.assertEquals("p2", serviceReference.getProperty("p2"));
@@ -153,7 +158,8 @@ public class MutablePropertiesTest extends ComponentTestBase
         Assert.assertEquals("p1", serviceReference.getProperty("p1"));
         Assert.assertEquals("p2", serviceReference.getProperty("p2"));
         findComponentConfigurationByName(componentName, ComponentConfigurationDTO.ACTIVE);
-        Dictionary d = new Hashtable(Collections.singletonMap( PROP_NAME, "anotherValue" ));
+        Dictionary<String, String> d = new Hashtable<>(
+            Collections.singletonMap(PROP_NAME, "anotherValue"));
         s.updateProperties(d);
         Assert.assertEquals("anotherValue", serviceReference.getProperty(PROP_NAME));
         checkPropertiesNotPresent(serviceReference, "p1", "p2");
@@ -182,12 +188,14 @@ public class MutablePropertiesTest extends ComponentTestBase
         String componentName = "components.mutable.properties.bind";
         findComponentConfigurationByName(componentName, ComponentConfigurationDTO.SATISFIED);
 
-        ServiceReference[] serviceReferences = bundleContext.getServiceReferences( MutatingService.class.getName(), "(service.pid=" + componentName + ")" );
+        ServiceReference<?>[] serviceReferences = bundleContext.getServiceReferences(
+            MutatingService.class.getName(), "(service.pid=" + componentName + ")");
         TestCase.assertEquals( 1, serviceReferences.length );
-        ServiceReference serviceReference = serviceReferences[0];
+        ServiceReference<?> serviceReference = serviceReferences[0];
         Assert.assertEquals("otherValue", serviceReference.getProperty(PROP_NAME));
         Assert.assertEquals("p1", serviceReference.getProperty("p1"));
         Assert.assertEquals("p2", serviceReference.getProperty("p2"));
+        @SuppressWarnings("unused")
         MutatingService s = ( MutatingService ) bundleContext.getService( serviceReference );
 
         SimpleServiceImpl srv1 = SimpleServiceImpl.create( bundleContext, "srv1" );
diff --git a/scr/src/test/java/org/apache/felix/scr/integration/PersistentComponentFactoryTest.java b/scr/src/test/java/org/apache/felix/scr/integration/PersistentComponentFactoryTest.java
index 38a68bf..76e4c20 100644
--- a/scr/src/test/java/org/apache/felix/scr/integration/PersistentComponentFactoryTest.java
+++ b/scr/src/test/java/org/apache/felix/scr/integration/PersistentComponentFactoryTest.java
@@ -58,7 +58,8 @@ public class PersistentComponentFactoryTest extends ComponentTestBase
 
         TestCase.assertNull( SimpleComponent.INSTANCE );
 
-        final ComponentInstance instance = createFactoryComponentInstance( componentfactory );
+        final ComponentInstance<?> instance = createFactoryComponentInstance(
+            componentfactory);
 
         // check registered components
         checkConfigurationCount( componentname, 1, ComponentConfigurationDTO.ACTIVE );
@@ -83,7 +84,8 @@ public class PersistentComponentFactoryTest extends ComponentTestBase
 
         TestCase.assertNull( SimpleComponent.INSTANCE );
 
-        final ComponentInstance instance = createFactoryComponentInstance( componentfactory );
+        final ComponentInstance<?> instance = createFactoryComponentInstance(
+            componentfactory);
 
         checkConfigurationCount( componentname, 1, ComponentConfigurationDTO.ACTIVE );
 
@@ -112,9 +114,9 @@ public class PersistentComponentFactoryTest extends ComponentTestBase
         Hashtable<String, String> props = new Hashtable<String, String>();
         props.put( PROP_NAME_FACTORY, PROP_NAME_FACTORY );
         props.put( SimpleComponent.PROP_ACTIVATE_FAILURE, "Requested Failure" );
-        final ComponentFactory factory = getComponentFactory( componentfactory );
+        final ComponentFactory<?> factory = getComponentFactory(componentfactory);
 
-        final ComponentInstance instance = factory.newInstance( props );
+        final ComponentInstance<?> instance = factory.newInstance(props);
         TestCase.assertNotNull( instance );
 
         checkConfigurationCount( componentname, 1, ComponentConfigurationDTO.FAILED_ACTIVATION );
@@ -159,7 +161,8 @@ public class PersistentComponentFactoryTest extends ComponentTestBase
 
     }
 
-    private ComponentInstance testConfiguredFactory(final String componentname, final String componentfactory,
+    private ComponentInstance<?> testConfiguredFactory(final String componentname,
+        final String componentfactory,
             boolean optional, boolean expectComponent)
                     throws InvocationTargetException, InterruptedException, InvalidSyntaxException
     {
@@ -183,7 +186,8 @@ public class PersistentComponentFactoryTest extends ComponentTestBase
         TestCase.assertNull( SimpleComponent.INSTANCE );
 
         // get the component factory service
-        final ComponentInstance instance = createFactoryComponentInstance( componentfactory );
+        final ComponentInstance<?> instance = createFactoryComponentInstance(
+            componentfactory);
 
         final Object instanceObject = instance.getInstance();
         TestCase.assertNotNull( instanceObject );
@@ -237,7 +241,8 @@ public class PersistentComponentFactoryTest extends ComponentTestBase
 
         TestCase.assertNull( SimpleComponent.INSTANCE );
 
-        final ComponentInstance instance = createFactoryComponentInstance( componentfactory );
+        final ComponentInstance<?> instance = createFactoryComponentInstance(
+            componentfactory);
         TestCase.assertEquals( 1, SimpleComponent.INSTANCE.m_multiRef.size() );
         TestCase.assertTrue( SimpleComponent.INSTANCE.m_multiRef.contains( match ) );
 
@@ -253,8 +258,8 @@ public class PersistentComponentFactoryTest extends ComponentTestBase
         Hashtable<String, String> propsNonMatch = new Hashtable<String, String>();
         propsNonMatch.put( PROP_NAME_FACTORY, PROP_NAME_FACTORY );
         propsNonMatch.put( "ref.target", "(filterprop=nomatch)" );
-        ComponentFactory factory = getComponentFactory( componentfactory );
-        final ComponentInstance instanceNonMatch = factory.newInstance( propsNonMatch );//works even without required reference
+        ComponentFactory<?> factory = getComponentFactory(componentfactory);
+        final ComponentInstance<?> instanceNonMatch = factory.newInstance(propsNonMatch);//works even without required reference
         checkConfigurationCount( componentname, 1, ComponentConfigurationDTO.UNSATISFIED_REFERENCE );
 
         final SimpleServiceImpl noMatch = SimpleServiceImpl.create( bundleContext, "nomatch" ).setFilterProperty(
@@ -310,9 +315,9 @@ public class PersistentComponentFactoryTest extends ComponentTestBase
 
         Hashtable<String, String> props = new Hashtable<String, String>();
         props.put( "service.pid", "myFactoryInstance" );
-        final ComponentFactory factory = getComponentFactory( componentfactory );
+        final ComponentFactory<?> factory = getComponentFactory(componentfactory);
 
-        final ComponentInstance instance = factory.newInstance( props );
+        final ComponentInstance<?> instance = factory.newInstance(props);
         TestCase.assertNotNull( instance );
 
         TestCase.assertNotNull( instance.getInstance() );
@@ -327,6 +332,7 @@ public class PersistentComponentFactoryTest extends ComponentTestBase
         checkConfigurationCount( referringComponentName, 1, ComponentConfigurationDTO.UNSATISFIED_REFERENCE );
     }
 
+    @SuppressWarnings("deprecation")
     @Test
     public void test_component_factory_with_target_filters() throws Exception
     {
@@ -345,7 +351,8 @@ public class PersistentComponentFactoryTest extends ComponentTestBase
         Hashtable<String, String> props = new Hashtable<String, String>();
         props.put( PROP_NAME_FACTORY, PROP_NAME_FACTORY );
         props.put( "ref.target", "(value=service2)" );
-        final ComponentInstance instance = createFactoryComponentInstance( componentfactory, props );
+        final ComponentInstance<?> instance = createFactoryComponentInstance(
+            componentfactory, props);
 
         log.log( LogService.LOG_WARNING, "Bound Services: " + SimpleComponent.INSTANCE.m_multiRef );
         TestCase.assertFalse( SimpleComponent.INSTANCE.m_multiRef.contains( s1 ) );
diff --git a/scr/src/test/java/org/apache/felix/scr/integration/ServiceBindGreedyTest.java b/scr/src/test/java/org/apache/felix/scr/integration/ServiceBindGreedyTest.java
index 34d0298..431bdfc 100644
--- a/scr/src/test/java/org/apache/felix/scr/integration/ServiceBindGreedyTest.java
+++ b/scr/src/test/java/org/apache/felix/scr/integration/ServiceBindGreedyTest.java
@@ -139,6 +139,7 @@ public class ServiceBindGreedyTest extends ComponentTestBase
         delay();
 
         // two services with service ranking (srv6 > srv5)
+        @SuppressWarnings("unused")
         final SimpleServiceImpl srv5 = SimpleServiceImpl.create( bundleContext, "srv5", 10 );
         final SimpleServiceImpl srv6 = SimpleServiceImpl.create( bundleContext, "srv6", 20 );
 
@@ -220,6 +221,7 @@ public class ServiceBindGreedyTest extends ComponentTestBase
         {
             threads.add(new Thread(new Runnable()
             {
+                @Override
                 public void run()
                 {
                     for (int j = 0; j < ranksPerThread; j++)
@@ -254,6 +256,7 @@ public class ServiceBindGreedyTest extends ComponentTestBase
         {
             threads.add(new Thread(new Runnable()
             {
+                @Override
                 public void run()
                 {
                     for (int j = 0; j < ranksPerThread; j++)
@@ -368,6 +371,7 @@ public class ServiceBindGreedyTest extends ComponentTestBase
         delay();
 
         // two services with service ranking (srv6 > srv5)
+        @SuppressWarnings("unused")
         final SimpleServiceImpl srv5 = SimpleServiceImpl.create( bundleContext, "srv5", 10 );
         final SimpleServiceImpl srv6 = SimpleServiceImpl.create( bundleContext, "srv6", 20 );
 
@@ -687,16 +691,18 @@ public class ServiceBindGreedyTest extends ComponentTestBase
         //        TestCase.assertEquals( Component.STATE_FACTORY, component.getState() );
 
         // create a component instance
-        final ServiceReference[] refs = bundleContext.getServiceReferences( ComponentFactory.class.getName(), "("
+        final ServiceReference<?>[] refs = bundleContext.getServiceReferences(
+            ComponentFactory.class.getName(), "("
                 + ComponentConstants.COMPONENT_FACTORY + "=" + factoryPid + ")" );
         TestCase.assertNotNull( refs );
         TestCase.assertEquals( 1, refs.length );
-        final ComponentFactory factory = ( ComponentFactory ) bundleContext.getService( refs[0] );
+        final ComponentFactory<?> factory = (ComponentFactory<?>) bundleContext.getService(
+            refs[0]);
         TestCase.assertNotNull( factory );
 
         Hashtable<String, String> props = new Hashtable<String, String>();
         props.put( PROP_NAME_FACTORY, PROP_NAME_FACTORY );
-        final ComponentInstance instance = factory.newInstance( props );
+        final ComponentInstance<?> instance = factory.newInstance(props);
         TestCase.assertNotNull( instance );
         TestCase.assertNotNull( instance.getInstance() );
         TestCase.assertEquals( SimpleComponent.INSTANCE, instance.getInstance() );
@@ -779,6 +785,7 @@ public class ServiceBindGreedyTest extends ComponentTestBase
         //        }
 
         // registeranother service, factory must come back, instance not
+        @SuppressWarnings("unused")
         final SimpleServiceImpl srv2 = SimpleServiceImpl.create( bundleContext, "srv2" );
         delay();
 
@@ -899,6 +906,7 @@ public class ServiceBindGreedyTest extends ComponentTestBase
         delay();
 
         // two services with service ranking (srv6 > srv5)
+        @SuppressWarnings("unused")
         final SimpleServiceImpl srv5 = SimpleServiceImpl.create( bundleContext, "srv5", 10 );
         final SimpleServiceImpl srv6 = SimpleServiceImpl.create( bundleContext, "srv6", 20 );
 
@@ -1027,6 +1035,7 @@ public class ServiceBindGreedyTest extends ComponentTestBase
         delay();
 
         // two services with service ranking (srv6 > srv5)
+        @SuppressWarnings("unused")
         final SimpleServiceImpl srv5 = SimpleServiceImpl.create( bundleContext, "srv5", 10 );
         final SimpleServiceImpl srv6 = SimpleServiceImpl.create( bundleContext, "srv6", 20 );
 
diff --git a/scr/src/test/java/org/apache/felix/scr/integration/ServiceBindTest.java b/scr/src/test/java/org/apache/felix/scr/integration/ServiceBindTest.java
index c8d6323..d972019 100644
--- a/scr/src/test/java/org/apache/felix/scr/integration/ServiceBindTest.java
+++ b/scr/src/test/java/org/apache/felix/scr/integration/ServiceBindTest.java
@@ -132,6 +132,7 @@ public class ServiceBindTest extends ComponentTestBase
         delay();
 
         // two services with service ranking (srv6 > srv5)
+        @SuppressWarnings("unused")
         final SimpleServiceImpl srv5 = SimpleServiceImpl.create( bundleContext, "srv5", 10 );
         final SimpleServiceImpl srv6 = SimpleServiceImpl.create( bundleContext, "srv6", 20 );
 
@@ -247,6 +248,7 @@ public class ServiceBindTest extends ComponentTestBase
         delay();
 
         // two services with service ranking (srv6 > srv5)
+        @SuppressWarnings("unused")
         final SimpleServiceImpl srv5 = SimpleServiceImpl.create( bundleContext, "srv5", 10 );
         final SimpleServiceImpl srv6 = SimpleServiceImpl.create( bundleContext, "srv6", 20 );
 
@@ -566,16 +568,18 @@ public class ServiceBindTest extends ComponentTestBase
         //        TestCase.assertEquals( Component.STATE_FACTORY, component.getState() );
 
         // create a component instance
-        final ServiceReference[] refs = bundleContext.getServiceReferences( ComponentFactory.class.getName(), "("
+        final ServiceReference<?>[] refs = bundleContext.getServiceReferences(
+            ComponentFactory.class.getName(), "("
                 + ComponentConstants.COMPONENT_FACTORY + "=" + factoryPid + ")" );
         TestCase.assertNotNull( refs );
         TestCase.assertEquals( 1, refs.length );
-        final ComponentFactory factory = ( ComponentFactory ) bundleContext.getService( refs[0] );
+        final ComponentFactory<?> factory = (ComponentFactory<?>) bundleContext.getService(
+            refs[0]);
         TestCase.assertNotNull( factory );
 
         Hashtable<String, String> props = new Hashtable<String, String>();
         props.put( PROP_NAME_FACTORY, PROP_NAME_FACTORY );
-        final ComponentInstance instance = factory.newInstance( props );
+        final ComponentInstance<?> instance = factory.newInstance(props);
         TestCase.assertNotNull( instance );
         TestCase.assertNotNull( instance.getInstance() );
         TestCase.assertEquals( SimpleComponent.INSTANCE, instance.getInstance() );
@@ -658,6 +662,7 @@ public class ServiceBindTest extends ComponentTestBase
         //        }
 
         // registeranother service, factory must come back, instance not
+        @SuppressWarnings("unused")
         final SimpleServiceImpl srv2 = SimpleServiceImpl.create( bundleContext, "srv2" );
         delay();
 
@@ -779,6 +784,7 @@ public class ServiceBindTest extends ComponentTestBase
         delay();
 
         // two services with service ranking (srv6 > srv5)
+        @SuppressWarnings("unused")
         final SimpleServiceImpl srv5 = SimpleServiceImpl.create( bundleContext, "srv5", 10 );
         final SimpleServiceImpl srv6 = SimpleServiceImpl.create( bundleContext, "srv6", 20 );
 
@@ -907,6 +913,7 @@ public class ServiceBindTest extends ComponentTestBase
         delay();
 
         // two services with service ranking (srv6 > srv5)
+        @SuppressWarnings("unused")
         final SimpleServiceImpl srv5 = SimpleServiceImpl.create( bundleContext, "srv5", 10 );
         final SimpleServiceImpl srv6 = SimpleServiceImpl.create( bundleContext, "srv6", 20 );
 
diff --git a/scr/src/test/java/org/apache/felix/scr/integration/ServiceComponentTest.java b/scr/src/test/java/org/apache/felix/scr/integration/ServiceComponentTest.java
index bad025a..81b7c64 100644
--- a/scr/src/test/java/org/apache/felix/scr/integration/ServiceComponentTest.java
+++ b/scr/src/test/java/org/apache/felix/scr/integration/ServiceComponentTest.java
@@ -55,7 +55,8 @@ public class ServiceComponentTest extends ComponentTestBase
         TestCase.assertEquals( "private", instance.getProperty( ".prop.private" ) );
 
         // get the service
-        ServiceReference reference = bundleContext.getServiceReference( "java.lang.Object" );
+        ServiceReference<Object> reference = bundleContext.getServiceReference(
+            Object.class);
         TestCase.assertNotNull( reference );
         try
         {
@@ -90,7 +91,8 @@ public class ServiceComponentTest extends ComponentTestBase
         TestCase.assertNull( SimpleComponent.INSTANCE );
 
         // get the service
-        ServiceReference reference = bundleContext.getServiceReference( "java.lang.Object" );
+        ServiceReference<Object> reference = bundleContext.getServiceReference(
+            Object.class);
         TestCase.assertNotNull( reference );
         try
         {
@@ -124,7 +126,8 @@ public class ServiceComponentTest extends ComponentTestBase
         TestCase.assertNull( SimpleComponent.INSTANCE );
 
         // get the service once
-        final ServiceReference reference1 = bundleContext.getServiceReference( "java.lang.Object" );
+        final ServiceReference<Object> reference1 = bundleContext.getServiceReference(
+            Object.class);
         TestCase.assertNotNull( reference1 );
         bundleContext.getService( reference1 );
         findComponentConfigurationByName(pid, ComponentConfigurationDTO.ACTIVE);
@@ -132,7 +135,8 @@ public class ServiceComponentTest extends ComponentTestBase
 
         // get the service a second time
         final BundleContext bundleContext2 = bundle.getBundleContext();
-        final ServiceReference reference2 = bundleContext2.getServiceReference( "java.lang.Object" );
+        final ServiceReference<Object> reference2 = bundleContext2.getServiceReference(
+            Object.class);
         TestCase.assertNotNull( reference2 );
         bundleContext2.getService( reference2 );
         findComponentConfigurationByName(pid, ComponentConfigurationDTO.ACTIVE);
@@ -162,7 +166,8 @@ public class ServiceComponentTest extends ComponentTestBase
         TestCase.assertNull( SimpleComponent.INSTANCE );
 
         // get the service
-        ServiceReference reference = bundleContext.getServiceReference( "java.lang.Object" );
+        ServiceReference<Object> reference = bundleContext.getServiceReference(
+            Object.class);
         TestCase.assertNotNull( reference );
         try
         {
diff --git a/scr/src/test/java/org/apache/felix/scr/integration/components/ActivatorComponent.java b/scr/src/test/java/org/apache/felix/scr/integration/components/ActivatorComponent.java
index bb121d5..c6ca72d 100644
--- a/scr/src/test/java/org/apache/felix/scr/integration/components/ActivatorComponent.java
+++ b/scr/src/test/java/org/apache/felix/scr/integration/components/ActivatorComponent.java
@@ -36,7 +36,7 @@ public class ActivatorComponent
 
     private static ActivatorComponent activatorComponent;
 
-    private ServiceRegistration registration;
+    private ServiceRegistration<SimpleService> registration;
 
     private SimpleService simpleService;
 
@@ -54,13 +54,14 @@ public class ActivatorComponent
         }
         if ( configuration.containsKey( FLAG_REGISTER_SERVICE ) )
         {
-            registration = context.registerService( SimpleService.class.getName(), new SimpleServiceImpl(), null );
+            registration = context.registerService(SimpleService.class,
+                new SimpleServiceImpl(), null);
         }
         if ( activatorComponent != null )
         {
         	    throw new IllegalStateException( "not the only activator component");
         }
-        this.activatorComponent = this;
+        ActivatorComponent.activatorComponent = this;
     }
 
 
diff --git a/scr/src/test/java/org/apache/felix/scr/integration/components/Felix4350Component.java b/scr/src/test/java/org/apache/felix/scr/integration/components/Felix4350Component.java
index af57cc1..0f4c248 100644
--- a/scr/src/test/java/org/apache/felix/scr/integration/components/Felix4350Component.java
+++ b/scr/src/test/java/org/apache/felix/scr/integration/components/Felix4350Component.java
@@ -24,7 +24,9 @@ public class Felix4350Component {
 	private static int m_activateCount;
 	private static int m_deactivateCount;
 	
+    @SuppressWarnings("unused")
     private SimpleComponent component1;
+    @SuppressWarnings("unused")
     private SimpleComponent2 component2;
 
     public void bindComponent1(SimpleComponent component1) {
diff --git a/scr/src/test/java/org/apache/felix/scr/integration/components/MutatingService.java b/scr/src/test/java/org/apache/felix/scr/integration/components/MutatingService.java
index b212457..b3339d2 100644
--- a/scr/src/test/java/org/apache/felix/scr/integration/components/MutatingService.java
+++ b/scr/src/test/java/org/apache/felix/scr/integration/components/MutatingService.java
@@ -24,6 +24,6 @@ import java.util.Dictionary;
 public interface MutatingService
 {
 
-    void updateProperties(Dictionary changes);
+    void updateProperties(Dictionary<String, ?> changes);
 
 }
diff --git a/scr/src/test/java/org/apache/felix/scr/integration/components/MutatingServiceImpl.java b/scr/src/test/java/org/apache/felix/scr/integration/components/MutatingServiceImpl.java
index 0e8c875..15aeb26 100644
--- a/scr/src/test/java/org/apache/felix/scr/integration/components/MutatingServiceImpl.java
+++ b/scr/src/test/java/org/apache/felix/scr/integration/components/MutatingServiceImpl.java
@@ -32,20 +32,25 @@ public class MutatingServiceImpl implements MutatingService
 {
     private ComponentContext activateContext;
 
+    @SuppressWarnings("unused")
     private void activate( ComponentContext activateContext )
     {
         this.activateContext = activateContext;
     }
 
+    @SuppressWarnings("unused")
     private void modified( ComponentContext activateContext )
     {
 
     }
 
-    private Map activateMutate( ComponentContext activateContext )
+    @SuppressWarnings("unused")
+    private Map<String, Object> activateMutate(ComponentContext activateContext)
     {
         this.activateContext = activateContext;
-        Map result = new Hashtable( (Map )activateContext.getProperties() );
+        @SuppressWarnings("unchecked")
+        Map<String, Object> result = new Hashtable<>(
+            (Map<String, Object>) activateContext.getProperties());
         if (activateContext.getServiceReference() != null) 
         {
             result.put( "theValue", "anotherValue1" );
@@ -57,36 +62,46 @@ public class MutatingServiceImpl implements MutatingService
         return result;
     }
 
-    private Map modifiedMutate( ComponentContext activateContext )
+    @SuppressWarnings("unused")
+    private Map<String, Object> modifiedMutate(ComponentContext activateContext)
     {
-        Map result = new Hashtable( (Map )activateContext.getProperties() );
+        @SuppressWarnings("unchecked")
+        Map<String, Object> result = new Hashtable<>(
+            (Map<String, Object>) activateContext.getProperties());
         result.put( "theValue", "anotherValue2" );
         return result;
     }
 
+    @SuppressWarnings({ "rawtypes", "unused" })
     private Map deactivateMutate( ComponentContext activateContext )
     {
-        Map result = new Hashtable( (Map )activateContext.getProperties() );
+        @SuppressWarnings("unchecked")
+        Map<String, Object> result = new Hashtable<>(
+            (Map<String, Object>) activateContext.getProperties());
         result.put( "theValue", "anotherValue3" );
         return result;
     }
 
-    public void updateProperties( Dictionary changes )
+    @Override
+    public void updateProperties(Dictionary<String, ?> changes)
     {
         ( ( ExtComponentContext ) activateContext ).setServiceProperties( changes );
     }
 
-    private Map bindSimpleService( SimpleService ss )
+    @SuppressWarnings("unused")
+    private Map<String, String> bindSimpleService(SimpleService ss)
     {
         return Collections.singletonMap( "SimpleService", "bound" );
     }
 
-    private Map unbindSimpleService( SimpleService ss )
+    @SuppressWarnings("unused")
+    private Map<String, String> unbindSimpleService(SimpleService ss)
     {
         return Collections.singletonMap( "SimpleService", "unbound" );
     }
 
-    private Map updateSimpleService( SimpleService ss )
+    @SuppressWarnings("unused")
+    private Map<String, String> updateSimpleService(SimpleService ss)
     {
         return Collections.singletonMap( "SimpleService", "updated" );
     }
diff --git a/scr/src/test/java/org/apache/felix/scr/integration/components/SimpleService2Impl.java b/scr/src/test/java/org/apache/felix/scr/integration/components/SimpleService2Impl.java
index c485d5c..de4e69c 100644
--- a/scr/src/test/java/org/apache/felix/scr/integration/components/SimpleService2Impl.java
+++ b/scr/src/test/java/org/apache/felix/scr/integration/components/SimpleService2Impl.java
@@ -21,8 +21,6 @@ package org.apache.felix.scr.integration.components;
 
 import java.util.Dictionary;
 import java.util.Hashtable;
-import java.util.Properties;
-
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.Constants;
 import org.osgi.framework.ServiceRegistration;
@@ -37,7 +35,7 @@ public class SimpleService2Impl implements SimpleService2
 
     private String m_filterProp;
 
-    private ServiceRegistration m_registration;
+    private ServiceRegistration<SimpleService2> m_registration;
 
 
     public static SimpleService2Impl create( BundleContext bundleContext, String value )
@@ -50,7 +48,8 @@ public class SimpleService2Impl implements SimpleService2
     {
         SimpleService2Impl instance = new SimpleService2Impl( value, ranking );
         Dictionary<String,?> props = instance.getProperties();
-        instance.setRegistration( bundleContext.registerService( SimpleService2.class.getName(), instance, props ) );
+        instance.setRegistration(
+            bundleContext.registerService(SimpleService2.class, instance, props));
         return instance;
     }
 
@@ -98,7 +97,7 @@ public class SimpleService2Impl implements SimpleService2
 
     public void drop()
     {
-        ServiceRegistration sr = getRegistration();
+        ServiceRegistration<SimpleService2> sr = getRegistration();
         if ( sr != null )
         {
             setRegistration( null );
@@ -107,19 +106,20 @@ public class SimpleService2Impl implements SimpleService2
     }
 
 
+    @Override
     public String getValue2()
     {
         return m_value;
     }
 
 
-    public void setRegistration( ServiceRegistration registration )
+    public void setRegistration(ServiceRegistration<SimpleService2> registration)
     {
         m_registration = registration;
     }
 
 
-    public ServiceRegistration getRegistration()
+    public ServiceRegistration<SimpleService2> getRegistration()
     {
         return m_registration;
     }
diff --git a/scr/src/test/java/org/apache/felix/scr/integration/components/SimpleServiceImpl.java b/scr/src/test/java/org/apache/felix/scr/integration/components/SimpleServiceImpl.java
index d365e6e..970863e 100644
--- a/scr/src/test/java/org/apache/felix/scr/integration/components/SimpleServiceImpl.java
+++ b/scr/src/test/java/org/apache/felix/scr/integration/components/SimpleServiceImpl.java
@@ -114,6 +114,7 @@ public class SimpleServiceImpl implements SimpleService, Comparable<SimpleServic
     }
 
 
+    @Override
     public String getValue()
     {
         return m_value;
diff --git a/scr/src/test/java/org/apache/felix/scr/integration/components/activatesignature/Signature_Package_Map.java b/scr/src/test/java/org/apache/felix/scr/integration/components/activatesignature/Signature_Package_Map.java
index c5b3279..55b7853 100644
--- a/scr/src/test/java/org/apache/felix/scr/integration/components/activatesignature/Signature_Package_Map.java
+++ b/scr/src/test/java/org/apache/felix/scr/integration/components/activatesignature/Signature_Package_Map.java
@@ -24,9 +24,7 @@ import java.util.Map;
 
 public class Signature_Package_Map extends AbstractActivateSignatureTestComponent
 {
-
-    @SuppressWarnings({ "unchecked" })
-    void activate( Map config )
+    void activate(Map<?, ?> config)
     {
         setMethodCalled( config );
     }
diff --git a/scr/src/test/java/org/apache/felix/scr/integration/components/activatesignature/Signature_Private_Map.java b/scr/src/test/java/org/apache/felix/scr/integration/components/activatesignature/Signature_Private_Map.java
index 7d06be1..7209229 100644
--- a/scr/src/test/java/org/apache/felix/scr/integration/components/activatesignature/Signature_Private_Map.java
+++ b/scr/src/test/java/org/apache/felix/scr/integration/components/activatesignature/Signature_Private_Map.java
@@ -25,8 +25,8 @@ import java.util.Map;
 public class Signature_Private_Map extends AbstractActivateSignatureTestComponent
 {
 
-    @SuppressWarnings({ "unchecked", "unused" })
-    private void activate( Map config )
+    @SuppressWarnings("unused")
+    private void activate(Map<?, ?> config)
     {
         setMethodCalled( config );
     }
diff --git a/scr/src/test/java/org/apache/felix/scr/integration/components/activatesignature/Signature_Protected_Map.java b/scr/src/test/java/org/apache/felix/scr/integration/components/activatesignature/Signature_Protected_Map.java
index 0f22b1d..a3c98e2 100644
--- a/scr/src/test/java/org/apache/felix/scr/integration/components/activatesignature/Signature_Protected_Map.java
+++ b/scr/src/test/java/org/apache/felix/scr/integration/components/activatesignature/Signature_Protected_Map.java
@@ -25,8 +25,7 @@ import java.util.Map;
 public class Signature_Protected_Map extends AbstractActivateSignatureTestComponent
 {
 
-    @SuppressWarnings({ "unchecked" })
-    protected void activate( Map config )
+    protected void activate(Map<?, ?> config)
     {
         setMethodCalled( config );
     }
diff --git a/scr/src/test/java/org/apache/felix/scr/integration/components/activatesignature/Signature_Public_Map.java b/scr/src/test/java/org/apache/felix/scr/integration/components/activatesignature/Signature_Public_Map.java
index 6034fd2..b7c3485 100644
--- a/scr/src/test/java/org/apache/felix/scr/integration/components/activatesignature/Signature_Public_Map.java
+++ b/scr/src/test/java/org/apache/felix/scr/integration/components/activatesignature/Signature_Public_Map.java
@@ -25,8 +25,7 @@ import java.util.Map;
 public class Signature_Public_Map extends AbstractActivateSignatureTestComponent
 {
 
-    @SuppressWarnings({ "unchecked" })
-    public void activate( Map config )
+    public void activate(Map<?, ?> config)
     {
         setMethodCalled( config );
     }
diff --git a/scr/src/test/java/org/apache/felix/scr/integration/components/circular/A.java b/scr/src/test/java/org/apache/felix/scr/integration/components/circular/A.java
index db9e4ac..c1f8bdb 100644
--- a/scr/src/test/java/org/apache/felix/scr/integration/components/circular/A.java
+++ b/scr/src/test/java/org/apache/felix/scr/integration/components/circular/A.java
@@ -33,18 +33,22 @@ public class A
 
     private List<B> bs = new ArrayList<B>();
 
+    @SuppressWarnings("unused")
     private boolean activated;
 
+    @SuppressWarnings("unused")
     private void activate(ComponentContext cc)
     {
         activated = true;
     }
 
+    @SuppressWarnings("unused")
     private void setB(B b)
     {
         bs.add( b );
     }
 
+    @SuppressWarnings("unused")
     private void unsetB(B b)
     {
         bs.remove( b );
diff --git a/scr/src/test/java/org/apache/felix/scr/integration/components/circular/B.java b/scr/src/test/java/org/apache/felix/scr/integration/components/circular/B.java
index 9e8a5ad..13e369e 100644
--- a/scr/src/test/java/org/apache/felix/scr/integration/components/circular/B.java
+++ b/scr/src/test/java/org/apache/felix/scr/integration/components/circular/B.java
@@ -33,18 +33,22 @@ public class B
 
     private List<A> as = new ArrayList<A>();
 
+    @SuppressWarnings("unused")
     private boolean activated;
 
+    @SuppressWarnings("unused")
     private void activate(ComponentContext cc)
     {
         activated = true;
     }
 
+    @SuppressWarnings("unused")
     private void setA(A a)
     {
         as.add( a );
     }
 
+    @SuppressWarnings("unused")
     private void unsetA(A a)
     {
         as.remove( a );
diff --git a/scr/src/test/java/org/apache/felix/scr/integration/components/circularFactory/FactoryClient.java b/scr/src/test/java/org/apache/felix/scr/integration/components/circularFactory/FactoryClient.java
index b57db0b..6e843a4 100644
--- a/scr/src/test/java/org/apache/felix/scr/integration/components/circularFactory/FactoryClient.java
+++ b/scr/src/test/java/org/apache/felix/scr/integration/components/circularFactory/FactoryClient.java
@@ -26,13 +26,13 @@ public class FactoryClient
 {
     
     
-    protected void setFactory(ComponentFactory cf)
+    protected void setFactory(ComponentFactory<?> cf)
     {
         cf.newInstance(new Hashtable<String, Object>());
         
     }
     
-    protected void unsetFactory(ComponentFactory cf)
+    protected void unsetFactory(ComponentFactory<?> cf)
     {
         
     }
diff --git a/scr/src/test/java/org/apache/felix/scr/integration/components/concurrency/AFactory.java b/scr/src/test/java/org/apache/felix/scr/integration/components/concurrency/AFactory.java
index 92be0f4..5188c45 100644
--- a/scr/src/test/java/org/apache/felix/scr/integration/components/concurrency/AFactory.java
+++ b/scr/src/test/java/org/apache/felix/scr/integration/components/concurrency/AFactory.java
@@ -14,10 +14,11 @@ import org.osgi.service.component.ComponentFactory;
 import org.osgi.service.component.ComponentInstance;
 
 public class AFactory implements Runnable {
-    private ComponentFactory _aFactory;
+    private ComponentFactory<?> _aFactory;
     private Thread[] _threads = new Thread[2];
     
-    public void bindAFactory(ComponentFactory aFactory) {
+    public void bindAFactory(ComponentFactory<?> aFactory)
+    {
       _aFactory = aFactory;
     }
     
@@ -40,11 +41,12 @@ public class AFactory implements Runnable {
       }
     }
     
+    @Override
     public void run() {
       while (true) {
         try {
           //System.out.println("Creating A");
-          ComponentInstance ci = _aFactory.newInstance(null);
+          ComponentInstance<?> ci = _aFactory.newInstance(null);
           ci.dispose();
           if (Thread.currentThread().isInterrupted()) {
             return;
diff --git a/scr/src/test/java/org/apache/felix/scr/integration/components/concurrency/CFactory.java b/scr/src/test/java/org/apache/felix/scr/integration/components/concurrency/CFactory.java
index 952ea3b..bc25891 100644
--- a/scr/src/test/java/org/apache/felix/scr/integration/components/concurrency/CFactory.java
+++ b/scr/src/test/java/org/apache/felix/scr/integration/components/concurrency/CFactory.java
@@ -14,10 +14,11 @@ import org.osgi.service.component.ComponentFactory;
 import org.osgi.service.component.ComponentInstance;
 
 public class CFactory implements Runnable {
-    private ComponentFactory _cFactory;
+    private ComponentFactory<?> _cFactory;
     private Thread[] _threads = new Thread[2];
     
-    public void bindCFactory(ComponentFactory cFactory) {
+    public void bindCFactory(ComponentFactory<?> cFactory)
+    {
       _cFactory = cFactory;
     }
     
@@ -40,10 +41,11 @@ public class CFactory implements Runnable {
       }
     }
     
+    @Override
     public void run() {
       while (true) {
         try {
-          ComponentInstance ci = _cFactory.newInstance(null);
+            ComponentInstance<?> ci = _cFactory.newInstance(null);
           ci.dispose();
           if (Thread.currentThread().isInterrupted()) {
             return;
diff --git a/scr/src/test/java/org/apache/felix/scr/integration/components/deadlock/Consumer.java b/scr/src/test/java/org/apache/felix/scr/integration/components/deadlock/Consumer.java
index 4673cdb..869f1b5 100644
--- a/scr/src/test/java/org/apache/felix/scr/integration/components/deadlock/Consumer.java
+++ b/scr/src/test/java/org/apache/felix/scr/integration/components/deadlock/Consumer.java
@@ -23,7 +23,7 @@ import org.osgi.service.component.ComponentContext;
 
 public class Consumer
 {
-    
+    @SuppressWarnings("unused")
     private ComponentContext cc;
     
     protected void activate(ComponentContext cc) 
diff --git a/scr/src/test/java/org/apache/felix/scr/integration/components/deadlock/TestComponent.java b/scr/src/test/java/org/apache/felix/scr/integration/components/deadlock/TestComponent.java
index e380900..2da9d53 100644
--- a/scr/src/test/java/org/apache/felix/scr/integration/components/deadlock/TestComponent.java
+++ b/scr/src/test/java/org/apache/felix/scr/integration/components/deadlock/TestComponent.java
@@ -26,7 +26,7 @@ public class TestComponent
     
     private ComponentContext cc;
     
-    private ServiceReference sr;
+    private ServiceReference<?> sr;
     private boolean success1;
     private boolean success2;
     
@@ -35,12 +35,12 @@ public class TestComponent
         this.cc =cc;
     }
     
-    protected void setRef(ServiceReference sr)
+    protected void setRef(ServiceReference<?> sr)
     {
         this.sr = sr;
     }
     
-    protected void unsetRef(ServiceReference sr)
+    protected void unsetRef(ServiceReference<?> sr)
     {
         if (sr == this.sr)
         {
diff --git a/scr/src/test/java/org/apache/felix/scr/integration/components/felix3680/Main.java b/scr/src/test/java/org/apache/felix/scr/integration/components/felix3680/Main.java
index cc4b709..1e1aac9 100644
--- a/scr/src/test/java/org/apache/felix/scr/integration/components/felix3680/Main.java
+++ b/scr/src/test/java/org/apache/felix/scr/integration/components/felix3680/Main.java
@@ -78,6 +78,8 @@ public class Main implements Runnable
             {
                 exec.execute(new Runnable()
                 {
+                    @SuppressWarnings("deprecation")
+                    @Override
                     public void run()
                     {
                         if (enable)
@@ -130,9 +132,9 @@ public class Main implements Runnable
         _logService = logService;
     }
 
-    void bindA(ServiceReference sr)
+    void bindA(ServiceReference<A> sr)
     {
-        A a = (A) sr.getBundle().getBundleContext().getService(sr);
+        A a = sr.getBundle().getBundleContext().getService(sr);
         if (a == null)
         {
             throw new IllegalStateException("bindA: bundleContext.getService returned null");
@@ -144,7 +146,7 @@ public class Main implements Runnable
         _enabledLatch.countDown();
     }
 
-    void unbindA(ServiceReference sr)
+    void unbindA(ServiceReference<A> sr)
     {
         if (_counter.decrementAndGet() != 0)
         {
@@ -153,6 +155,7 @@ public class Main implements Runnable
         _disabledLatch.countDown();
     }
 
+    @SuppressWarnings("deprecation")
     void start(ComponentContext ctx)
     {
         _logService.log(LogService.LOG_INFO, "Main.start");
@@ -168,6 +171,8 @@ public class Main implements Runnable
         _thread.interrupt();
     }
 
+    @SuppressWarnings("deprecation")
+    @Override
     public void run()
     {
         Executor exec = Executors.newFixedThreadPool(50);
@@ -227,6 +232,7 @@ public class Main implements Runnable
         }
     }
 
+    @SuppressWarnings("deprecation")
     private void dumpComponents()
     {
         StringWriter sw = new StringWriter();
diff --git a/scr/src/test/java/org/apache/felix/scr/integration/components/felix3680_2/Main.java b/scr/src/test/java/org/apache/felix/scr/integration/components/felix3680_2/Main.java
index 71f64b4..8274c27 100644
--- a/scr/src/test/java/org/apache/felix/scr/integration/components/felix3680_2/Main.java
+++ b/scr/src/test/java/org/apache/felix/scr/integration/components/felix3680_2/Main.java
@@ -49,7 +49,7 @@ public class Main implements Runnable
     private ServiceComponentRuntime m_scr;
     private final Executor m_exec = Executors.newFixedThreadPool( 12 );
     private volatile BundleContext m_bctx;
-    volatile ConcurrentHashMap<Class, ServiceRegistration> m_registrations = new ConcurrentHashMap<Class, ServiceRegistration>();
+    volatile ConcurrentHashMap<Class<?>, ServiceRegistration<?>> m_registrations = new ConcurrentHashMap<>();
     volatile Exception _bindStackTrace;
 
     private volatile boolean running = true;
@@ -103,10 +103,12 @@ public class Main implements Runnable
         }
 
 
-        private void register( final Class clazz )
+        private void register(final Class<?> clazz)
         {
             m_exec.execute( new Runnable()
             {
+                @SuppressWarnings("deprecation")
+                @Override
                 public void run()
                 {
                     try
@@ -124,15 +126,17 @@ public class Main implements Runnable
         }
 
 
-        private void unregister( final Class clazz )
+        private void unregister(final Class<?> clazz)
         {
             m_exec.execute( new Runnable()
             {
+                @SuppressWarnings("deprecation")
+                @Override
                 public void run()
                 {
                     try
                     {
-                        ServiceRegistration sr = m_registrations.remove( clazz );
+                        ServiceRegistration<?> sr = m_registrations.remove(clazz);
                         sr.unregister();
                         m_disabledLatch.countDown();
                     }
@@ -158,7 +162,8 @@ public class Main implements Runnable
     }
 
 
-    void bindA( ServiceReference sr )
+    @SuppressWarnings("deprecation")
+    void bindA(ServiceReference<?> sr)
     {
         Exception trace = new Exception( "bindA (" + Thread.currentThread() + ")" );
         if ( _bindStackTrace != null )
@@ -219,6 +224,8 @@ public class Main implements Runnable
     }
 
 
+    @SuppressWarnings("deprecation")
+    @Override
     public void run()
     {
         int loop = 0;
@@ -298,6 +305,7 @@ public class Main implements Runnable
         return b.toString();
     }
 
+    @SuppressWarnings("deprecation")
     private void dumpA()
     {
         ComponentDescriptionDTO c = m_scr
diff --git a/scr/src/test/java/org/apache/felix/scr/integration/components/felix4984/A.java b/scr/src/test/java/org/apache/felix/scr/integration/components/felix4984/A.java
index a685b05..5039a67 100644
--- a/scr/src/test/java/org/apache/felix/scr/integration/components/felix4984/A.java
+++ b/scr/src/test/java/org/apache/felix/scr/integration/components/felix4984/A.java
@@ -27,17 +27,17 @@ import org.osgi.service.log.LogService;
 /**
  * @version $Rev: 1350816 $ $Date: 2012-06-15 23:37:30 +0200 (Fri, 15 Jun 2012) $
  */
+
+@SuppressWarnings("unused")
 public class A
 {
 
     private List<B> bs = new ArrayList<B>();
-    private List<Exception> bsStackTraces = new ArrayList();
+    private List<Exception> bsStackTraces = new ArrayList<>();
 
-    private boolean activated;
 
     private void activate(ComponentContext cc)
     {
-        activated = true;
     }
 
     private void setB(B b)
@@ -57,6 +57,7 @@ public class A
         return bs;
     }
 
+    @SuppressWarnings("deprecation")
     public void dumpStackTracesWhenBWasBound(LogService log) {
         log.log(LogService.LOG_WARNING, "Stack traces when B was bound:");
         for (Exception e : bsStackTraces) {
diff --git a/scr/src/test/java/org/apache/felix/scr/integration/components/felix4984/B.java b/scr/src/test/java/org/apache/felix/scr/integration/components/felix4984/B.java
index c5dab0d..958cd4f 100644
--- a/scr/src/test/java/org/apache/felix/scr/integration/components/felix4984/B.java
+++ b/scr/src/test/java/org/apache/felix/scr/integration/components/felix4984/B.java
@@ -25,11 +25,13 @@ public class B
 {
     private List<A> as = new ArrayList<A>();
 
+    @SuppressWarnings("unused")
     private void setA(A a)
     {
         as.add( a );
     }
 
+    @SuppressWarnings("unused")
     private void unsetA(A a)
     {
         as.remove( a );
diff --git a/scr/src/test/java/org/apache/felix/scr/integration/components/felix5276/B.java b/scr/src/test/java/org/apache/felix/scr/integration/components/felix5276/B.java
index 6c7e792..0abf2d6 100644
--- a/scr/src/test/java/org/apache/felix/scr/integration/components/felix5276/B.java
+++ b/scr/src/test/java/org/apache/felix/scr/integration/components/felix5276/B.java
@@ -25,12 +25,14 @@ public class B
 {
     private A a;
 
+    @SuppressWarnings("unused")
     private Map<String, Object> setA(A a)
     {
         this.a = a;
         return Collections.<String, Object> singletonMap("foo", "bar");
     }
 
+    @SuppressWarnings("unused")
     private Map<String, Object> unsetA(A a)
     {
         if (this.a == a)
diff --git a/scr/src/test/java/org/apache/felix/scr/integration/components/felix5276/C.java b/scr/src/test/java/org/apache/felix/scr/integration/components/felix5276/C.java
index 7c48d76..9e53104 100644
--- a/scr/src/test/java/org/apache/felix/scr/integration/components/felix5276/C.java
+++ b/scr/src/test/java/org/apache/felix/scr/integration/components/felix5276/C.java
@@ -29,11 +29,13 @@ public class C
 
     }
 
+    @SuppressWarnings("unused")
     private void setB(B b)
     {
         this.b = b;
     }
 
+    @SuppressWarnings("unused")
     private void unsetB(B b)
     {
         if (this.b == b)
diff --git a/scr/src/test/java/org/apache/felix/scr/integration/components/felix6274_2/Component.java b/scr/src/test/java/org/apache/felix/scr/integration/components/felix6274_2/Component.java
index bec90db..6acdcdc 100644
--- a/scr/src/test/java/org/apache/felix/scr/integration/components/felix6274_2/Component.java
+++ b/scr/src/test/java/org/apache/felix/scr/integration/components/felix6274_2/Component.java
@@ -25,6 +25,7 @@ public class Component
 
 	LogService logger;
 	
+    @SuppressWarnings("deprecation")
     void activate()
     {
         logger.log(LogService.LOG_INFO, "Hello from felix6274_2");
diff --git a/scr/src/test/java/org/apache/felix/scr/integration/components/felix6274_hook/Activator.java b/scr/src/test/java/org/apache/felix/scr/integration/components/felix6274_hook/Activator.java
index 1e8b230..f7f68fa 100644
--- a/scr/src/test/java/org/apache/felix/scr/integration/components/felix6274_hook/Activator.java
+++ b/scr/src/test/java/org/apache/felix/scr/integration/components/felix6274_hook/Activator.java
@@ -24,7 +24,6 @@ import java.util.Iterator;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleActivator;
 import org.osgi.framework.BundleContext;
-import org.osgi.framework.Version;
 import org.osgi.framework.hooks.resolver.ResolverHook;
 import org.osgi.framework.hooks.resolver.ResolverHookFactory;
 import org.osgi.framework.namespace.PackageNamespace;


[felix-dev] 02/06: Add DS namespace version 1.5.0 for OSGi R8

Posted by tj...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tjwatson pushed a commit to branch scrR8
in repository https://gitbox.apache.org/repos/asf/felix-dev.git

commit 7898ad92ade59707dab993a35747a45130549066
Author: Thomas Watson <tj...@us.ibm.com>
AuthorDate: Wed Oct 28 10:06:53 2020 -0500

    Add DS namespace version 1.5.0 for OSGi R8
---
 .../main/java/org/apache/felix/scr/impl/metadata/DSVersion.java   | 8 +++++++-
 scr/src/main/java/org/apache/felix/scr/impl/xml/XmlConstants.java | 4 ++++
 scr/src/main/java/org/apache/felix/scr/impl/xml/XmlHandler.java   | 2 --
 3 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/scr/src/main/java/org/apache/felix/scr/impl/metadata/DSVersion.java b/scr/src/main/java/org/apache/felix/scr/impl/metadata/DSVersion.java
index b3a7ef8..1fc7570 100644
--- a/scr/src/main/java/org/apache/felix/scr/impl/metadata/DSVersion.java
+++ b/scr/src/main/java/org/apache/felix/scr/impl/metadata/DSVersion.java
@@ -27,7 +27,8 @@ public enum DSVersion
     DS12(3),
     DS12Felix(4),
     DS13(5),
-    DS14(6);
+    DS14(6),
+    DS15(7);
 
     private final int version;
 
@@ -60,4 +61,9 @@ public enum DSVersion
     {
         return version >=DS14.version;
     }
+
+    public boolean isDS15()
+    {
+        return version >= DS15.version;
+    }
 }
diff --git a/scr/src/main/java/org/apache/felix/scr/impl/xml/XmlConstants.java b/scr/src/main/java/org/apache/felix/scr/impl/xml/XmlConstants.java
index 112d34e..42624d7 100644
--- a/scr/src/main/java/org/apache/felix/scr/impl/xml/XmlConstants.java
+++ b/scr/src/main/java/org/apache/felix/scr/impl/xml/XmlConstants.java
@@ -55,6 +55,9 @@ public abstract class XmlConstants
     // Namespace URI of DS 1.4
     public static final String NAMESPACE_URI_1_4 = "http://www.osgi.org/xmlns/scr/v1.4.0";
 
+    // Namespace URI of DS 1.5
+    public static final String NAMESPACE_URI_1_5 = "http://www.osgi.org/xmlns/scr/v1.5.0";
+
     // Elements
     public static final String EL_COMPONENT = "component";
     public static final String EL_COMPONENTS = "components";
@@ -113,5 +116,6 @@ public abstract class XmlConstants
         NAMESPACE_CODE_MAP.put( NAMESPACE_URI_1_2_FELIX, DSVersion.DS12Felix );
         NAMESPACE_CODE_MAP.put( NAMESPACE_URI_1_3, DSVersion.DS13 );
         NAMESPACE_CODE_MAP.put( NAMESPACE_URI_1_4, DSVersion.DS14 );
+        NAMESPACE_CODE_MAP.put( NAMESPACE_URI_1_5, DSVersion.DS15 );
     }
 }
diff --git a/scr/src/main/java/org/apache/felix/scr/impl/xml/XmlHandler.java b/scr/src/main/java/org/apache/felix/scr/impl/xml/XmlHandler.java
index 19c9374..e40954c 100644
--- a/scr/src/main/java/org/apache/felix/scr/impl/xml/XmlHandler.java
+++ b/scr/src/main/java/org/apache/felix/scr/impl/xml/XmlHandler.java
@@ -26,8 +26,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.Properties;
 
-import javax.xml.XMLConstants;
-
 import org.apache.felix.scr.impl.logger.BundleLogger;
 import org.apache.felix.scr.impl.logger.InternalLogger.Level;
 import org.apache.felix.scr.impl.metadata.ComponentMetadata;


[felix-dev] 01/06: Merge branch 'master' into scrR8

Posted by tj...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tjwatson pushed a commit to branch scrR8
in repository https://gitbox.apache.org/repos/asf/felix-dev.git

commit 6afbad63ccfd8859ee59c1ec254b407db636db91
Merge: 35c51c7 ecad95c
Author: Thomas Watson <tj...@us.ibm.com>
AuthorDate: Thu Oct 22 14:24:58 2020 -0500

    Merge branch 'master' into scrR8

 gogo/bom/pom.xml                                   |  4 +-
 gogo/jline/doc/changelog.txt                       |  5 ++
 gogo/jline/pom.xml                                 |  2 +-
 .../hc/core/impl/executor/HealthCheckFuture.java   |  7 ++-
 .../felix/scr/impl/manager/DependencyManager.java  | 55 +++++++++++++---------
 5 files changed, 44 insertions(+), 29 deletions(-)