[Geoserver-devel] [JIRA] (GEOS-8215) WPS will pick the wrong PPIO for WFS when a PPIO that starts with a letter before W in the list

Ian Turton created an issue

GeoServer / BugGEOS-8215

WPS will pick the wrong PPIO for WFS when a PPIO that starts with a letter before W in the list

Issue Type:

BugBug

Affects Versions:

2.11.1

Assignee:

Ian Turton

Components:

WPS

Created:

07/Jul/17 2:35 PM

Priority:

MediumMedium

Reporter:

Ian Turton

If you add another PPIO to the WPS that has a name that starts with a letter before W it will be picked for WFS sources that only declare thier mime-type as ‘text-xml’ as none of them match that. Note this is what the request builder uses as the mime type for local layers.
Issue occurs in org.geoserver.wps.ppio.ProcessParameterIO.find(Parameter<?>, ApplicationContext, String)

{{// TODO: come up with some way to flag one as “default”
List<ProcessParameterIO> all = findAll(p, context);
if (all.isEmpty())

{ return null; }

if (mime != null) {
for (ProcessParameterIO ppio : all) {
if (ppio instanceof ComplexPPIO && ((ComplexPPIO) ppio).getMimeType().equals(mime))

{ return ppio; }

}
}

// if more than one sort by class hierarchy, pushing the most specific classes to the
// beginning
if (all.size() > 0) {
Collections.sort(all, new Comparator<ProcessParameterIO>() {
public int compare(ProcessParameterIO o1, ProcessParameterIO o2) {
Class c1 = o1.getType();
Class c2 = o2.getType();

if (c1.equals(c2))

{ return 0; }

if (c1.isAssignableFrom(c2))

{ return 1; }

return -1;
}
});
}

// fall back on the first found
return all.get(0);}}

Just picks the first alphabetically.

Add Comment

Add Comment

Get JIRA notifications on your phone! Download the JIRA Cloud app here.


This message was sent by Atlassian JIRA (v1000.1110.0#100054-sha1:381c8dd)

Atlassian logo