void (Object cts, Closure toDo) { cts = handleImplicitBind(cts); if (cts instanceof DslPointcut) { if (((DslPointcut)cts).operatesOn(GroovyClassDescriptor.class)) { PointcutContextFilter filter = new PointcutContextFilter((DslPointcut<? super GroovyClassDescriptor, ?>)cts); addClassEnhancer(List.of(filter), toDo); } else { Logger.getInstance(getClass()).error("A non top-level pointcut passed to contributor"); } return; } if (cts instanceof Map) { cts = new Context((Map)cts); } if (!(cts instanceof List)) { assert cts instanceof Context : "The contributor() argument must be a context"; cts = List.of(cts); } List<Context> contexts = (List<Context>)ContainerUtil.filter(((List<?>)cts), x -> x != null); if (!contexts.isEmpty()) { List<ContextFilter> filters = ContainerUtil.map(contexts, x -> x.getFilter()); addClassEnhancer(filters, toDo); } }