Ignore:
Timestamp:
2016-07-04T14:18:17+02:00 (9 years ago)
Author:
donvip
Message:

checkstyle

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CacheControl.java

    r32211 r32556  
    1 // License: GPL. v2 and later. Copyright 2008-2009 by Pieren <pieren3@gmail.com> and others
     1// License: GPL. For details, see LICENSE file.
    22package cadastre_fr;
    33
     
    4242            super(out);
    4343        }
     44
    4445        @Override
    4546        protected void writeStreamHeader() throws IOException {
     
    8889            for (int i = 0; i < files.length; i++) {
    8990                size += files[i].length();
    90                 if (files[i].lastModified() <  oldestFileDate) {
     91                if (files[i].lastModified() < oldestFileDate) {
    9192                    oldestFile = i;
    9293                    oldestFileDate = files[i].lastModified();
    9394                }
    9495            }
    95             if (size > (long)cacheSize*1024*1024) {
     96            if (size > (long) cacheSize*1024*1024) {
    9697                Main.info("Delete oldest file  \""+ files[oldestFile].getName()
    9798                        + "\" in cache dir to stay under the limit of " + cacheSize + " MB.");
     
    120121                    CadastrePlugin.prepareDialog(dialog);
    121122                    dialog.setVisible(true);
    122                     return (Integer)pane.getValue();
     123                    return (Integer) pane.getValue();
    123124                    // till here
    124125                }
     
    142143        if (file.exists())
    143144            file.delete();
    144         while (file.exists()) // wait until file is really gone (otherwise appends to existing one)
     145        while (file.exists()) { // wait until file is really gone (otherwise appends to existing one)
    145146            CadastrePlugin.safeSleep(500);
     147        }
    146148    }
    147149
     
    158160                @Override
    159161                public void run() {
    160                     JOptionPane.showMessageDialog(Main.parent, tr("Error loading file.\nProbably an old version of the cache file."), 
     162                    JOptionPane.showMessageDialog(Main.parent, tr("Error loading file.\nProbably an old version of the cache file."),
    161163                            tr("Error"), JOptionPane.ERROR_MESSAGE);
    162164                }
     
    193195                        try (ObjectOutputStreamAppend oos = new ObjectOutputStreamAppend(
    194196                                new BufferedOutputStream(new FileOutputStream(file, true)))) {
    195                             for (int i=0; i < size; i++) {
     197                            for (int i = 0; i < size; i++) {
    196198                                oos.writeObject(imagesToSave.get(i));
    197199                            }
     
    201203                                new BufferedOutputStream(new FileOutputStream(file)))) {
    202204                            wmsLayer.write(file, oos);
    203                             for (int i=0; i < size; i++) {
     205                            for (int i = 0; i < size; i++) {
    204206                                oos.writeObject(imagesToSave.get(i));
    205207                            }
     
    210212                }
    211213                imagesLock.lock();
    212                 for (int i=0; i < size; i++) {
     214                for (int i = 0; i < size; i++) {
    213215                    imagesToSave.remove(0);
    214216                }
    215217                imagesLock.unlock();
    216218            }
    217             try {wait();} catch (InterruptedException e) {
     219            try {
     220                wait();
     221            } catch (InterruptedException e) {
    218222                Main.error(e);
    219223            }
Note: See TracChangeset for help on using the changeset viewer.