I have some misunderstanding of OSGI fragment,
Suppose I have deployed a bundle "B" with two classes "com.company.C1" and "com.company.C2" where C1 use C2. And then, I deployed a fragment "F" for the host bundle "B" where F contains only one class "com.company.C2" (with a little change in the code of the first class)
Now, if the class "com.company.C1" is being executed, which class (file) "com.company.C2" will be used, from "B" or from "F" ?
Can the presence of the same class C2 twice in the same class-loader cause runtime errors (same version & differents versions)?
Read chapter "3.9.4 Overall Search Order" of OSGi Core specification and everything will be clear.
In short: The classes in the bundle are checked first and than the fragment bundle. If you have a class in the bundle and in the fragment bundle, the one in the fragment bundle will never be used.