Changeset 2945 for SRUClient


Ignore:
Timestamp:
05/28/13 09:48:39 (11 years ago)
Author:
oschonef
Message:
  • make sure, we don't leak XMLStreamReaders in case of string record packing
File:
1 edited

Legend:

Unmodified
Added
Removed
  • SRUClient/trunk/src/main/java/eu/clarin/sru/client/SRUSimpleClient.java

    r2944 r2945  
    571571                    throw new SRUClientException(
    572572                            "error parsing explain record", e);
     573                } finally {
     574                    /*
     575                     * make sure, we're deallocate the record reader in case of
     576                     * string record packing
     577                     */
     578                    if (packing == SRURecordPacking.STRING) {
     579                        recordReader.closeCompletly();
     580                    }
    573581                }
    574582                if (recordData == null) {
     
    576584                    throw new SRUClientException(
    577585                            "error parsing explain record");
    578                 }
    579                 if (packing == SRURecordPacking.STRING) {
    580                     recordReader.closeCompletly();
    581586                }
    582587                reader.consumeWhitespace();
     
    10241029                                        throw new SRUClientException(
    10251030                                                "error parsing record", e);
     1031                                    } finally {
     1032                                        /*
     1033                                         * make sure, we deallocate the record
     1034                                         * reader in case of string record
     1035                                         * packing
     1036                                         */
     1037                                        if (packing == SRURecordPacking.STRING) {
     1038                                            recordReader.closeCompletly();
     1039                                        }
    10261040                                    }
    10271041                                    if (recordData == null) {
     
    10561070                                                    schema + "' found.");
    10571071                                }
    1058                             }
    1059 
    1060                             if (packing == SRURecordPacking.STRING) {
    1061                                 recordReader.closeCompletly();
    10621072                            }
    10631073
Note: See TracChangeset for help on using the changeset viewer.