Bug in BundleUtil.removeBundle? Driver classes do not unload

There seems to be a little bug or at least a documentation problem with the bundle util.
When i add a bundle in ModuleHook.setup with BundleUtil.get().addBundle(xxx.class); and remove it in ModuleHook.shutdown with BundleUtil.get().removeBundle(xxx.class); there is still a reference to my class on the heap. As the built in drivers seem to to use this remove method (the Modbus driver in the api example definitely does), you will always have duplicate classes after a driver restart. This causes problems when trying to debug in development mode, since the VM seems to use parts of the old jar file instead of the newly uploaded one.
When is use BundleUtil.get().removeBundle(xxx.class.getSimpleName(); instead, everything works as expected.

If this is a intended behavior of BundleUtil.remove(Class) it would be good to mention it in the javadocs.

By the way, is it correct that the 7.4 api still expects api version 3 in ModuleHook.startup?

Thanks for the heads up. The docs aren’t wrong (It is removing your bundle), but there is an implementation issue that’s leaving a reference to your module’s ClassLoader when you use the removeBundle(Class) overload, as you reported.

Yes, that’s correct. I don’t think anything in the Driver API changes in a backwards-incompatible way between 7.3 and 7.4, like it did between 7.2 and 7.3.