To pass the OSGi CT we must let an exception bubble up. (FELIX-2039)
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@948545 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/framework/src/main/java/org/apache/felix/framework/capabilityset/CapabilitySet.java b/framework/src/main/java/org/apache/felix/framework/capabilityset/CapabilitySet.java
index 29e5629..270088c 100644
--- a/framework/src/main/java/org/apache/felix/framework/capabilityset/CapabilitySet.java
+++ b/framework/src/main/java/org/apache/felix/framework/capabilityset/CapabilitySet.java
@@ -438,14 +438,27 @@
// Since we cannot identify the LHS type, then we can only perform
// equality comparison.
+// TODO: COMPLIANCE - This should be changed to return false in case
+// of an exception, but the R4.2 CT has a mistake in it, so for
+// now we'll throw exceptions from equals().
+// try
+// {
+// return lhs.equals(coerceType(lhs, (String) rhsUnknown));
+// }
+// catch (Exception ex)
+// {
+// return false;
+// }
+ Object rhsObj = null;
try
{
- return lhs.equals(coerceType(lhs, (String) rhsUnknown));
+ rhsObj = coerceType(lhs, (String) rhsUnknown);
}
catch (Exception ex)
{
return false;
}
+ return lhs.equals(rhsObj);
}
private static boolean compareApproximate(Object lhs, Object rhs)