Ticket #23721: 23721.jmapviewer.patch

File 23721.jmapviewer.patch, 1.6 KB (added by taylor.smock, 22 months ago)
  • src/org/openstreetmap/gui/jmapviewer/tilesources/BingAerialTileSource.java

    Subject: [PATCH] Fix #23721: JOSM hangs indefinitely if Bing API unavailable
    ---
    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/gui/jmapviewer/tilesources/BingAerialTileSource.java b/src/org/openstreetmap/gui/jmapviewer/tilesources/BingAerialTileSource.java
    a b  
    286286                }
    287287            }
    288288        }
    289         try {
    290             return attributions.get();
    291         } catch (ExecutionException ex) {
    292             throw new JMapViewerRuntimeException(ex);
    293         } catch (InterruptedException ign) {
    294             LOG.log(Level.SEVERE, "InterruptedException: {0}", ign.getMessage());
    295             LOG.log(Level.FINE, ign.getMessage(), ign);
    296             Thread.currentThread().interrupt();
     289        if (attributions.isDone()) {
     290            try {
     291                return attributions.get();
     292            } catch (ExecutionException ex) {
     293                throw new JMapViewerRuntimeException(ex);
     294            } catch (InterruptedException ign) {
     295                LOG.log(Level.SEVERE, "InterruptedException: {0}", ign.getMessage());
     296                LOG.log(Level.FINE, ign.getMessage(), ign);
     297                Thread.currentThread().interrupt();
     298            }
    297299        }
    298300        return null;
    299301    }