Parameterization of input parameters is also compile-compatible, you only get warnings. You are still able to compile old java programs without generics using new Java versions (this is how Java itself solves the compatibility problem) The whole Java collection API uses generics, and you can simply use it completely without generics.
You only have problems, if somebody uses generics is his own code around Lucene and the new Lucene API uses other parameterization than this user (e.g. closer types etc.). But most time this code would not work before, too. ----- Uwe Schindler H.-H.-Meier-Allee 63, D-28213 Bremen http://www.thetaphi.de eMail: u...@thetaphi.de > -----Original Message----- > From: Yonik Seeley [mailto:ysee...@gmail.com] > Sent: Saturday, December 13, 2008 11:16 PM > To: java-dev@lucene.apache.org > Subject: Re: 2.9/3.0 plan & Java 1.5 > > Parametrization of return types should be fully back compatible. > Parameterization of input parameters would be run-time compatible (due > to type erasure), but not compile-time compatible. > > -Yonik > > On Sat, Dec 13, 2008 at 5:07 PM, Michael McCandless > <luc...@mikemccandless.com> wrote: > > > > Grant Ingersoll wrote: > > > >> IIRC, we also agreed that we didn't feel any compelling reason to make > a > >> sweeping change to generics, but would likely just add them as we see > 'em, > >> unless of course someone wants to do a wholesale patch. > > > > I like that approach. > > > >> In the case of generics, I see no reason why we can't intro them over > >> time, people using the non-generic forms will still work. > > > > I don't fully understand the back compatibility of generics, but I did > try > > changing Document.getFields to return List<Fieldable> and even > List<Integer> > > (hmm), as well as separately changing a caller of that API to assign to > a > > List<Fieldable> type, and things compile & test fine. > > > > Does anyone know of any gotchyas that'd happen if in fact we slowly over > > time changed existing APIs to use generics? > > > > EG I haven't yet tested for JAR drop-in compatibility, eg if in 3.1 we > > wanted to swap in more generics, would a 3.0 app be able to drop in the > 3.1 > > Lucene jar w/o problems? > > > > Mike > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-dev-unsubscr...@lucene.apache.org > For additional commands, e-mail: java-dev-h...@lucene.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscr...@lucene.apache.org For additional commands, e-mail: java-dev-h...@lucene.apache.org