Skip to content

Commit

Permalink
fix: avoid not-breaking exception ojn loading class from another bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
Denis Anisimov committed Mar 16, 2021
1 parent c6aeb67 commit 7d477e3
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,14 @@ private void scanClasses(Bundle bundle, Map<Long, Collection<Class<?>>> map,

// get all .class resources of this bundle
Collection<String> classes = wiring.listResources("/", "*.class",
BundleWiring.LISTRESOURCES_RECURSE);
/*
* Two options: recursive to visit all resources including
* sub-directories, and limit resources only to the current
* wiring (bundle) avoiding possibly returned classes from
* dependencies
*/
BundleWiring.LISTRESOURCES_RECURSE
| BundleWiring.LISTRESOURCES_LOCAL);

Collection<Class<?>> bundleClasses = new ArrayList<>();

Expand All @@ -271,7 +278,7 @@ private void scanClasses(Bundle bundle, Map<Long, Collection<Class<?>>> map,
continue;
}
if ("module-info".equals(className)) {
// New modular Java info class which we are not intrested in
// New modular Java info class which we are not interested in
continue;
}
try {
Expand Down

0 comments on commit 7d477e3

Please sign in to comment.