Let's assume you have bundle A exporting a type T, bundle B exporting a method m that returns T, and bundle C consuming method m and executing a method on T. Then C requires a dependency to bundle A to be able to execute that method. However, when using "find unused dependencies" on bundle C, the dependency to A will be removed.
The class of interested for this functionality should be this: https://github.com/eclipse-pde/eclipse.pde/blob/master/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dependencies/GatherUnusedDependenciesOperation.java
The following archive contains projects demonstrating that situation: demo2.zip
Before "find unused dependencies":

After removing unused dependencies:

Of course, it's not nice that as a consumer of public methods you potentially need to define additional dependencies for being able to use the return type of the methods. But if I am not mistaken, the only way to avoid this would be some kind of reexport and it's not the idea to do this for every type used in some API, is it?
I plan to put this issue into the backlog of my team. But in case anyone has input the issue or a potential solution, please share that, or if anyone wants to pick this issue before we find the time to do so, of course feel free to do so.
Let's assume you have bundle
Aexporting a typeT, bundleBexporting a methodmthat returnsT, and bundleCconsuming methodmand executing a method onT. ThenCrequires a dependency to bundleAto be able to execute that method. However, when using "find unused dependencies" on bundleC, the dependency toAwill be removed.The class of interested for this functionality should be this: https://github.com/eclipse-pde/eclipse.pde/blob/master/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dependencies/GatherUnusedDependenciesOperation.java
The following archive contains projects demonstrating that situation: demo2.zip
Before "find unused dependencies":

After removing unused dependencies:

Of course, it's not nice that as a consumer of public methods you potentially need to define additional dependencies for being able to use the return type of the methods. But if I am not mistaken, the only way to avoid this would be some kind of reexport and it's not the idea to do this for every type used in some API, is it?
I plan to put this issue into the backlog of my team. But in case anyone has input the issue or a potential solution, please share that, or if anyone wants to pick this issue before we find the time to do so, of course feel free to do so.