Generics revisited - questions

Cantor, Scott cantor.2 at osu.edu
Fri Mar 3 09:46:53 EST 2017


On 3/3/17, 8:53 AM, "dev on behalf of Rod Widdowson" <dev-bounces at shibboleth.net on behalf of rdw at steadingsoftware.com> wrote:

> In this case we are actually injecting an ApplicationContextInitializer (we do this since we want to use the properties to
> get a the configured certificates).  So I want to add a call to     setContextInitializers(). The signature for this is that it takes
> a  List<ApplicationContextInitializer<? super FilesystemGenericApplicationContext>>

That's the new version, right? and I made that "fix" when I created the new method because the old code actually called the initializers with that type of object, which meant that if you violated the rule, you could actually have a bug. It's one of those subtle "this is why the compiler is failing" things.

> So things degenerate pretty quickly (ConfigurableApplicationContext being a subtype of 
> FilesystemGenericApplicationContext not a super type).

That seems wrong, so I probably got the capture wrong. I was planning to go in and deal with the remaining uses of the deprecated method, and since I now have bigger fish to fry I would leave it and I'll deal with it later. The new thing is a new API and means we can change it to whatever we want, and it won't be in the 3.3.1 patch.

-- Scott




More information about the dev mailing list