Changeset 7280


Ignore:
Timestamp:
01/10/22 12:10:08 (3 years ago)
Author:
Oliver Schonefeld
Message:
  • cleanup
Location:
FCSSimpleClient/trunk/src
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • FCSSimpleClient/trunk/src/main/java/eu/clarin/sru/client/fcs/AbstractClarinFCSRecordDataParser.java

    r7274 r7280  
    6464        }
    6565
    66         ArrayList<DataViewParser> list = new ArrayList<DataViewParser>();
     66        ArrayList<DataViewParser> list = new ArrayList<>();
    6767        boolean foundGeneric = false;
    6868        for (DataViewParser parser : parsers) {
     
    172172            if (dataview != null) {
    173173                if (dataviews == null) {
    174                     dataviews = new LinkedList<DataView>();
     174                    dataviews = new LinkedList<>();
    175175                }
    176176                dataviews.add(dataview);
     
    196196
    197197            if (resourceFragments == null) {
    198                 resourceFragments = new LinkedList<Resource.ResourceFragment>();
     198                resourceFragments = new LinkedList<>();
    199199            }
    200200            resourceFragments.add(new Resource.ResourceFragment(pid, ref, dataviews));
  • FCSSimpleClient/trunk/src/main/java/eu/clarin/sru/client/fcs/ClarinFCSClientBuilder.java

    r7274 r7280  
    2020import java.util.List;
    2121
    22 import eu.clarin.sru.client.SRURequestAuthenticator;
    2322import eu.clarin.sru.client.SRUClient;
    2423import eu.clarin.sru.client.SRUClientConfig;
    2524import eu.clarin.sru.client.SRUExtraResponseDataParser;
     25import eu.clarin.sru.client.SRURequestAuthenticator;
    2626import eu.clarin.sru.client.SRUSimpleClient;
    2727import eu.clarin.sru.client.SRUThreadedClient;
     
    3939    private static final SRUVersion DEFAULT_SRU_VERSION =
    4040            SRUVersion.VERSION_1_2;
    41     private List<DataViewParser> parsers = new ArrayList<DataViewParser>();
     41    private List<DataViewParser> parsers = new ArrayList<>();
    4242    private List<SRUExtraResponseDataParser> extraDataParsers =
    43             new ArrayList<SRUExtraResponseDataParser>();
     43            new ArrayList<>();
    4444    private SRUVersion defaultVersion = DEFAULT_SRU_VERSION;
    4545    private boolean unknownAsDom = DEFAULT_UNKNOWN_AS_DOM;
     
    4949    private int socketTimeout = SRUClientConfig.DEFAULT_SOCKET_TIMEOUT;
    5050    private SRURequestAuthenticator requestAuthStrategy;
    51    
     51
    5252
    5353    /**
     
    354354    private List<DataViewParser> finalizeDataViewParsers() {
    355355        final List<DataViewParser> result =
    356                 new ArrayList<DataViewParser>(parsers.size() +
     356                new ArrayList<>(parsers.size() +
    357357                        (legacySupport ? 2 : 1));
    358358        result.addAll(parsers);
  • FCSSimpleClient/trunk/src/main/java/eu/clarin/sru/client/fcs/ClarinFCSEndpointDescriptionParser.java

    r7274 r7280  
    127127                final URI uri = new URI(s);
    128128                if (capabilities == null) {
    129                     capabilities = new ArrayList<URI>();
     129                    capabilities = new ArrayList<>();
    130130                }
    131131                capabilities.add(uri);
     
    189189                }
    190190            } else {
    191                 supportedDataViews = new ArrayList<DataView>();
     191                supportedDataViews = new ArrayList<>();
    192192            }
    193193            supportedDataViews.add(new DataView(id, type, policy));
     
    261261                XmlStreamReaderUtils.readEnd(reader, ED_NS_URI, "SupportedLayer");
    262262                if (supportedLayers == null) {
    263                     supportedLayers = new ArrayList<Layer>();
     263                    supportedLayers = new ArrayList<>();
    264264                }
    265265                supportedLayers.add(new Layer(id, resultId, layer,
     
    336336
    337337            logger.debug("hasAdvSearch: {}", hasAdvancedSearch);
    338            
     338
    339339            logger.debug("parsing resource with pid = {}", pid);
    340340
     
    361361                XmlStreamReaderUtils.readEnd(reader, ED_NS_URI, "Language");
    362362                if (languages == null) {
    363                     languages = new ArrayList<String>();
     363                    languages = new ArrayList<>();
    364364                } else {
    365365                    for (String l : languages) {
     
    389389                            found = true;
    390390                            if (dataviews == null) {
    391                                 dataviews = new ArrayList<DataView>();
     391                                dataviews = new ArrayList<>();
    392392                            }
    393393                            dataviews.add(dataview);
     
    420420                                found = true;
    421421                                if (layers == null) {
    422                                     layers = new ArrayList<Layer>();
     422                                    layers = new ArrayList<>();
    423423                                }
    424424                                layers.add(layer);
     
    475475
    476476            if (resources == null) {
    477                 resources = new ArrayList<ResourceInfo>();
     477                resources = new ArrayList<>();
    478478            }
    479479            resources.add(new ResourceInfo(pid, title, description,
     
    497497            final String content = XmlStreamReaderUtils.readString(reader, true);
    498498            if (result == null) {
    499                 result = new HashMap<String, String>();
     499                result = new HashMap<>();
    500500            }
    501501            if (result.containsKey(lang)) {
  • FCSSimpleClient/trunk/src/main/java/eu/clarin/sru/client/fcs/DataViewParserAdvanced.java

    r7274 r7280  
    7272
    7373        // Segments
    74         final Map<String, DataViewAdvanced.Segment> segments =
    75                 new HashMap<String, DataViewAdvanced.Segment>();
     74        final Map<String, DataViewAdvanced.Segment> segments = new HashMap<>();
    7675        XmlStreamReaderUtils.readStart(reader, FCS_ADV_NS, "Segments", true);
    7776        while (XmlStreamReaderUtils.readStart(reader, FCS_ADV_NS, "Segment",
     
    9897        // Layers
    9998        List<DataViewAdvanced.Layer> layers =
    100                 new ArrayList<DataViewAdvanced.Layer>();
     99                new ArrayList<>();
    101100
    102101        XmlStreamReaderUtils.readStart(reader, FCS_ADV_NS, "Layers", true);
     
    108107
    109108            final List<DataViewAdvanced.Span> spans =
    110                     new ArrayList<DataViewAdvanced.Span>();
     109                    new ArrayList<>();
    111110            while (XmlStreamReaderUtils.readStart(reader, FCS_ADV_NS, "Span",
    112111                    spans.isEmpty(), true)) {
  • FCSSimpleClient/trunk/src/main/java/eu/clarin/sru/client/fcs/DataViewParserGenericString.java

    r7274 r7280  
    1818
    1919import java.io.StringWriter;
     20
    2021import javax.xml.stream.XMLOutputFactory;
    2122import javax.xml.stream.XMLStreamConstants;
  • FCSSimpleClient/trunk/src/main/java/eu/clarin/sru/client/fcs/LegacyClarinFCSRecordDataParser.java

    r7274 r7280  
    3737    private final boolean fullLegacyCompatMode;
    3838
    39    
     39
    4040    /**
    4141     * Constructor.
  • FCSSimpleClient/trunk/src/test/java/eu/clarin/sru/client/fcs/TestClient.java

    r7274 r7280  
    2929import eu.clarin.sru.client.SRUSearchRetrieveResponse;
    3030import eu.clarin.sru.client.SRUVersion;
    31 import eu.clarin.sru.client.fcs.ClarinFCSClientBuilder;
    32 import eu.clarin.sru.client.fcs.ClarinFCSEndpointDescriptionParser;
    3331
    3432
  • FCSSimpleClient/trunk/src/test/java/eu/clarin/sru/client/fcs/TestSimpleClient.java

    r7274 r7280  
    3232import eu.clarin.sru.client.SRUSimpleClient;
    3333import eu.clarin.sru.client.SRUWhereInList;
    34 import eu.clarin.sru.client.fcs.ClarinFCSClientBuilder;
    35 import eu.clarin.sru.client.fcs.ClarinFCSRecordData;
    3634
    3735
  • FCSSimpleClient/trunk/src/test/java/eu/clarin/sru/client/fcs/TestThreadedClient.java

    r7274 r7280  
    3030import eu.clarin.sru.client.SRUSearchRetrieveResponse;
    3131import eu.clarin.sru.client.SRUThreadedClient;
    32 import eu.clarin.sru.client.fcs.ClarinFCSClientBuilder;
    33 import eu.clarin.sru.client.fcs.ClarinFCSEndpointDescriptionParser;
    3432
    3533@Deprecated
  • FCSSimpleClient/trunk/src/test/java/eu/clarin/sru/client/fcs/TestThreadedClientCallback.java

    r7274 r7280  
    3131import eu.clarin.sru.client.SRUSearchRetrieveResponse;
    3232import eu.clarin.sru.client.SRUThreadedClient;
    33 import eu.clarin.sru.client.fcs.ClarinFCSClientBuilder;
    34 import eu.clarin.sru.client.fcs.ClarinFCSEndpointDescriptionParser;
    3533
    3634
  • FCSSimpleClient/trunk/src/test/java/eu/clarin/sru/client/fcs/TestUtils.java

    r7274 r7280  
    2626import eu.clarin.sru.client.SRUDiagnostic;
    2727import eu.clarin.sru.client.SRUExplainRecordData;
     28import eu.clarin.sru.client.SRUExplainRecordData.ConfigInfo;
     29import eu.clarin.sru.client.SRUExplainRecordData.Schema;
    2830import eu.clarin.sru.client.SRUExplainRequest;
    2931import eu.clarin.sru.client.SRUExplainResponse;
     
    3941import eu.clarin.sru.client.SRUSurrogateRecordData;
    4042import eu.clarin.sru.client.SRUTerm;
    41 import eu.clarin.sru.client.SRUExplainRecordData.ConfigInfo;
    42 import eu.clarin.sru.client.SRUExplainRecordData.Schema;
    43 import eu.clarin.sru.client.fcs.ClarinFCSEndpointDescription;
    4443import eu.clarin.sru.client.fcs.ClarinFCSEndpointDescription.ResourceInfo;
    45 import eu.clarin.sru.client.fcs.ClarinFCSRecordData;
    46 import eu.clarin.sru.client.fcs.DataView;
    47 import eu.clarin.sru.client.fcs.DataViewAdvanced;
    48 import eu.clarin.sru.client.fcs.DataViewGenericDOM;
    49 import eu.clarin.sru.client.fcs.DataViewGenericString;
    50 import eu.clarin.sru.client.fcs.DataViewHits;
    51 import eu.clarin.sru.client.fcs.Resource;
    5244
    5345class TestUtils {
Note: See TracChangeset for help on using the changeset viewer.