Skip to content

Commit

Permalink
fix: make BundleImpl.adapt method accessible
Browse files Browse the repository at this point in the history
  • Loading branch information
ozhelezniak-talend committed Oct 15, 2024
1 parent 899b5dc commit 701f1f7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/com/cedarsoftware/util/ClassUtilities.java
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,9 @@ private static ClassLoader getOSGiClassLoader() {
// Get the adapt(Class) method
Method adaptMethod = bundle.getClass().getMethod("adapt", Class.class);

// method is inside not a public class, so we need to make it accessible
adaptMethod.setAccessible(true);

// Invoke bundle.adapt(BundleWiring.class) to get the BundleWiring instance
Object bundleWiring = adaptMethod.invoke(bundle, bundleWiringClass);

Expand Down

0 comments on commit 701f1f7

Please sign in to comment.