On Feb 24, 12:26 pm, Reinier Zwitserloot <[email protected]> wrote: > Right, so you agree that there are situations where a module must ask > specifically for List[1..7] and cannot just go for [1..*]. I contend > that these situations are sufficiently common that there's going to be > a LOT of headache with incompatible modules, if this happens.
I agree versioning is a big deal and all module systems - Jigsaw, OSGi, Maven, NetBeans - have to educate their users about it carefully. Almost no module should depend on a version with an infinite upper bound. The common practice in OSGi today is to use bounded ranges like [1.0,2.0). A module using or reusing List should ask for >=7 or 7.* respectively, which is not possible today and prevents Sun and others from sanely evolving APIs. > You also won't get any errors when you start implementing list when > you compile this with java7, which is presumably the state of the art > when the library is written. In other words, we have the following fun > situation: > > A tonne of libraries out there will all of a sudden break when the new > java8 (or whatever) is released with new methods on java.util.List, > because they mistakenly specified compatibility with 7+. There's no > way to test for this, certainly not at first (at some point I expect > findbugs and other tools can find likely problems in this area). Also > known as a clustersomething. > > Can't be done. Legacy libraries implicitly have dependencies on the JDK up to and including 7.0. Such libraries are easily identified at compile-time and runtime, and bound forever to JDK 7.*. (As I said earlier, the 7.* family is very very unlikely to make source-incompatible changes to official APIs.) I am pretty sure the Jigsaw module system will default to x.* version ranges rather than >=x (i.e. no upper bound) version ranges. In years to come, a library (legacy or otherwise) which likes new JDK8 List methods can implement List and depend on JDK >=8 specifically. Alex --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "The Java Posse" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/javaposse?hl=en -~----------~----~----~----~------~----~------~--~---
