Ignore:
Timestamp:
01/10/22 12:04:49 (2 years ago)
Author:
Oliver Schonefeld
Message:
  • cleanup
File:
1 edited

Legend:

Unmodified
Added
Removed
  • FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/utils/SimpleEndpointDescriptionParser.java

    r7273 r7279  
    185185
    186186        // capabilities
    187         List<URI> capabilities = new ArrayList<URI>();
     187        List<URI> capabilities = new ArrayList<>();
    188188        exp = xpath.compile("//ed:Capabilities/ed:Capability");
    189189        NodeList list =
     
    225225
    226226        // used to check for uniqueness of id attribute
    227         final Set<String> xml_ids = new HashSet<String>();
     227        final Set<String> xml_ids = new HashSet<>();
    228228
    229229        // supported data views
    230         List<DataView> supportedDataViews = new ArrayList<DataView>();
     230        List<DataView> supportedDataViews = new ArrayList<>();
    231231        exp = xpath.compile("//ed:SupportedDataViews/ed:SupportedDataView");
    232232        list = (NodeList) exp.evaluate(doc, XPathConstants.NODESET);
     
    406406
    407407                if (supportedLayers == null) {
    408                     supportedLayers = new ArrayList<Layer>(list.getLength());
     408                    supportedLayers = new ArrayList<>(list.getLength());
    409409                }
    410410                supportedLayers.add(new Layer(id, resultId, type, encoding,
     
    426426        exp = xpath.compile("/ed:EndpointDescription/ed:Resources/ed:Resource");
    427427        list = (NodeList) exp.evaluate(doc, XPathConstants.NODESET);
    428         final Set<String> pids = new HashSet<String>();
     428        final Set<String> pids = new HashSet<>();
    429429        List<ResourceInfo> resources = parseResources(xpath, list, pids,
    430430                supportedDataViews, supportedLayers, version, hasAdvView);
     
    511511
    512512                    if (titles == null) {
    513                         titles = new HashMap<String, String>();
     513                        titles = new HashMap<>();
    514514                    }
    515515                    if (titles.containsKey(lang)) {
     
    542542
    543543                    if (descrs == null) {
    544                         descrs = new HashMap<String, String>();
     544                        descrs = new HashMap<>();
    545545                    }
    546546
     
    592592
    593593                    if (langs == null) {
    594                         langs = new ArrayList<String>();
     594                        langs = new ArrayList<>();
    595595                    }
    596596                    langs.add(s);
     
    614614                }
    615615
    616                 for (int i = 0; i < refs.length; i++) {
     616                for (String ref2 : refs) {
    617617                    DataView dataview = null;
    618618                    for (DataView dv : supportedDataViews) {
    619                         if (refs[i].equals(dv.getIdentifier())) {
     619                        if (ref2.equals(dv.getIdentifier())) {
    620620                            dataview = dv;
    621621                            break;
     
    624624                    if (dataview != null) {
    625625                        if (availableDataViews == null) {
    626                             availableDataViews = new ArrayList<DataView>();
     626                            availableDataViews = new ArrayList<>();
    627627                        }
    628628                        availableDataViews.add(dataview);
    629629                    } else {
    630630                        throw new SRUConfigException(
    631                                 "A data view with " + "identifier '" + refs[i] +
     631                                "A data view with " + "identifier '" + ref2 +
    632632                                        "' was not defined " +
    633633                                        "in <SupportedDataViews>");
     
    658658                }
    659659
    660                 for (int i = 0; i < refs.length; i++) {
     660                for (String ref2 : refs) {
    661661                    Layer layer = null;
    662662                    for (Layer l : supportedLayers) {
    663                         if (refs[i].equals(l.getId())) {
     663                        if (ref2.equals(l.getId())) {
    664664                            layer = l;
    665665                            break;
     
    668668                    if (layer != null) {
    669669                        if (availableLayers == null) {
    670                             availableLayers = new ArrayList<Layer>();
     670                            availableLayers = new ArrayList<>();
    671671                        }
    672672                        availableLayers.add(layer);
    673673                    } else {
    674674                        throw new SRUConfigException("A layer with " +
    675                                 "identifier '" + refs[i] +
     675                                "identifier '" + ref2 +
    676676                                "' was not defined " + "in <SupportedLayers>");
    677677                    }
     
    692692
    693693            if (ris == null) {
    694                 ris = new ArrayList<ResourceInfo>();
     694                ris = new ArrayList<>();
    695695            }
    696696            if ((availableLayers != null) && (version < 1)) {
Note: See TracChangeset for help on using the changeset viewer.