boolean isInheritedAndNotPublic ( TypeElement concreteClass , TypeElement declaringClass , Element methodOrField ) { PackageElement packageOfDeclaringClass = elementUtils . getPackageOf ( declaringClass ) ; PackageElement packageOfConcreteClass = elementUtils . getPackageOf ( concreteClass ) ; return declaringClass != concreteClass && ! packageOfDeclaringClass . getQualifiedName ( ) . equals ( packageOfConcreteClass . getQualifiedName ( ) ) && ( isProtected ( methodOrField ) || ! isPublic ( methodOrField ) ) ; }
Return whether the given method or field is inherited but not public .