boolean (@NotNull final DefinitionsScopedSearch.SearchParameters queryParameters, @NotNull final Processor<? super PsiElement> consumer) { return ReadAction.compute(() -> { final PsiElement source = queryParameters.getElement(); if (!source.isValid()) return true; if (source instanceof GrAccessorMethod) { GrField property = ((GrAccessorMethod)source).getProperty(); return consumer.process(property); } else { final SearchScope searchScope = queryParameters.getScope(); if (source instanceof GrMethod) { GrReflectedMethod[] reflectedMethods = ((GrMethod)source).getReflectedMethods(); for (GrReflectedMethod reflectedMethod : reflectedMethods) { if (!MethodImplementationsSearch.processImplementations(reflectedMethod, consumer, searchScope)) return false; } } else if (source instanceof GrField) { for (GrAccessorMethod method : GroovyPropertyUtils.getFieldAccessors((GrField)source)) { if (!MethodImplementationsSearch.processImplementations(method, consumer, searchScope)) return false; } } } return true; }); }