[Geoserver-devel] [JIRA] (GEOS-8146) Hard to look up GeoServer Extensions with null context

Jody Garnett [Administrator] created an issue

GeoServer / BugGEOS-8146

Hard to look up GeoServer Extensions with null context

Issue Type:

BugBug

Affects Versions:

2.12-beta

Assignee:

Unassigned

Components:

Main

Created:

20/May/17 4:58 PM

Priority:

MediumMedium

Reporter:

Jody Garnett [Administrator]

GEOS-8046 Open has identified an API usability issue with GeoServerExtensions:

if (context != null) {
    ppioFactories = GeoServerExtensions.extensions(PPIOFactory.class, context);
} else {
    ppioFactories = GeoServerExtensions.extensions(PPIOFactory.class);
}

Andrea has clarifications on #2177:

Check how you get there, from what I see the context checked is null only if the caller did pass a null context, or if the caller did not pass a context and GeoServerExtensions bean has not yet been initialized. Generally speaking, beans depending on a context-less call should declare a dependency on GeoServerExtensions (not all do, not all can). Ideally, it would be nice if GeoServerExtensions was the very first bean initialized in the spring context. There is an article about this here:
http://rachitskillisaurus.blogspot.it/2013/10/spring-force-bean-to-be-first-to.html

Maybe the above is a better option than this fix, along with GeoServerExtensions automatically using its own default context if null is passed.

Add Comment

Add Comment

This message was sent by Atlassian JIRA (v1000.990.2#100044-sha1:9546d20)

Atlassian logo