code: public static Filter getFilterForLocation(String location, String context) throws IllegalArgumentException {
          String filter = makeLocationFilterString(location, context);
          try {
              return FrameworkUtil.createFilter(filter);
          } catch (InvalidSyntaxException e) {
              throw new IllegalArgumentException("location is invalid: " + location, e);
          }
      }
docs: returns a filter that matches services with the given location in both the given context and the root-context
  
  @throws IllegalArgumentException if the location contains special characters that prevent the filter from
  compiling