Skip to content

Commit

Permalink
fix: Ignore private and package-private classes when importing custom…
Browse files Browse the repository at this point in the history
… components (#702)
  • Loading branch information
jperedadnr authored Aug 20, 2024
1 parent 2a81078 commit df782b0
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, Gluon and/or its affiliates.
* Copyright (c) 2020, 2024, Gluon and/or its affiliates.
* Copyright (c) 2012, 2014, Oracle and/or its affiliates.
* All rights reserved. Use is subject to license terms.
*
Expand Down Expand Up @@ -102,8 +102,10 @@ JarReportEntry exploreEntry(String entryName, ClassLoader classLoader, String cl
// http://stackoverflow.com/questions/8100376/class-forname-vs-classloader-loadclass-which-to-use-for-dynamic-loading
entryClass = classLoader.loadClass(className); // Note: static intializers of entryClass are not run, this doesn't seem to be an issue

if (Modifier.isAbstract(entryClass.getModifiers())
|| !Node.class.isAssignableFrom(entryClass)) {
final int modifiers = entryClass.getModifiers();
if (Modifier.isAbstract(modifiers)
|| !Node.class.isAssignableFrom(entryClass)
|| !(Modifier.isPublic(modifiers) || Modifier.isProtected(modifiers))) {
status = JarReportEntry.Status.IGNORED;
entryClass = null;
entryException = null;
Expand Down

0 comments on commit df782b0

Please sign in to comment.