Dependencies leaking outside a bundle [message #65584] |
Thu, 25 June 2009 06:42 |
bank kus Messages: 13 Registered: July 2009 |
Junior Member |
|
|
==========
BACKGROUND:
==========
Consider the following example:
Bundle A
|_______ export package B[1.0.0]
|_______ import package M[3.0.0, 4.0.0)
The catch here being an interface ISomeInterface belonging to package M
"leaks out of package B". Now this is a term I just coined for want of a
better term.
ISomeInterface could leak out of package B if its part of the method
signature or public field of any public class/interface in package B.
What I noticed is if Bundle A upgrades from M[3.0.0, 4.0.0) to M[4.0.0,
5.0.0) then it must also upgrade its own exported package B to [3.0.0]. If
it did not do so then another package/bundle using it can lose binary
compatibility since it could be using M[3.0.0, 4.0.0] itself and this will
present a case where a single interface exists within the same classloader
at two different versions. Based on a test run JVM throws
"IncompatibleClassChangeError".
==========
QUESTION:
==========
<a> Is the above analysis of backwards compatibility correct?
<b> Is there a way to detect this pattern of error using the PDE toolchain
without actually deploying and getting Java runtime Errors?
Regards
banks
|
|
|
Powered by
FUDForum. Page generated in 0.03248 seconds