commit | 2883d389dff97140e6c3cf7435fd8819e6ee7b47 | [log] [tgz] |
---|---|---|
author | sseifert <sseifert@pro-vision.de> | Tue Jul 31 11:58:52 2018 +0200 |
committer | sseifert <sseifert@pro-vision.de> | Tue Jul 31 11:58:52 2018 +0200 |
tree | 5dff997d2301cbb4da99086ac32e88a354ca4e1f | |
parent | 2c5abc648e0e84add92de548b0d82d32b7719a4a [diff] |
SLING-7788 always initialize array with proper size
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/MockServiceRegistration.java b/src/main/java/org/apache/sling/testing/mock/osgi/MockServiceRegistration.java index 94c3cec..57b8c3b 100644 --- a/src/main/java/org/apache/sling/testing/mock/osgi/MockServiceRegistration.java +++ b/src/main/java/org/apache/sling/testing/mock/osgi/MockServiceRegistration.java
@@ -66,7 +66,7 @@ this.properties = properties != null ? properties : new Hashtable<String,Object>(); this.properties.put(Constants.SERVICE_ID, this.serviceId); - this.properties.put(Constants.OBJECTCLASS, this.clazzes.toArray(new String[0])); + this.properties.put(Constants.OBJECTCLASS, this.clazzes.toArray(new String[this.clazzes.size()])); this.serviceReference = new MockServiceReference<T>(bundle, this); this.bundleContext = bundleContext; }
diff --git a/src/test/java/org/apache/sling/testing/mock/osgi/context/OsgiContextImplTest.java b/src/test/java/org/apache/sling/testing/mock/osgi/context/OsgiContextImplTest.java index 174c6a1..d4bee18 100644 --- a/src/test/java/org/apache/sling/testing/mock/osgi/context/OsgiContextImplTest.java +++ b/src/test/java/org/apache/sling/testing/mock/osgi/context/OsgiContextImplTest.java
@@ -34,7 +34,6 @@ import org.apache.sling.testing.mock.osgi.OsgiServiceUtilTest.ServiceInterface2; import org.junit.After; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; import org.osgi.framework.BundleContext; import org.osgi.framework.ServiceReference;