Uploaded image for project: 'GeoServer'
  1. GEOS-8215

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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: 2.11.1
    • Fix Version/s: 2.14-RC
    • Component/s: WPS
    • Labels:
      None

      Description

      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.

        Attachments

          Activity

            People

            • Assignee:
              ianturton Ian Turton
              Reporter:
              ianturton Ian Turton
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: