boolean (StubElement<?> stub) { StubElement<?> modifierOwner = stub instanceof GrMethodStub ? stub : stub.getParentStub(); GrModifierListStub type = modifierOwner.findChildStubByType(GroovyStubElementTypes.MODIFIER_LIST); if (type == null) { return false; } int mask = type.getModifiersFlags(); if (hasMaskModifier(mask, PsiModifier.PRIVATE)) { return false; } if (hasMaskModifier(mask, PsiModifier.STATIC)) { return true; } StubElement parent = modifierOwner.getParentStub(); StubElement classStub = parent == null ? null : parent.getParentStub(); if (classStub instanceof GrTypeDefinitionStub && (((GrTypeDefinitionStub)classStub).isAnnotationType() || ((GrTypeDefinitionStub)classStub).isInterface())) { return true; } return false; }