boolean (@Nullable RefClass refClass, @NotNull RefJavaModule refJavaModule) { RefEntity refOwner = refClass; while (refOwner instanceof RefClass) { String modifier = ((RefClass)refOwner).getAccessModifier(); refOwner = PsiModifier.PUBLIC.equals(modifier) || PsiModifier.PROTECTED.equals(modifier) ? refOwner.getOwner() : null; } if (refOwner instanceof RefPackage) { Map<String, List<String>> exportedPackageNames = refJavaModule.getExportedPackageNames(); if (exportedPackageNames.containsKey(refOwner.getQualifiedName())) { return true; } } return false; }