This is an automated email from the ASF dual-hosted git repository. rombert pushed a commit to annotated tag org.apache.sling.testing.osgi-mock-2.0.0 in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-osgi-mock.git
commit 5e0ac1d148c38bc77f04b689d0bfb20e15d3a873 Author: Stefan Seifert <[email protected]> AuthorDate: Tue Nov 24 06:33:26 2015 +0000 SLING-5323 no need to update to JDK 1.7, we stick with JDK 1.6. git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/osgi-mock@1716042 13f79535-47bb-0310-9956-ffa450edef68 --- pom.xml | 5 ----- src/main/java/org/apache/sling/testing/mock/osgi/MockOsgi.java | 4 ++-- .../java/org/apache/sling/testing/mock/osgi/OsgiServiceUtil.java | 4 ++-- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/pom.xml b/pom.xml index 085b1ad..7b7b28a 100644 --- a/pom.xml +++ b/pom.xml @@ -40,11 +40,6 @@ <url>http://svn.apache.org/viewvc/sling/trunk/testing/mocks/osgi-mock</url> </scm> - <properties> - <!-- OSGi mocks 2.x only support Java 7, 1.x still supports Java 6 --> - <sling.java.version>7</sling.java.version> - </properties> - <dependencies> <!-- This version of OSGi mocks is targeted at OSGi R6. osgi-mocks 1.x is compatible with older versions. --> diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/MockOsgi.java b/src/main/java/org/apache/sling/testing/mock/osgi/MockOsgi.java index 431ef27..cf2452a 100644 --- a/src/main/java/org/apache/sling/testing/mock/osgi/MockOsgi.java +++ b/src/main/java/org/apache/sling/testing/mock/osgi/MockOsgi.java @@ -232,9 +232,9 @@ public final class MockOsgi { * @return Configuration admin or null if not registered. */ private static ConfigurationAdmin getConfigAdmin(BundleContext bundleContext) { - ServiceReference<ConfigurationAdmin> ref = bundleContext.getServiceReference(ConfigurationAdmin.class); + ServiceReference<?> ref = bundleContext.getServiceReference(ConfigurationAdmin.class.getName()); if (ref != null) { - return bundleContext.getService(ref); + return (ConfigurationAdmin)bundleContext.getService(ref); } return null; } diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/OsgiServiceUtil.java b/src/main/java/org/apache/sling/testing/mock/osgi/OsgiServiceUtil.java index ea304d5..3e22353 100644 --- a/src/main/java/org/apache/sling/testing/mock/osgi/OsgiServiceUtil.java +++ b/src/main/java/org/apache/sling/testing/mock/osgi/OsgiServiceUtil.java @@ -478,7 +478,7 @@ final class OsgiServiceUtil { field.setAccessible(true); Collection<Object> collection = (Collection<Object>)field.get(target); if (collection == null) { - collection = new ArrayList<>(); + collection = new ArrayList<Object>(); } if (item != null) { collection.add(item); @@ -500,7 +500,7 @@ final class OsgiServiceUtil { field.setAccessible(true); Collection<Object> collection = (Collection<Object>)field.get(target); if (collection == null) { - collection = new ArrayList<>(); + collection = new ArrayList<Object>(); } if (item != null) { collection.remove(item); -- To stop receiving notification emails like this one, please contact "[email protected]" <[email protected]>.
