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