Update Property.java. The TYPE[].class construction is not supported by Apache Harmony. So, an empty array has to be created and the .getClass() method called.
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@734662 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/ipojo/core/src/main/java/org/apache/felix/ipojo/util/Property.java b/ipojo/core/src/main/java/org/apache/felix/ipojo/util/Property.java
index 58a4478a..47dca68 100644
--- a/ipojo/core/src/main/java/org/apache/felix/ipojo/util/Property.java
+++ b/ipojo/core/src/main/java/org/apache/felix/ipojo/util/Property.java
@@ -181,33 +181,35 @@
* @throws ConfigurationException if the class cannot be loaded
*/
private static Class computeArrayType(String type, BundleContext context) throws ConfigurationException {
+ // Note: Harmony does't support the type[].class notation.
+ // An empty array has to be created to get the class object.
String internalType = type.substring(0, type.length() - 2);
if ("string".equals(internalType) || "String".equals(internalType)) {
- return String[].class;
+ return new String[0].getClass();
}
if ("boolean".equals(internalType)) {
- return boolean[].class;
+ return new boolean[0].getClass();
}
if ("byte".equals(internalType)) {
- return byte[].class;
+ return new byte[0].getClass();
}
if ("short".equals(internalType)) {
- return short[].class;
+ return new short[0].getClass();
}
if ("int".equals(internalType)) {
- return int[].class;
+ return new int[0].getClass();
}
if ("long".equals(internalType)) {
- return long[].class;
+ return new long[0].getClass();
}
if ("float".equals(internalType)) {
- return float[].class;
+ return new float[0].getClass();
}
if ("double".equals(internalType)) {
- return double[].class;
+ return new double[0].getClass();
}
if ("char".equals(internalType)) {
- return char[].class;
+ return new char[0].getClass();
}
// Complex array type.
diff --git a/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/FactoryTestSuite.java b/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/FactoryTestSuite.java
index 121578d..973582c 100644
--- a/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/FactoryTestSuite.java
+++ b/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/FactoryTestSuite.java
@@ -32,7 +32,7 @@
ots.addTestSuite(ConfigAdminTest.class);
ots.addTestSuite(ObedienceTest.class);
ots.addTestSuite(FactoryProps.class);
- // ots.addTestSuite(EmptyArrayTest.class);
+ // ots.addTestSuite(EmptyArrayTest.class);
return ots;
}
diff --git a/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/UnacceptableConfigurationTest.java b/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/UnacceptableConfigurationTest.java
index e6b4d92..9c7ba67 100644
--- a/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/UnacceptableConfigurationTest.java
+++ b/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/UnacceptableConfigurationTest.java
@@ -47,7 +47,10 @@
try {
ci = f.createComponentInstance(p);
ci.dispose();
- } catch(Exception e) { fail("an acceptable configuration is refused : " + e.getMessage()); }
+ } catch(Exception e) {
+ fail("an acceptable configuration is refused : " + e.getMessage());
+ e.printStackTrace();
+ }
}
diff --git a/ipojo/tests/integration-tests/pom.xml b/ipojo/tests/integration-tests/pom.xml
index a1409fd..b68682c 100644
--- a/ipojo/tests/integration-tests/pom.xml
+++ b/ipojo/tests/integration-tests/pom.xml
@@ -219,6 +219,7 @@
</dependency>
<!-- External handlers -->
+
<dependency>
<groupId>ipojo.tests</groupId>
<artifactId>tests.eventadmin.handler
@@ -242,7 +243,7 @@
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.configadmin</artifactId>
- <version>1.0.4</version>
+ <version>1.0.8</version>
<scope>test</scope>
</dependency>
<dependency>