Ignore private/package private classes from CP-scan

This commit is contained in:
Roland Praml
2023-01-04 13:59:51 +01:00
parent d84c9dc1a9
commit 1d48e2afb3
5 changed files with 11 additions and 10 deletions
@@ -342,8 +342,9 @@ public class BootupClasses implements Predicate<Class<?>> {
*/
@SuppressWarnings("unchecked")
private boolean isInterestingInterface(Class<?> cls) {
if (Modifier.isAbstract(cls.getModifiers())) {
// do not include abstract classes as we can
if (Modifier.isAbstract(cls.getModifiers())
|| !(Modifier.isPublic(cls.getModifiers()) || Modifier.isProtected(cls.getModifiers()))) {
// do not include abstract and non pupbic/protected classes as we can
// not instantiate them
return false;
}