Changeset 1134 for OAIHarvester


Ignore:
Timestamp:
02/17/11 13:15:45 (13 years ago)
Author:
oschonef
Message:
  • fix some bugs noted by findbugs
Location:
OAIHarvester/trunk/OAIHarvester/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • OAIHarvester/trunk/OAIHarvester/src/main/java/eu/clarin/cmdi/oai/harvester/impl/Response.java

    r1128 r1134  
    2222
    2323final class Response {
    24     private final class CountingInputStream extends FilterInputStream {
     24    private static final class CountingInputStream extends FilterInputStream {
    2525        private long count = 0;
    2626
     
    6969    private final HttpEntity entity;
    7070    private final long now = System.currentTimeMillis();
    71     private CountingInputStream stream;
    72     private XMLStreamReader reader;
     71    private final CountingInputStream stream;
     72    private final XMLStreamReader reader;
    7373
    7474    Response(HarvestJobImpl job, HttpEntity entity, AbstractHarvester harvester)
     
    125125        job.addToProcessingTime(System.currentTimeMillis() - now);
    126126        job.addToBytesTransferred(stream.getByteCount());
    127         if (reader != null) {
    128             try {
    129                 reader.close();
    130             } catch (XMLStreamException e) {
    131                 /* IGNORE */
    132             }
    133         }
    134         if (stream != null) {
    135             try {
    136                 stream.close();
    137             } catch (IOException e) {
    138                 /* IGNORE */
    139             }
     127        try {
     128            reader.close();
     129        } catch (XMLStreamException e) {
     130            /* IGNORE */
     131        }
     132        try {
     133            stream.close();
     134        } catch (IOException e) {
     135            /* IGNORE */
    140136        }
    141137        try {
  • OAIHarvester/trunk/OAIHarvester/src/test/java/eu/clarin/cmdi/oai/harvester/HarvesterTest.java

    r1128 r1134  
    2727        XMLOutputFactory.newInstance();
    2828
    29     private class MyHarvestHandler extends HarvestHandlerAdapter {
     29    private static class MyHarvestHandler extends HarvestHandlerAdapter {
    3030        private ZipOutputStream output;
    3131        private int reqNum;
Note: See TracChangeset for help on using the changeset viewer.