This is an automated email from the git hooks/post-receive script.

sebastic pushed a commit to branch master
in repository jmapviewer.

commit 122ea3ebcc52104e6f8beb194606ac7115aa37b5
Author: Bas Couwenberg <sebas...@xs4all.nl>
Date:   Fri Oct 30 12:31:46 2015 +0100

    Imported Upstream version 1.12+dfsg
---
 build.xml                                                 |  4 ++--
 src/org/openstreetmap/gui/jmapviewer/MemoryTileCache.java | 15 +++++++--------
 src/org/openstreetmap/gui/jmapviewer/Tile.java            |  1 -
 .../gui/jmapviewer/tilesources/BingAerialTileSource.java  |  2 +-
 4 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/build.xml b/build.xml
index 49c98c4..75b70c8 100644
--- a/build.xml
+++ b/build.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
 <project default="all" name="Compile and build java classes plus jar archives">
 
-       <target name="all" 
depends="clean,build,svn_info,pack,create_run_jar,create_release_zip,create_source_release_zip,findbugs,checkstyle,javadoc"
 />
+       <target name="all" 
depends="clean,build,svn_info,pack,create_run_jar,findbugs,checkstyle,javadoc,create_release_zip,create_source_release_zip"
 />
 
        <target name="clean">
                <mkdir dir="bin" />
@@ -77,7 +77,7 @@
 
     <target name="checkstyle">
         <taskdef 
resource="com/puppycrawl/tools/checkstyle/ant/checkstyle-ant-task.properties" 
-               classpath="tools/checkstyle/checkstyle-6.11-all.jar"/>
+               classpath="tools/checkstyle/checkstyle-6.11.2-all.jar"/>
         <checkstyle config="tools/checkstyle/jmapviewer_checks.xml">
             <fileset dir="${basedir}/src" includes="**/*.java" />
             <formatter type="xml" toFile="checkstyle-jmapviewer.xml"/>
diff --git a/src/org/openstreetmap/gui/jmapviewer/MemoryTileCache.java 
b/src/org/openstreetmap/gui/jmapviewer/MemoryTileCache.java
index 84ca330..2ab8693 100644
--- a/src/org/openstreetmap/gui/jmapviewer/MemoryTileCache.java
+++ b/src/org/openstreetmap/gui/jmapviewer/MemoryTileCache.java
@@ -51,10 +51,12 @@ public class MemoryTileCache implements TileCache {
     @Override
     public synchronized void addTile(Tile tile) {
         CacheEntry entry = createCacheEntry(tile);
-        hash.put(tile.getKey(), entry);
-        lruTiles.addFirst(entry);
-        if (hash.size() > cacheSize) {
-            removeOldEntries();
+        if (hash.put(tile.getKey(), entry) == null) {
+            // only if hash hadn't had the element, add it to LRU
+            lruTiles.addFirst(entry);
+            if (hash.size() > cacheSize || lruTiles.getElementCount() > 
cacheSize) {
+                removeOldEntries();
+            }
         }
     }
 
@@ -63,10 +65,7 @@ public class MemoryTileCache implements TileCache {
         CacheEntry entry = hash.get(Tile.getTileKey(source, x, y, z));
         if (entry == null)
             return null;
-        // We don't care about placeholder tiles and hourglass image tiles, the
-        // important tiles are the loaded ones
-        if (entry.tile.isLoaded())
-            lruTiles.moveElementToFirstPos(entry);
+        lruTiles.moveElementToFirstPos(entry);
         return entry.tile;
     }
 
diff --git a/src/org/openstreetmap/gui/jmapviewer/Tile.java 
b/src/org/openstreetmap/gui/jmapviewer/Tile.java
index 4edbf43..b24052d 100644
--- a/src/org/openstreetmap/gui/jmapviewer/Tile.java
+++ b/src/org/openstreetmap/gui/jmapviewer/Tile.java
@@ -414,7 +414,6 @@ public class Tile {
      * indicate that loading process for this tile has started
      */
     public void initLoading() {
-        loaded = false;
         error = false;
         loading = true;
     }
diff --git 
a/src/org/openstreetmap/gui/jmapviewer/tilesources/BingAerialTileSource.java 
b/src/org/openstreetmap/gui/jmapviewer/tilesources/BingAerialTileSource.java
index 2a24961..83991da 100644
--- a/src/org/openstreetmap/gui/jmapviewer/tilesources/BingAerialTileSource.java
+++ b/src/org/openstreetmap/gui/jmapviewer/tilesources/BingAerialTileSource.java
@@ -258,7 +258,7 @@ public class BingAerialTileSource extends 
AbstractTMSTileSource {
             }
         }
         try {
-            return attributions.get(10, TimeUnit.MILLISECONDS);
+            return attributions.get(0, TimeUnit.MILLISECONDS);
         } catch (TimeoutException ex) {
             System.err.println("Bing: attribution data is not yet loaded.");
         } catch (ExecutionException ex) {

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-grass/jmapviewer.git

_______________________________________________
Pkg-grass-devel mailing list
Pkg-grass-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-grass-devel

Reply via email to