Permalink
Browse files

bug-osgi: fix infinite recursion due to incorrect method

overloading introduced in 9706e75.  See
9706e75#commitcomment-722303
  • Loading branch information...
1 parent 6dfdc76 commit 4175c64ec814f1504e50d1dea7aa5b3eb3447d30 @kgilmer kgilmer committed Nov 16, 2011
Showing with 6 additions and 4 deletions.
  1. +6 −4 com.buglabs.common/com/buglabs/util/osgi/FilterUtil.java
View
10 com.buglabs.common/com/buglabs/util/osgi/FilterUtil.java
@@ -64,7 +64,7 @@ public static String generateServiceFilter(String clazz) {
* @return A LDAP filter string that can be used to construct a Filter. If null passed in, null is returned to caller.
*/
public static String generateServiceFilter(String ... services) {
- return generateServiceFilter(services);
+ return generateServiceFilter(Arrays.asList(services));
}
/**
@@ -98,7 +98,9 @@ public static String generateServiceFilter(List<String> services) {
* @throws InvalidSyntaxException thrown if a syntax error is found in the generated Filter.
*/
public static Filter generateServiceFilter(BundleContext context, String[] services) throws InvalidSyntaxException {
- return context.createFilter(generateServiceFilter(services));
+ String filterString = generateServiceFilter(Arrays.asList(services));
+
+ return context.createFilter(filterString);
}
/**
@@ -116,8 +118,8 @@ public static Filter generateServiceFilter(BundleContext context, String[] servi
*/
public static String generateServiceFilter(SortedMap<String, Map<String, String>> servicesMap) {
if (servicesMap.size() == 1) {
- return "(&(" + Constants.OBJECTCLASS + "=" + ((String) servicesMap.firstKey()) + ")"
- + generatePropertiesFilter(new TreeMap((Map) servicesMap.get(servicesMap.firstKey()))) + ")";
+ return "(&(" + Constants.OBJECTCLASS + "=" + servicesMap.firstKey() + ")"
+ + generatePropertiesFilter(new TreeMap(servicesMap.get(servicesMap.firstKey()))) + ")";
} else if (servicesMap.size() > 1) {
return "(|" + generateServiceFilter(servicesMap.subMap(servicesMap.firstKey(), servicesMap.firstKey() + "\0"))
+ generateServiceFilter(servicesMap.tailMap(servicesMap.firstKey() + "\0")) + ")";

0 comments on commit 4175c64

Please sign in to comment.